Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Aug 2009 05:49:38 GMT
From:      Boris Popov <bp@FreeBSD.org>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   usb/138124: Axed uaudio functionality in the usbng (alternate endpoints)
Message-ID:  <200908240549.n7O5ncKQ005492@www.freebsd.org>
Resent-Message-ID: <200908240550.n7O5o16R091489@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         138124
>Category:       usb
>Synopsis:       Axed uaudio functionality in the usbng (alternate endpoints)
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-usb
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Aug 24 05:50:00 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     Boris Popov
>Release:        FreeBSD-current
>Organization:
>Environment:
FreeBSD fb8.bhome 8.0-BETA2 FreeBSD 8.0-BETA2 #2: Mon Aug 17 19:07:02 ALMT 2009     root@fb8.bhome:/usr/src/sys/i386/compile/vm  i386

>Description:
The new USB stack doesn't handle properly alternate endpoint settings -
according to author, it pickups the best one from the list. Eg., if card
claims to support 16bit/48kHz, 24bit/48kHz, 16bit/96kHz and 24bit/96kHz
the last one will be selected. For some applications this will be
sufficient because internal resampler had been improved significantly.

This creates, however, serious problem for embedded systems where
applications fine tuned for specific sample rates and external
hardware (DACs and ADCs) work only with the given bits resolution
and sample rate.

