Mauro Carvalho Chehab wrote:
Clemens Ladisch clemens@ladisch.de escreveu:
Mauro Carvalho Chehab wrote:
.period_bytes_min = 64, /* 12544/2, */
This is wrong (if the driver doesn't install other constraints on the period length, like the USB audio class driver does).
Ok, how should it be estimated?
This value specifies how fast the driver can report period interrupts, i.e., how often it can call snd_pcm_period_elapsed(). In other words, if the application configures the device for this minimum period size, but if it is possible for this amount of bytes to be transferred _without_ triggering an interrupt (by reaching the end of the URB), then this value was too low.
The em28xx driver uses a fixed URB size, so actual interrupts happen every 64 frames, so this value should be at least the number of bytes that can be transferred in 64 ms (assuming a full-speed device).
Because you do not know the exact number of samples that will be sent per frame, it is possible that the USB interrupt happens up to 63 ms after the point where the period interrupt should actually have happened. This jitter could be reduced by using shorter URBs.
In any case, this driver does not need the integer constraint on the period count.
Regards, Clemens