Bluetooth stops working after resume from suspend

As the title says, whenever I resume my laptop from suspend the bluetooth stops working. This only happens on my laptop and not my desktop even though I use the same config between the two, minus the filesystems nix config of course.

I’m using KDE Plasma 6 with Wayland

{pkgs, ...}: {
  system.nixos.tags = ["plasma"];

  services.greetd = {
    enable = true;
    restart = true;
    settings.default_session = {
      user = "my_user";
      command = "startplasma-wayland";
    };
  };

  services.desktopManager.plasma6.enable = true;
}

More specifically, after resuming, when I go to the bluetooth settings page (or taskbar applet), the bluetooth looks like it’s enabled, but it doesn’t show any of my paired devices. Turning off and on from there doesn’t do anything. The only solution is to power off my laptop and turn it back on. Reboots don’t work.

I’ve tried this solution from the Arch wiki, but it didn’t help.
lsusb -vt returns

/:  Bus 001.Port 001: Dev 001, Class=root_hub, Driver=xhci_hcd/4p, 480M
    ID 1d6b:0002 Linux Foundation 2.0 root hub
    |__ Port 002: Dev 002, If 0, Class=Hub, Driver=hub/3p, 480M
        ID 05e3:0610 Genesys Logic, Inc. Hub
    |__ Port 004: Dev 003, If 0, Class=Human Interface Device, Driver=usbhid, 12M
        ID 048d:c101 Integrated Technology Express, Inc. 
/:  Bus 002.Port 001: Dev 001, Class=root_hub, Driver=xhci_hcd/2p, 10000M
    ID 1d6b:0003 Linux Foundation 3.0 root hub
    |__ Port 002: Dev 002, If 0, Class=Hub, Driver=hub/3p, 5000M
        ID 05e3:0620 Genesys Logic, Inc. GL3523 Hub
/:  Bus 003.Port 001: Dev 001, Class=root_hub, Driver=xhci_hcd/4p, 480M
    ID 1d6b:0002 Linux Foundation 2.0 root hub
    |__ Port 004: Dev 002, If 0, Class=Wireless, Driver=btusb, 480M
        ID 0489:e0cd Foxconn / Hon Hai MediaTek Bluetooth Adapter
    |__ Port 004: Dev 002, If 1, Class=Wireless, Driver=btusb, 480M
        ID 0489:e0cd Foxconn / Hon Hai MediaTek Bluetooth Adapter
    |__ Port 004: Dev 002, If 2, Class=Wireless, Driver=btusb, 480M
        ID 0489:e0cd Foxconn / Hon Hai MediaTek Bluetooth Adapter
/:  Bus 004.Port 001: Dev 001, Class=root_hub, Driver=xhci_hcd/2p, 10000M
    ID 1d6b:0003 Linux Foundation 3.0 root hub

Issuing sudo usb_modeswitch -R -v 1d6b -p 0002 doesn’t fix the problem and returns

Look for default devices ...
 Found devices in default mode (2)
Access device 001 on bus 001
Get the current device configuration ...
Current configuration number is 1
Use interface number 0
 with class 9
Warning: no switching method given. See documentation
Reset USB device ...........Reset USB device failed with error -99 Reset USB device failed with error -99-> Run lsusb to note any changes. Bye!

I also tried sudo modprobe -r btusb but this command hangs and after waiting around a minute I canceled it. Then sudo modprobe btusb finishes instantly, but doesn’t do anything and the bluetooth device is gone from the output of lsusb -vt.

Here’s my relevant hardware config.

