BLE Audio Streaming from Android App to nRF5340 Audio DK: Seeking Guidance on LC3 Codec Implementation

Problem Statement:

I am working on a project where I want to stream audio from a customized Android app to the nRF5340 Audio DK over Bluetooth Low Energy (BLE). The nRF5340 Audio DK supports LC3 codec for efficient BLE audio streaming, but I am facing the following challenges:

  1. Mobile App to nRF5340 Audio DK Streaming:

    • I am developing the app in Flutter and need to send audio (preferably PCM data) from the mobile to the nRF5340 Audio DK.
    • I understand that LC3 codec is crucial for reducing the data rate in BLE audio transmissions, but Flutter does not natively support LC3 encoding, and I am uncertain how to implement it on the mobile side.
    • My goal is to leverage the LC3 codec on the nRF5340 Audio DK for efficient audio streaming, but I need guidance on how to achieve this with the mobile app.
  2. Data Rate Concerns:

    • I previously attempted to implement BLE audio streaming using nRF52840 DK, but it did not work due to BLE's limited data rate when sending uncompressed PCM data.
    • My understanding is that LC3 encoding should happen before the BLE transmission to ensure that the audio stream fits within BLE’s limited bandwidth, but I don’t know how to handle the LC3 codec on the mobile app side.
    • Without LC3, I believe I will face the same data rate limitations as with the nRF52840.
  3. Seeking a Solution:

    • Is there any recommended approach for implementing LC3 encoding on the mobile side (in Android) or ensuring that audio can be streamed efficiently over BLE to the nRF5340 Audio DK?
    • If LC3 encoding is handled only on the nRF5340 Audio DK side, will it still provide the data rate advantages, or does the mobile app need to perform the encoding before transmission?
    • Are there any existing libraries or tools that can help me perform LC3 encoding on Android before sending audio over BLE?

Request for Examples:

If anyone has successfully implemented BLE audio streaming from an Android app to the nRF5340 Audio DK or a similar setup (with or without LC3 encoding on the mobile side), I would greatly appreciate any guidance, links, or example projects you can share.

Parents
  • Hello, 

    I am working on a project where I want to stream audio from a customized Android app to the nRF5340 Audio DK over Bluetooth Low Energy (BLE). The nRF5340 Audio DK supports LC3 codec for efficient BLE audio streaming, but I am facing the following challenges:

    What phone are you using? Does it support Bluetooth LE Audio? As long as the phone has support, you should be able to connect to the nRF5340 Audio DK running the correct FW

    More information can be found on our website.

    Kind regards
    Øyvind

  • Hi Øyvind,

    Thanks for your response Slight smile

    Yes, I am using a phone with an Android version that supports the LC3 codec and Bluetooth LE Audio.

    In my project, I am building a customized Android app using Flutter to stream music to the nRF5340 Audio DK. Additionally, I have connected an ADC module to the nRF5340 Audio DK via I2C (SCL and SDA pins). My goal is to process incoming values from the ADC module on the nRF5340 Audio DK and send them back to the Android app while simultaneously streaming audio.

    I previously attempted the same project using the nRF52840 DK. In that implementation, I was successfully receiving values from the ADC on the Android app, but I faced challenges with the audio streaming. I tried converting .mp3 files to .pcm format on the app side and sent them over BLE packets to the nRF52840 DK, but the audio was distorted, possibly due to the data rate limitations of BLE.

    Because of this issue, I have now moved my project to the nRF5340 Audio DK to leverage its support for LC3 and better handle audio streaming. However, I am now uncertain how to manage the app side in Flutter. Specifically:

    • Previously, I converted the .mp3 to .pcm format on the app side before sending it to the nRF52840 DK.
    • Now, I am confused about how I should encode the audio data to the LC3 codec on the app side or if there is another approach I should follow to stream the audio efficiently.
    • My aim is to get audio streaming working alongside receiving real-time values from the ADC module connected to the nRF5340 Audio DK.

    I am relatively new to BLE, and I would appreciate your guidance on the best approach to take to achieve both tasks simultaneously. I apologize for the lengthy details and truly appreciate your patience.

    Looking forward to your valuable feedback.

  • Hello, I've discussed this internally and have the following answers to you.

    Engr Abdul said:
    However, I am now uncertain how to manage the app side in Flutter. Specifically:

    I'm afraid we can't provide much help with the Android side. We have no knowledge of Flutter and how that uses codecs. I suspect that the LC3 codec is available somewhere general in Android and can be used. LC3 is mandatory in LE Audio, but in case he just wants to get audio over the air in a proprietary manner, it is possible to use a different compression algorithm, but that needs to be on the kit side as well. As we only support LC3 in our SDK, you will need to add this compression algorithm yourself.

    Data Rate Concerns:

    Yes, sending uncompressed data is only possible for low/medium quality or one PCM stream. The total effective bandwidth of Bluetooth on a 2MPHY is around 1.4 Mbit/s, and will be a bit less if you want to use CIS ISO as there are some data used for the ACL connection. See more information on BL Audio here
    You can possibly get 1 Mbit/s over ISO and that means a single channel in one direction at e.g. 48000 Hz * 16 bit = 0.768 Mbit/s. This leaves no room for re-transmits so the sound will easily get choppy. 24000 Hz * 16 bit at least leaves room for one retransmit. This is all in all a hacky option.

    I would greatly appreciate any guidance, links, or example projects you can share.

    The nRF5340 Audio applications is the best starting point for understanding BLE Audio. This should also let you stream sound from an Android phone to the nRF5340 Audio DK without any Android app.

Reply Children
No Data
Related