Moode Forum
[How to do instruction] Pi Zero 2 W: Fix choppy bluetooth playback (updated firmware package now available) - Printable Version

+- Moode Forum (https://moodeaudio.org/forum)
+-- Forum: moOde audio player (https://moodeaudio.org/forum/forumdisplay.php?fid=3)
+--- Forum: FAQ and Guides (https://moodeaudio.org/forum/forumdisplay.php?fid=9)
+--- Thread: [How to do instruction] Pi Zero 2 W: Fix choppy bluetooth playback (updated firmware package now available) (/showthread.php?tid=5607)

Pages: 1 2


RE: Pi Zero 2 W: Fix choppy bluetooth playback (updated firmware package now available) - Tim Curtis - 12-30-2023

(12-30-2023, 10:39 PM)Chiny Wrote: Newbie alert... have had moodeaudio running for only an hour or so.

S Y S T E M   P A R A M E T E R S
moOde release   = 8.3.7 2023-12-07
RaspiOS         = 11.8
Linux kernel    = 6.1.21-v8+ #1642
Platform        = Pi-Zero 2 W 1.0 512MB
Architecture    = aarch64 (64-bit)

I had the same stuttering audio when using a bluetooth loudspeaker or a pair of bluetooth headphones.   The stutter was once every half second.

@jenzd
Quote:Try to remove just the last switch "--sbc-quality=xq+" and see if this already solves the issue (after a final reboot).
No effect at all.

@jenzd
Quote:If this is the case, it would be interesting if "--sbc-quality=xq" (without the "+") would work instead.
Next, I tried this line.   It made a massive improvement, with stutters now once every 1 - 5 minutes.   Almost solved the problem.

Interesting if frustrating.

Here are the params for bluez-alsa
https://github.com/arkq/bluez-alsa/blob/master/doc/bluealsa.8.rst

Code:
--sbc-quality=MODE
    
Set SBC encoder quality. Default value is high.

The MODE can be one of:

low - low audio quality (mono: 114 kbps, stereo: 213 kbps)
medium - medium audio quality (mono: 132 kbps, stereo: 237 kbps)
high - high audio quality (mono: 198 kbps, stereo: 345 kbps)
xq - SBC Dual Channel HD (SBC XQ) (452 kbps)
xq+ - SBC Dual Channel HD (SBC XQ+) (551 kbps)


Maybe try high, medium or low.

If one of these is glitch free, I can add to the TODO list to put an option "SBC quality" on Bluetooth Control screen.


RE: Pi Zero 2 W: Fix choppy bluetooth playback (updated firmware package now available) - Chiny - 12-31-2023

OK, I'm now using:
Code:
--sbc-quality=high
and in 15 minutes of testing, there has not been a single stutter.

That highlights an inconsistency in my testing.   In the first of two tests (yesterday), I removed  the last switch "--sbc-quality=xq+" entirely, about which the documentation says
Code:
Default value is high.
so in theory it should have worked without stuttering yesterday.

One difference in my testing method was:
In the first two tests yesterday, I rebooted the R Pi after making the changes, whereas today for the xq --> high change, I went for:

Code:
sudo systemctl daemon-reload
although I can't see this being significant.

Ah, 20 - 25 minutes, a stutter.   I'll drop the quality to medium, later today, and re-test.

Clearly this change of --sbc-quality is making a difference although I'm not clear why.   Perhaps I need to read the bluealsa documentation Idea


RE: Pi Zero 2 W: Fix choppy bluetooth playback (updated firmware package now available) - Chiny - 12-31-2023

OK, I've been running:

Code:
--sbc-quality=medium

for over an hour now, and no audio stuttering has been detected.

For me, this solves the problem.   Nice to have would be: @Tim Curtis  add to the TODO list to put an option "SBC quality" on Bluetooth Control screen - thanks for this response and to @jenzd for the initial pointer.

Two other things have been suggested as a cause of bluetooth audio stuttering:
  1. Busy wifi enviroment.   It is busy around my moodeaudio R Pi, multiple networks, multiple wifi gadgets and within 150mm, a Zigbee transmitter.
  2. R Pi Zero 2W not having enough cpu grunt.   My R Pi Zero 2W is loafing along with mpd being the most demanding (3% cpu) and bluealsa next (at 1.2%).
But it works.   Hope this helps others.

Happy New Year Smile


RE: Pi Zero 2 W: Fix choppy bluetooth playback (updated firmware package now available) - Nutul - 12-31-2023

(12-31-2023, 10:35 AM)Chiny Wrote: OK, I've been running:

Code:
--sbc-quality=medium

for over an hour now, and no audio stuttering has been detected.

For me, this solves the problem.   Nice to have would be: @Tim Curtis  add to the TODO list to put an option "SBC quality" on Bluetooth Control screen - thanks for this response and to @jenzd for the initial pointer.

Two other things have been suggested as a cause of bluetooth audio stuttering:
  1. Busy wifi enviroment.   It is busy around my moodeaudio R Pi, multiple networks, multiple wifi gadgets and within 150mm, a Zigbee transmitter.
  2. R Pi Zero 2W not having enough cpu grunt.   My R Pi Zero 2W is loafing along with mpd being the most demanding (3% cpu) and bluealsa next (at 1.2%).
But it works.   Hope this helps others.

Happy New Year Smile

Nice!
Probably, in less polluted environments a higher quality can be chosen, so the option in the BT screen would be a welcome improvement! :-)


RE: Pi Zero 2 W: Fix choppy bluetooth playback (updated firmware package now available) - jenzd - 01-01-2024

(12-31-2023, 10:35 AM)Chiny Wrote: Two other things have been suggested as a cause of bluetooth audio stuttering:
  1. Busy wifi enviroment.   It is busy around my moodeaudio R Pi, multiple networks, multiple wifi gadgets and within 150mm, a Zigbee transmitter.
  2. R Pi Zero 2W not having enough cpu grunt.   My R Pi Zero 2W is loafing along with mpd being the most demanding (3% cpu) and bluealsa next (at 1.2%).
But it works.   Hope this helps others.

Happy New Year Smile

Hi Chiny,

The issue might indeed be caused by other 2.4 GHz/noisy devices in the direct vicinity. What happens, for example, when you move the Pi to a quieter place (i.e. with more distance from your other 2.4 GHz devices)? CPU capacity shouldn't be an issue as the (quad-core) processor of the Zero 2W has nearly the same specs as the one used in the Pi 3B.

Transmissions with lower SBC encoding quality settings tend to be more stable because they are using less bandwidth. XQ+ mode for example needs roughly 60% more bandwidth than the standard setting "high" (which is by the way also the standard quality used by most bluetooth sources like PCs/smartphones).

Moreover the signal quality/range of the internal wifi/bluetooth of the Zero 2W is not the best. Infrequent minor dropouts once or twice an hour might be expected due to these limitations (e.g. with surrounding WLANs). Connecting an external USB bluetooth dongle rather than using the internal one usually leads to a more stable transmission - and might be a better solution in your case than choosing a quality lower than "high".


Happy New Year :-)