{
  config,
  lib,
  inputs,
  ...
}: {
  # Has to use nixpkgs directly because using pkgs causes infintie recursion
  imports = ["${inputs.nixpkgs}/nixos/modules/installer/scan/not-detected.nix"];

  boot = {
    # Bootloader
    loader = {
      systemd-boot.enable = true;
      efi.canTouchEfiVariables = true;
      timeout = 2;
    };

    initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod"];
    initrd.kernelModules = [
      # "amdgpu" # Loading driver early causes short freeze before asking for luks passwords while the terminal resolution changes
    ];

    kernelModules = ["kvm-amd"];
    kernelParams = ["sysrq_always_enabled=1"];
    kernel.sysctl = {"vm.swappiness" = 10;};

    # For OBS virtual camera
    extraModulePackages = with config.boot.kernelPackages; [v4l2loopback];
  };

  # Enables DHCP on each ethernet and wireless interface. In case of scripted networking
  # (the default) this is the recommended approach. When using systemd-networkd it's
  # still possible to use this option  but it's recommended to use it in conjunction
  # with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
  networking.useDHCP = lib.mkDefault true;
  # networking.interfaces.enp0s3.useDHCP = lib.mkDefault true;

  nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
  hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;

  # On 64-bit systems, if you want OpenGL for 32-bit programs such as in Wine, you should also set the following:
  hardware.graphics.enable32Bit = true;

  # Bluetooth
  hardware.bluetooth = {
    enable = true;
    powerOnBoot = true;
  };

  # Enable using scanner (e.g. on a printer)
  hardware.sane.enable = true;
}

This is what appears in my journal after booting up from a normal shutdown which is when the bluetooth is working with sudo journalctl -b --no-hostname | rg -i bluetooth

