irreleph4nt / mkinitcpio-bluetooth

GNU General Public License v2.0
56 stars 4 forks source link

Works when booting but not when resuming from hibernate #6

Closed NiklasBeierl closed 2 years ago

NiklasBeierl commented 4 years ago

Hello everyone and thanks for providing this amazing package! Exactly what I needed and it just worked!

One little catch tho: It seems like I can use my bluetooth keyboard to enter my LUKS passphrase when rebooting or doing a cold boot. But not when resuming from hibernate. I will try to look into that myself, but maybe you guys can bump me in the right direction.

Here some information on my hardware: Keyboard: Logitech K380 Bluetooth adapter: Internal adapter on a Dell XPS 13 2 in 1 7390 I have a hard time figuring out the exact hardware name for adapter, maybe someone can advise. It doesn't show up in lsusb and lspci.

irreleph4nt commented 4 years ago

Hey and thanks for providing feedback. A few things come to mind that you can check:

0) You did follow the instructions here in github, right? You are also not using Manjaro or an encrypted /boot, right? 1) The Arch Wiki mentions that your device has funny sleep behavior. What settings are you using for sleep and hibernate? 2) I could immagine that your PC turns off the WIFI/ BT adapter when hibernating and resumes it only after the LUKS screen. Check your system log to see whether any messages regarding BT or WIFI show up. 3) Does your BT keyboard work again (instantly) when you entered the PW after hibernate? If there is a delay, for example on the login screen, 2) is a likely cause.

Personally I don't use hibernate at all, so I frankly to this day have not tested this hook with hibernate.

EDITH says: Which version of the hook are you using? I pushed 1.4 to AUR yesterday. EDITH 2 says: Did you trust your keyboard with bluetoothctl as described on the wiki?

NiklasBeierl commented 4 years ago

Hello and thanks for the speedy reply. 😊

  1. My /boot is indeed encrypted. But I am copying my kernel and initramfs to /efi as a Unified kernel image, I then directly boot Arch Linux via EFISTUB. (So there is no real bootloader involved)
  2. The arch wiki does indeed mention that, but since I did not have any issues with hibernate itself so far I didn't configure anything.
  3. Will do ASAP
  4. I think the keyboard is indeed re-connecting after the PW prompt. At least a small LED on it blinking would indicate so. I will investigate!

Edit: I got the hook it straight from this github repo. Cloned just yesterday. Edit 2: Yes, I did.

NiklasBeierl commented 4 years ago

Heyja, sorry for the late reply, Life had different plans, so I didn't get to tinker with this one.

Actually, I had to remove the hook because it was causing my bluetooth controller to disappear. This happened as soon as I:

  1. Added the hook.
  2. Went through a hibernate-cycle.
  3. And then through a power-cycle (poweroff and start the machine back up)

The controller no longer showed up in bluetoothctrl. (i.e. bluetoothctl list printed nothing.) The only way I was able to resolve this was by removing the hook and rebooting.

Heres my logs: https://controlc.com/1ef4c9e3

irreleph4nt commented 3 years ago

Hi @NiklasBeierl ,

Like for yourself, life had me busy for a while. I have looked into the problem and your logs and found the following:

  1. The networking module used in your laptop is a Killer AX 1650
  2. The bluetooth disappearing is not a direct issue of this hook; when looking through your log you will find a couple of lines like: Aug 08 13:19:10 Calypso kernel: bluetooth hci0: Direct firmware load for intel/ibt-19-32-4.sfi failed with error -2 When this happens, the consequence is for the bluetooth adapter to not be available, hence not working. A clean firmware reload happens only from cold-booting, so a simple restart might not make your adapter reappear.
  3. Killer networking adapters appear to be notorious for having driver issues. I found a couple of examples ... Arch Forum Clear Linux Github Ubuntu Bug Tracker

Please note that the readme of this hook clearly states it has been built only with USB adapters in mind, which means you will have to check that all relevant / required pci modules and firmware blobs are actually available in your initramfs. What might be happening here is that your adapter locks up when hibernating, so it does not come back up when you wake the laptop. This can have many reasons, including ...

  1. The device or its linux driver for the device being garbage
  2. This hook causing the lock-up when trying to access your BT adapter, which I doubt but can't test as I only have a USB adapter