Hardware Setup:
- nRF52840 DK: Serving as the BLE central device and I2S master.
- PCM5102 DAC: Connected to the nRF52840 DK via I2S. The connections are:
- LRCK (Pin 30 on nRF52840) to LRCK on PCM5102
- BCK (Pin 31 on nRF52840) to BCK on PCM5102
- DIN (Pin 29 on nRF52840) to DIN on PCM5102
- Power Supply: Powered via USB.
Software Setup:
- Development Environment: SEGGER Embedded Studio.
- SDK Version: nRF5 SDK 15.3.0.
- I2S Configuration: The nRF52840 is configured in Master mode, 16-bit sample width, left-aligned, with a sample rate matching the converted PCM audio from the app.
Issue Description: I am trying to implement BLE audio streaming on the nRF52840 DK, sending audio data from a Flutter app where the audio file is converted from MP3 to PCM format. The PCM conversion is done using the following command:
await _flutterFFmpeg.execute('-y -i $path -f s16le -acodec pcm_s16le -ar 16000 -ac 1 $pcmFilePath');
The configuration on the nRF52840 DK matches the sample rate and bit size used during the PCM conversion.
Problem: When I stream the audio over BLE to the nRF52840 and play it through the PCM5102 DAC, I hear a clear noise. However, the noise pattern resembles the structure of the audio being played, indicating that the data is being processed, but there is some issue causing the distortion.
- Verification: I have verified that the PCM5102 DAC is working correctly by running a test code that generates a sine wave. The sine wave plays without any noise, indicating that the I2S configuration is correct.
What I Have Tried:
- Hardware Check: Verified all connections and ensured proper power supply.
- Sampling Rate and Bit Size Match: Ensured that the sample rate and bit size in the Flutter app's PCM conversion match those configured on the nRF52840 DK.
- I2S Configuration: Verified the I2S settings on the nRF52840 to ensure they align with the expected PCM format.
- Sine Wave Test: Confirmed that the PCM5102 DAC plays a generated sine wave without issues, indicating proper I2S setup.
Request for Guidance: I understand that the nRF5340 is recommended for BLE audio streaming, but I would like to achieve proper BLE audio streaming with the nRF52840 DK. My goal is not high-quality audio but functional BLE audio streaming without noise.
Could you please guide me on what might be causing this patterned noise and how I can resolve it? Any suggestions or modifications to my current setup would be greatly appreciated.
Thank you for your support.