Messages in this thread Patch in this message | | | Date | Tue, 18 Jul 2000 02:25:22 -0700 | From | David Ford <> | Subject | Re: 2.4.0-test4 niggles |
| |
Esound code came from a crackbaby design. :)
esd writes nonstop to the audio dev without checking any return values. Chances are incredibly strong that the buffer is overflowing and sound data is being lost.
Attached is a patch to help that. I've no suggestion for the second problem.
-d
Jareth Hein wrote:
> Started playing with 2.4.0-test4 (first new kernel since 2.3.99) this > weekend, and have a couple of small concerns. First off, running a mostly > Debian potato setup w/Gnome on my 2x300 PII box has amazing sound > problems on anything that routes through esd (Enlightenment Sound > Daemon). I've tried play, playmidi and xmms, and the sounds get > fragmented. If I have them directly open /dev/sound they work fine. > > Secondly, neither raid1 or raid5 can be built as modules. raid1 simply > needs to have drive_stat_acct exported from drivers/block/ll_rw_blk.c > (however: is it kosher to export inline functions?), but one of the > symbols raid5 needs to be modulized is set_bh_page from fs/buffer.c, and > buffer.c is not searched for exportable symbols. Is this alright for me > (or whomsoever) to modify the makefile to do this, or should raid5 not be > asking to call that function? > > -- > Jareth Hein > Weirdness for hire
-- "The difference between 'involvement' and 'commitment' is like an eggs-and-ham breakfast: the chicken was 'involved' - the pig was 'committed'."
--- audio.c.old Wed Feb 10 17:48:24 1999 +++ audio.c Tue Jun 13 02:25:43 2000 @@ -1,6 +1,7 @@ #include "esd.h" #include "config.h" +#include <errno.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> @@ -75,7 +75,27 @@ /* dump a buffer to the sound device */ int esd_audio_write( void *buffer, int buf_size ) { - return write( esd_audio_fd, buffer, buf_size ); + /* silly author doesn't do any return value checking =) + * some sound card drivers don't tolerate full bore writes + */ + int retval, newsize, counter=0; + newsize=buf_size; + do { + retval = write( esd_audio_fd, buffer, newsize ); + if(retval == newsize) + return; + if(retval == -1 && errno != EAGAIN) + return -1; + if(retval == -1 && errno == EAGAIN) { + counter++; + usleep(100); + } + else { + counter=0; + newsize=retval; + } + } while(counter < 100); + return -1; } #endif begin:vcard n:Ford;David x-mozilla-html:TRUE org:<img src="http://www.kalifornia.com/images/paradise.jpg"> adr:;;;;;; version:2.1 email;internet:david@kalifornia.com title:Blue Labs Developer x-mozilla-cpt:;-12480 fn:David Ford end:vcard
| |