On Wed, Jun 24, 2009 at 10:39 AM, Takashi Iwaitiwai@suse.de wrote:
The glitch-free problem of PA comes from the fact that PA assumes that the driver returns the current hw position accurately at any time. But, in many hardwares, including HDA, this is not true. The hardware lies. It doesn't report the right position at all. Thus, there are many workarounds implemented in HD-audio side.
Why does pulse need to know the DMA position?
If it is so that it can write into the buffer with minimal latency there are other ways to accomplish that. The simplest is to just add an entry into ALSA core that says, play this buffer with minimal latency. That would let the transfer be pushed down into the specific driver and that driver could handle it in an optimal way.
Optimal on my hardware would be to reprogram the DMA hardware to immediately start playing from the new buffer. No copies involved. The FIFO will hide the buffer swap from the audio hardware.
Optimal on ring buffer hardware would be to locate where DMA was in the ring and copy to a position in front of it.
These hardware differences should be hidden from pulse.