OSMC Remote V1 Ubuntu 20.04 Mythtv

Hi, I have the 4k and I think v1 remote (rf/ff) and would like to use it on Ubuntu 20.04 for Mythtv and upgrade the one for 4k.

I’ve followed the previous questions on 20.10, 18.04 and it works except for some of the lower keys not generating any codes irw/evtest. I think I’ve narrowed it down to the wrong event.

/dev/input/event4: HBGIC Technology Co., Ltd. USB Keyboard Mouse
/dev/input/event5: HBGIC Technology Co., Ltd. USB Keyboard Mouse
/dev/input/event6: HBGIC Technology Co., Ltd. USB Keyboard Mouse Consumer Control
/dev/input/event7: HBGIC Technology Co., Ltd. USB Keyboard Mouse System Control

Event 6 is the one which seems to generate on all key presses.
I’ve tried the various /etc/udev/hwdb.d/osmcrf.hwdb scripts with no luck.

No biggie but if anyone has done this before and has any tips, much appreciated.

Does it work on the Vero 4K (to rule out HW issue)?

Hi Sam, yes it works perfectly on 4k, just missing some buttons on Ubuntu.

Have you read: OSMC remote with Ubuntu 20.10?

This might help.

Thanks Sam, tried that with no luck. I’ll maybe start over, don’t want to take up your time on this as it’s not OSMC.

Could you share the full text of running evtest and pressing all the buttons. Also what did you use for the hwdb file contents and did you make sure they were formatted correctly and checked the file permission as I noted in that thread Sam linked to?

Hi Darwindesign, thanks for replying, I had followed your previous posts on 20.10. Here’s wher I’m at:

Devices

dev/input/event4:      HBGIC Technology Co., Ltd. USB Keyboard Mouse
/dev/input/event5:      HBGIC Technology Co., Ltd. USB Keyboard Mouse
/dev/input/event6:      HBGIC Technology Co., Ltd. USB Keyboard Mouse Consumer Control
/dev/input/event7:      HBGIC Technology Co., Ltd. USB Keyboard Mouse System Control

Dev4

