Hwdb file only works for select button

I’m trying to map a Tivo Stream 4K remote for use on an Ugoos AM6B+ under CoreELEC 21.0, but it’s not working for any button but the select button.

cat /proc/bus/input/devices

I: Bus=0005 Vendor=0471 Product=1207 Version=0110
N: Name="TiVo Remote"
P: Phys=c0:f5:35:0e:2d:4f
S: Sysfs=/devices/virtual/misc/uhid/0005:0471:1207.0009/input/input8
U: Uniq=ac:eb:51:08:91:ca
H: Handlers=sysrq kbd leds event8 
B: PROP=0
B: EV=12001f
B: KEY=3f 3007f 0 0 0 0 483ffff 17aff32d bf544446 0 0 1 130ff3 8b17c007 ffff7bfa d9415fff ffbeffdf ffefffff ffffffff fffffffe
B: REL=c0
B: ABS=101 0
B: MSC=10
B: LED=1f
evtest /dev/input/event8

Input driver version is 1.0.1
Input device ID: bus 0x5 vendor 0x471 product 0x1207 version 0x110
Input device name: "TiVo Remote"
Supported events:
...

*Press Select Key*
Event: time 1712643414.772952, type 4 (EV_MSC), code 4 (MSC_SCAN), value c0041
Event: time 1712643414.772952, type 1 (EV_KEY), code 28 (KEY_ENTER), value 1
Event: time 1712643414.772952, -------------- SYN_REPORT ------------
Event: time 1712643414.874782, type 4 (EV_MSC), code 4 (MSC_SCAN), value c0041
Event: time 1712643414.874782, type 1 (EV_KEY), code 28 (KEY_ENTER), value 0
Event: time 1712643414.874782, -------------- SYN_REPORT ------------

*Press Neflix key*
Event: time 1712643577.450678, type 4 (EV_MSC), code 4 (MSC_SCAN), value c01c8
Event: time 1712643577.450678, type 1 (EV_KEY), code 240 (KEY_UNKNOWN), value 1
Event: time 1712643577.450678, -------------- SYN_REPORT ------------
Event: time 1712643577.552032, type 4 (EV_MSC), code 4 (MSC_SCAN), value c01c8
Event: time 1712643577.552032, type 1 (EV_KEY), code 240 (KEY_UNKNOWN), value 0
Event: time 1712643577.552032, -------------- SYN_REPORT ------------

Edit /storage/.config/hwdb/99-tivo.hwdb

#Tivo Stream 4k Remote
evdev:input:b0005v0471p1207*
 KEYBOARD_KEY_c0041=enter
 KEYBOARD_KEY_c01c8=enter

udevadm hwdb --update
udevadm trigger -s input
reboot

Result is select key works, netflix key does nothing. Trying to remap channel up/down, “i”, tivo button, etc. all don’t work either.

With kodi debug logging on pushing the netflix keys gives

2024-04-08 23:22:19.657 T:5319    debug <general>: Keyboard: scancode: 0xf0, sym: 0x00, unicode: 0x00, modifier: 0x0
2024-04-08 23:22:19.657 T:5319    debug <general>: GetActionCode: Trying Hardy keycode for 0xf200
2024-04-08 23:22:19.657 T:5319     info <general>: Skipped 3 duplicate messages..
2024-04-08 23:22:19.657 T:5319    debug <general>: HandleKey: 0 (0xf200, obc-61697) pressed, window 10000, action is 
2024-04-08 23:22:19.750 T:5319    debug <general>: Keyboard: scancode: 0xf0, sym: 0x00, unicode: 0x00, modifier: 0x0

systemd-analyze cat-config udev/hwdb.d shows the entries from the .hwdb file have been read. And the select key working says it’s been read too as it doesn’t work without the hwdb file.

So what am I doing wrong for all the other keys that they aren’t getting mapped to whatever I map them to?

If key is not recognized then you need to add it like it is done for enter key.

