Bluetooth keyboard stopped working after Nov.2020 Beta update

Okay guys, I tried now with an original and working apple keyboard. Could pair with it without problem, but same effect: Kodi is not reacting to any keyboard input. Unless I didn’t do any kind of very stupid mistake, I suppose something is very wrong with that update…

If two keyboards are not working, all I can suggest is to back up your settings and reinstall OSMC with the latest image, see if it works, then try installing the 4.9 kernel again.

I doubt that this will help, I just got the device from you guys, installed current latest and then updated to 4.9. Very unlikely that there was something going wrong. Anyway, if I try, is there a tutorial for complete reinstall somewhere?

Resurrecting this thread because I’m having the exact same problem with my own bluetooth keyboard: it’s paired and connected, but no response to keyboard input.

(This worked in the past on my Vero4K. It’s been busted for most if not all of this year following a house move; not sure if Nov.2020 update was the culprit. I’m only now getting around to investigate.)

Running kernel is:

Linux vero4k 4.9.113-55-osmc #1 SMP PREEMPT Fri Nov 19 14:03:43 UTC 2021 aarch64 GNU/Linux

Device info from bluetoothctl:

Device 20:73:00:47:91:68
        Name: Anker A7721
        Alias: Anker A7721
        Class: 0x000540
        Icon: input-keyboard
        Paired: yes
        Trusted: yes
        Blocked: no
        Connected: yes
        LegacyPairing: no
        UUID: Service Discovery Serve.. (00001000-0000-1000-8000-00805f9b34fb)
        UUID: Human Interface Device... (00001124-0000-1000-8000-00805f9b34fb)
        UUID: PnP Information           (00001200-0000-1000-8000-00805f9b34fb)
        Modalias: usb:v05ACp022Cd0001

Perhaps significant is the Modalias is exactly the same as the OP. There’s no matching pattern in /lib/modules/$(uname -r)/modules.alias so I assume that means the driver is built directly into the OSMC kernel.

I’m not yet well versed in Linux’s Bluetooth subsystem so this is as far as I’ve gotten so far.

What module are you expecting for this keyboard?
dmesg might show some clues.

On a Debian Bullseye machine, the same keyboard connects and works properly.

On the Bullseye machine it’s using the btusb module – which as I understand is built into OSMC’s kernel (CONFIG_BT_HCIBTUSB=y) – and kernel Linux 5.10.0-8-amd64 #1 SMP Debian 5.10.46-4 (2021-08-03) x86_64 GNU/Linux.

So I have a basis for comparison with OSMC.

Upon keyboard connection on the Bullseye machine, dmesg prints:

[1852508.259393] input: Anker A7721 as /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/bluetooth/hci0/hci0:256/0005:05AC:022C.0006/input/input34
[1852508.260161] apple 0005:05AC:022C.0006: input,hidraw1: BLUETOOTH HID v0.01 Keyboard [Anker A7721] on 74:70:fd:c1:f2:5e

on OSMC all I get are a bunch of seemingly unrelated audio messages, but I get these each time I disconnect or re-connect the Bluetooth keyboard:

[89652.590940] audio_dsp: buf=0
[89652.590949] audio_dsp: IEC958_mode_raw=0
[89652.590985] audio_dsp: IEC958_mode_codec= 0, IEC958 type 2 CH PCM
[89652.590988] audio_dsp: last mode 0,now 0
[89652.591102] hdmitx: hdmitx: config: audio_on
[89652.591107] hdmitx: audio: configure on
[89652.602735] aml_meson_snd_card aml_sound_meson:
               area=ffffff8008d01000,addr=1503657984,bytes=65536,rate:44100, channels:2, subformat:0                                                                                         
[89652.602784] snd_spdif_dai: aml_hw_iec958_init,runtime->rate=44100, runtime->channels=2
                       same source mode(1), stream format=2 CH PCM
