balenaSound blueooth audio on Raspberry Pi 3: Sound skipping, dropping

I have balenaSound running on a Raspberry Pi 3. When I stream audio to it over Bluetooth from any device (even with my phone right next to the raspberry pi) the audio very regularly skips a bit, and about once every minute or two will cut out for 1 second or so.

I used balena-cloud-audiopi-raspberrypi3-2.43.0+rev1-v10.2.2.img and pushed the latest 0.4.4 balenaSound project from a Linux Machine. The bluetooth-audio, spotify and airplay downloaded and installed OK.

Is this bluetooth audio issue a common problem with the rpi3 and can it be fixed? If not, does the rpi4 have these problems also, or should I consider an upgrade?

Since you don’t want to have Wifi active, you can try disabling the interface at a hardware level. The Pi 3 has issues with Wifi/Bluetooth interfering with each other, so this might help and I would love to hear back if it does. You would need to set an application config variable in the balenaCloud dashboard for RESIN_HOST_CONFIG_dtoverlay and you want to set it to disable-wifi.

Thanks. I’ve set the variable and will report back after I test it.

I’ve set the variable and rebooted, but it seems the device is still visible as Online in the dashboard?

I’ve confirmed that dtoverlay=disable-wifi line exists in the config.txt, but Wifi is still connecting? (BT audio problem still exists)

OK - It’s weird that the Wifi wasn’t disabled, so I am going to ask a collegue to confirm this is something we directly support in balenaOS

Could you try setting the value to pi3-disable-wifi as it may be that our kernel is older than the one the RPi foundation has documented. Please report back if that kills the wifi interface :+1:

Thanks. This setting seems to have disabled the Wifi.

I wonder does this setting also disable the Bluetooth HW?

I wasn’t seeing the Bluetooth device any more, so I connected an Ethernet cable to check.

I see the Bluetooth service is restarting on a loop, with this message:

“31.10.19 08:19:14 (+0100) bluetooth-audio /bin/bash: relocation error: /bin/bash: symbol clo3%, version GLIBC_2.4 not defined in file libc.so.6 with link time reference
31.10.19 08:19:33 (+0100) Service exited ‘bluetooth-audio sha256:dccff48d6f76f1d41e97fbe5d386b58f707e2b5146ee35f9c70291e9cbce12e0’
31.10.19 08:19:33 (+0100) Restarting service ‘bluetooth-audio sha256:dccff48d6f76f1d41e97fbe5d386b58f707e2b5146ee35f9c70291e9cbce12e0’
31.10.19 08:19:14 (+0100) bluetooth-audio /bin/bash: relocation error: /bin/bash: symbol clo3%, version GLIBC_2.4 not defined in file libc.so.6 with link time reference
31.10.19 08:19:28 (+0100) bluetooth-audio /bin/bash: relocation error: /bin/bash: symbol clo3%, version GLIBC_2.4 not defined in file libc.so.6 with link time reference
31.10.19 08:19:53 (+0100) Service exited ‘bluetooth-audio sha256:dccff48d6f76f1d41e97fbe5d386b58f707e2b5146ee35f9c70291e9cbce12e0’
31.10.19 08:19:53 (+0100) Restarting service ‘bluetooth-audio sha256:dccff48d6f76f1d41e97fbe5d386b58f707e2b5146ee35f9c70291e9cbce12e0’
31.10.19 08:19:28 (+0100) bluetooth-audio /bin/bash: relocation error: /bin/bash: symbol clo3%, version GLIBC_2.4 not defined in file libc.so.6 with link time reference”

Hi, I am going to run it now and get back to you shortly.
Thanks,
Zahari

Hi, I do not experience any issues when adding pi3-disable-wifi overlay.

What I did is:

  1. cloned the balena-sound repository
  2. pushed it to a freshly created application with balena push
  3. added RESIN_HOST_CONFIG_dtoverlay as pi3-disable-wifi in the dashboard Fleet configuration page
  4. rebooted the device
  5. WiFi interface is not available and everything seems to be working correctly:
Setting output volume to 100%
Connection notify volume is 75%
Restarting bluetooth service
Bluetooth agent registered
Device is discoverable as "balenaSound f7ba"

Did you made some modifications on top of the balena-sound project when receiving those errors? The glibc relocation error does not look related to that change as it indicates something is not installed properly in the container.

Thanks,
Zahari

Hi,

Thanks. I started from scratch as you did, and now have Wifi disabled and bluetooth streaming.

The audio skips and gaps are still there unfortunately. I have ethernet plugged in, and I can see the following from the log:

