[alsa-devel] USB Audio questions

Clemens Ladisch clemens at ladisch.de
Tue Aug 16 08:47:04 CEST 2011


David Henningsson wrote:
> On 08/15/2011 10:31 PM, Pierre-Louis Bossart wrote:
> > - Increasing the number of packets/urbs solves my power issue but not the
> > synchronization issue. If I reduce the number of urbs to reduce the
> > interrupt rate, then the accuracy of the hw_pointer is decreased big time
> > and it becomes difficult to synchronize with video.
> 
> I think the same thing is a problem for quite a few other devices as
> well

Yes; sometimes, the period interrupt is the only information from which
the driver can derive the position.

> I wonder if we need some kind of "pointer granularity" variable
> to be exported through the ALSA API?

This is certainly possible, and by putting it into the hw_params, it
would be possible to model any dependencies between granularity and
period size.  However, this isn't quite at the top of my steadily-growing
ToDo list.

> a call to hw_pointer could return hw_pointer and time,

After calling snd_pcm_status(), you have snd_pcm_status_get_avail() and
snd_pcm_status_get_(h)tstamp().

> and then PulseAudio etc could use that for extrapolation

IIRC PA does exactly this if it detects that the pointer values don't
increase smoothly.


Regards,
Clemens


More information about the Alsa-devel mailing list