[alsa-devel] [PATCH 1/3] sound: Add a quirk to enforce period_bytes

Clemens Ladisch clemens at ladisch.de
Wed Jun 18 10:20:59 CEST 2014


Mauro Carvalho Chehab wrote:
> Let's see the au0828 case:
> 	48 kHz, 2 bytes/sample, 2 channels, 256 maxpacksize, 1 ms URB
> interval (bInterval = 1).
>
> In this case, there is 192 bytes per 1ms period.

The device's clock and the bus clock are not synchronized, so there will
be _approximately_ 192 bytes per USB frame.

> Let's assume that the period was set to 3456, with corresponds to
> a latency of 18 ms.
>
> In this case, as NUM_URBS = 12,

There is no symbol named NUM_URBS.

> it means that the transfer buffer will be set to its maximum value of
> 3072 bytes per URB pack (12 * 256)

The number of URBs is not the same as the number of packets per URB.

> and the URB transfer_callback will be called on every 16 ms.

It will be called once per millisecond.

> So, what

... definitely not ...

> happens is:
>
> 	- after 16 ms, the first 3072 bytes arrive. The next
> 	  packet will take another 16ms to arrive;
> 	- after 2 ms, underrun, as the period_size was not
> 	  filled yet.


Regards,
Clemens


More information about the Alsa-devel mailing list