01.11.19 18:58:24 (+0100)  bluetooth-audio  Setting output volume to 100%
01.11.19 18:58:24 (+0100)  bluetooth-audio  Connection notify volume is 75%
01.11.19 18:58:24 (+0100)  bluetooth-audio  Restarting bluetooth service
01.11.19 18:58:31 (+0100)  bluetooth-audio  Device is discoverable as "balenaSound c88f"
01.11.19 18:58:36 (+0100)  bluetooth-audio  Bluetooth agent registered
01.11.19 18:59:10 (+0100)  bluetooth-audio  AuthorizeService (/org/bluez/hci0/dev_94_65_2D_9C_DD_5C, 0000110d-0000-1000-8000-00805f9b34fb)
01.11.19 18:59:12 (+0100)  bluetooth-audio  /usr/bin/bluealsa: Missing RTP packet: 16 != 15
01.11.19 18:59:15 (+0100)  bluetooth-audio  /usr/bin/bluealsa: SBC decoding error: No such file or directory
01.11.19 18:59:15 (+0100)  bluetooth-audio  /usr/bin/bluealsa: Missing RTP packet: 176 != 175
01.11.19 18:59:15 (+0100)  bluetooth-audio  /usr/bin/bluealsa: SBC decoding error: No such file or directory
01.11.19 18:59:15 (+0100)  bluetooth-audio  /usr/bin/bluealsa: Missing RTP packet: 227 != 226
01.11.19 18:59:18 (+0100)  bluetooth-audio  /usr/bin/bluealsa: Missing RTP packet: 409 != 407
01.11.19 18:59:28 (+0100)  bluetooth-audio  /usr/bin/bluealsa: SBC decoding error: No such file or directory
01.11.19 18:59:28 (+0100)  bluetooth-audio  /usr/bin/bluealsa: Missing RTP packet: 1122 != 1121
01.11.19 18:59:36 (+0100)  bluetooth-audio  /usr/bin/bluealsa: SBC decoding error: No such file or directory
01.11.19 18:59:36 (+0100)  bluetooth-audio  /usr/bin/bluealsa: Missing RTP packet: 1654 != 1651
01.11.19 18:59:36 (+0100)  bluetooth-audio  /usr/bin/bluealsa: SBC decoding error: No such file or directory
01.11.19 18:59:37 (+0100)  bluetooth-audio  /usr/bin/bluealsa: Missing RTP packet: 1675 != 1673
01.11.19 18:59:45 (+0100)  bluetooth-audio  /usr/bin/bluealsa: SBC decoding error: No such file or directory
01.11.19 18:59:45 (+0100)  bluetooth-audio  /usr/bin/bluealsa: Missing RTP packet: 2241 != 2240
01.11.19 19:00:04 (+0100)  bluetooth-audio  /usr/bin/bluealsa: SBC decoding error: No such file or directory
01.11.19 19:00:04 (+0100)  bluetooth-audio  /usr/bin/bluealsa: Missing RTP packet: 3590 != 3589
01.11.19 19:00:09 (+0100)  bluetooth-audio  /usr/bin/bluealsa: SBC decoding error: No such file or directory
01.11.19 19:00:09 (+0100)  bluetooth-audio  /usr/bin/bluealsa: Missing RTP packet: 3932 != 3931
01.11.19 19:00:28 (+0100)  bluetooth-audio  /usr/bin/bluealsa: SBC decoding error: No such file or directory
01.11.19 19:00:28 (+0100)  bluetooth-audio  /usr/bin/bluealsa: Missing RTP packet: 5229 != 5228
01.11.19 19:00:34 (+0100)  bluetooth-audio  /usr/bin/bluealsa: Missing RTP packet: 5665 != 5664
01.11.19 19:01:06 (+0100)  bluetooth-audio  /usr/bin/bluealsa: SBC decoding error: No such file or directory
01.11.19 19:01:06 (+0100)  bluetooth-audio  /usr/bin/bluealsa: Missing RTP packet: 7229 != 7227
01.11.19 19:01:10 (+0100)  bluetooth-audio  /usr/bin/bluealsa: SBC decoding error: No such file or directory
01.11.19 19:01:10 (+0100)  bluetooth-audio  /usr/bin/bluealsa: Missing RTP packet: 7569 != 7568
01.11.19 19:01:16 (+0100)  bluetooth-audio  /usr/bin/bluealsa: SBC decoding error: No such file or directory
01.11.19 19:01:16 (+0100)  bluetooth-audio  /usr/bin/bluealsa: Missing RTP packet: 7961 != 7960
01.11.19 19:01:43 (+0100)  bluetooth-audio  /usr/bin/bluealsa: Unsupported RTP payload type: 0
01.11.19 19:01:43 (+0100)  bluetooth-audio  /usr/bin/bluealsa: Missing RTP packet: 9817 != 9816
01.11.19 19:01:47 (+0100)  bluetooth-audio  /usr/bin/bluealsa: SBC decoding error: No such file or directory
01.11.19 19:01:47 (+0100)  bluetooth-audio  /usr/bin/bluealsa: Missing RTP packet: 10083 != 10081
01.11.19 19:02:06 (+0100)  bluetooth-audio  /usr/bin/bluealsa: SBC decoding error: No such process
01.11.19 19:02:06 (+0100)  bluetooth-audio  /usr/bin/bluealsa: Missing RTP packet: 11416 != 11415
01.11.19 19:02:27 (+0100)  bluetooth-audio  /usr/bin/bluealsa: SBC decoding error: No such file or directory

The audio skips and gaps coincide exactly with the Missing RTP packet and SBC decoding errors.

Hey @outhud9 I’ve been trying to reproduce this on my side. Unfortunately I only have a rpi4 to test with. I have been streaming music to it via bluetooth for the last 30 minutes or so (from my macbook). I haven’t noticed any drop outs and havent got those logs. Lets try figure out what is different in your setup that causes this, some questions from my side:

  1. ) does Airplay and spotify connect functionality work as expected, or is there drop out there too? (trying to determine if its some how network related)
  2. ) Does stopping the airplay and spotify containers improve the audio quality? (trying to determine if its a resource problem)
  3. ) What kinda of SD card are you using with your RPI3? Our team all use Sandisk Extreme Pro SD cards because they are fast and don’t get corrupt. (trying to figure out if possibly related to IO performance)

@outhud9 Also another debugging step would be to get an external usb bluetooth dongle and test that, with the internal bluetooth disabled. However I know not everyone has these dongles :stuck_out_tongue: . From googling around most of the threads related to missing RTP packet end in “I just got an external usb dongle and it all works” …which is not a very satisfying answer :confused: