PRI4 and RPi0 bluetooth problems
I've can't seem to get bluetooth working on 2 different RPi4 revisions and on RPi0W. This is the version information from cpuinfo:
Code:
Hardware : BCM2711 I keep on getting this message in the kernel ring buffer: Code:
brcmfmac mmc1:0001:1: Direct firmware load for brcm/brcmfmac43455-sdio.raspberrypi,4-model-b.txt failed with error -2 sarpi4-hacks-4.0-armv7l-1_slackcurrent_28Jan21_sp1.txz borrowed from raspbian https://github.com/RPi-Distro/firmwa...ee/master/brcm None seem to work (all produce the same message in kernel ring buffer) and hciconfig shows no bluetooth device. Wifi seems to be working fine but I wanted have the bluetooth working for testing for something I plan to do in the near future. Has anyone got similar problems ? Anyone know how to solve it ? |
I had similar problems with a Pi 400 (only partially fixed, even now) which I think uses a different chipset to the 4.
First of all, try installing the latest sarpi-hacks package, which has updated firmware for the bluetooth chips. If that doesn't work, have a look at the modified bluez pkg detailed here: https://www.linuxquestions.org/quest...719/page5.html At the time I found the patches for bluez, I was having problems compiling some things and sndwvs kindly provided a (64-bit!) package with the patches already applied in that thread. BUT be warned! Try the sarpi-hacks first! There are (unconfirmed) reports that although the modified bluez package works with the 400, it might stop the 4 from working. Mine now finds the bluetooth device and I can attach my headphones, but they drop out after a short, random time period, and the device vanishes again! -- Pete |
Well, 'error -2' means it is not found at the time when kernel bluetooth driver is loading. Common problem for instance when the driver is built into kernel and the firmware is in /lib/firmware. When the kernel loads the drive with firmware is not mounted yet and you get error -2. In your case I assume the kernel driver is a module, not built into kernel? Then the firmware is not in correct location, the driver is looking into brcm subdirectory in your firmware directory, did you place it there? You may need to rename it to satisfy the driver.
|
Quote:
Quote:
Code:
root@rpi4:~# ls -l /lib/firmware/brcm/ The exact message is: Code:
[ 3.751663] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6 If so exactly which one and what precise name ? these ate the files that almost match the name in dmesg Code:
brcmfmac43455-sdio.bin brcmfmac43455-sdio.clm_blob brcmfmac43455-sdio.txt Code:
[ 1.455027] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null) Code:
[ 4.043040] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6 |
Yes error -2 is not found, you could try renaming, it does not hurt.
|
Ok so to get the error -2 to dissapear I renamed
brcmfmac43455-sdio.txt to brcmfmac43455-sdio.raspberrypi,4-model-b.txt but still hciconfig shows nothing I had a spare uSD so I put raspbian on it and the bloetooth seems to work there ... I wonder if it's a kernel problem. |
Quote:
|
1 Attachment(s)
Quote:
I did cheat a little and manually install kernel, modules, rc.modules-<kernel version> and hack ... manually doing most of the stuff that doinst would do ... is there something I left out that could cause this ? like not updating config.txt or cmdline.txt or the boot firmware ? I looked a bit more into this and noticed that there are quite a few files that differ from what I have (sarpi4-boot-firmware-armv7l-1_slackcurrent_13May20_sp1.txz) to the new boot firmware: Code:
* System.map differs The new boot firmware can boot the old kernel ... and also new kernel seems to boot fine with it. Be warned : update both kernel and boot firmware else you get in trouble ;) old kernel and new boot firmware: no bt device new kernel and latest SARPi-hack firmware: no bt device New kernel and raspbian firmware: still no bt device How do they get it working on raspbian ? I also found a github project with the brcm firmware and the stuff there does not match with SARPi nor raspbian ... is that stuff any good ? PS: sorry for calling "Raspberripi OS" "rasbian" ... it may seem that I put something old on my RPI4 but that is not the case I downloaded 2021-01-11-raspios-buster-armhf.zip Nice to note they don't call it raspbian any more but they still have the debian release name "buster" |
One of the patches I pointed to earlier corrects an error in bluez. Bluez looks for firmware in /etc/firmware rather than /lib/firmware. One of the three patches is to fix that. The other two are specifically for the chip used in the 400.
-- Pete |
Quote:
Code:
root@rpi4:/etc# ls -ld /etc/firmware Full reboot and still no bt device |
The other thing worth trying is to replace the /lib/firmware/brcm folder with the one from Raspbian. That is what got mine to at least load initially. Sarpi-hacks should do this, but if it didn't work for you, try going back to the original firmware supplied for the device.
-- Pete |
Quote:
Quote:
I suspect something has changed in kernel 5.10.x that worked fine in kernel 5.4.x. That's what I'll be looking into initially. Quote:
|
You could try to look over here for hints
https://www.linuxquestions.org/quest...an-4175689292/ Wifi wasn't found Code:
# ifconfig wlan0 Code:
wlan0: error fetching interface information: Device not found Note that I don't know if what I did there will also work for Bluetooth. I also don't know if it's everything I should have done ex. if I should have done a complete sarpi & kernel reinstall. Going to do that now. TKS |
I suspect I should have done a diff with raspbian config.txt but even with
Code:
# Uncomment to enable Bluetooth LE I will examine the lsmod output from raspbian and slackwareARM and see if I can catch something. I looked at the differences in kernel config between raspbian and SARPi-current for RPi4 Code:
davide@nuc8i5:/tmp/rpi4-bt-issue$ zdiff raspbian.config.gz slackwarearm.config.gz |grep BT Code:
davide@nuc8i5:/tmp/rpi4-bt-issue$ comm -23 <(zcat raspbian.config.gz |sort) <(zcat slackwarearm.config.gz |sort) | grep BT Code:
davide@nuc8i5:/tmp/rpi4-bt-issue$ comm -23 <(awk '{print $1}' < raspbian.lsmod | sort) <(awk '{print $1}' < slackwarearm.lsmod | sort) But even with a bit of module unload/load still no luck: Code:
root@rpi4:~# lsmod | grep bt |
Quote:
Then I again deleted all files in /lib/firmware/brcm and reinstalled sarpi-hacks, and now have functioning wifi again. TKS |
4 Attachment(s)
For me wifi is working ok (in fact I connect to my RPi4 via wifi)
I tried removing everything from /lib/firmware/brcm and then putting in there only the firmware from SARPi-hack but still bluetooth is not working. @TheTKS this thread is about bluetooth ;) I've attached the kernel configs and output of lsmod should anyone want to do some more analysis there. My considerations regarding the differences are in a previpus post on this thread. |
Quote:
It appears not, so I’ll stop with the wifi stuff now. Still curious about what’s causing your BT problems. Exaga’s suggestion of a dongle sounding pretty good to me now. Good luck getting your BT problem solved soon. TKS |
Quote:
I noticed that modules were missing from the kernel 5.10.11 so I fixed that and rebuilt it. This made no difference. In fact I've built approx. 5 kernels today, testing with various configs, and it's made no difference. I've also played around with Raspberry Pi OS /lib/firmware/brcm and it's made no difference. The strange thing is that Bluetooth is initialising and activating as expected but no device(s) are found with 'hcitool dev', or by any other means/commands. All I get is this: Code:
root@torq:~# hcitool dev |
1 Attachment(s)
Quote:
|
@Exaga
I noticed this in your dmesg: Code:
[ 4.292244] brcmfmac: F1 signature read @0x18000000=0x15264345 Code:
cd /lib/firmware/brcm Will that make any difference to your newer kernel builds ? Can you share the kernel config where you fixed the missing modules ? |
Not sure if it will help or not, but I've finally cracked the problem with the 400, and part of the solution may apply to your setup.
I discovered that there is another version of the BCM4345C5.hcd firmware required for bluetooth in the /lib/firmware/ap6256 directory. Being further up the "pecking order", this was being loaded in preference to the version in the brcm folder. Removing the ap6256 folder enabled the correct firmware to load, and all my problems went away! I also found an interesting script which resets bluetooth and reloads the firmware here: https://github.com/agungpambudi55/bl...n-init-running The file you want is called "bluetoothResetFirmware.sh" It needs to be run twice for some reason, but when it reloads the firmware, it will tell you the location where it found it. That is what tipped me off as to the problem! See my post here for all the gory details: https://www.linuxquestions.org/quest...-a-4175689669/ Hope this helps! -- Pete |
In my case these are the only firmwares that are loading:
Code:
root@rpi4:~# grep -i firmware: /var/log/dmesg You got that bluetoothResetFirmware.sh script to run in SlackwareARM ? Code:
# Created on Mar 2020 Code:
killall hciattach Oooops raspbian is hardfloat and 14.2 is softfloat Code:
root@rpi4:/opt/vc/bin# file vcmailbox Not sure how you came to have ap6256 in the first place but i cant find it in /lib/firmware (both SlackwareARM and raspbian ) |
1 Attachment(s)
Quote:
|
1 Attachment(s)
@Louigi and here's the dmesg from the latest boot with that kernel...
|
@EXAGA did the BT device work any better with the renaming of brcmfmac43455-sdio.txt ?
|
David: Just to clarify - I'm running slarm64-current, so there will be differences with slackwarearm-14.2. I have done a lot of messing around with firmware, but I thought I had only changed the contents of the brcm directory. And yes, my installation does have /opt/vc/bin/vcmailbox (no idea what it is or does, though!).
At a guess, it is setting the baud rate of the uart. -- Pete |
I compiled with Exaga's config and i noticed that I have the btsdio module loaded:
Code:
bnep 20480 2 But in the other thread I also remember reading somewhere that, in these conditions, the device showed up wrong in hciconfig ... it's not showing at all on my RPi4. In this post Exaga is talking about this issue but here it's different there is no device showing up at all. Code:
root@rpi4:~# rmmod btsdio Also tried with raspbian lib/firmware/brcm/* ... still no go Last try I will try with raspbian boot birmware I noticed these differences in the config.txt : Code:
root@rpi4:/boot# grep -vE '^#|^ *$' config.txt I'm stuck ... I've no idea what else could make the difference (/etc/firmware is still linked to /lib/firmware). Anyone have any other ideas ? something in the userland ? (I mean I'm using raspbian kernel, modules, boot firmware and firmware and still no bt device detected !) |
Quote:
|
If the BT device is not detected, that implies that either the firmware is not being loaded, or it is the wrong firmware. At least, that is the conclusion I came to on my 400.
Once I got that sorted, it all leapt into life. Can't help much further, because the 400 uses a slightly different chipset. I've lost track of all the things I tried on mine before I finally cracked it (might explain the ap6256 folder!), so I'm going to do a fresh install and start again from scratch - though keeping my currently working card, just in case! One final thought - and it is clutching at straws - I see you are using 14.2. In the x86 world, this is well past its sell-by date, and most have switched to -current, which is actually very stable. I'm running 64-bit current on the 400, and now I've got the BT working, its almost indistinguishable from the x86_64 version. -- Pete |
So I will double check which firmware files are being loaded on raspbian ... because I've copied over the entire /lib/firmware/brcm directory from raspbian entirely replacing what was there before (except for the renaming thing on the txt file) ... if it is a firmware issue it's not for something in the brcm subfolder.
I don't get this on the raspbian dmesg Code:
[ 3.966894] cfg80211: Loading compiled-in X.509 certificates for regulatory database Unfortunately not all firmware loading operations get logged, it is up to the author of the driver. It would be interesting to enable kernel dynamic debug buy raspbian kernel does not have it enabled # CONFIG_DYNAMIC_DEBUG is not set it would be interesting to log every firmware load operation where it is working :( Found this intresting subfolder: Code:
root@nuc8i5:/mnt/tmp/lib/firmware# tar cpvzf /tmp/rpi.tgz raspberrypi Ok one last try with the firmware: I will copy the entire /lib/firmware from raspbian to slackware : damn it still no go :( If it is a firmware issue raspbian is loading firmware trough fallback from somewhere else. |
I'm not sure what the exact filename of the firmware would be for your system, I only know it for the 400. If you can determine exactly which firmware *should* be loaded, try looking for duplicate filenames in /lib/firmware.
I've just done a complete re-install of slarm64 (on a new sd card!), and that troublesome ap6256 folder is definitely there again! I'm not sure where its coming from, as it certainly isn't in the kernel-firmware package! I will need to move it out of the way as part of my (ongoing) setting up! My new install does not have that /opt/vc/bin/vcmailbox file. Can't remember where I must have got it from - perhaps form the same location as the bluetoothResetFirmware.sh script? I'll have to go back and have a look... -- Pete |
louigi, clear something up. In various posts, you’ve mentioned SlackwareARM 14.2 and Sarpi and RPi 4.
But those aren’t meant to go together. You should only be installing -current on RPi 4, otherwise - problems! So , do you have -current or 14.2 on your Pi4? I don’t understand it enough to explain why you’ll have problems. I’m going by the instructions on the Sarpi website. Getting that right doesn’t eliminate the BT problems, though. TKS |
Quote:
The kernel does offer hardfloat but the userland will never require it so it's ok to use the current kernel on softfloat userland. Actually the only problem I have is bluetooth, everything else is working fine, ethernet, wifi, audio, X ... I even compiled the kernel with Exaga's bt config. I don't think it's because I'm doing this workaround to run 14.2 on my RPi4 ... but I have 2 more spare uSD ... I can try current on one of them and see how it goes. And besides that I think Exaga himself is having the same problem on current. |
No Bluetooth
I have also a RPI4 running current and impossible to make PI Bluetooth work !
I have also tested many things without success ! When I plug a USB Bluetooth adapter, everything works perfectly ! But impossible to use the onboard Bluetooth adapter Quote:
|
Desiderius: This is a firmware issue! I have a Pi 400 which is different from the 4, but some of the fixes I used on the 400 apply. The only one that may not is patching Bluez, and even one of those patches is probably a good idea. Have a look here: https://www.linuxquestions.org/quest...-a-4175689669/
The main points are: 1) Replace the /lib/firmware/brcm folder with the one from a recent Raspbian. 2) If your system has a /lib/firmware/ap6256 folder, move it out of the way (I put it in /root/tmp). Don't just delete it, in case you need it back! This should make your adapter appear! If it still won't bind, try patching Bluez - but I believe this is only necessary for the 400. The reason for moving the ap6256 folder is that it contains files with the same names as some in the brcm folder. Being higher up the "pecking order", it gets loaded first, so the updates to brcm become ineffective! Moving the ap6256 folder out of the way allows the correct firmware from the brcm folder to load. That is my experience anyway! It certainly works on the 400. -- Pete |
Guys I have copied from PRiOS with working onboard bluetooth (on the very same RPi4):
the entire /lib/firmware and /etc/firmware is linked to /lib/firmware. kernel and modules boot firmware The only thing that is left over is the renaming txt file I renamed ... I will remove that and see if it's any better. I will take with me one of my old bt dongles and see if they work with the same setup. |
Thanks for your answer @PChristhy
Where can I download the Raspbian /lib/firmware/brcm ? Desiderius Quote:
|
Quote:
You will need to mount the image (or install it on an SD card) and then extract the firmware files. Alternatively, Exaga's sarpi-hacks package contains firmware files, which I believe he got from Raspbian: https://sarpi.fatdog.eu/index.php?p=downloads Click on the appropriate version for your system, and it will take you to a second page where you can find the hacks package. I'm not sure if Exaga uses the "pure" Raspbian files, or if he tweaks them somewhat. I've been using the pure Raspbian ones, which are a bit more effort to obtain, but I know they work! -- Pete |
Thanks for your quick answer
I will try to extract it from the Raspian image since actually I have the files from the Exaga sarpi-hacks package ( since I use SARPI to install Slackware ) and it does not work. I will let you know if it works ! Didier |
Yes, please let us know! I'm afraid I only have a 400, so my experience is not necessarily applicable to other Pis! But from your description of your problem, it sounds the same as mine!
-- Pete |
Quote:
Concerning the firmware now even the renamd txt fie was removed and still can't see the onboard BT device. I tried a usb BT dongle and it works |
I have some interesting updates that also span to a little OT from this post.
I recently treated myself with a new 2Gb ram RPi4 instead of the stingy 1Gb I'd usually buy (the old one will become a NAS). Code:
Hardware : BCM2711 No change at all regarding BT on this device even with latest SARPi kernel and firmware. I set up a multiboot uSD so that the 14.2 userland on it will boot from both RPi4 and RPi0 ... so I can also report that BT on the RPi0 is in the same state as the RPi4 |
I did the test yesterday !
First I have looked for an ap6256 folder on the RPI : no ap6256 folder ! In /lib/firmware I have renamed the "brcm" folder to "old_brcm" and I have put the "brcm" folder extracted from the actual Raspberry PI OS image. Look for an ap6256 folder : no ! Chown root:root to brcm and reboot ! No Bluetooth icon in the task bar and when asking KDE for Bluetooth adapters, the answer is "No adapter available" ! To be sure, I have plugged an USB Bluetooth stick and the icon appears in the task bar and KDE sees the USB adapter ! Quote:
|
Oh, dear! Well, as I said at the start, I have a 400, not a 4 which I know is slightly different. I can only say what worked on my system.
It was worth a try, though, and thanks for posting so that others will know! -- Pete |
So recapping :
Onbpard bluetooth does work if I boot RPiOS but not with any of the above combinations with slackwareARM 14.2. USB bluetooth dongles work fine. I tried on the below RPi models : Code:
Hardware : BCM2711 |
Quote:
After reading over your own efforts, and those of others, in an attempt to solve this Cypress Bluetooth shizzle on Slackware ARM, I decided to look into this issue with the mindset that it cannot be that difficult to get working - given that Bluetooth works perfectly on the Raspberry Pi OS. Initially I assumed it must be a /dev rule or some other configuration setting that was missing. Historically, in my experience, the key to solving Slackware problems such as this usually lies in the amount of Jaffa cakes consumed while working on it and the level of enjoyment reached while doing so. On this particular wet, cold, freezing, winter's day the enjoyment factor cannot easily be measured. However, this venture took less than a box of (10) Jaffa cakes - and I finished the rest off because they were lonely. Full moon, half moon, total eclipse! <3 So, working loosely from what you (and others) have already tried and done, first I took a look at the Raspberry Pi OS Bluetooth files and configurations. I installed the 'bluez' pkg and noticed that it added a '/usr/lib/firmware/brcm' directory full of driver files. There's just one of them that's relevant to RPi4 Bluetooth, namely the 'BCM4345C0.hcd' file. So, this was my starting point. I copied the entire '/usr/lib/firmware/brcm' directory from the Raspberry Pi OS to Slackware ARM into the same location. Then I looked at the Raspberry Pi's Device Tree overlays README specifically for boot related Bluetooth settings. As a result I added the following to my 'boot/config.txt' file: Code:
dtparam=krnbt=on Code:
root@torq:~# mkdir -p /usr/lib/firmware/updates/brcm Code:
root@torq:~# echo $MACHTYPE The important thing to note here is that it was solved with Slackware ARM and eating Jaffa cakes at the same time, washed down with strong Italian (100% Arabica) coffee. HOO-RAH! :cool: |
Thanks Exaga ... I can confirm that this fixes it on both RPi4 and RPi0
Code:
root@rpi4:~# hciconfig Code:
root@rpi0:~# hcitool dev |
Thanks for your efforts, Exaga! Regarding your comment about not needing bluetooth, it is actually quite important on the 400 which doesn't have an audio out jack.
The only way to get audio out of a 400 is either via the HDMI lead, or bluetooth. Since most monitors don't offer HDMI audio, that leaves only bluetooth, so for some of us, it is quite important! I'll try adding your commands to the config.txt file on my 400 and report back later today. Mine is currently working OK, but I note that the there has been an overnight upgrade to the kernel-firmware file in slarm64, which may overwrite that dreaded brcm folder again! Again, thanks for your efforts investigating this! -- Pete |
Quote:
|
sndwvs: Thanks for pointing that out! I have just been using slackpkg to update from the distribution. Perhaps I should add slackpkg+ and add the location of that firmware file. Is this documented anywhere?
That also answers the question of where the ap6256 folder that caused me so much trouble came from! I originally loaded my installation from one of your images, and then pointed slackpkg at the distribution to update and install everything. Although this updated the /lib/firmware/brcm folder, it didn't update the ap6256 folder, which had an older - and incompatible - version of the BCM4345C5.hcd firmware needed by my 400. My 400 kept loading the wrong firmware, because ap6256 is higher up the "pecking order" than brcm! It took me some time to find that issue! According to the dates on the files, the two now appear to be in sync. I think this needs to be flagged up - and/or some kind of work-around devised. Those of us new to ARM are not familiar with these foibles! ;) BTW, as an aside, although the kernel-firmware package appears to have been updated in the distribution, slackpkg isn't picking it up. I'm guessing this is because the changelog and other associated files haven't caught up yet. Cheers, -- Pete |
All times are GMT -5. The time now is 06:46 PM. |