linux icon indicating copy to clipboard operation
linux copied to clipboard

Pi3 bluetooth audio stutters with Wifi enabled

Open SebastiaanAdamo opened this issue 10 years ago • 147 comments

Hello,

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?

SebastiaanAdamo avatar Apr 11 '16 20:04 SebastiaanAdamo

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 avatar Apr 17 '16 04:04 pbros

Same is here. Took me 3 days, 2 distros to figure out it was the build in WiFi. Same error appears when i use a WiFi stick direktly at the USB Ports. When i use a USB connection cable with the USB stick everything works fine. So i simply think it comes from the build in antenna that the two 2.4 GHz services interfer each other. :-/

ghost avatar Apr 19 '16 05:04 ghost

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.

pbros avatar Apr 19 '16 13:04 pbros

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 avatar Apr 19 '16 13:04 Ferroin

The BCM43438 has a co-existence interface between the WiFi and Bluetooth interfaces - no software support is required.

pelwell avatar Apr 19 '16 13:04 pelwell

@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.

WayneKeenan avatar Apr 19 '16 13:04 WayneKeenan

+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?

rschulman avatar Oct 07 '16 01:10 rschulman

+1 me too, "ifdown wlan0" and pulseaudio streams fine via a2dp

adn77 avatar Nov 14 '16 18:11 adn77

+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.

libertineplusplus avatar Dec 12 '16 22:12 libertineplusplus

+1 that gave me headaches finding this problem out !

I needed WiFi so I just:

  1. Use a USB dongle as WiFi adapter
  2. Disable onboard WiFi adapter in /etc/network/interfaces

No more sound problems.

vgallissot avatar Jan 07 '17 16:01 vgallissot

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.

daryltucker avatar Jan 12 '17 19:01 daryltucker

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. :-(

jeffleus avatar Jan 24 '17 04:01 jeffleus

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.

mohitkalraniit avatar Jan 24 '17 04:01 mohitkalraniit

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.

hurda avatar Feb 28 '17 09:02 hurda

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

BaReinhard avatar Mar 03 '17 03:03 BaReinhard

Only an issue when both are going. WiFi actively transmitting and then try to use Bluetooth. Bluetooth + LAN is no problem. So most people and applications won't see the issue.

abatardi avatar Mar 03 '17 03:03 abatardi

I have added secondary WiFi receiver and made it primary and using embedded WiFi as bluetooth receiver. This is a cheapest way to get this working.

kalramohit avatar Mar 03 '17 04:03 kalramohit

Bluetooth + LAN is no problem.

Please show me the LAN-port on the Pi0W.

hurda avatar Mar 03 '17 09:03 hurda

Has anyone tried renicing pulseaudio to have a higher priority?

BaReinhard avatar Mar 06 '17 15:03 BaReinhard

Yes, I tried with with higher priority with no discernible difference in the outcome.

pradeepprakash avatar Mar 07 '17 04:03 pradeepprakash