Yair K. wrote: > On Tuesday 19 August 2008 14:28:24 Hannu Savolainen wrote: > >> Yair K. wrote: >> >>> Hi, >>> >>> I noticed pulseaudio has problems starting when OSSv4 is loaded, and >>> traced it down to using select() and GET{I,O}SPACE with an mmap()'d device >>> > To be more accurate, PulseAudio uses poll() not select(). > > >>> (PulseAudio tries using mmap unless explicitly told otherwise). OSS >>> doesn't support that, and returns -EIO, which is an error code PulseAudio >>> doesn't check for and eventually leads to it failing to start. One might >>> consider blaming Pulseaudio, except: >>> >>> A) These limitations aren't documented anywhere I can see. AFAICT >>> FreeBSD's implementation does support using select(),etc. with mmap(). >>> B) OSS's return value isn't entirely consistent: It returns OSS_EIO when >>> select() is used (oss_audio_core.c / oss_audio_chpoll() ), but OSS_EPERM >>> when GETOSPACE is used with mmap. OSS_EIO seems wrong to me - the device is >>> okay, it's just select() isn't supported in the current mode. >>> >>> >> The attached diff comments out the error checking. However the result is >> probably that select/poll will never report data available. However >> could you try if it makes any difference with pulseaudio. >> > > What happens is exactly as described - poll() never reports data (it does > work in non-mmaped mode). > Ok.
I split oss_audio_chpoll() to separate input and output handlers. Now poll/select will report available data if dmap->interrupt_counter > 0. This counter gets incremented at each fragment boundary. Calling GETIPTR/GETOPTR clears the counter to zero. I think approach should work because every mmap application will make these calls. Best regards, Hannu _______________________________________________ oss-devel mailing list oss-devel@mailman.opensound.com http://mailman.opensound.com/mailman/listinfo/oss-devel