Skip to content

Raspberry PiOS lite bluetooth audio stutter on kernel 6.1.21-v8+ #5454

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
adix-code opened this issue Apr 30, 2023 · 8 comments
Closed

Raspberry PiOS lite bluetooth audio stutter on kernel 6.1.21-v8+ #5454

adix-code opened this issue Apr 30, 2023 · 8 comments

Comments

@adix-code
Copy link

Describe the bug

Stuttering bluetooth audio with bluetooth headphones ATH-S200BT.

Steps to reproduce the behaviour

Just pair headphones and play audio, I use mpd to stream internet radio. Using pulseaudio, but same behavior happens with pipewire.

Device (s)

Raspberry Pi 4 Mod. B

System

$ cat /etc/rpi-issue
Raspberry Pi reference 2023-02-21
Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, 25e2319effa91eb95edd9d9209eb9f8a584d67be, stage2

$ vcgencmd version
Mar 17 2023 10:50:39
Copyright (c) 2012 Broadcom
version 82f3750a65fadae9a38077e3c2e217ad158c8d54 (clean) (release) (start)

$ uname -a
Linux raspberrypi 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64 GNU/Linux

Logs

[ 16.179011] Bluetooth: Core ver 2.22
[ 16.179161] Bluetooth: HCI device and connection manager initialized
[ 16.179188] Bluetooth: HCI socket layer initialized
[ 16.179203] Bluetooth: L2CAP socket layer initialized
[ 16.179227] Bluetooth: SCO socket layer initialized
[ 16.195660] Bluetooth: HCI UART driver ver 2.3
[ 16.195694] Bluetooth: HCI UART protocol H4 registered
[ 16.195806] Bluetooth: HCI UART protocol Three-wire (H5) registered
[ 16.196124] Bluetooth: HCI UART protocol Broadcom registered
[ 16.468004] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[ 16.468024] Bluetooth: BNEP filters: protocol multicast
[ 16.468039] Bluetooth: BNEP socket layer initialized
[ 16.473073] Bluetooth: MGMT ver 1.22
[ 32.080253] Bluetooth: RFCOMM TTY layer initialized
[ 32.080288] Bluetooth: RFCOMM socket layer initialized
[ 32.080311] Bluetooth: RFCOMM ver 1.11
[ 212.522218] Bluetooth: Unexpected continuation frame (len 0)
[ 212.605914] Bluetooth: Unexpected continuation frame (len 0)
[ 212.614682] Bluetooth: Unexpected continuation frame (len 0)
[ 212.722180] Bluetooth: Unexpected continuation frame (len 0)
[ 212.730971] Bluetooth: Unexpected continuation frame (len 0)
[ 212.817197] Bluetooth: Unexpected continuation frame (len 0)
[ 212.825934] Bluetooth: Unexpected continuation frame (len 0)
[ 212.910947] Bluetooth: Unexpected continuation frame (len 0)
[ 212.919722] Bluetooth: Unexpected continuation frame (len 0)
[ 213.007188] Bluetooth: Unexpected continuation frame (len 0)
[ 223.541199] Bluetooth: Unexpected continuation frame (len 0)

Additional context

No response

@pelwell
Copy link
Contributor

pelwell commented May 2, 2023

I've never seen that error message before. Looking at the kernel BT stack source code it thinks its receiving something bad, but that could be symptom of some other problem (I'm not blaming the headphones yet).

Which WLAN band and channel are you using? WLAN 2.4GHz and BT share the same spectrum and an antenna, so it's better to use a 5GHz channel if possible. If you have to use the 2.4G band, try changing the channel - I seem to remember that channel 1 is best for BT coexistence, but I may have got that wrong.

@pelwell
Copy link
Contributor

pelwell commented May 2, 2023

Also, is this a change in behaviour following a recent software update, or is it the first time you've used the headphone+Pi combination?

@adix-code
Copy link
Author

I installed Arch Linux on my Raspberry Pi 4:
$ uname -a Linux alarm 6.2.10-1-aarch64-ARCH #1 SMP PREEMPT_DYNAMIC Fri Apr 7 10:32:52 MDT 2023 aarch64 GNU/Linux
and bluetooth works ok here with same headphones as mentioned before, streaming internet radio over WiFi and playing audio on the bluetooth headphones, using same WiFi connection (2.4GHz).

I used my headphones with Raspberry Pi 3 before with an older version of raspbian (buster) and also worked ok back than (same WiFi, headphones, streaming internet radio).

@avevad
Copy link

avevad commented May 15, 2023

I am having the same issue now, is there a Raspbian fix without installing Arch?

@adix-code
Copy link
Author

adix-code commented May 16, 2023

Hmm just bought the official rpi4 power supply and now works ok for me, don't know if has anything to do with that. Also ran pacman -Syu on RPI, not sure what fixed it though.

Issue was still happening with some Bluetooth speaker, but not with headphones.

@pelwell
Copy link
Contributor

pelwell commented Jun 26, 2023

I'm closing this as it sounds like your issue has been resolved.

@pelwell pelwell closed this as completed Jun 26, 2023
@jennifersmith
Copy link

I have two Raspberry PI 4Bs with the same Bluetooth audio issues as the original submitter describes. Both are on Raspberry Pi OS Lite: one is on bookworm, one on bullseye. Using official power supply in at least one of these machines and the latest firmware, bluez packages etc.

The Bluetooth device paired to to is a fairly old Logitech UE Mobile Boombox speaker. When playing audio, I notice the logs full of these messages - maybe a 100 a second or so:

2023-08-26T11:06:04.998385+1000 rpi1 kernel: Bluetooth: Unexpected continuation frame (len 0)
2023-08-26T11:06:05.174161+1000 rpi1 kernel: Bluetooth: Unexpected continuation frame (len 0)
2023-08-26T11:06:05.194030+1000 rpi1 kernel: Bluetooth: Unexpected continuation frame (len 0)
2023-08-26T11:06:05.198000+1000 rpi1 kernel: Bluetooth: Unexpected continuation frame (len 0)
...

This seems to correspond to the poor audio quality/stutter. Only happens when playing audio (A2DP - SBC).

Still investigating the root cause (mainly out of curiosity at this point), but it does seem like a patch to the error handling code around here to apply a rate limit would stop the torrent of log messages if it's something that is not easy to fix.

System

cat /etc/rpi-issue
Raspberry Pi reference 2023-10-10
Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, 962bf483c8f326405794827cce8c0313fd5880a8, stage2

vcgencmd version
Oct 17 2023 15:39:16
Copyright (c) 2012 Broadcom
version 30f0c5e4d076da3ab4f341d88e7d505760b93ad7 (clean) (release) (start)

Currently on a custom kernel build for reasons, but it was definitely an issue with the original!

uname -a
Linux rpi1 6.1.58-v8+customstuff #4 SMP PREEMPT Wed Nov 22 10:53:16 AEDT 2023 aarch64 GNU/Linux

Also in case it helps:

apt info bluez-firmware
Package: bluez-firmware
Version: 1.2-9+rpt2

strings /lib/firmware/brcm/BCM4345C0.hcd | grep Raspberry
&BCM43455 37.4MHz Raspberry Pi 3+-0190

@mschilli87
Copy link

@jennifersmith: I can reproduce this exact issue when streaming audio via BT to my RP4B running the officiale mo0de audio image. Any update or idea how to workaround this? Streaming audio to the Pi to play it back via speakers attached to it is the main use case for that project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants