You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Pi3 bluetooth audio stutters with Wifi enabled #1402
I'm testing with streaming music using a2dp over bluetooth on the Pi3. When Wifi is enabled, I get constant buffer underruns wit Pulseaudio (Blueman shows a downstream of around 34kB/s). As soon as I disable the Wifi interface (ifdown wlan0), the audio starts to play normally and the downstream is around 42kB/s (which is correct high quality stereo audio if I see http://soundexpert.org/news/-/blogs/bluetooth-audio-quality-a2dp).
Also tried making the buffer much larger, changing resampling type, realtime-scheduling etc. Also tried latest Pulseaudio, no difference. Seems like it is a Raspberry problem.
First thought it was because the Wifi and Bluetooth both use UART, but the is not true (and would be too slow if Wifi was over the 921600 baud if I see it correctly). They still share the same chip (BCM43438). Is there a known reason why I (and also heard others) have this problem?
This brings up a rather interesting question: Does the on-board WiFi chip support Bluetooth co-existence, does the driver support this, and does it work correctly? Based on what I've seen from multiple sources, there's considerably better latency when you either disable the on-board WiFi or disable the on-board Bluetooth and use a USB adapter instead, and that sounds to me like either the on-board chip doesn't correctly implement BT co-existence, or the driver doesn't properly support it.
@Ferroin From my experience I would say /fundamentally/ yes it does, although I'm not an authoritative source and I do not demand much on the Bluetooth side.... Whilst developing Bluetooth LE central and peripheral applications on a Pi 3 I run a VNC X session, 2x SSH sessions and have NFS share mounted all via WiFi and all are ok.
+1 on this, as I've just discovered tonight. Took wlan0 down and the audio played just fine. Has anyone gotten any new word since August on what's going on here and if there's a fix?
+1, just updated today, using an Anker Sound Core bluetooth speaker. Plays beautifully if I turn off wifi, but that's a pretty big workaround. It's annoying but workable for this project (OKAY FINE, I'll connect via hdmi instead of vncserver I GUESS ) but I too am waiting on a fix because it seriously limits my ability to make my projects mobile. VNCserver is a must.
I'm excited to see any progress on this, but as a reminder, you can Subscribe to this thread and add a reaction to the original post. It is not recommended to post a response of +1.
Reacted by Nicolas Gotchac, santosjrm, Christian Flach, alexey polusov and Alfonso Montero López
I have also tested the behavior and facing same issue as reported here. Planning to add additional USB WiFi adapter to overcome the problem. Hope pi would support second WiFi without much problems.
I guess the Zero W will suffer from the same issues regarding Bluetooth and WLAN, as its using the same chip?
Using USB-devices as workarounds ain't that easy with the Zero W, though.
I have the same problem. Running Arch on a Pi B3, B3+ and Zero. All exhibit the same symptoms: Choppy play with a2dp. Arch has not updated the firmware as listed here, but I did that manually first. If I use the onboard BT on these 3 machines, Bluealsa complains of buffer under runs and it plays music in spurts. The journal shows a buffer under run. If I use a USB dongle it all works as expected. Can we try anything else? fwiw, my kernel is 4.19.32
Is this the appropriate command to run to get the onboard BT working?
/usr/bin/btattach -B /dev/ttyAMA0 -P bcm -S 3000000
This is the command in the service file for Arch Linux with the default install of Bluez 5.50
So I have streaming audio to a B3+ with wifi enabled and active (I am logged in via ssh). I am running Arch Linux. I had to install bluez-utils-compat to get the hciattach command installed. I believe Raspian has this already...
The default Bluez 5.50 package has btattach which Arch uses to turn on the BT adapter. This did not work. All I got was stuttering sound. This the Arch pi-bluetooth package calls for the command to be: ExecStart=/usr/bin/btattach -B /dev/ttyAMA0 -P bcm -S 3000000
The command that worked was from an older version of the package: ExecStart=/usr/bin/hciattach -n /dev/ttyAMA0 bcm43xx 921600 noflow -
I do not claim to know if this is 'correct' or whatever, just that this is the first time I have had smooth playing bluetooth using the onboard adapter.
@JamesH65 yes, it's a bluetooth keyboard I see this was for audio, but thought i'd mention it. Once I turned off the wifi the bluetooth keyboard worked perfectly. No repeated characters i didn't press.
I recommend that you leave your 2.4GHz network set to 20MHz-only. Using 40MHz in 2.4GHz doesn't leave enough room for other uses of the band, such as Bluetooth. All of Apple's N-capable gear limits itself to 20MHz operation in 2.4GHz (even if the third-party Wi-Fi AP is configured to allow 40MHz operation in 2.4GHz), in order to leave room for Bluetooth. So your MacBook Pro is only going to use 40MHz-wide channels in 5GHz. - https://superuser.com/a/362377
I wonder if it talks about the same phenomenon or the literal spectrum width. Would someone please try to set their AP to only 20 MHz mode OR with newer models that support 5 GHz try to simultaneously use BT and the 5 GHz WiFi AP? That being said, the older chip (CYW43438) is only capable of 2.4GHz and 20 MHz width, so this is just a shot in the dark. The layout shows only one (shared) antenna.
Activity
pbros commentedon Apr 17, 2016
I've been having the exact same issue. Disabling WLAN0 fixed the audio issues. However, I would very much like to be able to use the wifi...
pbros commentedon Apr 19, 2016
I was able to get A2DP to work by disabling the on-board wifi and using a Wi-Pi USB adapter, without any extension cable.
Ferroin commentedon Apr 19, 2016
This brings up a rather interesting question: Does the on-board WiFi chip support Bluetooth co-existence, does the driver support this, and does it work correctly? Based on what I've seen from multiple sources, there's considerably better latency when you either disable the on-board WiFi or disable the on-board Bluetooth and use a USB adapter instead, and that sounds to me like either the on-board chip doesn't correctly implement BT co-existence, or the driver doesn't properly support it.
pelwell commentedon Apr 19, 2016
The BCM43438 has a co-existence interface between the WiFi and Bluetooth interfaces - no software support is required.
WayneKeenan commentedon Apr 19, 2016
@Ferroin From my experience I would say /fundamentally/ yes it does, although I'm not an authoritative source and I do not demand much on the Bluetooth side.... Whilst developing Bluetooth LE central and peripheral applications on a Pi 3 I run a VNC X session, 2x SSH sessions and have NFS share mounted all via WiFi and all are ok.
rschulman commentedon Oct 7, 2016
+1 on this, as I've just discovered tonight. Took wlan0 down and the audio played just fine. Has anyone gotten any new word since August on what's going on here and if there's a fix?
adn77 commentedon Nov 14, 2016
+1 me too, "ifdown wlan0" and pulseaudio streams fine via a2dp
libertineplusplus commentedon Dec 12, 2016
+1, just updated today, using an Anker Sound Core bluetooth speaker. Plays beautifully if I turn off wifi, but that's a pretty big workaround. It's annoying but workable for this project (OKAY FINE, I'll connect via hdmi instead of vncserver I GUESS ) but I too am waiting on a fix because it seriously limits my ability to make my projects mobile. VNCserver is a must.
vgallissot commentedon Jan 7, 2017
+1 that gave me headaches finding this problem out !
I needed WiFi so I just:
No more sound problems.
daryltucker commentedon Jan 12, 2017
I'm excited to see any progress on this, but as a reminder, you can Subscribe to this thread and add a reaction to the original post. It is not recommended to post a response of +1.
jeffleus commentedon Jan 24, 2017
Agreed that no WiFi is crippling to the base Pi3. Adding a usb dongle defeats one of the big gains w/ the Pi3 of onboard WiFi/BT. :-(
mohitkalraniit commentedon Jan 24, 2017
I have also tested the behavior and facing same issue as reported here. Planning to add additional USB WiFi adapter to overcome the problem. Hope pi would support second WiFi without much problems.
hurda commentedon Feb 28, 2017
I guess the Zero W will suffer from the same issues regarding Bluetooth and WLAN, as its using the same chip?
Using USB-devices as workarounds ain't that easy with the Zero W, though.
BaReinhard commentedon Mar 3, 2017
Is this happening to everyones Raspberry Pi? How is the music being played? (Pi hat DACs, sound cards, BCM?) What are you using the Wifi for?
Because, I haven't had any issues with my Pi3
126 remaining items
JamesH65 commentedon Mar 29, 2019
@pratt-jeremy Is that a wireless keyboard?
gearhead commentedon Apr 9, 2019
I have the same problem. Running Arch on a Pi B3, B3+ and Zero. All exhibit the same symptoms: Choppy play with a2dp. Arch has not updated the firmware as listed here, but I did that manually first. If I use the onboard BT on these 3 machines, Bluealsa complains of buffer under runs and it plays music in spurts. The journal shows a buffer under run. If I use a USB dongle it all works as expected. Can we try anything else? fwiw, my kernel is 4.19.32
bwims commentedon Apr 9, 2019
gearhead commentedon Apr 9, 2019
Is this the appropriate command to run to get the onboard BT working?
/usr/bin/btattach -B /dev/ttyAMA0 -P bcm -S 3000000
This is the command in the service file for Arch Linux with the default install of Bluez 5.50
gearhead commentedon Apr 10, 2019
So I have streaming audio to a B3+ with wifi enabled and active (I am logged in via ssh). I am running Arch Linux. I had to install bluez-utils-compat to get the hciattach command installed. I believe Raspian has this already...
The default Bluez 5.50 package has btattach which Arch uses to turn on the BT adapter. This did not work. All I got was stuttering sound. This the Arch pi-bluetooth package calls for the command to be:
ExecStart=/usr/bin/btattach -B /dev/ttyAMA0 -P bcm -S 3000000The command that worked was from an older version of the package:
ExecStart=/usr/bin/hciattach -n /dev/ttyAMA0 bcm43xx 921600 noflow -I do not claim to know if this is 'correct' or whatever, just that this is the first time I have had smooth playing bluetooth using the onboard adapter.
rpi-wireless: Set options for modprobe. Helps with BT coexist
vitaminace33 commentedon Oct 29, 2019
Just to avoid confusions. Broadcom WiFi tech was bought by Cypress back in June 2016. Since then
pratt-jeremy commentedon Oct 29, 2019
@JamesH65 yes, it's a bluetooth keyboard I see this was for audio, but thought i'd mention it. Once I turned off the wifi the bluetooth keyboard worked perfectly. No repeated characters i didn't press.
JamesH65 commentedon Oct 30, 2019
Presumably your distro is fully up to date?
pratt-jeremy commentedon Oct 30, 2019
It was up to date when I posted here, it's probably out of date by now since it was in Mar. I'll update and see if it still is happening.
parkerlreed commentedon May 12, 2020
On an RPI4 with WiFi soft blocked in rfkill. Still choppy on Pulseaudio A2DP.
cipriantrofin commentedon Dec 27, 2022
A little offtopic, but I'm having the same issue with Raspberry Pi Zero 2 W
vadcx commentedon Oct 25, 2024
I wonder if it talks about the same phenomenon or the literal spectrum width. Would someone please try to set their AP to only 20 MHz mode OR with newer models that support 5 GHz try to simultaneously use BT and the 5 GHz WiFi AP? That being said, the older chip (CYW43438) is only capable of 2.4GHz and 20 MHz width, so this is just a shot in the dark. The layout shows only one (shared) antenna.
seamusdemora commentedon Oct 28, 2024
feat(bluetooth): ship BT/WiFi coex timing params for AP6275P (BT-audi…