NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.83k stars 13.92k forks source link

bluetooth low energy devices stopped working on newer linux kernels (6.4) #242313

Closed MangoIV closed 10 months ago

MangoIV commented 1 year ago

Describe the bug

For a while not I cannot pair any bluetooth keyboards anymore, the keyboards have been confirmed to work fine by connecting to another central device.

Steps To Reproduce

Expected behavior

the keyboard connects and pairs fine

Screenshots

image

Additional context

Metadata

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.4.1-zen1, NixOS, 23.11 (Tapir), 23.11.20230706.3c74875`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix Super) 2.14.0pre20230128_792d83f`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
kelszo commented 1 year ago

I had a similar problem where bluetooth LE stopped working and I couldn't find my keyboard. I was also running kernel version 6.4. Downgrading the kernel to 6.1 solved it for me.

MangoIV commented 1 year ago

Thank you for that information, do you know what specifically causes this behaviour?

kelszo commented 1 year ago

Sadly not. I couldn't find any good error logs/messages and couldn't find anything relevant on the kernels bugzilla. What I can say is that this problem was replicated on two different devices (HP Elitebook and Dell Precision) both running NixOS on the latest kernel, downgrading to 6.1 helped on both.

Also other bluetooth devices worked, seems to be isolated to just LE devices. So most likely some bug in Bluez kernel modules for LE?

Did downgrading help you?

MangoIV commented 1 year ago

No, though I haven’t tried yet - should do that - I mean it’s not a long term solution but it might resolve the issue for now.

kelszo commented 1 year ago

Most likely related to https://bugzilla.kernel.org/show_bug.cgi?id=217651

Seems to be a patch in the pipeline so let's hope it is related so we can return to the latest kernel version :)

kelszo commented 1 year ago

It now works for me with the latest kernel version 6.4.9 (nixpkgs rev ce5e4a6ef2e59d89a971bc434ca8ca222b9c7f5e)

MangoIV commented 1 year ago

Nice thank you for the heads up!

stereomato commented 1 year ago

I can't pair my bluetooth 5.0 mouse anymore and that patch/thing doesn't seem like it helped ...

MangoIV commented 1 year ago

Yes for me too, had to downgrade to 6.1 again.

stereomato commented 1 year ago

I have tested opensuse's live cd iso and the issue is present there too. Someone has to report this on kernel.org

MangoIV commented 10 months ago

this is not present for all bluetooth LE devices apparently, I have a pointing device that is working just fine, whereas my keyboard with ZMK firmware doesn't I'm starting to think this might be an issue with the clients bluetooth stack, perhaps zephyros

kelszo commented 10 months ago

Can chime in with when I had this problem it was also with a keyboard running ZMK firmware

MangoIV commented 10 months ago

Alright. Maybe it's not a kernel problem after all

MangoIV commented 10 months ago

@kelszo there might be fix for you https://github.com/zmkfirmware/zmk/issues/1487#issuecomment-1836675169

x418 commented 10 months ago

Thanks for the tip @MangoIV. I also use a Keyboard with ZMK (Kinesis Adv360) on NixOS (kernel 6.6.3) and can chime in and say that the fix https://github.com/zmkfirmware/zmk/issues/1487#issuecomment-1836675169 worked for me. I can finally use the Adv360 via Bluetooth. (I also had to use bluetuith to actually pair the Keyboard if that helps as bluetoothctl didn't work)

MangoIV commented 10 months ago

I think it's pretty clear by now that this issue is caused by ZMK. If you run into this issue, please refer to the discussion above which should solve your problems.

buttergrillcorn commented 8 months ago

@kelszo there might be fix for you zmkfirmware/zmk#1487 (comment)

Thank you, finally found what's causing the issue after days of research. I can confirm that after enabling the experimental features for ZMK does indeed fix the problem.