AlessandroFerri
Posts: 61
Joined: Tue Apr 02, 2013 5:44 pm

Pi3 conflict between Bluetooth WiFi

Thu Apr 21, 2016 5:48 pm

Just got a fresh image of Raspbian Jessie for my Raspberry Pi 3 B. Updated everything (apt-get update, apt-get upgrade and rpi-update). I'm trying to stream audio from my iPad to the Raspberry.
Run apt-get install pulseaudio pulseaudio-module-bluetooth (did not use pavucontrol or bluez-firmware).
apt-get install bluez (for pairing visually).
I can connect with my phone and stream, but the sound is too fast, pops, clicks and stops. Seems like a buffer underrun and strange resampling. When turning the Pi3's Wifi off with

Code: Select all

sudo ifdown wlan0
The sound becomes good, no glitches, and then it resumes when I reactivate the WiFi with

Code: Select all

sudo ifup wlan0
Has anyone the a2dp streaming working on the RPI 3 with WLAN enabled, and is there anybody with a solution?

dukla2000
Posts: 190
Joined: Tue Jan 10, 2012 12:02 am
Location: Reading.UK.EU

Re: Pi3 conflict between Bluetooth WiFi

Fri Apr 22, 2016 12:51 am

I suspect some kind of conflict between Bluetooth and WiFi but can't reproduce a fault reliably. My symptoms are, if I use my Bluetooth mouse with my Bluetooth keyboard and WiFi then I get a variety of nasty side effects from outright hangs to the keyboard disconnecting and being extremely difficult to reconnect. If I run USB mouse, Bluetooth keyboard and WiFi my Pi3 is stable.

See also this post.
Daily driver: Pi3B, 64GB Samsung Evo+ @100MHz, DVB-T, onboard WiFi for internet, BT/USB dongle for KB/mouse, 250GB HDD via USB for media, Raspbian Jessie Lite with Openbox desktop.
Museum: Pi B

AlessandroFerri
Posts: 61
Joined: Tue Apr 02, 2013 5:44 pm

Re: Pi3 conflict between Bluetooth WiFi

Fri Apr 22, 2016 8:45 am

Do you think this is a hardware or software issue? You have to consider that previously with a Raspberry Pi2 + a dongle for WiFi and + one for Bluetooth, with the same software installed (pulseaudio 5.0 and Bluez 5.35) I did not have this issue.
Do you think that I should try to install Bluez 5.35, instead of default 5.23?

dukla2000
Posts: 190
Joined: Tue Jan 10, 2012 12:02 am
Location: Reading.UK.EU

Re: Pi3 conflict between Bluetooth WiFi

Fri Apr 22, 2016 11:22 am

Pretty sure it is hardware/firmware - if you check the post I linked by emw (s)he can avoid problems by using a bluetooth dongle on their Pi3. I have a bluetooth dongle and when I get the time plan t try it on my Pi3.
Daily driver: Pi3B, 64GB Samsung Evo+ @100MHz, DVB-T, onboard WiFi for internet, BT/USB dongle for KB/mouse, 250GB HDD via USB for media, Raspbian Jessie Lite with Openbox desktop.
Museum: Pi B

emw
Posts: 30
Joined: Tue Apr 12, 2016 2:53 pm

Re: Pi3 conflict between Bluetooth WiFi

Thu Apr 28, 2016 10:13 am

I have been able to isolate this down a simple low level test cases test case to show the conflict if this helps any

When I attempt to make a connection to a a bluetooth LE device and the connection does not establish (or the device does not exist), wifi is disable (or has >99% packet loss) while the bluetooth LE connection is being attempted.

On one RPi3 (#1) I have a window with iperf3 running

Code: Select all

iperf3 -s


on another RPi3 (#2) I have a window with with iperf3 running with a connection to RPi3 #1

Code: Select all

iperf3 -c 192.168.1.138 -time 100 -u
Everything works fine (RPi3 #1 shows it is receiving udp packets) unit I open another window on RPi3 #1 and attempt to connect to a non existent device

Code: Select all

sudo hcitool lecc 11:11:11:11:11:11 
Note: bluetooth LE will continue to attempt the connection even after hcitool returns with a timeout error.

RPi3 #1 iperf3 now shows it is dropping packets (0 data rate). After terminating the BLE connection attempt with an LE Create Connection Cancel Command things resume normally

Code: Select all

sudo hcitool cmd 0x08 0x0e
I have tried this with "ping" instead and packets seem to get through
I have tried this with both "ping" and "iperf3" together, and there are a lot of dropped pings (and the one that do make it are very long... 10, 20, 30 seconds)

Looking at the data on wireshark I see the occasional packet is making it through... but very few.

My current guess is a lot of the logic for wifi is being turned off while BLE is access the radio, but there is a small buffer (which overflows very quickly) so some of the pings make it through. A full data set never makes it through for udp, so it is reported as 0 throughput)

Could any one shed some more light on this, or suggest a work around?

Johny Su
Posts: 1
Joined: Tue May 17, 2016 8:33 am

Re: Pi3 conflict between Bluetooth WiFi

Tue May 17, 2016 8:50 am

Confirmed the same behaviour on Ubuntu Mate.

Until no change in firmware (if anyhow possible to solve this from HW pov) workaround is simple.
For now either WiFi or BT dongle is needed to work these two services together reliably.
BTW: I also could not get the built-in WiFi-N to create a fast Wifi hotspot - thus I would try to expermient with external Wifi-N USB dongle. Pi's bluetooth LE - seems to be energy efficient and worth to use.

Personally I have impression that USB bus is the most reliable part of Pi3.

Do you know any WiFi dongle recommended ?

emw
Posts: 30
Joined: Tue Apr 12, 2016 2:53 pm

Re: Pi3 conflict between Bluetooth WiFi

Tue May 17, 2016 11:08 am

There seem to be some improvement to the wifi operation (at the expense of the bluetooth) in last weeks release of raspbian. You may want to try this for your application.

brianmichalk
Posts: 1
Joined: Thu Aug 09, 2018 2:56 am

Re: Pi3 conflict between Bluetooth WiFi

Thu Aug 09, 2018 3:10 am

I can confirm this, and posted this chart of my simple experiment in another thread.

Image

Return to “Advanced users”