Hi,
I'm working with a modified version of the evkmimxrt1060/usb_examples/usb_device_composite_hid_audio_unified project and I believe there's a bug (or at least an improvement that can be made) in bm/audio_unified.c...
The application is pre-configured to run at 48kHz; but I had need to test something at 16kHz; hence, I stumbled on an issue on the USB side of things. There are two definitions in usb_device_descriptor.h:
#define AUDIO_IN_SAMPLING_RATE_KHZ (48) and #define AUDIO_OUT_SAMPLING_RATE_KHZ (48).
I changed these (plus a few other hardware specific clock adjustments) to 16 and found that the host still thought the USB device was using a 48kHz sample rate. I then discovered these lines in audio_unified.c:
...
g_deviceComposite->audioUnified.curSampleFrequency = 48000U;
...
g_deviceComposite->audioUnified.freqControlRange.wMIN = 48000U;
g_deviceComposite->audioUnified.freqControlRange.wMAX = 48000U;
...
When I changed 48000U to (AUDIO_IN_SAMPLING_RATE_KHZ *1000) my host then saw the device as a 16kHz samplerate.
NXP Team: please let me know if you agree with this change. I don't know the USB stack that well, so this is based on empirical observation only.
By the way, the same issue exists for bm and lite/bm.
Thanks,
Solved! Go to Solution.
Hello @EdSutter,
I agree with you, you also need to modify this so the host can identify the device sample frequency. I will forward your comments to the applications team.
Best Regards,
Alexis Andalon
Hello @EdSutter,
I agree with you, you also need to modify this so the host can identify the device sample frequency. I will forward your comments to the applications team.
Best Regards,
Alexis Andalon
Great, thanks!