Event: time 1644513262.526452, type 4 (EV_MSC), code 4 (MSC_SCAN), value 7004a
Event: time 1644513262.526452, type 1 (EV_KEY), code 1 (KEY_ESC), value 1
Event: time 1644513262.526452, -------------- SYN_REPORT ------------
Event: time 1644513262.534168, type 4 (EV_MSC), code 4 (MSC_SCAN), value 7004a
Event: time 1644513262.534168, type 1 (EV_KEY), code 1 (KEY_ESC), value 0
Event: time 1644513262.534168, -------------- SYN_REPORT ------------
^[(Event: time 1644513268.523747, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70050
Event: time 1644513268.523747, type 1 (EV_KEY), code 105 (KEY_LEFT), value 1
Event: time 1644513268.523747, -------------- SYN_REPORT ------------
^[[DEvent: time 1644513268.571257, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70050
Event: time 1644513268.571257, type 1 (EV_KEY), code 105 (KEY_LEFT), value 0
Event: time 1644513268.571257, -------------- SYN_REPORT ------------
Event: time 1644513269.605860, type 4 (EV_MSC), code 4 (MSC_SCAN), value 7004f
Event: time 1644513269.605860, type 1 (EV_KEY), code 106 (KEY_RIGHT), value 1
Event: time 1644513269.605860, -------------- SYN_REPORT ------------
^[[CEvent: time 1644513269.677141, type 4 (EV_MSC), code 4 (MSC_SCAN), value 7004f
Event: time 1644513269.677141, type 1 (EV_KEY), code 106 (KEY_RIGHT), value 0
Event: time 1644513269.677141, -------------- SYN_REPORT ------------
Event: time 1644513272.675363, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70052
Event: time 1644513272.675363, type 1 (EV_KEY), code 103 (KEY_UP), value 1
Event: time 1644513272.675363, -------------- SYN_REPORT ------------
^[[AEvent: time 1644513272.746919, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70052
Event: time 1644513272.746919, type 1 (EV_KEY), code 103 (KEY_UP), value 0
Event: time 1644513272.746919, -------------- SYN_REPORT ------------
Event: time 1644513273.462682, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70051
Event: time 1644513273.462682, type 1 (EV_KEY), code 108 (KEY_DOWN), value 1
Event: time 1644513273.462682, -------------- SYN_REPORT ------------
^[[BEvent: time 1644513273.494314, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70051
Event: time 1644513273.494314, type 1 (EV_KEY), code 108 (KEY_DOWN), value 0
Event: time 1644513273.494314, -------------- SYN_REPORT ------------
)

Dev5

^[(^[[D^[[C^[[A^[[B)

Dev6

^
[Event: time 1644513501.636851, type 4 (EV_MSC), code 4 (MSC_SCAN), value c0060
Event: time 1644513501.636851, type 1 (EV_KEY), code 179 (KEY_KPLEFTPAREN), value 1
Event: time 1644513501.636851, -------------- SYN_REPORT ------------
(Event: time 1644513501.700424, type 4 (EV_MSC), code 4 (MSC_SCAN), value c0060
Event: time 1644513501.700424, type 1 (EV_KEY), code 179 (KEY_KPLEFTPAREN), value 0
Event: time 1644513501.700424, -------------- SYN_REPORT ------------
^[[D^[[C^[[A^[[
BEvent: time 1644513508.216077, type 4 (EV_MSC), code 4 (MSC_SCAN), value c0224
Event: time 1644513508.216077, type 1 (EV_KEY), code 158 (KEY_BACK), value 1
Event: time 1644513508.216077, -------------- SYN_REPORT ------------
Event: time 1644513508.353727, type 4 (EV_MSC), code 4 (MSC_SCAN), value c0224
Event: time 1644513508.353727, type 1 (EV_KEY), code 158 (KEY_BACK), value 0
Event: time 1644513508.353727, -------------- SYN_REPORT ------------
)Event: time 1644513509.882461, type 4 (EV_MSC), code 4 (MSC_SCAN), value c00cd
Event: time 1644513509.882461, type 1 (EV_KEY), code 164 (KEY_PLAYPAUSE), value 1
Event: time 1644513509.882461, -------------- SYN_REPORT ------------
Event: time 1644513509.954940, type 4 (EV_MSC), code 4 (MSC_SCAN), value c00cd
Event: time 1644513509.954940, type 1 (EV_KEY), code 164 (KEY_PLAYPAUSE), value 0
Event: time 1644513509.954940, -------------- SYN_REPORT ------------
Event: time 1644513511.550641, type 4 (EV_MSC), code 4 (MSC_SCAN), value c0226
Event: time 1644513511.550641, type 1 (EV_KEY), code 128 (KEY_STOP), value 1
Event: time 1644513511.550641, -------------- SYN_REPORT ------------
Event: time 1644513511.574648, type 4 (EV_MSC), code 4 (MSC_SCAN), value c0226
Event: time 1644513511.574648, type 1 (EV_KEY), code 128 (KEY_STOP), value 0
Event: time 1644513511.574648, -------------- SYN_REPORT ------------
Event: time 1644513512.941527, type 4 (EV_MSC), code 4 (MSC_SCAN), value c00b4
Event: time 1644513512.941527, type 1 (EV_KEY), code 168 (KEY_REWIND), value 1
Event: time 1644513512.941527, -------------- SYN_REPORT ------------
Event: time 1644513513.013752, type 4 (EV_MSC), code 4 (MSC_SCAN), value c00b4
Event: time 1644513513.013752, type 1 (EV_KEY), code 168 (KEY_REWIND), value 0
Event: time 1644513513.013752, -------------- SYN_REPORT ------------
Event: time 1644513513.575401, type 4 (EV_MSC), code 4 (MSC_SCAN), value c00b3
Event: time 1644513513.575401, type 1 (EV_KEY), code 208 (KEY_FASTFORWARD), value 1
Event: time 1644513513.575401, -------------- SYN_REPORT ------------
Event: time 1644513513.655592, type 4 (EV_MSC), code 4 (MSC_SCAN), value c00b3
Event: time 1644513513.655592, type 1 (EV_KEY), code 208 (KEY_FASTFORWARD), value 0
Event: time 1644513513.655592, -------------- SYN_REPORT ------------

And the current hwdb (although I’ve tried them all) with chmod -x

evdev:input:b0003v2252p1069*
 KEYBOARD_KEY_7002e=volumeup
 KEYBOARD_KEY_7002d=volumedown
 KEYBOARD_KEY_7000c=kpleftparen
 KEYBOARD_KEY_70006=kprightparen

evdev:input:b0003v2017p1689*
 KEYBOARD_KEY_7002e=volumeup
 KEYBOARD_KEY_7002d=volumedown
 KEYBOARD_KEY_7000c=kpleftparen
 KEYBOARD_KEY_70006=kprightparen

evdev:input:b0003v2017p1688*
 KEYBOARD_KEY_7004a=esc
 KEYBOARD_KEY_c0060=kpleftparen
 KEYBOARD_KEY_10084=kprightparen
 KEYBOARD_KEY_7002e=volumeup
 KEYBOARD_KEY_7002d=volumedown

evdev:input:b0003v2252p1037*
 KEYBOARD_KEY_7004a=esc
 KEYBOARD_KEY_c0060=kpleftparen
 KEYBOARD_KEY_10084=kprightparen

It looks like you are remapping the keys successfully as it is registering the new mapping (ie KEY_KPLEFTPAREN) but where you are getting hung up is what key names you should be remapping the keys to. The choices your using with that hwdb are what OSMC is using to get around some language and Kodi limitations and oddities but they do not line up with something that will give you a fully working Kodi implementation which is why we have a custom Kodi keymap to straighten that out. That is why in that thread I posted a different mapping to use for Ubuntu that lines up with stock Kodi mappings…

evdev:input:b0003v2252p1037*
 KEYBOARD_KEY_7004a=esc
 KEYBOARD_KEY_c0060=i
 KEYBOARD_KEY_10084=c
 KEYBOARD_KEY_c0226=x
 KEYBOARD_KEY_c00cd=p
 KEYBOARD_KEY_c00b3=f
 KEYBOARD_KEY_c00b4=r

Since you are wanting to use the remote for another application you are probably wanting to dig up a list of keyboard shortcuts for that application and then come up with your own hwdb file. As you will notice the buttons actually show up across two of those device types and all you need to do is match up the key id listed in evtest with the key name you want it to produce instead. You only need to make it for the VID/PID of your device and not the other versions of the remote.

Ahh thats the missing link I was looking for. Will try that later, will just need to mod the myth keymapping. Thanks for your help!

1 Like

Since I think that remote has some buttons that do not work in Ubuntu without a remap it would make more sense to just find what the stock myth keyboard mappings are and reconfigure the remote to those so your only needing a single mod (the hwdb) to make the whole thing work. That is the path that I would have taken with OSMC if I could but things got complicated with keyboard language switching, dead keys, and other things that you don’t need to bother with in your use case.

Thanks for your help, all working the way I want it! :grin:
I’ll leave the /etc/udev/hwdb.d/osmcrf.hwdb here in case its useful for anyone with Mythtv.

evdev:input:b0003v2252p1037*
 KEYBOARD_KEY_7004a=esc
 KEYBOARD_KEY_c0060=i
 KEYBOARD_KEY_10084=o            #playback menu#
 KEYBOARD_KEY_c0226=d            #delete recording#
 KEYBOARD_KEY_c00cd=p 
 KEYBOARD_KEY_c00b3=f11         #vol down#
 KEYBOARD_KEY_c00b4=f10         #vol up#
 KEYBOARD_KEY_c0224=esc



2 Likes