RPi-Distro / firmware-nonfree

182 stars 101 forks source link

rpi4 buster bluetooth and wlan conflict #8

Closed akicker closed 3 years ago

akicker commented 4 years ago

With the update from 27.3. (updating bluetooth, ... to bluetooth (5.50-1.2\~deb10u1)) raspbian buster on rpi4 bluetooth and wlan did work well (the first time on my rpi4) !!! :+1: Unfortunately updates from 30.3. to bluetooth (5.50-1.2\~deb10u1+rpt1) and 11 other updates bluetooth and wlan conflicts again (BT off --> wlan ok, BT on --> very low wlan rx-rate). :-1: current using buster kernel 4.19.97 - Some more info see image below, wlan and BT improoved when (5.50-1.2\~deb10u1) is in use !!! image

thamht4190 commented 4 years ago

For one who don't want to read all comments: I got this problem on my Pi4B. I got the firmware +rpt7, so I suppose the fix (on +rpt6) is already there. If your firmware version is less than +rpt6, you should update it.

pi@raspberrypi:~ $ apt info firmware-brcm80211 | grep Version
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
Version: 1:20190114-1+rpt7

I checked bluez version:

pi@raspberrypi:~ $ dpkg --status bluez \| grep '^Version:'
Version: 5.50-1.2~deb10u1+rpt1

From the comment on this ticket, I understand that bluez version 5.50-1.2~deb10u1 can work, so I download it from here, then install it (bluez will be downgraded automatically):

pi@raspberrypi:~ $ wget http://ftp.hk.debian.org/debian/pool/main/b/bluez/bluez_5.50-1.2~deb10u1_armhf.deb
pi@raspberrypi:~ $ sudo apt install ./bluez_5.50-1.2~deb10u1_armhf.deb

And now, bluetooth and wifi can work together on my Pi.

stuckinger commented 3 years ago

Thanks for this post! It kind of helped me, but only partly. I want to share my experience because I got an improvement, someone else might be interested in. Even though I end up using an extra usb wifi - read below why...

The Hardware:

