title: 24bit USB Sample Rate Support
body: <p>My question is quite similar to this question: <a href="https://stackoverflow.com/questions/20541589/usb-24bits-audiostream-descriptors">Link</a>, but i am not allowed to comment.</p>
  
  <p>I'm implementing a PIC32 as a soundcard, and i now have a working USB audio stream, supporting  16-bit at 32kHz and 48kHz sample rates. I now want to change the bit depth to 24-bit, so i change my USB Descriptors to: </p>
  
  <pre><code>bSubFrameSize  = 0x03,    // 3 bytes per sample
  bBitResolution = 0x18,    // 24-bit resolution
  </code></pre>
  
  <p>When i do this, he bit resolution is changed as it is suppose to, but in the properties of the microphone, the dropdown menu where i could change the sampling frequency is grey.
  I havn't changed anything in the endpoint descriptors, where both 32kHz and 48kHz still is supported.</p>
  
  <p><img src="https://i.stack.imgur.com/J019S.jpg" alt="can&#39;t change sampling frequency"></p>
  
  <p>My USB topology has 1 Audio control interface with a couple of Units, and 2 Audio Streaming Interfaces, for streaming IN and OUT. 
  Marc O answered his question by saying that something in his Input Terminal, i have tried changing <code>wChannelConfig</code> but i doesn't work.
  I have tried Uninstalling and Installing the device drivers, but doesn't work.</p>
  
  <p><strong>What more do i need to change in the descriptors, to be able to select the sampling Frequency?</strong></p>
  
  <p>Thanks :)</p>
  
  <p><strong>Edit: Added Descriptor code and descriped progress</strong></p>
  
  <p>When i changed the no of channels to 2, and made the <code>wChannelConfig = 0x03 -&gt; right + Left Front</code>, i saw the the field on he picture change to: "2 channel, 24 bit, 48000 Hz (Studio Quality)", but it still didn't make the dropdown menu white, and i couldn't change sample rate. </p>
  
  <p>Below i've added the Audio funcion descriptors:</p>
  
  <pre><code>    //CD
  0x09,                           // Size : 9 Bytes
  USB_DESCRIPTOR_CONFIGURATION,   // Configuration Descriptor (0x02)
  0x10,                           // Total length in bytes of data returned
  0x01,                           //      2. Byte af Total Length
  0x05,                           // Number of Interfaces: 5      3 Audio + 2 Comm
  0x01,                           // Configuration Value, Value to use as an argument to select this configuration
  0x00,                           // iConfiguration, Index of String Descriptor describing this configuration
  _DEFAULT | _SELF,               // bmAttributes, selfpowered
  0xFA,                           // Maximum Power : 250 mA
  
  
  
      // ########          Audio Control Interface Descriptor
  
      //ID - Interface Descriptor
      0x09,                       // Size : 9 Bytes
      USB_DESCRIPTOR_INTERFACE,   // Interface Descriptor (0x04)
      0x00,                       // Number of Interface:                             Interface nr 0
      0x00,                       // Value used to select alternative setting
      0x00,                       // Number of Endpoints used for this interface, 0
      AUDIO_DEVICE,               // Class Code (Assigned by USB Org),                AUDIO
      AUDIOCONTROL,               // Subclass Code (Assigned by USB Org),             AUDIOCONTROL
      0x00,                       // Protocol Code (Assigned by USB Org)
      0x00,                       // Index of String Descriptor Describing this interface
  
  
          // HEADER
          0x0A,                   // Size : 10 Bytes
          CS_INTERFACE,           // CS_INTERFACE Descriptor Type
          HEADER,                 // HEADER descriptor subtype
          0x00,0x01,              // Audio Device compliant to the USB Audio specification version 1.00
          0x46,0x00,              // 64 bytes - Total number of bytes returned for the class-specific AudioControl interface descriptor.  // Includes the combined length of this descriptor header and all Unit and Terminal descriptors.
          0x02,                   // bInCollection -&gt; Number of streaming interfaces = 2
          0x01,                   // en form for index: "AudioStreaming interface 1 belongs to this AudioControl interface."
          0x02,                   // beskriver nok streaming interface 2's index
  
          // INPUT_TERMINAL       ID = 1      USB Stream
          0x0B,                   // size : 12 bytes
          CS_INTERFACE,           // CS_INTERFACE Descriptor Type
          INPUT_TERMINAL,         // INPUT_TERMINAL - Descriptor subtype = 2
          INPUT_TER_USB,          // ID of this Input Terminal. // Constant uniquely identifying the Terminal within the audio function.
          USB_STREAMING,          // wTerminalType -&gt; 0x0101 = USB streamming
          0x00,                   // bAssocTerminal -&gt; 0x00 = No association.
          0x02,                   // bNrChannels -&gt; 0x01 two channel.
          0x03,                   // wChannelConfig -&gt; 0x03 = right + Left Front
          0x00,                   // iChannelNames -&gt; 0x00 = Unused.
          0x00,                   // iTerminal -&gt; 0x00 = Unused.
  
          // INPUT_TERMINAL       ID = 4      MICROPHONE
          0x0B,                   // size : 12 bytes
          CS_INTERFACE,           // CS_INTERFACE Descriptor Type
          INPUT_TERMINAL,         // INPUT_TERMINAL - Descriptor subtype
          INPUT_TER_MIC,          // bTerminalID -&gt; ID of this Input Terminal = 4
          MICROPHONE,             // wTerminalType -&gt; 0x0201 = Microphone
          0x00,                   // bAssocTerminal -&gt; 0x00 = No association.
          0x02,                   // bNrChannels -&gt; 0x01 one channel.
          0x03,                   // wChannelConfig -&gt; 0x03 = right + Left Front
          0x00,                   // iChannelNames -&gt; 0x00 = Unused.
          0x00,                   // iTerminal -&gt; 0x00 = Unused.
  
          // OUTPUT_TERMINAL      ID = 3      SPEAKER
          0x09,                   // size : 9 Bytes
          CS_INTERFACE,           // CS_INTERFACE Descriptor Type
          OUTPUT_TERMINAL,        // OUTPUT_TERMINAL - Descriptor subtype
          OUTPUT_TER_SPEAK,       // bTerminalID -&gt; ID of this Output Terminal = 3
          SPEAKER,                // wTerminalType -&gt; 0x0301 = Speaker
          0x00,                   // bAssocTerminal -&gt; 0x00 = Unused
          FEATURE_OUT,            // bSourceID -&gt; 0x02 = From Input Terminal ID 2 = USB stream
          0x00,                   // iTerminal -&gt; 0x00 = Unused.
  
          // OUTPUT_TERMINAL      ID = 6      USB Stream
          0x09,                   // Size : 9 Bytes
          CS_INTERFACE,           // CS_INTERFACE Descriptor Type
          OUTPUT_TERMINAL,        // OUTPUT_TERMINAL - Descriptor subtype
          OUTPUT_TER_USB,         // bTerminalID -&gt; ID of this Output Terminal = 6
          USB_STREAMING,          // wTerminalType -&gt; 0x0101 = USB streaming
          0x00,                   // bAssocTerminal -&gt; 0x00 = Unused
          FEATURE_IN,             // bSourceID -&gt; 0x05 = Feature Unit that sets IN features               SOURCE = 5 (Feature_IN)
          0x00,                   // iTerminal -&gt; 0x00 = Unused.
  
          // FEATURE_UNIT         ID = 2
          0x0A,                   // Size : 10 Bytes
          CS_INTERFACE,           // CS_INTERFACE Descriptor Type
          FEATURE_UNIT,           // FEATURE_UNIT - Descriptor subtype
          FEATURE_OUT,            // bUnitID -&gt; ID 2
          INPUT_TER_USB,          // bSourceID -&gt; 0x01 = connected to Input Terminal 1                    SOURCE = 1 (Input USB)
          0x01,                   // bControlSize -&gt; 0x01 = 1 Byte
          0x03,                   // bmaControls(n = channel nr) -&gt; 0x03 = Mute + volume
          0x03,                   // bmaControls(n = channel nr) -&gt; 0x03 = Mute + volume
          0x00,                   // bmaControls(n = channel nr) -&gt; 0x00 = no master control
          0x00,                   // iFeature -&gt; string Descriptor Unused
  
          // FEATURE_UNIT         ID = 5
          0x0A,                   // Size : 9 Bytes
          CS_INTERFACE,           // CS_INTERFACE Descriptor Type
          FEATURE_UNIT,           // FEATURE_UNIT - Descriptor subtype
          FEATURE_IN,             // bUnitID -&gt; ID 5
          INPUT_TER_MIC,          // bSourceID -&gt; 0x04 = Connected to Unit ID 4                           SOURCE = 4 (Input Mic.)
          0x01,                   // bControlSize -&gt; 0x01 = 1 Byte
          0x03,                   // bmaControls(1) -&gt; 0b0000011 = Mute + Volume      no. of Channels +1 = no. of bmaControls
          0x03,                   // bmaControls(2) -&gt; 0b0000011 = Mute + Volume      no. of Channels +1 = no. of bmaControls
          0x00,                   // bmaControls(3) -&gt; 0x00 = No controls supperted   no. of Channels +1 = no. of bmaControls
          0x00,                   // iFeature -&gt; string Descriptor Unused
  
  
      // ########          AUDIO STREAM INTERFACE 1         OUT     SPEAKER
  
      //ID    // Alternate Setting 0 - 0 endpoint
      0x09,                       // Size : 9 Bytes
      USB_DESCRIPTOR_INTERFACE,   // Interface Descriptor (0x04)
      0x01,                       // bInterfaceNumber -&gt; 0x01 Interface ID = 1
      0x00,                       // bAlternateSetting -&gt; 0x00 = index of this interface's alternate setting
      0x00,                       // bNumEndpoints -&gt; 0x00 = 0 Endpoints to this interface
      AUDIO_DEVICE,               // bInterfaceClass -&gt; 0x01 = Audio Interface
      AUDIOSTREAMING,             // bInterfaceSubclass -&gt; 0x02 = AUDIO_STREAMING
      0x00,                       // bInterfaceProtocol -&gt; 0x00 = Unused
      0x00,                       // iInterface -&gt; 0x00 = Unused
  
      //ID    // Alternate Setting 1 - 1 endpoint
      0x09,                       // Size : 9 Bytes
      USB_DESCRIPTOR_INTERFACE,   // Interface Descriptor (0x04)
      0x01,                       // bInterfaceNumber -&gt; 0x01 Interface ID = 1
      0x01,                       // bAlternateSetting -&gt; 0x01 = index of this interface's alternate setting
      0x01,                       // bNumEndpoints -&gt; 0x01 = 1 Endpoints to this interface
      0x01,                       // bInterfaceClass -&gt; 0x01 = Audio Interface
      0x02,                       // bInterfaceSubclass -&gt; 0x02 = AUDIO_STREAMING
      0x00,                       // bInterfaceProtocol -&gt; 0x00 = Unused
      0x00,                       // iInterface -&gt; 0x00 = Unused
  
          // ASID     GENERAL
          0x07,                   // Size : 7 Bytes
          CS_INTERFACE,           // CS_INTERFACE Descriptor Type
          AS_GENERAL,             // bDescriptorSubtype -&gt; 0x01 = GENERAL subtype
          0x01,                   // bTerminalLink -&gt; 0x01 = The Terminal ID of the Terminal to which the endpoint of this interface is connected.
          0x01,                   // bDelay -&gt; 0x01 = Delay (delta) introduced by the data path (see Section 3.4, ?Inter Channel Synchronization? - in Audio Devices). Expressed in number of frames.
          0x01,0x00,              // wFormatTag -&gt; 0x0001 = PCM
  
          // ASID     FORMAT_TYPE
          0x0E,                   // Size : 14 Bytes
          CS_INTERFACE,           // CS_INTERFACE Descriptor Type
          FORMAT_TYPE,            // bDescriptorSubtype -&gt; 0x02 = FORMAT_TYPE
          0x01,                   // bFormatType -&gt; 0x01 = FORMAT_TYPE_I -&gt; ref: A.1.1  Audio Data Format Type I Codes -&gt; Audio Data Format Dok
          0x02,                   // bNrChannels -&gt; 0x02 = Two channels
          BYTES_PR_SAMPLE,        // bSubFrameSize -&gt; 0x03 = 3 bytes pr audio subframe
          BIT_RESOLUTION,         // bBitResolution -&gt; 0x18 = 24 bit pr sample
          0x02,                   // bSamFreqType -&gt; 0x02 = 2 sample frequencies supported
          0x00,0x7D,0x00,         // tSamFreq -&gt; 0x7D00 = 32000 Hz
          0x80,0xBB,0x00,         // tSamFreq -&gt; 0xBB80 = 48000 Hz
  
      //ED            ENDPOINT    OUT
      0x09,                       // Size : 9 Bytes
      USB_DESCRIPTOR_ENDPOINT,    // 0x05 -&gt; ENDPOINT Descriptor Type
      0x01,                       // bEndpointAddress -&gt; 0x01 = adress 1, OUT, -&gt; ref 9.6.6 Endpoint -&gt; usb_20 Dok
      0x09,                       // bmAttributes -&gt; 0b00001001 -&gt; Bits 0-1 = 01 = Isochronous , Bits 2-3 = 10 = Adaptive
      AUDIO_MAX_SAMPLES * sizeof ( AUDIO_PLAY_SAMPLE ), AUDIO_MAX_SAMPLES * sizeof ( AUDIO_PLAY_SAMPLE )&gt;&gt;8,
      0x01,                       // bInterval -&gt; 0x01 = 1 millisecond
      0x00,                       // Unused
      0x00,                       // Unused
  
          //AS        ENDPOINT
          0x07,                   // Size : 7 Bytes
          CS_ENDPOINT,            // CS_ENDPOINT
          EP_GENERAL,             // bDescriptorSubtype -&gt; 0x01 = GENERAL
          SAMPLING_FREQ_CONTROL,  // bmAttributes -&gt; 0b00000001 = Bit 1 = 1 =&gt; Sample Freq Control is supported by this endpoint
          0x00,                   // bLockDelayUnits -&gt; 0x00 = Indicates the units used for the wLockDelay field: 0 = Undefined
          0x00,0x00,              // the time it takes this endpoint to reliably lock its internal clock recovery circuitry.
  
  
  // ########          AUDIO STREAM INTERFACE 2         IN     MICROPHONE
  
      //ID    // Alternate Setting 0 - 0 endpoint
      0x09,                       // Size : 9 Bytes
      USB_DESCRIPTOR_INTERFACE,   // Interface Descriptor (0x04)
      0x02,                       // bInterfaceNumber -&gt; 0x02 Interface ID = 2
      0x00,                       // bAlternateSetting -&gt; 0x00 = Value used to select this alternate setting for the interface identified in the prior field
      0x00,                       // bNumEndpoints -&gt; 0x00 = 0 -&gt; Number of endpoints used by this interface
      AUDIO_DEVICE,               // bInterfaceClass -&gt; 0x01 = 1 = AUDIO
      AUDIOSTREAMING,             // bInterfaceSubClass -&gt; 0x02 = AUDIO_STREAMING
      0x00,                       // bInterfaceProtocol -&gt; 0x00 = Unused
      0x00,                       // iInterface -&gt; 0x00 = Unused -&gt; Index of string descriptor.
  
      //ID    // Alternate Setting 1 - 1 endpoint
      0x09,                       // Size : 9 Bytes
      USB_DESCRIPTOR_INTERFACE,   // Interface Descriptor (0x04)
      0x02,                       // bInterfaceNumber -&gt; 0x02 Interface ID = 2
      0x01,                       // bAlternateSetting -&gt; 0x01 = Value used to select this alternate setting for the interface identified in the prior field
      0x01,                       // bNumEndpoints -&gt; 0x01 = 1 -&gt; Number of endpoints used by this interface
      0x01,                       // bInterfaceClass -&gt; 0x01 = 1 = AUDIO
      0x02,                       // bInterfaceSubClass -&gt; 0x02 = AUDIO_STREAMING
      0x00,                       // bInterfaceProtocol -&gt; 0x00 = Unused
      0x00,                       // iInterface -&gt; 0x00 = Unused -&gt; Index of string descriptor.
  
          // ASID     GENERAL
          0x07,                   // Size : 7 Bytes
          CS_INTERFACE,           // CS_INTERFACE Descriptor Type
          AS_GENERAL,             // GENERAL Descriptor
          0x06,                   // bTerminalLink -&gt; 0x06 = The Terminal ID of the Terminal to which the endpoint of this interface is connected. = 6
          0x01,                   // bDelay -&gt; 0x01 = Delay (delta) introduced by the data path (see Section 3.4, ?Inter Channel Synchronization? - in Audio Devices). Expressed in number of frames.
          0x01,0x00,              // wFormatTag -&gt; 0x0001 = PCM
  
          // ASID     FORMAT_TYPE
          0x0E,                   // Size : 14 Bytes
          CS_INTERFACE,           // CS_INTERFACE Descriptor Type
          FORMAT_TYPE,            // bDescriptorSubtype -&gt; 0x02 = FORMAT_TYPE
          0x01,                   // bFormatType -&gt; 0x01 = FORMAT_TYPE_I -&gt; ref: A.1.1  Audio Data Format Type I Codes -&gt; Audio Data Format Dok
          0x02,                   // bNrChannels -&gt; 0x02 = Two channels
          BYTES_PR_SAMPLE,        // bSubFrameSize -&gt; 0x03 = 3 bytes pr audio subframe
          BIT_RESOLUTION,         // bBitResolution -&gt; 0x18 = 24 bit pr sample
          0x02,                   // bSamFreqType -&gt; 0x02 = 2 sample frequencies supported
          0x00,0x7D,0x00,         // tSamFreq -&gt; 0x7D00 = 32000 Hz
          0x80,0xBB,0x00,         // tSamFreq -&gt; 0xBB80 = 48000 Hz
  
      //ED            ENDPOINT        IN
      0x09,                       // Size : 9 Bytes
      USB_DESCRIPTOR_ENDPOINT,    // 0x05 -&gt; ENDPOINT Descriptor Type
      0x82,                       // bEndpointAddress -&gt; 0x82 = adress 2, IN, -&gt; ref 9.6.6 Endpoint -&gt; usb_20 Dok
      0x05,                       // bmAttributes -&gt; 0b00000101 -&gt; Bits 0-1 = 01 = Isochronous , Bits 2-3 = 01 = Asynchronous
      AUDIO_MAX_SAMPLES * sizeof ( AUDIO_PLAY_SAMPLE ), AUDIO_MAX_SAMPLES * sizeof ( AUDIO_PLAY_SAMPLE )&gt;&gt;8,
      0x01,                       // bInterval -&gt; 0x01 = 1 millisecond
      0x00,                       // unused
      0x00,                       // unused
  
          //AS        ENDPOINT
          0x07,                   // Size : 7 Bytes
          CS_ENDPOINT,            // bDescriptorType -&gt; 0x25 = CS_ENDPOINT
          EP_GENERAL,             // bDescriptorSubtype -&gt; 0x01 = GENERAL
          SAMPLING_FREQ_CONTROL,  // bmAttributes -&gt; 0b00000001 = Bit 1 = 1 =&gt; Sample Freq Control is supported by this endpoint
          0x00,                   // bLockDelayUnits -&gt; 0x00 = Indicates the units used for the wLockDelay field: 0 = Undefined
          0x00,0x00,              // the time it takes this endpoint to reliably lock its internal clock recovery circuitry.
  </code></pre>