[alsa-devel] safe support for rewind in ALSA

Kai Vehmanen kvehmanen at eca.cx
Wed Feb 3 19:03:26 CET 2010


On Wed, 3 Feb 2010, Raymond Yau wrote:

>> - the 'only' change is to make sure the hw_ptr reported in .pointer is
>> NOT the number of samples pushed out to the interface. hw_ptr should
> if snd_xxx_pointer call back return the next read position , the hw_ptr will
> always be multiple of PCI/PCIe brust size

yep, that's the point I was trying to make in my longish earlier
mail yesterday:

I also presented two solutions for this. So let hw_ptr be a multiple of 
burst/batch size, but compensate by:

1) driver updates runtime->delay in its pointer() callback, or
 	-> finegrained playout delay can be reported even if
 	   hw_ptr is a multiple of burst/batch size
2) use of snd_pcm_status_get_tstamp() (original idea from Eero)
         -> assumes runtime->delay is updated in sync with hw_ptr

Both are possible with existing ALSA infra, and driver and app developers
could just use these, but what is missing is the consensus whether this is 
a valid/allowed thing to do and rely on.

More information about the Alsa-devel mailing list