[89652.602795] hdmitx: audio: aout notify rate 44100
[89652.602797] hdmitx: audio: aout notify size 32
[89652.602800] hdmitx: audio: hdmi_ch: 0 speaker_layout: 0
[89652.603726] hdmitx: sysfs set hdmi_ch to 0
[89652.603920] snd_spdif_dai: aml_hw_iec958_init,runtime->rate=44100, runtime->channels=2
                       same source mode(1), stream format=2 CH PCM
[89652.603961] hdmitx: audio: aout notify rate 44100
[89652.603963] hdmitx: audio: aout notify size 32
[89652.603966] hdmitx: audio: hdmi_ch: 0 speaker_layout: 0

Here’s another comparison using udevadm monitor, upon keyboard connection:

Bullseye

KERNEL[1853824.368315] add      /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/bluetooth/hci0/hci0:256 (bluetooth)
UDEV  [1853824.374935] add      /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/bluetooth/hci0/hci0:256 (bluetooth)
KERNEL[1853824.599042] add      /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/bluetooth/hci0/hci0:256/0005:05AC:022C.000B (hid)
KERNEL[1853824.599785] add      /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/bluetooth/hci0/hci0:256/0005:05AC:022C.000B/power_supply/hid-20:73:00:47:91:68-battery/wakeup33 (wakeup)
KERNEL[1853824.599862] add      /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/bluetooth/hci0/hci0:256/0005:05AC:022C.000B/power_supply/hid-20:73:00:47:91:68-battery/hwmon9 (hwmon)
KERNEL[1853824.600028] add      /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/bluetooth/hci0/hci0:256/0005:05AC:022C.000B/input/input39 (input)
KERNEL[1853824.600094] add      /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/bluetooth/hci0/hci0:256/0005:05AC:022C.000B/input/input39/input39::numlock (leds)
KERNEL[1853824.600156] change   /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/bluetooth/hci0/hci0:256/0005:05AC:022C.000B/input/input39/input39::numlock (leds)
KERNEL[1853824.600205] add      /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/bluetooth/hci0/hci0:256/0005:05AC:022C.000B/input/input39/input39::capslock (leds)
KERNEL[1853824.600263] change   /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/bluetooth/hci0/hci0:256/0005:05AC:022C.000B/input/input39/input39::capslock (leds)
KERNEL[1853824.600314] add      /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/bluetooth/hci0/hci0:256/0005:05AC:022C.000B/input/input39/input39::scrolllock (leds)
KERNEL[1853824.600383] change   /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/bluetooth/hci0/hci0:256/0005:05AC:022C.000B/input/input39/input39::scrolllock (leds)
KERNEL[1853824.600427] add      /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/bluetooth/hci0/hci0:256/0005:05AC:022C.000B/input/input39/input39::compose (leds)
KERNEL[1853824.600472] add      /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/bluetooth/hci0/hci0:256/0005:05AC:022C.000B/input/input39/input39::kana (leds)
KERNEL[1853824.600531] change   /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/bluetooth/hci0/hci0:256/0005:05AC:022C.000B/input/input39/input39::kana (leds)
KERNEL[1853824.600596] add      /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/bluetooth/hci0/hci0:256/0005:05AC:022C.000B/input/input39/event23 (input)
KERNEL[1853824.600666] add      /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/bluetooth/hci0/hci0:256/0005:05AC:022C.000B/hidraw/hidraw1 (hidraw)
KERNEL[1853824.600764] bind     /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/bluetooth/hci0/hci0:256/0005:05AC:022C.000B (hid)
UDEV  [1853824.604045] add      /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/bluetooth/hci0/hci0:256/0005:05AC:022C.000B (hid)
UDEV  [1853824.614719] add      /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/bluetooth/hci0/hci0:256/0005:05AC:022C.000B/input/input39 (input)
UDEV  [1853824.621649] add      /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/bluetooth/hci0/hci0:256/0005:05AC:022C.000B/hidraw/hidraw1 (hidraw)
UDEV  [1853824.623228] add      /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/bluetooth/hci0/hci0:256/0005:05AC:022C.000B/input/input39/input39::numlock (leds)
UDEV  [1853824.626699] add      /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/bluetooth/hci0/hci0:256/0005:05AC:022C.000B/input/input39/input39::capslock (leds)
UDEV  [1853824.627717] add      /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/bluetooth/hci0/hci0:256/0005:05AC:022C.000B/input/input39/input39::scrolllock (leds)
UDEV  [1853824.628946] add      /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/bluetooth/hci0/hci0:256/0005:05AC:022C.000B/input/input39/input39::compose (leds)
UDEV  [1853824.630605] change   /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/bluetooth/hci0/hci0:256/0005:05AC:022C.000B/input/input39/input39::numlock (leds)
UDEV  [1853824.634616] change   /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/bluetooth/hci0/hci0:256/0005:05AC:022C.000B/input/input39/input39::capslock (leds)
UDEV  [1853824.634832] add      /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/bluetooth/hci0/hci0:256/0005:05AC:022C.000B/input/input39/input39::kana (leds)
UDEV  [1853824.635385] change   /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/bluetooth/hci0/hci0:256/0005:05AC:022C.000B/input/input39/input39::scrolllock (leds)
UDEV  [1853824.639294] change   /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/bluetooth/hci0/hci0:256/0005:05AC:022C.000B/input/input39/input39::kana (leds)
UDEV  [1853824.643561] add      /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/bluetooth/hci0/hci0:256/0005:05AC:022C.000B/power_supply/hid-20:73:00:47:91:68-battery/wakeup33 (wakeup)
UDEV  [1853824.673423] add      /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/bluetooth/hci0/hci0:256/0005:05AC:022C.000B/power_supply/hid-20:73:00:47:91:68-battery/hwmon9 (hwmon)
UDEV  [1853824.715332] add      /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/bluetooth/hci0/hci0:256/0005:05AC:022C.000B/input/input39/event23 (input)
UDEV  [1853824.716681] bind     /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/bluetooth/hci0/hci0:256/0005:05AC:022C.000B (hid)
KERNEL[1853824.719150] change   /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/bluetooth/hci0/hci0:256/0005:05AC:022C.000B/power_supply/hid-20:73:00:47:91:68-battery (power_supply)
UDEV  [1853824.759619] change   /devices/pci0000:00/0000:00:14.0/usb1/1-14/1-14:1.0/bluetooth/hci0/hci0:256/0005:05AC:022C.000B/power_supply/hid-20:73:00:47:91:68-battery (power_supply)

