[alsa-devel] USB Audio questions

Clemens Ladisch clemens at ladisch.de
Tue Aug 16 17:46:23 CEST 2011


Daniel Mack wrote:
> On Tue, Aug 16, 2011 at 8:37 AM, Clemens Ladisch <clemens at ladisch.de> wrote:
>> Pierre-Louis Bossart wrote:
>>> - Is there any good reason why the max number of packets per urb defaults to
>>> 8?
>>
>> Not really.  It is an attempt to compromise between interrupt frequency
>> and the latency resulting from packet queueing.
> 
> Ah, I thought there is a limit of frames per urb that is the same than
> subframes per packet on USB. That's not the case then?

URBs are a Linux-defined data structure; they can be arbitrarily long
(as long as you don't reach the undocumented limit of how far in the
future the HCD can schedule packets).

> Wouldn't it be possible to not count what we submitted but look at the
> playback packets that return from the HCD and move the hwptr there?
> That information is presumably closer to the actual hardware position
> than the time when we queue.

In this case, the "hardware position" is the read pointer in ALSA's ring
buffer, which must be incremented whenever data is moved from there into
the URBs' buffers.


Regards,
Clemens


More information about the Alsa-devel mailing list