[alsa-devel] [PATCH] Coping with short replies in usbmixer

thomas at devbase.at thomas at devbase.at
Fri May 11 22:28:16 CEST 2007

while trying to find out why a USB handset (Yealink P1K) frequently gets 
muted when changing volume, I found that short USB responses cause the 

The function get_ctl_value(..) in usbmixer.c requests the state of a 
certain control and retries up to 10 times if an error occurs. However a 
short USB response is not treated as an error as neither the transfer 
flag URB_SHORT_NOT_OK is set nor is the return value of 
snd_usb_ctl_msg(..) compared with the requested amount of data. As a 
result the function get_ctl_value(..) might not retry the USB request 
but returns an unpredictable result without reporting an error.

The attached patch forces the number of returned bytes to be at least 
val_len. It was generated from kernel version 2.6.21. If there are any 
issues with the patch please let me know. Otherwise I would be happy if 
it could be applied to the ALSA sources.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: usbmixer.patch
Type: text/x-patch
Size: 556 bytes
Desc: not available
Url : http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20070511/fd492130/attachment.patch 

More information about the Alsa-devel mailing list