OSMC

KERNEL[90120.958818] add      /devices/platform/c11084c0.serial/tty/ttyS1/hci1/hci1:11 (bluetooth)                                                                                           
UDEV  [90120.963961] add      /devices/platform/c11084c0.serial/tty/ttyS1/hci1/hci1:11 (bluetooth)                                                                                           
KERNEL[90121.081474] add      /devices/platform/c11084c0.serial/tty/ttyS1/hci1/hci1:11/0005:05AC:022C.0010 (hid)                                                                             
UDEV  [90121.084272] add      /devices/platform/c11084c0.serial/tty/ttyS1/hci1/hci1:11/0005:05AC:022C.0010 (hid)                                                                             

The audio messages in the OSMC dmesg output above might be a red herring; it’s not consistently reproducible. In subsequent keyboard connection attempts, dmesg prints nothing.

The audio code listens for a udev event which might signal a USB soundcard or BT audio device connecting. But udev can’t distinguish a BT audio device from any other BT device. Hence the prints.

Starting fresh on the Debian Bullseye machine, I took a snapshot of lsmod | sort before and after pairing and connecting the Bluetooth keyboard for the first time, to find out what other kernel modules may be relevant as the Bluetooth layer is clearly working on OSMC.

I then compared the snapshots, and mapped the changes to OSMC’s kernel config. Results below.

