[alsa-devel] Solved Hercules RMX2

Daniel Mack zonque at gmail.com
Tue Apr 16 18:05:32 CEST 2013


On 16.04.2013 17:35, Gabriel M. Beddingfield wrote:
> On 04/16/2013 08:12 AM, Daniel Schürmann wrote:
>> Hi Gabriel,
>>
>> Thank you for your quick response.
>> The patch against the alsa-kernel is also attached at
>> https://bugs.launchpad.net/mixxx/+bug/1096687 and here:
> 
> OK, I see now.  FYI, most maintainers prefer that you submit patches 
> according to the guidelines in Documentation/SubmittingPatches.  (I'm 
> not a maintainer, BTW...)
> 
>>
>> diff --git a/sound/usb/helper.c b/sound/usb/helper.c
>> index c1db28f..e044804 100644
>> --- a/sound/usb/helper.c
>> +++ b/sound/usb/helper.c
>> @@ -23,6 +23,9 @@
>>   #include "helper.h"
>>   #include "quirks.h"
>>
>> +/* Hercules RMX2 needs 1240 ms for setting the sample rate the first time */
>> +#define USB_MSG_TIMEOUT 1500
>> +
>>   /*
>>    * combine bytes and get an integer value
>>    */
>> @@ -93,7 +96,7 @@ int snd_usb_ctl_msg(struct usb_device *dev, unsigned int pipe, __u8 request,
>>   			return -ENOMEM;
>>   	}
>>   	err = usb_control_msg(dev, pipe, request, requesttype,
>> -			      value, index, buf, size, 1000);
>> +			      value, index, buf, size, USB_MSG_TIMEOUT);
>>   	if (size > 0) {
>>   		memcpy(data, buf, size);
>>   		kfree(buf);
> 
> This changes the value for every USB audio device... not just the RMX2. 
>   Daniel, is there a better way to do this?

Yes, you can store an integer in struct snd_usb_audio (call it
usb_msg_timeout or s.th.), initialize it to 1000 from
snd_usb_audio_probe() and add a quirk to override that value in
snd_usb_apply_boot_quirk().


Thanks,
Daniel



More information about the Alsa-devel mailing list