Hi engineers,
I want to achieve a demand that receive audio/HID data from the PC side through USB interface and transmit data through BLE to other devices.
So has the nRF SDK already included the example about UAC? Thanks!
Best Regards,
Sean
Hi engineers,
I want to achieve a demand that receive audio/HID data from the PC side through USB interface and transmit data through BLE to other devices.
So has the nRF SDK already included the example about UAC? Thanks!
Best Regards,
Sean
You would need to combine the USB Audio class example with an BLE example, for instance modify:
https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/usbd_ble_uart_example.html
to use this instead
https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/examples_usb.html
However, make sure you understand that with the current BLE spec the audio quality will be low and the delay can be long. So you can't expect real-time audio streaming with high quality audio with low latency.
Thanks
I see the max theoretical value of nRF52833 bandwidth in the feature list is 2Mbps. So if the audio parameter is like this.
- Bit depth: 16bit
- Sample rate: 32kHz
- Audio channel: mono(1 channel)
- Unidirectional transmission
The least theoretical value I need is 16*32k*1 = 512k < 2M, but how to calculate the latency?
2Mbps is the on-air data rate during transmission. It does not take into account startup and switching time of the radio. It does not take into overhead, bi-directional data and re-transmissions. It does not take into account that communication is synchronized at specific connection intervals. So unfortunately the actual throughput in a real scenario is lower, you cannot expect sustained 512kbps. The latency will depend on the connection interval and re-transmissions that may occur due to interference. It can be as high as several tens of ms (e.g. 100ms) under some situations, it will likely vary, so you would need to buffer quite a lot of data.
Best regards,
Kenneth
So it actually cannot transmit such large data. May I ask what's the actual max data rate by measuring?
If you run the throughput example you can likely find that it will transfer over >1000kbps, this is high throughput that should be able to support audio, however for an audio solution you will need also to have control of the latency and also control the buffers (for instance you do not want to transfer audio data that is old). "Unfortunately" in BLE all data transfer is reliable, so you can't change data that have been buffered, so this can increase the latency by very much once you start to experience packet loss.