model name      : ARMv7 Processor rev 4 (v7l)
BogoMIPS        : 51.20
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4`

Hardware        : BCM2835
Revision        : a02082
Model           : Raspberry Pi 3 Model B Rev 1.2

I do not have an exact setup from before when it was not working, but I was on stretch and on blue*-version 5.50 something I guess and kernel 4.19 something. I had scratches in my audio in general, not only bluetooth. Network via WIFI onboard and Bluetooth via onboard. The main problem was, when trying to read/write Bluetooth LE Devices it mostly did not work:

Error: connect error: Function not implemented (38)
[E0:E5:CF:D6:AF:49][LE]> Bluetooth connection timed out

After reading this thread I updated to buster, so now my versions are:

~# uname -a
Linux  5.4.51-v7+ #1333 SMP Mon Aug 10 16:45:19 BST 2020 armv7l GNU/Linux
~# dpkg -l |grep -i blue
ii  bluej                                 4.2.1                                     all          A simple but powerful Java IDE.
ii  blueman                               2.0.8-1+b2                                armhf        Graphical bluetooth manager
ii  bluetooth                             5.50-1.2~deb10u1+rpt2                     all          Bluetooth support (metapackage)
ii  bluez                                 5.50-1.2~deb10u1+rpt2                     armhf        Bluetooth tools and daemons
ii  bluez-alsa:armhf                      4.99-2+deb7u1                             armhf        Bluetooth ALSA support
ii  bluez-audio                           4.99-2+deb7u1                             all          Transitional package
ii  bluez-firmware                        1.2-4+rpt5                                all          Firmware for Bluetooth devices
ii  bluez-gstreamer                       4.99-2+deb7u1                             armhf        Bluetooth GStreamer support
ii  bluez-hcidump                         5.50-1.2~deb10u1+rpt2                     armhf        Analyses Bluetooth HCI packets
ii  bluez-obexd                           5.50-1.2~deb10u1+rpt2                     armhf        bluez obex daemon
ii  bluez-tools                           2.0~20170911.0.7cb788c-2                  armhf        Set of tools to manage Bluetooth devices for linux
ii  bluez-utils                           4.99-2+deb7u1                             all          Transitional package
ii  libbluetooth3:armhf                   5.50-1.2~deb10u1+rpt2                     armhf        Library to use the BlueZ Linux Bluetooth stack
ii  pi-bluetooth                          0.1.15                                    all          Raspberry Pi 3 bluetooth
ii  pulseaudio-module-bluetooth           12.2-4+deb10u1                            armhf        Bluetooth module for PulseAudio sound server
~# dpkg -l |grep -i firmware
ii  bluez-firmware                        1.2-4+rpt5                                all          Firmware for Bluetooth devices
ii  firmware-atheros                      1:20190114-1+rpt8                         all          Binary firmware for Atheros wireless cards
ii  firmware-brcm80211                    1:20190114-1+rpt8                         all          Binary firmware for Broadcom/Cypress 802.11 wireless cards
ii  firmware-libertas                     1:20190114-1+rpt8                         all          Binary firmware for Marvell wireless cards
ii  firmware-misc-nonfree                 1:20190114-1+rpt8                         all          Binary firmware for various drivers in the Linux kernel
ii  firmware-ralink                       1:20190114-1+rpt8                         all          Binary firmware for Ralink wireless cards (dummmy package)
ii  firmware-realtek                      1:20190114-1+rpt8                         all          Binary firmware for Realtek wired/wifi/BT adapters
ii  rpi-update                            20200409                                  all          Raspberry Pi firmware updating tool

In first place I was really happy because even though my pi was still connected via internal WIFI I could control my bluetooth devices! I even found out that the sound was way better than before - I haven't tested bluetooth yet, only audio plug. But then I realized that there are still some conflicts because while streaming audio - I have an mpd running that is streaming from network - every time I connect to a bluetooth-device the music stopped. I guess it comes from buffer underrun, maybe the wifi connection drops for some seconds. Something I did not realize while being on ssh.

So while not using it as a radio station I guess this setup would work fine, but constant WIFI network AND Bluetooth still conflicts.

My workaround: Using USB WIFI. Sound = OK Bluetooth = OK WIFI = OK

Still sad since the hardware is already onboard and should be working...

sebastianeferrer commented 3 years ago

Hi everyone! great news! we finally have an official bugfix for CYW43455.

$ apt changelog bluez-firmware | head

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Get:1 store: bluez-firmware 1.2-4+rpt8 Changelog
bluez-firmware (1.2-4+rpt8) buster; urgency=medium

  [ Phil Elwell ]
  * Second Spectra fix for CYW43455 (CVE-2020-10370)
    - Original firmware name: BCM4345C0_003.001.025.0174.0342.hcd

 -- Serge Schneider <serge@raspberrypi.com>  Thu, 28 Jan 2021 14:57:44 +0000

Just run:

$ sudo apt update && sudo apt upgrade bluez-firmware

then it should work again.

May be a deeper review on different implementations should be done, but first signs from me are good. My problem of interference between bt and wifi working on 2.4GHz was fixed

akicker commented 3 years ago

Great, that's working, did remove my hold on bluez (sudo apt-mark unhold bluez) updated all and everything is OK again :-)

pelwell commented 3 years ago

I'm going to close this issue then.

rabe- commented 3 years ago

I'm still having that problem on my Pi4 with the K380 It works fine on my Pi3 with the same SD card.

I did try a fresh pairing of course. Many times over.

pelwell commented 3 years ago

That's strange - I'm using one now and it works fine. Which distribution are you using?

lesinigo commented 3 years ago

I'm having the same problem:

After weeks without any problem using wifi only, I turned on bluetooth, paired a BT GPS and suddenly got connectivity issues over WiFi (2.4GHz). Disabling bluetooth gave me a perfectly working wifi again.

These are from my dmesg:

[   17.552652] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[   17.941396] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[   18.363915] brcmfmac: F1 signature read @0x18000000=0x1541a9a6
[   18.376905] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43430-sdio for chip BCM43430/1
[   18.377393] usbcore: registered new interface driver brcmfmac
[   18.412091] brcmfmac mmc1:0001:1: Direct firmware load for brcm/brcmfmac43430-sdio.raspberrypi,model-zero-w.txt failed with error -2
[   18.652728] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43430-sdio for chip BCM43430/1
[   18.652945] brcmfmac: brcmf_c_process_clm_blob: no clm_blob available (err=-2), device may have limited channels available
[   18.654148] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM43430/1 wl0: Oct 22 2019 01:59:28 version 7.45.98.94 (r723000 CY) FWID 01-3b33decd
[   27.978848] uart-pl011 20201000.serial: no DMA platform data
[   29.175921] brcmfmac: brcmf_cfg80211_set_power_mgmt: power save enabled
[   31.900322] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[   32.531216] Bluetooth: Core ver 2.22
[   32.531389] NET: Registered protocol family 31
[   32.531405] Bluetooth: HCI device and connection manager initialized
[   32.531440] Bluetooth: HCI socket layer initialized
[   32.531462] Bluetooth: L2CAP socket layer initialized
[   32.531510] Bluetooth: SCO socket layer initialized
[   32.554015] Bluetooth: HCI UART driver ver 2.3
[   32.554045] Bluetooth: HCI UART protocol H4 registered
[   32.554212] Bluetooth: HCI UART protocol Three-wire (H5) registered
[   32.554500] Bluetooth: HCI UART protocol Broadcom registered
[   33.914212] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[   33.914238] Bluetooth: BNEP filters: protocol multicast
[   33.914272] Bluetooth: BNEP socket layer initialized