(crypto modules are probably not relevant, but shown for completeness)

Bullseye Module    Kernel Config                     vero364
---------------    -------------------------------   ------------
bluetooth       -> CONFIG_BT                         built-in (y)
hidp            -> CONFIG_BT_HIDP                    built-in (y)
aesni_intel     -> CONFIG_CRYPTO_AES_NI_INTEL        unknown
af_alg          -> CONFIG_CRYPTO_USER_API            module (m)
algif_hash      -> CONFIG_CRYPTO_USER_API_HASH       module (m)
algif_skcipher  -> CONFIG_CRYPTO_USER_API_SKCIPHER   module (m)
cmac            -> CONFIG_CRYPTO_CMAC                built-in (y)
cryptd          -> CONFIG_CRYPTO_CRYPTD              built-in (y)
hid             -> CONFIG_HID                        built-in (y)
hid_apple       -> CONFIG_HID_APPLE                  is not set
evdev           -> CONFIG_INPUT_EVDEV                built-in (y)

The missing CONFIG_HID_APPLE strikes me as the likely culprit, given the aforementioned dmesg output where it works:

apple 0005:05AC:022C.0006: input,hidraw1: BLUETOOTH HID v0.01 Keyboard [Anker A7721] on 74:70:fd:c1:f2:5e

Using git blame I traced this back to October 2020 when Vero4K switched to the 4.9 kernel.

-+CONFIG_HID_APPLE=y
++# CONFIG_HID_APPLE is not set

I’d appreciate a sanity check on these findings, but it would seem the OP was likely right: support for these devices broke with the Nov.2020 (or thereabouts) update.

I suggest the “Special HID drivers” configuration be synchronized with Debian.

I managed to build my own OSMC kernel to verify the above. The patch below was the only change:

diff --git a/package/kernel-osmc/patches/vero364-000-add-kernel-config.patch b/package/kernel-osmc/patches/vero364-000-add-kernel-config.patch
index b712311d1..384eef51b 100644
--- a/package/kernel-osmc/patches/vero364-000-add-kernel-config.patch
+++ b/package/kernel-osmc/patches/vero364-000-add-kernel-config.patch
@@ -3998,7 +3998,7 @@
 +#
 +# CONFIG_HID_A4TECH is not set
 +# CONFIG_HID_ACRUX is not set
-+# CONFIG_HID_APPLE is not set
++CONFIG_HID_APPLE=m
 +# CONFIG_HID_APPLEIR is not set
 +# CONFIG_HID_AUREAL is not set
 +# CONFIG_HID_BELKIN is not set

This was enough to get my Bluetooth keyboard working properly again on OSMC.

Upon keyboard connection I observed similar dmesg messages as on Debian Bullseye:

[ 4995.356412] input: Anker A7721 as /devices/platform/c11084c0.serial/tty/ttyS1/hci1/hci1:12/0005:05AC:022C.0002/input/input7
[ 4995.360911] apple 0005:05AC:022C.0002: input,hidraw1: BLUETOOTH HID v0.01 Keyboard [Anker A7721] on cc:4b:73:78:6e:93

Tagging @sam_nazarko for awareness. I’m happy to develop this into a pull request for all platforms but need guidance on scope. Would you prefer to synchronize HID drivers with Debian as suggested above or cherry-pick individual drivers by user request?

Thanks for sorting that. I think Sam normally prefers to include as few drivers as possible to minimise bloat.

Hi Matthew,

Thanks for confirming that this solved the problem for you.
I got hit hard by coronavirus a couple of days ago so haven’t been doing much the last couple of days but did make a note to re-visit this thread.

I’ve updated the kernel config here:

and it will be in the staging repository shortly.

Let’s just pick the Apple HID driver for now and add any more on a case by case basis.

Cheers

Sam

Sounds good. Thanks and get well soon!