From: Rui S. <rui...@cl...> - 2002-02-25 15:00:05
|
On Mon, 25 Feb 2002, Shane Wegner wrote: We don't start recording automatically on select() anymore. You must use SNDCTL_DSP_SETTRIGGER to start the recording. In your example bellow this would be done just before the while(1) loop. Rui P.S: The "read select() starts recording" was also removed from latest OSS spec. > Hi all, > > I have been working on moving from the ALSA drivers to the > latest emu10k1 OSS CVS drivers for the advanced routing > controls. Mostly, the upgrade has gone smoothly, however, > I am the author of an audio application which breaks under > the emu10k1 driver. > > Basically what seems to be happening is the select or poll > system calls aren't returning during audio capture so my > application doesn't bother to read audio data. I have > enclosed a tiny test program to demonstrate this. Under > ALSA or an OSS driver for another audio card, there is all > kinds of output; with emu10k1, it is quite silent. > > I have tested both the latest drivers in CVS at sourceforge > as well as those in the 2.4.18-rc4 kernel prepatch. If > anyone has any suggestions, I would appreciate hearing from > you? I glanced at audio.c where the poll function lives > but can't make sense of it at this point. > > --- begin test program --- > #include <stdio.h> > #include <sys/types.h> > #include <sys/stat.h> > #include <fcntl.h> > > int main() > { > fd_set rs; > char buff[1024]; > int fd, i; > if ((fd = open("/dev/dsp", O_RDONLY)) == -1) > abort("open failed."); > while (1) { > FD_ZERO(&rs); > FD_SET(fd, &rs); > if ((i = select(fd + 1, &rs, NULL, NULL, NULL)) <= 0) > continue; > i = read(fd, buff, 1024); > printf("Got %d bytes.\n", i); > } > return 0; > } > --- end test program --- > > |