Bluetooth stops working after kernel update

I installed Tumbleweed on my laptop for the first time.
And after a kernel update, I noticed that my Bluetooth stopped working.
I got an error like this:

Direct firmware load for mediatek/BT_RAM_CODE_MT7922_1_1_hdr.bin failed error code -2

After a lot of research, I discovered that the problem was in the initrd files, but after recreating them nothing changed.
So I began my research again. Then I recreated the initrd using:

dracut -f --omit bluetooth --regenerate-all

Now my Bluetooth works again.
I’m a Linux noob, just wanted to know if there was another way to solve this and make a topic to help someone with the same problem.

1 Like

It’s my understand an error code 2 is related to “missing file or sub-directory”.

Did you attempt to locate the “*.bin” file shown in your first code quote ?
(before recreating initrd)

Yes, I did.
It was located in:

/usr/lib/firmware/mediatek/BT_RAM_CODE_MT7922_1_1_hdr.bin.xz

I didn’t understand why it couldn’t be loaded.

Probably because it was not extracted. .xz is a compression format, similar to .gzip or .bzip2. Maybe just extracting it might have solved it. But anyways you solved your issue, so that’s good.

Most of them are zipped to xz, see in your firmware directory.

1 Like

Sorry for the late reply.
However, uncompressing the file does not make the Bluetooth work.

I’m having the same problem:

Mar 04 12:34:45 andromeda kernel: bluetooth hci0: Direct firmware load for mediatek/BT_RAM_CODE_MT7922_1_1_hdr.bin failed with error -2
Mar 04 12:34:45 andromeda kernel: Bluetooth: hci0: Failed to load firmware file (-2)
Mar 04 12:34:45 andromeda kernel: Bluetooth: hci0: Failed to set up firmware (-2)

Any ideas/help, please?

 andrea î‚° /usr/lib/firmware/mediatek î‚° ll
total 7.5M
-rw-r--r-- 1 root root 502K Feb 23 17:25 BT_RAM_CODE_MT7922_1_1_hdr.bin.xz
-rw-r--r-- 1 root root 336K Feb 23 17:25 BT_RAM_CODE_MT7961_1_2_hdr.bin.xz
-rw-r--r-- 1 root root 135K Feb 23 17:25 WIFI_MT7922_patch_mcu_1_1_hdr.bin.xz
-rw-r--r-- 1 root root  43K Feb 23 17:25 WIFI_MT7961_patch_mcu_1_2_hdr.bin.xz
[...]

Did you read this topic at all? Did you do what was suggested in the very first post?

If your dracut invocation helped, it means that module was loaded in initrd where firmware was missing.

I apologize. No, I didn’t. :worried:

I have run that command now, and Bluetooth is functioning again, the firmware loading error message is also no longer there.

So thanks for that, and hurray! :partying_face:

However, I have a doubt: will I be in the same situation at the next snapshot update?

Thanks

May be. dracut bluetooth module is three years old and it is not clear why it suddenly decided to load BT drivers in the first place.

Show output of

grep -qiE -e 'Class=0x[0-9a-f]{3}5[4c]0' -e 'Appearance=0x03c1' /var/lib/bluetooth/*/*/info
1 Like

It’s empty.

Here are the contents for that path:

andromeda:/ # cat /var/lib/bluetooth/*/*/info

[General]
Name=Keychron K3 Pro
Class=0x000540
SupportedTechnologies=BR/EDR;
Trusted=true
Blocked=false
WakeAllowed=true
Services=00001000-0000-1000-8000-00805f9b34fb;00001124-0000-1000-8000-00805f9b34fb;00001200-0000-1000-8000-00805f9b34fb;

[LinkKey]
Key=E13040DA4E422B27FB96DCDD2F661CBA
Type=4
PINLength=0

[DeviceID]
Source=2
Vendor=13364
Product=563
Version=306


[General]
Name=EarFun di Andrea
Class=0x240404
AddressType=public
SupportedTechnologies=BR/EDR;LE;
Trusted=true
Blocked=false
Services=00001100-d102-11e1-9b23-00025b00a5a5;00001101-0000-1000-8000-00805f9b34fb;00001108-0000-1000-8000-00805f9b34fb;0000110b-0000-1000-8000-00805f9b34fb;0000110c-0000-1000-8000-00805f9b34fb;0000110d-0000-1000-8000-00805f9b34fb;0000110e-0000-1000-8000-00805f9b34fb;0000111e-0000-1000-8000-00805f9b34fb;00001800-0000-1000-8000-00805f9b34fb;00001801-0000-1000-8000-00805f9b34fb;0000180a-0000-1000-8000-00805f9b34fb;0000180f-0000-1000-8000-00805f9b34fb;0000eb04-d102-11e1-9b23-00025b00a5a5;0000eb05-d102-11e1-9b23-00025b00a5a5;0000eb06-d102-11e1-9b23-00025b00a5a5;0000eb07-d102-11e1-9b23-00025b00a5a5;0000eb10-d102-11e1-9b23-00025b00a5a5;0000fd92-0000-1000-8000-00805f9b34fb;

[LinkKey]
Key=9A0D3298259A18939FBE5F1CC337DE4F
Type=4
PINLength=0

The intention is to include bluetooth modules in initrd if bluetooth keyboard is present and this is bluetooth keyboard. So I expect this problem to happen with every kernel update as long as this device is present during dracut invocation.

As a workaround you may permanently disable dracut bluetooth module

echo 'omit_dracutmodules+=" bluetooth "' > /etc/dracut.conf.d/disable_bluetooth.conf

See

man dracut.conf.d

This most certainly needs bug report.

1 Like

Thanks for this explanation, now everything makes sense. I got that keyboard quite recently, but I’ve linked this problem with TW snapshots because it started happening after an update…How hard it can be to troubleshoot stuff if you don’t know everything!

My understanding is that the intention for that behavior, is to allow to use BT keyboards to be used before reaching the user session, to allow for example selecting previous snapshots in grub as well as typing in LUKS passwords.

Since it seems quite an important feature to have, where should I report the bug?

Thanks

Use https://bugzilla.opensuse.org/ (the same user/password as here). Open bug against openSUSE Tumbleweed, component Basesystem. It would be quite helpful to include full output of

journalctl -b --no-pager --full

with the stock initrd where problem was observed as well as the content of /var/lib/bluetooth.

It is useful if you post link to the bug report here.

1 Like

Thanks to your guidance I have filed a bug here:

https://bugzilla.opensuse.org/show_bug.cgi?id=1220888

FYI @arvidjaar ,

this command DOES return something:

andromeda:/home/andrea # grep -E  'Class=0x[0-9a-f]{3}5[4c]0'  /var/lib/bluetooth/*/*/info
/var/lib/bluetooth/14:AC:60:46:89:72/6C:93:08:67:1D:A4/info:Class=0x000540

I guess that the Appearance thingy is missing in my case, and that’s why the command you provided didn’t catch my keyboard.

I also have to drop the -qi grep params, with only -E it works best.

Weird, but I just thought I’d let you know.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.