Multiple audio sample rate support on FX3

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hello,

I have a UAC device that can output different audio sample rate 32kHz/44.1kHz/48kHz via setting,  then is connected to PC via USB.

In FX3 firmware code, I have already modified some USB descriptors to support multiple sampling frequencies, as follow:

At Type I Format descriptor,

(1) increase the number of sampling frequencies (bSamFreqType)

(2) list up available frequencies

(3) Tune the size of Type I format descriptor, by the increased bytes for frequencies

(4) Tune wMaxPacketSize of the endpoint descriptor, so that it covers the samples of the greatest frequency

(5) Set the bit 0 (Sampling Frequency control) of bmAttributes on Audio-Streaming Class-specific (AS-CS) endpoint descriptor.

(6) Tune the size of wTotalLength field of the Configuration descriptor

    /* Class specific AS Format descriptor - Type I Format Descriptor ???*/

    0x11,                           /* Descriptor size */

    0x24,                           /* Class-specific Interface Descriptor Type */

    0x02,                           /* Format Type Descriptor subtype */

    0x01,                           /* PCM FORMAT_TYPE_I */

    0x02,                           /* Number of channels - 2 */

    0x02,                           /* Subframe size - 2 bytes per audio subframe */

    0x10,                           /* Bit resolution - 16 bits */

    0x03,                           /* Number of samping frequencies - 1 */

    0x00, 0x7D,0x00, //32kHz

    0x44, 0xAC, 0x00, //44.1kHz

    0x80, 0xBB, 0x00,               /* Sampling frequency - 48000 Hz */

But per modifying code above, as amcap run on the pc, it doesn't have sound for all these three audio sample rate. So, I am not sure whether I need to modify or add other code. how do I tell PC which sampling frequency to use?

Thanks.

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Hi,

Please make sure the audio class specific requests are handled in the CyFxApplnUSBSetupCB.

PLease check the attached firmware for reference. Here 44.1 KHz and 48 Khz are used as sampling frequencies.

Regards,

- Madhu Sudhan

View solution in original post

0 Likes
1 Reply