May 02 08:13:31 kernel: Bluetooth: Core ver 2.22
May 02 08:13:31 kernel: NET: Registered PF_BLUETOOTH protocol family
May 02 08:13:31 kernel: Bluetooth: HCI device and connection manager initialized
May 02 08:13:31 kernel: Bluetooth: HCI socket layer initialized
May 02 08:13:31 kernel: Bluetooth: L2CAP socket layer initialized
May 02 08:13:31 kernel: Bluetooth: SCO socket layer initialized
May 02 08:13:31 kernel: Bluetooth: hci0: HW/SW Version: 0x008a008a, Build Time: 20241106151414
May 02 08:13:38 kernel: Bluetooth: BNEP (Ethernet Emulation) ver 1.3
May 02 08:13:38 kernel: Bluetooth: BNEP socket layer initialized
May 02 08:13:38 kernel: Bluetooth: hci0: Device setup in 3102496 usecs
May 02 08:13:38 kernel: Bluetooth: hci0: HCI Enhanced Setup Synchronous Connection command is advertised, but not supported.
May 02 08:13:38 kernel: Bluetooth: MGMT ver 1.23
May 02 08:13:33 bluetoothd[1102]: Bluetooth daemon 5.80
May 02 08:13:33 bluetoothd[1102]: Starting SDP server
May 02 08:13:33 bluetoothd[1102]: Bluetooth management interface 1.23 initialized
May 02 08:13:34 bluetoothd[1102]: Battery Provider Manager created
May 02 08:13:34 bluetoothd[1102]: Failed to set mode: Failed (0x03)
May 02 08:13:34 bluetoothd[1102]: Failed to add device F6:AF:F0:E4:E5:A3 (2): Failed (0x03)
May 02 08:13:34 bluetoothd[1102]: Failed to add device DF:3E:AA:A3:E2:28 (2): Failed (0x03)
May 02 08:13:33 systemd[1]: Starting Bluetooth service...
May 02 08:13:33 systemd[1]: Started Bluetooth service.
May 02 08:13:33 systemd[1]: Reached target Bluetooth Support.
May 02 08:13:44 kernel: Bluetooth: RFCOMM TTY layer initialized
May 02 08:13:44 kernel: Bluetooth: RFCOMM socket layer initialized
May 02 08:13:44 kernel: Bluetooth: RFCOMM ver 1.11
May 02 08:13:44 bluetoothd[1102]: Endpoint registered: sender=:1.25 path=/MediaEndpoint/A2DPSource/ldac
May 02 08:13:44 bluetoothd[1102]: Endpoint registered: sender=:1.25 path=/MediaEndpoint/A2DPSink/aptx_hd
May 02 08:13:44 bluetoothd[1102]: Endpoint registered: sender=:1.25 path=/MediaEndpoint/A2DPSource/aptx_hd
May 02 08:13:44 bluetoothd[1102]: Endpoint registered: sender=:1.25 path=/MediaEndpoint/A2DPSink/aptx
May 02 08:13:44 bluetoothd[1102]: Endpoint registered: sender=:1.25 path=/MediaEndpoint/A2DPSource/aptx
May 02 08:13:44 bluetoothd[1102]: Endpoint registered: sender=:1.25 path=/MediaEndpoint/A2DPSink/aac
May 02 08:13:44 bluetoothd[1102]: Endpoint registered: sender=:1.25 path=/MediaEndpoint/A2DPSource/aac
May 02 08:13:44 bluetoothd[1102]: Endpoint registered: sender=:1.25 path=/MediaEndpoint/A2DPSink/opus_g
May 02 08:13:44 bluetoothd[1102]: Endpoint registered: sender=:1.25 path=/MediaEndpoint/A2DPSource/opus_g
May 02 08:13:44 bluetoothd[1102]: Endpoint registered: sender=:1.25 path=/MediaEndpoint/A2DPSink/sbc
May 02 08:13:44 bluetoothd[1102]: Endpoint registered: sender=:1.25 path=/MediaEndpoint/A2DPSource/sbc
May 02 08:13:44 bluetoothd[1102]: Endpoint registered: sender=:1.25 path=/MediaEndpoint/A2DPSource/aptx_ll_1
May 02 08:13:44 bluetoothd[1102]: Endpoint registered: sender=:1.25 path=/MediaEndpoint/A2DPSource/aptx_ll_0
May 02 08:13:44 bluetoothd[1102]: Endpoint registered: sender=:1.25 path=/MediaEndpoint/A2DPSource/aptx_ll_duplex_1
May 02 08:13:44 bluetoothd[1102]: Endpoint registered: sender=:1.25 path=/MediaEndpoint/A2DPSource/aptx_ll_duplex_0
May 02 08:13:44 bluetoothd[1102]: Endpoint registered: sender=:1.25 path=/MediaEndpoint/A2DPSource/faststream
May 02 08:13:44 bluetoothd[1102]: Endpoint registered: sender=:1.25 path=/MediaEndpoint/A2DPSource/faststream_duplex
May 02 08:13:44 bluetoothd[1102]: Endpoint registered: sender=:1.25 path=/MediaEndpoint/A2DPSink/opus_05
May 02 08:13:44 bluetoothd[1102]: Endpoint registered: sender=:1.25 path=/MediaEndpoint/A2DPSource/opus_05
May 02 08:13:44 bluetoothd[1102]: Endpoint registered: sender=:1.25 path=/MediaEndpoint/A2DPSink/opus_05_duplex
May 02 08:13:44 bluetoothd[1102]: Endpoint registered: sender=:1.25 path=/MediaEndpoint/A2DPSource/opus_05_duplex
May 02 08:13:44 kdeconnectd[1923]: 2025-05-02T08:13:44 qt.bluetooth.bluez: Bluetooth device is powered off
May 02 08:13:45 systemd[1427]: Starting Bluetooth OBEX service...
May 02 08:13:45 systemd[1427]: Started Bluetooth OBEX service.
May 02 08:13:45 kernel: Bluetooth: hci0: HW/SW Version: 0x008a008a, Build Time: 20241106151414
May 02 08:13:45 kernel: Bluetooth: hci0: Device setup in 148266 usecs
May 02 08:13:45 kernel: Bluetooth: hci0: HCI Enhanced Setup Synchronous Connection command is advertised, but not supported.
May 02 08:23:10 systemd[1427]: Reached target Bluetooth.
May 02 08:23:23 bluetoothd[1102]: /org/bluez/hci0/dev_AC_80_0A_11_7E_3E/fd0: fd(42) ready

And here’s the remaining output after resuming from suspend

