Balena Sound stuttering

I have been trying to build a working Balena sound device for 3 days now and I have been running into a consistent problem with bluetooth sound stuttering.

Here is my setup:
RPI 3b with the innomaker DAC, bluetooth 4 dongle.
RPI 4 with the innomaker DAC. bluetooth 4 dongle.
I can get sound from the DAC, but when connected to bluetooth there is a severe audio stutter. Removing the DAC does not change the issue. Changing from the RPI 3 to RPI 4 does not change the issue.

Sometimes the stutter resolves and the sound is great, most times the stutter does not resolve and the audio is choppy. Restarting Bluetooth and sound services do not help the issue. Multiroom client and server are both disabled.

Ive tried 2 different bluetooth dongles, TPlink and pluggable, but the issue persists. I have disabled bluetooth and wifi on the pi3, which does not help.

Ive tried BalenaOS 32bit 2.72 - 2.80 on the Rpi 3, which did not help the issue.
Ive tried BalenaOS 64bit 2.71.5 - 2.80.3 on the Rpi4 and had similar results.

I read about the RPI 3 issues using builtin bluetooth, and they sound similar to what im seeing here, but ive tried 2 different dongles and have the same results. Im at a loss here.

Config overlays:
Define DT parameters “i2c_arm=on”,“spi=on”,“audio=off”
BALENA_HOST_CONFIG_dtoverlay “allo-boss-dac-pcm512x-audio”,“pi3-disable-bt”,“pi3-disable-wifi”

Device Env. variables
AUDIO_OUTPUT AUTO
DISABLE_MULTI_ROOM 1
SOUND_MODE STANDALONE
SOUND_VOLUME 75

