[alsa-devel] USB Audio questions

Pierre-Louis Bossart pierre-louis.bossart at linux.intel.com
Sat Aug 20 00:02:04 CEST 2011


> > Any idea on how this frame number can be read,
> 
> With usb_get_current_frame_number().

I hacked something to refine the delay information based on the USB
frame number. see attached patch. 
Two points can be improved:
- I am not sure how to convert from USB frames to ALSA frames. I used a
fixed value based what my headset supports
- Every second or so the estimate seems to be off by 96 samples, see
below. Not sure why this happens, how accurate the counter is and if
there a delay in handling retired urbs? Looks good enough though.
Thanks,
-Pierre

[10880.896486] plb-urb -- actual delay 96 estimated delay 0 
[10881.917729] plb-urb -- actual delay 48 estimated delay 0 
[10882.937948] plb-urb -- actual delay 96 estimated delay 0 
[10883.966190] plb-urb -- actual delay 96 estimated delay 0 
[10884.987425] plb-urb -- actual delay 96 estimated delay 0 
[10886.008654] plb-urb -- actual delay 96 estimated delay 0 
[10887.029931] plb-urb -- actual delay 96 estimated delay 0 
[10888.050153] plb-urb -- actual delay 96 estimated delay 0 
[10889.071375] plb-urb -- actual delay 96 estimated delay 0



-------------- next part --------------
A non-text attachment was scrubbed...
Name: usb-delay.patch
Type: text/x-patch
Size: 3789 bytes
Desc: not available
Url : http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20110819/19e81f78/attachment.patch 


More information about the Alsa-devel mailing list