2010/5/12 pl bossart bossart.nospam@gmail.com
Some care would need to be taken with regards to detecting xruns. I think the alsa code currently uses the interrupt callback to detect
this.
I have seen a Windows 7 machine happily loop the audio buffer uncontrollably, so I assume it has problems detecting xruns as well.
When the PulseAudio timer fires, the use of snd_pcm_avail() will force a call to .pointer and will detect underflows. PulseAudio modilfies its watermark when underflows occur so that more time is allocated to refilling the ring buffer. There are probably some cases I didn't plan for, but on paper I don't really see a show-stopper here.
Refer to your patch "add rewind-safeguard parameter"
http://git.0pointer.de/?p=pulseaudio.git;a=commit;h=4df443bbe682055a41e7c224...
you mention glitch occur because application cannot rewind appl pointer to hardware ptr.
In another word, app ptr must be 128/256 bytes ahead of hardware ptr at any time to prevent glitch occur. this mean that the glitch was due to DMA brust size since "PulseAudio modilfies its watermark when underflows occur".