May 02 09:08:43 bluetoothd[1102]: src/profile.c:ext_io_disconnected() Unable to get io data for Hands-Free Voice gateway: getpeername: Transport endpoint is not connected (107)
May 02 09:08:43 bluetoothd[1102]: Endpoint unregistered: sender=:1.25 path=/MediaEndpoint/A2DPSource/ldac
May 02 09:08:43 bluetoothd[1102]: Endpoint unregistered: sender=:1.25 path=/MediaEndpoint/A2DPSink/aptx_hd
May 02 09:08:43 bluetoothd[1102]: Endpoint unregistered: sender=:1.25 path=/MediaEndpoint/A2DPSource/aptx_hd
May 02 09:08:43 bluetoothd[1102]: Endpoint unregistered: sender=:1.25 path=/MediaEndpoint/A2DPSink/aptx
May 02 09:08:43 bluetoothd[1102]: Endpoint unregistered: sender=:1.25 path=/MediaEndpoint/A2DPSource/aptx
May 02 09:08:43 bluetoothd[1102]: Endpoint unregistered: sender=:1.25 path=/MediaEndpoint/A2DPSink/aac
May 02 09:08:43 bluetoothd[1102]: Endpoint unregistered: sender=:1.25 path=/MediaEndpoint/A2DPSource/aac
May 02 09:08:43 bluetoothd[1102]: Endpoint unregistered: sender=:1.25 path=/MediaEndpoint/A2DPSink/opus_g
May 02 09:08:43 bluetoothd[1102]: Endpoint unregistered: sender=:1.25 path=/MediaEndpoint/A2DPSource/opus_g
May 02 09:08:43 bluetoothd[1102]: Endpoint unregistered: sender=:1.25 path=/MediaEndpoint/A2DPSink/sbc
May 02 09:08:43 bluetoothd[1102]: Endpoint unregistered: sender=:1.25 path=/MediaEndpoint/A2DPSource/sbc
May 02 09:08:43 bluetoothd[1102]: Endpoint unregistered: sender=:1.25 path=/MediaEndpoint/A2DPSource/aptx_ll_1
May 02 09:08:43 bluetoothd[1102]: Endpoint unregistered: sender=:1.25 path=/MediaEndpoint/A2DPSource/aptx_ll_0
May 02 09:08:43 bluetoothd[1102]: Endpoint unregistered: sender=:1.25 path=/MediaEndpoint/A2DPSource/aptx_ll_duplex_1
May 02 09:08:43 bluetoothd[1102]: Endpoint unregistered: sender=:1.25 path=/MediaEndpoint/A2DPSource/aptx_ll_duplex_0
May 02 09:08:43 bluetoothd[1102]: Endpoint unregistered: sender=:1.25 path=/MediaEndpoint/A2DPSource/faststream
May 02 09:08:43 bluetoothd[1102]: Endpoint unregistered: sender=:1.25 path=/MediaEndpoint/A2DPSource/faststream_duplex
May 02 09:08:43 bluetoothd[1102]: Endpoint unregistered: sender=:1.25 path=/MediaEndpoint/A2DPSink/opus_05
May 02 09:08:43 bluetoothd[1102]: Endpoint unregistered: sender=:1.25 path=/MediaEndpoint/A2DPSource/opus_05
May 02 09:08:43 bluetoothd[1102]: Endpoint unregistered: sender=:1.25 path=/MediaEndpoint/A2DPSink/opus_05_duplex
May 02 09:08:43 bluetoothd[1102]: Endpoint unregistered: sender=:1.25 path=/MediaEndpoint/A2DPSource/opus_05_duplex
May 02 09:08:43 bluetoothd[1102]: Battery Provider Manager destroyed
May 02 09:08:43 kdeconnectd[1923]: 2025-05-02T09:08:43 kdeconnect.core: No local bluetooth adapter found
May 02 09:08:44 systemd[1427]: Stopped target Bluetooth.
May 02 09:08:44 systemd[1]: Stopped target Bluetooth Support.
May 02 09:08:45 systemd[1]: Reached target Bluetooth Support.
May 02 09:08:45 systemd[1427]: Reached target Bluetooth.
May 02 09:08:49 kernel: Bluetooth: hci0: Failed to write uhw reg(-110)
May 02 09:08:49 kernel: Bluetooth: hci0: HW/SW Version: 0x008a008a, Build Time: 20241106151414

Strange thing is that this started happening maybe 2 months ago? I’ll have to try booting into some old generations to know when exactly it started though.

Sounds like hardware failure, or perhaps a firmware bug. Bluetooth likes breaking like this IME.

See if you can attempt a firmware update, both by checking the manufacturer’s support page and fwupdmgr.

Some BIOS settings might also affect this, particularly the powersaving ones. Be aware there are powersaving features named after california and EU laws which don’t look like powersaving features at all, but usually instruct your device to very aggressively shut things off when sleeping or turned off.

1 Like

I think I’ve discovered a workaround while testing out various actions yesterday. If I power on the laptop, reboot, then I can sleep and wake it without the bluetooth dying. But if I power it off, then on, then suspend without a reboot in the middle, the problem re-appears.