There are no errors in the logs.
Bluetooth logs:
22.06.21 17:15:05 (-0400) bluetooth — Bluetooth —
22.06.21 17:15:05 (-0400) bluetooth Starting bluetooth service with settings:
22.06.21 17:15:05 (-0400) bluetooth - Device name: balenaOS c28f
22.06.21 17:15:05 (-0400) bluetooth - HCI interface: hci0
22.06.21 17:15:05 (-0400) bluetooth - Pairing mode: SSP
22.06.21 17:15:05 (-0400) bluetooth - PIN code: 0000
22.06.21 17:15:05 (-0400) bluetooth Available HCI interfaces: hci0 hci0
22.06.21 17:15:05 (-0400) bluetooth Resetting hci0
22.06.21 17:15:05 (-0400) bluetooth Resetting hci0
22.06.21 17:15:05 (-0400) bluetooth Configuring selected interface: hci0
22.06.21 17:15:05 (-0400) bluetooth hci0 Set Connectable complete, settings: powered connectable ssp br/edr le secure-conn
22.06.21 17:15:05 (-0400) bluetooth hci0 Set Bondable complete, settings: powered connectable bondable ssp br/edr le secure-conn
22.06.21 17:15:05 (-0400) bluetooth hci0 Set Discoverable complete, settings: powered connectable discoverable bondable ssp br/edr le secure-conn
22.06.21 17:15:05 (-0400) bluetooth hci0 Set Secure Simple Pairing complete, settings: powered connectable discoverable bondable ssp br/edr le secure-conn
22.06.21 17:15:05 (-0400) bluetooth Pairing mode set to ‘Secure Simple Pairing Mode (SSPM)’. PIN code is NOT required.
22.06.21 17:15:07 (-0400) bluetooth Bluetooth agent started!
22.06.21 17:15:07 (-0400) bluetooth Checking for known bluetooth devices…
22.06.21 17:15:07 (-0400) bluetooth - Attempting to reconnect to Galaxy Tab S5e (D8:0B:9A:00:37

Audio logs during connection and playback:

22.06.21 17:15:09 (-0400) audio W: [pulseaudio] server-lookup.c: Unable to contact D-Bus: org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
22.06.21 17:15:09 (-0400) audio W: [pulseaudio] main.c: Unable to contact D-Bus: org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
22.06.21 17:15:13 (-0400) bluetooth - Successfully connected to Galaxy Tab S5e (D8:0B:9A:00:37:45)…
22.06.21 17:15:15 (-0400) sound-supervisor Connected to PulseAudio at 192.168.2.254:4317
22.06.21 17:15:15 (-0400) sound-supervisor Server protocol version: 33
22.06.21 17:15:15 (-0400) sound-supervisor Client protocol version: 33
22.06.21 17:15:16 (-0400) audio W: [pulseaudio] module-loopback.c: Configured latency of 200.00 ms is smaller than minimum latency, using minimum instead
22.06.21 17:15:16 (-0400) audio W: [pulseaudio] module-loopback.c: Cannot set requested source latency of 66.67 ms, adjusting to 250.00 ms
22.06.21 17:15:19 (-0400) audio E: [pulseaudio] backend-native.c: socket(SEQPACKET, SCO) Address family not supported by protocol

adding dmsg logs
[ 7.459139] bcm2835_mmal_vchiq: module is from the staging directory, the quality is unknown, you have been warned.
[ 7.459153] bcm2835_mmal_vchiq: module is from the staging directory, the quality is unknown, you have been warned.
[ 7.461623] bcm2835_mmal_vchiq: module is from the staging directory, the quality is unknown, you have been warned.
[ 7.475445] bcm2835_v4l2: module is from the staging directory, the quality is unknown, you have been warned.
[ 7.487463] bcm2835_isp: module is from the staging directory, the quality is unknown, you have been warned.
[ 7.490157] bcm2835_codec: module is from the staging directory, the quality is unknown, you have been warned.
[ 7.499359] bcm2835_mmal_vchiq: Failed to open VCHI service connection (status=-1)
[ 7.500742] bcm2835_mmal_vchiq: Failed to open VCHI service connection (status=-1)
[ 7.500769] bcm2835_mmal_vchiq: Failed to open VCHI service connection (status=-1)
[ 7.505499] smsc95xx v1.0.6
[ 7.548810] snd-allo-boss-dac soc:sound: ASoC: failed to init link Boss DAC: -517
[ 7.548859] snd-allo-boss-dac soc:sound: snd_soc_register_card() failed: -517
[ 7.618961] smsc95xx 1-1.1:1.0 eth0: register ‘smsc95xx’ at usb-3f980000.usb-1.1, smsc95xx USB 2.0 Ethernet, b8:27:eb:7f:ef:cd
[ 7.620270] snd-allo-boss-dac soc:sound: ASoC: failed to init link Boss DAC: -517
[ 7.620316] snd-allo-boss-dac soc:sound: snd_soc_register_card() failed: -517
[ 7.620784] usbcore: registered new interface driver smsc95xx
[ 7.676542] Bluetooth: Core ver 2.22
[ 7.676611] NET: Registered protocol family 31
[ 7.676620] Bluetooth: HCI device and connection manager initialized
[ 7.676640] Bluetooth: HCI socket layer initialized
[ 7.676653] Bluetooth: L2CAP socket layer initialized
[ 7.676673] Bluetooth: SCO socket layer initialized
[ 7.716992] snd-allo-boss-dac soc:sound: ASoC: failed to init link Boss DAC: -517
[ 7.717045] snd-allo-boss-dac soc:sound: snd_soc_register_card() failed: -517
[ 7.724904] snd-allo-boss-dac soc:sound: ASoC: failed to init link Boss DAC: -517
[ 7.724951] snd-allo-boss-dac soc:sound: snd_soc_register_card() failed: -517
[ 7.740946] snd-allo-boss-dac soc:sound: ASoC: failed to init link Boss DAC: -517
[ 7.740996] snd-allo-boss-dac soc:sound: snd_soc_register_card() failed: -517
[ 7.746569] usbcore: registered new interface driver btusb
[ 7.872084] Bluetooth: hci0: BCM: chip id 63
[ 7.874083] Bluetooth: hci0: BCM: features 0x07
[ 7.906019] Bluetooth: hci0: BCM20702A
[ 7.908092] Bluetooth: hci0: BCM20702A1 (001.002.014) build 0000
[ 7.925262] bluetooth hci0: Direct firmware load for brcm/BCM20702A1-0a5c-21e8.hcd failed with error -2
[ 7.925286] Bluetooth: hci0: BCM: Patch brcm/BCM20702A1-0a5c-21e8.hcd not found
[ 8.091634] zram: Can’t change algorithm for initialized device
[ 8.322748] snd-allo-boss-dac soc:sound: ASoC: failed to init link Boss DAC: -517
[ 8.322765] snd-allo-boss-dac soc:sound: snd_soc_register_card() failed: -517
[ 8.323341] snd-allo-boss-dac soc:sound: ASoC: failed to init link Boss DAC: -517
[ 8.323355] snd-allo-boss-dac soc:sound: snd_soc_register_card() failed: -517
[ 8.354934] pcm512x 1-004d: 1-004d supply AVDD not found, using dummy regulator
[ 8.355031] pcm512x 1-004d: 1-004d supply DVDD not found, using dummy regulator
[ 8.355081] pcm512x 1-004d: 1-004d supply CPVDD not found, using dummy regulator
[ 8.466168] snd-allo-boss-dac soc:sound: pcm512x-hifi <-> 3f203000.i2s mapping ok
[ 8.658129] random: crng init done
[ 8.658147] random: 7 urandom warning(s) missed due to ratelimiting
[ 9.092982] Adding 498328k swap on /dev/zram0. Priority:-2 extents:1 across:498328k SSFS
[ 9.702337] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[ 9.702358] Bluetooth: BNEP filters: protocol multicast
[ 9.702383] Bluetooth: BNEP socket layer initialized

Sorry for the delayed reply on this one Jim, and thanks for the great details. My very first question, is what happens if you do not use the Bluetooth dongles, and instead do try to make use of the onboard bluetooth on the Pi’s? (You’ll have to remove that device tree overlay config that is currently disabling the onboard bluetooth, of course). And a second question, is can you ensure you have the latest version of balenaSound? You can re-deploy a fresh build simply by clicking the “Deploy with balena” button on the blog post, and choosing your existing application.