Re: snd-usb-audio : issue sending "set sample freq"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 22.04.2013 21:23, Torstein Hegge wrote:
> On Mon, Apr 22, 2013 at 20:44:40 +0200, Daniel Mack wrote:
>> Also, the lsusb dumps don't contain a audio specific header descriptor,
>> which normally looks like this:
>>
>>         AudioControl Endpoint Descriptor:
>>           bLength                 7
>>           bDescriptorType        37
>>           bDescriptorSubtype      1 (EP_GENERAL)
>>           bmAttributes         0x01
>>             Sampling Frequency
>>           bLockDelayUnits         0 Undefined
>>           wLockDelay              0 Undefined
>>
>> And without the "Sampling Frequency" bit in bmAttributes, the driver
>> will bail out early (clock.c):
> 
> I think it has the class specific endpoint descriptor, but it is in
> front of the standard endpoint descriptor. From the 'lsusb -v':
> 
>        AudioStreaming Interface Descriptor:
>          bLength                14
>          bDescriptorType        36
>          bDescriptorSubtype      2 (FORMAT_TYPE)
>          bFormatType             1 (FORMAT_TYPE_I)
>          bNrChannels             2
>          bSubframeSize           2
>          bBitResolution         16
>          bSamFreqType            2 Discrete
>          tSamFreq[ 0]        16000
>          tSamFreq[ 1]        48000
>        ** UNRECOGNIZED:  07 25 01 81 02 00 00
>        Endpoint Descriptor:
>          bLength                 9
>          bDescriptorType         5
>          bEndpointAddress     0x03  EP 3 OUT
>          bmAttributes            1
>            Transfer Type            Isochronous
>            Synch Type               None
>            Usage Type               Data
>          wMaxPacketSize     0x00c0  1x 192 bytes
>          bInterval               1
>          bRefresh                0
>          bSynchAddress           0
> 
> The UNRECOGNIZED bit matches the missing AudioControl endpoint
> descriptor.
> 
> Even if this is against the specification, devices that does this is out
> there. I have seen the same thing on a Sennheiser BTD-500, but that only
> supports one frequency, so I didn't hit this problem.

But it should still complain about "no or invalid class specific
endpoint descriptor", right?

If you have time, please check the attached (totally untested) patch.
Let's see.

Yves - did you ever compile and run your own kernel? Then please also
try this patch.


Thanks,
Daniel

diff --git a/sound/usb/stream.c b/sound/usb/stream.c
index 8951f77..67617e8 100644
--- a/sound/usb/stream.c
+++ b/sound/usb/stream.c
@@ -393,6 +393,11 @@ static int parse_uac_endpoint_attributes(struct snd_usb_audio *chip,
 	if (!csep && altsd->bNumEndpoints >= 2)
 		csep = snd_usb_find_desc(alts->endpoint[1].extra, alts->endpoint[1].extralen, NULL, USB_DT_CS_ENDPOINT);
 
+	/* if we still haven't found an uac endpoint descriptor, search the
+	 * entire interface */
+	if (!csep)
+		csep = snd_usb_find_desc(alts->extra, alts->extralen, NULL, USB_DT_CS_ENDPOINT);
+
 	if (!csep || csep->bLength < 7 ||
 	    csep->bDescriptorSubtype != UAC_EP_GENERAL) {
 		snd_printk(KERN_WARNING "%d:%u:%d : no or invalid"
------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
Alsa-user mailing list
Alsa-user@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-user

[Index of Archives]     [ALSA Devel]     [Linux Audio Users]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]

  Powered by Linux