We have implemented proprietary audio streaming on the nRF52. It reads Audio from a PDM mic and uses the timeslot feature of the BLE radio to send said audio to another BLE device. This allows BLE and our proprietary Audio stream to co exist.
Now we want to use audio from a USB host, such as the Windows PC or a Phone ( Android and iOS )
We have implemented the audio loop back per the USB audio class example and can pull the audio out and send it over our proprietary audio stream. We are running 16bit 16khz stereo audio over USB.
Unfortunately, the sample clock rates are slightly different causing buffer overrun or underrun depending on the device under test.
So the question:
What support does the SDK have for USB audio sample rate feedback?
nRF52840 dev kit
Segger Embedded Studio
Resampling and such is normally done on the host side, but you can use the SOF event to get a timing anchor for your firmware. Based on your description, I am not 100% sure where the issue occurs in your system. Is this due to the asynchronous radio communication?
Yes the problem is our proprietary audio sample rate is fixed due to the fact it has to coexist with BLE. So we need to convince the host to adjust it's sample rate. This a BLE feature we just can't figure out how to get the Nordic library to do it.
Sample rate conversion on the nRF side doesn't seem feasible due to processing time constraints.
Sample rate conversion is normally done on the side that has the most processing (normally a PC).
It sounds like you are doing asynchronous audio transfers to the usb host, and there's no ready made libraries to do feedback / conversion in the SDK (bSynchAddress is 0 in the usbd audio class files, thus no endpoint feedback is setup).
Yes we are trying using asynchronous audio transfer, either implicit or explicit feedback would be acceptable, but explicit is preferred
Is it possible for us to add the feedback endpoint? or does that have to be done at a level we don't have access to?
keith v said:Is it possible for us to add the feedback endpoint? or does that have to be done at a level we don't have access to?
It is possible, but this is then something you need to develop and add the proper handling of this in the sources. Unfortunately, I do not have experience with adding such features, but I suppose you can start by look at the app_usbd_audio.c file and see what needs to be setup on a descriptor level first.
Yes I think that is what is needed.
Please ask your USB developers to provide guidance on how to specify the required endpoint
I've inputted this as a feature request internally to our SDK team.
is there anyway for me to know if/when any action has been taken on the request?