Attached one will find a sample of USB Audio descriptor with alternate
endpoints.
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

   Interface Descriptor:
     bLength                 9
     bDescriptorType         4
     bInterfaceNumber        1
     bAlternateSetting       0
     bNumEndpoints           0
     bInterfaceClass         1 Audio
     bInterfaceSubClass      2 Streaming
     bInterfaceProtocol      0
     iInterface              0
   Interface Descriptor:
     bLength                 9
     bDescriptorType         4
     bInterfaceNumber        1
     bAlternateSetting       1
     bNumEndpoints           1
     bInterfaceClass         1 Audio
     bInterfaceSubClass      2 Streaming
     bInterfaceProtocol      0
     iInterface              0
     AudioStreaming Interface Descriptor:
       bLength                 7
       bDescriptorType        36
       bDescriptorSubtype      1 (AS_GENERAL)
       bTerminalLink           1
       bDelay                  0 frames
       wFormatTag              1 PCM
     AudioStreaming Interface Descriptor:
       bLength                11
       bDescriptorType        36
       bDescriptorSubtype      2 (FORMAT_TYPE)
       bFormatType             1 (FORMAT_TYPE_I)
       bNrChannels             2
       bSubframeSize           2
       bBitResolution         16
       bSamFreqType            1 Discrete
       tSamFreq[ 0]        44100
     Endpoint Descriptor:
       bLength                 9
       bDescriptorType         5
       bEndpointAddress     0x01  EP 1 OUT
       bmAttributes            9
         Transfer Type            Isochronous
         Synch Type               Adaptive
         Usage Type               Data
       wMaxPacketSize     0x00b4  1x 180 bytes
       bInterval               1
       bRefresh                0
       bSynchAddress           0
       AudioControl Endpoint Descriptor:
         bLength                 7
         bDescriptorType        37
         bDescriptorSubtype      1 (EP_GENERAL)
         bmAttributes         0x00
         bLockDelayUnits         0 Undefined
         wLockDelay              0 Undefined
   Interface Descriptor:
     bLength                 9
     bDescriptorType         4
     bInterfaceNumber        1
     bAlternateSetting       2
     bNumEndpoints           1
     bInterfaceClass         1 Audio
     bInterfaceSubClass      2 Streaming
     bInterfaceProtocol      0
     iInterface              0
     AudioStreaming Interface Descriptor:
       bLength                 7
       bDescriptorType        36
       bDescriptorSubtype      1 (AS_GENERAL)
       bTerminalLink           1
       bDelay                  0 frames
       wFormatTag              1 PCM
     AudioStreaming Interface Descriptor:
       bLength                11
       bDescriptorType        36
       bDescriptorSubtype      2 (FORMAT_TYPE)
       bFormatType             1 (FORMAT_TYPE_I)
       bNrChannels             2
       bSubframeSize           3
       bBitResolution         24
       bSamFreqType            1 Discrete
       tSamFreq[ 0]        44100
     Endpoint Descriptor:
       bLength                 9
       bDescriptorType         5
       bEndpointAddress     0x01  EP 1 OUT
       bmAttributes            9
         Transfer Type            Isochronous
         Synch Type               Adaptive
         Usage Type               Data
       wMaxPacketSize     0x010e  1x 270 bytes
       bInterval               1
       bRefresh                0
       bSynchAddress           0
       AudioControl Endpoint Descriptor:
         bLength                 7
         bDescriptorType        37
         bDescriptorSubtype      1 (EP_GENERAL)
         bmAttributes         0x00
         bLockDelayUnits         0 Undefined
         wLockDelay              0 Undefined
   Interface Descriptor:
     bLength                 9
     bDescriptorType         4
     bInterfaceNumber        1
     bAlternateSetting       3
     bNumEndpoints           1
     bInterfaceClass         1 Audio
     bInterfaceSubClass      2 Streaming
     bInterfaceProtocol      0
     iInterface              0
     AudioStreaming Interface Descriptor:
       bLength                 7
       bDescriptorType        36
       bDescriptorSubtype      1 (AS_GENERAL)
       bTerminalLink           1
       bDelay                  0 frames
       wFormatTag              1 PCM
     AudioStreaming Interface Descriptor:
       bLength                11
       bDescriptorType        36
       bDescriptorSubtype      2 (FORMAT_TYPE)
       bFormatType             1 (FORMAT_TYPE_I)
       bNrChannels             2
       bSubframeSize           2
       bBitResolution         16
       bSamFreqType            1 Discrete
       tSamFreq[ 0]        48000
     Endpoint Descriptor:
       bLength                 9
       bDescriptorType         5
       bEndpointAddress     0x01  EP 1 OUT
       bmAttributes            9
         Transfer Type            Isochronous
         Synch Type               Adaptive
         Usage Type               Data
       wMaxPacketSize     0x00c4  1x 196 bytes
       bInterval               1
       bRefresh                0
       bSynchAddress           0
       AudioControl Endpoint Descriptor:
         bLength                 7
         bDescriptorType        37
         bDescriptorSubtype      1 (EP_GENERAL)
         bmAttributes         0x00
         bLockDelayUnits         0 Undefined
         wLockDelay              0 Undefined
   Interface Descriptor:
     bLength                 9
     bDescriptorType         4
     bInterfaceNumber        1
     bAlternateSetting       4
     bNumEndpoints           1
     bInterfaceClass         1 Audio
     bInterfaceSubClass      2 Streaming
     bInterfaceProtocol      0
     iInterface              0
     AudioStreaming Interface Descriptor:
       bLength                 7
       bDescriptorType        36
       bDescriptorSubtype      1 (AS_GENERAL)
       bTerminalLink           1
       bDelay                  0 frames
       wFormatTag              1 PCM
     AudioStreaming Interface Descriptor:
       bLength                11
       bDescriptorType        36
       bDescriptorSubtype      2 (FORMAT_TYPE)
       bFormatType             1 (FORMAT_TYPE_I)
       bNrChannels             2
       bSubframeSize           3
       bBitResolution         24
       bSamFreqType            1 Discrete
       tSamFreq[ 0]        48000
     Endpoint Descriptor:
       bLength                 9
       bDescriptorType         5
       bEndpointAddress     0x01  EP 1 OUT
       bmAttributes            9
         Transfer Type            Isochronous
         Synch Type               Adaptive
         Usage Type               Data
       wMaxPacketSize     0x0126  1x 294 bytes
       bInterval               1
       bRefresh                0
       bSynchAddress           0
       AudioControl Endpoint Descriptor:
         bLength                 7
         bDescriptorType        37
         bDescriptorSubtype      1 (EP_GENERAL)
         bmAttributes         0x00
         bLockDelayUnits         0 Undefined
         wLockDelay              0 Undefined
   Interface Descriptor:
     bLength                 9
     bDescriptorType         4
     bInterfaceNumber        1
     bAlternateSetting       5
     bNumEndpoints           1
     bInterfaceClass         1 Audio
     bInterfaceSubClass      2 Streaming
     bInterfaceProtocol      0
     iInterface              0
     AudioStreaming Interface Descriptor:
       bLength                 7
       bDescriptorType        36
       bDescriptorSubtype      1 (AS_GENERAL)
       bTerminalLink           1
       bDelay                  0 frames
       wFormatTag              1 PCM
     AudioStreaming Interface Descriptor:
       bLength                11
       bDescriptorType        36
       bDescriptorSubtype      2 (FORMAT_TYPE)
       bFormatType             1 (FORMAT_TYPE_I)
       bNrChannels             2
       bSubframeSize           2
       bBitResolution         16
       bSamFreqType            1 Discrete
       tSamFreq[ 0]        96000
     Endpoint Descriptor:
       bLength                 9
       bDescriptorType         5
       bEndpointAddress     0x01  EP 1 OUT
       bmAttributes            9
         Transfer Type            Isochronous
         Synch Type               Adaptive
         Usage Type               Data
       wMaxPacketSize     0x0184  1x 388 bytes
       bInterval               1
       bRefresh                0
       bSynchAddress           0
       AudioControl Endpoint Descriptor:
         bLength                 7
         bDescriptorType        37
         bDescriptorSubtype      1 (EP_GENERAL)
         bmAttributes         0x00
         bLockDelayUnits         0 Undefined
         wLockDelay              0 Undefined
   Interface Descriptor:
     bLength                 9
     bDescriptorType         4
     bInterfaceNumber        1
     bAlternateSetting       6
     bNumEndpoints           1
     bInterfaceClass         1 Audio
     bInterfaceSubClass      2 Streaming
     bInterfaceProtocol      0
     iInterface              0
     AudioStreaming Interface Descriptor:
       bLength                 7
       bDescriptorType        36
       bDescriptorSubtype      1 (AS_GENERAL)
       bTerminalLink           1
       bDelay                  0 frames
       wFormatTag              1 PCM
     AudioStreaming Interface Descriptor:
       bLength                11
       bDescriptorType        36
       bDescriptorSubtype      2 (FORMAT_TYPE)
       bFormatType             1 (FORMAT_TYPE_I)
       bNrChannels             2
       bSubframeSize           3
       bBitResolution         24
       bSamFreqType            1 Discrete
       tSamFreq[ 0]        96000
     Endpoint Descriptor:
       bLength                 9
       bDescriptorType         5
       bEndpointAddress     0x01  EP 1 OUT
       bmAttributes            9
         Transfer Type            Isochronous
         Synch Type               Adaptive
         Usage Type               Data
       wMaxPacketSize     0x0246  1x 582 bytes
       bInterval               1
       bRefresh                0
       bSynchAddress           0
       AudioControl Endpoint Descriptor:
         bLength                 7
         bDescriptorType        37
         bDescriptorSubtype      1 (EP_GENERAL)
         bmAttributes         0x00
         bLockDelayUnits         0 Undefined
         wLockDelay              0 Undefined


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200908240549.n7O5ncKQ005492>