Press Select Key
Event: time 1712643414.772952, type 4 (EV_MSC), code 4 (MSC_SCAN), value c0041

KEYBOARD_KEY_c0041=enter
Press Neflix key
Event: time 1712643577.450678, type 4 (EV_MSC), code 4 (MSC_SCAN), value c01c8

KEYBOARD_KEY_c01c8=some_other_name

some_other_name from xbmc/xbmc/input/actions/ActionTranslator.cpp at 60c450005472e6d38929bb28c07d00589102818d · xbmc/xbmc · GitHub

Yes I did add it, in this example as a second enter key.

#Tivo Stream 4k Remote
evdev:input:b0005v0471p1207*
 KEYBOARD_KEY_c0041=enter
 KEYBOARD_KEY_c01c8=enter

I’ve assigned to other keys like o, c, 1, etc. None of the assignments do anything for any key other assigning KEYBOARD_KEY_c0041=enter. And nor does it work if I only make one assignment assigning netflix to enter and leaving select unassigned. So it’s not like it’s a problem with defining the mapping of more than one button (as a different single button fails) nor assigning multiple buttons to the say key as I’m doing here. It just won’t assign a key for KEYBOARD_KEY_CODE other than CODE=c0041.

I’m completely confused.

Yes, i missed you already add it.

And when you don’t have support for this remote (part with evdev:input:b0005v0471p1207*) does enter key works or not?

And what happens if you remove line KEYBOARD_KEY_c0041? Does other key then works or still not?

Also check the lines you added like remove trailing spaces at the end of lines and use only space and not tab in front of a key line.

No the select button does not work as an enter key in Kodi w/o the KEYBOARD_KEY_c0041=enter and removing it does not make the line below it work either.

As I said having one mapping or many mappings whether to the same or different (output) keys doesn’t work except the select key can be mapped to enter.

No trailing spaces at end of lines. A space in front not a tab. No extra blank line at the bottom either. Although I had a bunch of comments holding potential future keys at the bottom and their being there did not change the behavior.

I don’t have any more ideas. It should jsut work like that :tm:

Does evtest still reports KEY_UNKNOWN even with added line in hwdb file?

But now I see you wrote above filen path /storage/.config/hwdb/99-tivo.hwdb - is there hwdb or hwdb.d? Because it must be latter.

Sorry that was a typo in the post. The file’s actual location is /storage/.config/hwdb.d/99-tivo.hwdb

evtest still reports KEY_UNKNOWN for the netflix key, but again KEY_ENTER for the select key (which I believe without the hwdb file is KEY_SELECT).

So it’s seeing the change for the select key but ignores it for all the others. And that’s why I’m confused.

Strange behaviour.

Can you post url for command after reboot

journalctl -l | paste

Also try

#Tivo Stream 4k Remote
evdev:name:TiVo Remote:*
 KEYBOARD_KEY_c0041=enter
 KEYBOARD_KEY_c01c8=enter

I remapped all the keys to enter using the name:TiVo Remote. Some of them other than select work now. I hadn’t tried assigning them all to enter before. But ch up/dn, guide, “i”, input, and netflix all still don’t work. “skip” is never registered not even in evtest.

Here is the bootlog.

https://paste.coreelec.org/nM36OZ

Ok, just retested with everything assigned to “c” (context menu) and back to evdev:input:b0005v0471p1207*. The same set of keys that worked before are still working after a reboot.

I don’t think assigning them to things from xbmc/xbmc/input/actions/ActionTranslator.cpp at 60c450005472e6d38929bb28c07d00589102818d · xbmc/xbmc · GitHub is right, but instead they should map to system key names. For example if I put in contextmenu the keys don’t remap, but if I put in c, which by default is mapped to contextmenu, it works. One the keys that actually work of course.

Yes, names are from this linux file linux-amlogic/include/uapi/linux/input-event-codes.h at amlogic-5.4.210 · CoreELEC/linux-amlogic · GitHub.