Hannu Savolainen wrote:
> Yair K. wrote:
>   
>> On Tuesday 19 August 2008 15:57:47 Hannu Savolainen wrote:
>>
>>     
>>> 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.
>>>       
>> I ran pulseaudio ("module-oss rate=48000", 
>> "module-native-protocol-unix") and paplay and it still doesn't work 
>> when mmap is used.
>>
>> strace output is attached - I traced only poll and ioctl (I sent the 
>> SIGINT in order to stop pulseaudio).
>>
>>     
> It looks like PulseAudio doesn't call SNDCTL_DSP_SETTRIGER to start the 
> device. Poll will never report any input activity if the device is stopped.
>
> Also the strace doesn't seem to contain any poll cals for fd=9.
>   

I took a quick look at pulseaudio (module-oss.c). There are few obvious 
errors:

- If the trigger() function gets called with quick==true then it will 
fail for sure. It will not start recording.
- Calling SNDCTL_DSP_HALT in the place it's called now is an error. It 
will prevent SNDCTL_DSP_SETTRIGGER from working even when quick==false.
- The call to SNDCTL_DSP_POST is bogus. It may or may not cause troubles.
- Below that the "/* Some crappy drivers do not start... */ is wrong. 
Instead of calling read() it should do SNDCTL_DSP_SETTRIGGER(0) and 
SNDCTL_DSP_SETTRIGGER(PCM_ENABLE_INPUT). This should be done even when 
quick==true.

Best regards,

Hannu
_______________________________________________
oss-devel mailing list
oss-devel@mailman.opensound.com
http://mailman.opensound.com/mailman/listinfo/oss-devel

Reply via email to