cvs server: Diffing . Index: artscbackend.cc =================================================================== RCS file: /home/kde/kdelibs/arts/artsc/artscbackend.cc,v retrieving revision 1.15 diff -u -r1.15 artscbackend.cc --- artscbackend.cc 2001/01/17 15:21:26 1.15 +++ artscbackend.cc 2001/01/30 12:14:45 @@ -164,13 +164,22 @@ if(isAttached) return ARTS_E_NOIMPL; - packetCount = settings >> 16; - - packetCapacity = 1; - int c = settings & 0xffff; - while(c > 0) { - packetCapacity *= 2; - c--; + if((settings & 0x7fff0000) != 0x7fff0000) + packetCount = settings >> 16; + + if((settings & 0x00007fff) != 0x00007fff) + { + packetCapacity = 1; + int c = settings & 0xffff; + while(c > 0) { + packetCapacity *= 2; + c--; + } + } + else + { + /* choose something convenient */ + packetCapacity = 4096; } /* Index: artsdsp.c =================================================================== RCS file: /home/kde/kdelibs/arts/artsc/artsdsp.c,v retrieving revision 1.26 diff -u -r1.26 artsdsp.c --- artsdsp.c 2001/01/02 18:05:37 1.26 +++ artsdsp.c 2001/01/30 12:14:46 @@ -67,6 +67,8 @@ static int settings; static int arts_init_done = 0; static arts_stream_t stream = 0; +static int blocking; +static int frags; #if defined(HAVE_IOCTL_INT_INT_DOTS) typedef int ioctl_request_t; @@ -192,6 +194,8 @@ settings = 0; stream = 0; + frags = 0; + blocking = 1; artsdspdebug ("aRts: hijacking /dev/dsp open...\n"); @@ -221,6 +225,7 @@ static int channels; static int bits; static int speed; + static int blocking; int space, size, latency, odelay; /* @@ -317,7 +322,8 @@ #ifdef SNDCTL_DSP_SETFRAGMENT case SNDCTL_DSP_SETFRAGMENT: /* _SIOWR('P',10, int) */ - artsdspdebug("aRts: SNDCTL_DSP_SETFRAGMENT(%x) unsupported\n",*arg); + artsdspdebug("aRts: SNDCTL_DSP_SETFRAGMENT(%x) only partially supported\n",*arg); + frags = *arg; break; #endif @@ -348,12 +354,16 @@ stream?arts_stream_get(stream, ARTS_P_BUFFER_SPACE):16384; audiop->fragments = audiop->bytes / audiop->fragsize; } + artsdspdebug("returning (io)space = (ftotal: %d, fsize: %d, bytes: %d, frags: %d)\n", + audiop->fragstotal, audiop->fragsize, audiop->bytes, + audiop->fragments); break; #endif #ifdef SNDCTL_DSP_NONBLOCK case SNDCTL_DSP_NONBLOCK: /* _SIO ('P',14) */ - artsdspdebug("aRts: SNDCTL_DSP_NONBLOCK unsupported\n"); + blocking = 0; + /*artsdspdebug("aRts: SNDCTL_DSP_NONBLOCK unsupported\n");*/ break; #endif @@ -445,6 +455,16 @@ artsdspdebug ("aRts: creating stream...\n"); stream = arts_play_stream(speed,bits,channels,name?name:"artsdsp"); + + if(!blocking) + arts_stream_set(stream,ARTS_P_BLOCKING,0); + + if(frags) + arts_stream_set(stream,ARTS_P_PACKET_SETTINGS,frags); + arts_stream_set(stream,ARTS_P_PACKET_SETTINGS,0x00660008); + artsdspdebug("aRts: %d packets with %d bytes\n", + arts_stream_get(stream,ARTS_P_PACKET_COUNT), + arts_stream_get(stream, ARTS_P_PACKET_SIZE)); if(mmapemu) {