How to get a seamless remote experience
I have the Hama Remote Mce - USB - which is also seen as Keyboard / Mouse by Ubuntu. On newer versions of Ubuntu (I now use LinuxMint 20.1 Ulyssa - Xfce and Cinnamon on different PC's), Kodi does not see the Multimedia and Power keys, at least I was not able to get this working by just editing Kodi's keymaps allone. With tail -f ~/.kodi/temp/kodi.log I see some of the events arriving from the remote, the Multmedia-Keys do not. I do not know, whether it is possible to bind Kodi directly onto a specific device, that would ease the solution.

In addition to get the Multimedia Buttons (PLAY/PAUSE/FF/RW/STOP ....) working with Kodi, the Volume Control should stay with the OS, as I need to use the Volume autogain of the sound system of PulseEffects. Kodi's volume control would work against the autogain function of the OS.

So here is the ir-remote part of my solution Kodi on Ubuntu 20.1 Xfce with Hama Remote Mce and DSP. Sorry for some overlap to previouse posts, but this gives a one in all.

Step 1 - Get the remote properly mapped to devices on Ubuntu
Code:
dmesg
gives me
Code:
usb 3-9: USB disconnect, device number 20
[27586.308750] usb 3-9: new low-speed USB device number 21 using xhci_hcd
[27586.467274] usb 3-9: New USB device found, idVendor=05a4, idProduct=9881, bcdDevice= 1.20
[27586.467279] usb 3-9: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[27586.476993] input: HID 05a4:9881 as /devices/pci0000:00/0000:00:14.0/usb3/3-9/3-9:1.0/0003:05A4:9881.0024/input/input124
[27586.540933] hid-generic 0003:05A4:9881.0 024: input,hidraw0: USB HID v1.10 Keyboard [HID 05a4:9881] on usb-0000:00:14.0-9/input0
[27586.563257] input: HID 05a4:9881 Mouse as /devices/pci0000:00/0000:00:14.0/usb3/3-9/3-9:1.1/0003:05A4:9881.0025/input/input125
[27586.563436] input: HID 05a4:9881 Consumer Control as /devices/pci0000:00/0000:00:14.0/usb3/3-9/3-9:1.1/0003:05A4:9881.0025/input/input126
[27586.620830] input: HID 05a4:9881 System Control as /devices/pci0000:00/0000:00:14.0/usb3/3-9/3-9:1.1/0003:05A4:9881.0025/input/input127
[27586.620926] hid-generic 0003:05A4:9881.0025: input,hidraw1: USB HID v1.10 Mouse [HID 05a4:9881] on usb-0000:00:14.0-9/input1

See here 2 Mouse (USB HID v1.10 Mouse, HID 05a4:9881 Mouse) - and 3 Keyboards (USB HID v1.10 Keyboard, HID 05a4:9881, Consumer Control, HID 05a4:9881 System Control)
Unfortunately, due to some naming overlap in the udev process, I only get a reduced number of symlinks in the /dev/input/by-id folder.

The HID 05a4:9881, Consumer Control gets lost - it is there as /dev/input/event5, but not in this symlink list which I could use for inputlirc otherwise.
Code:
ls -l /dev/input/by-id/ | grep 05a4
lrwxrwxrwx 1 root root 9 Feb 14 10:07 usb-05a4_9881-event-if01 -> ../event6
lrwxrwxrwx 1 root root 9 Feb 14 10:07 usb-05a4_9881-event-kbd -> ../event3
lrwxrwxrwx 1 root root 9 Feb 14 10:07 usb-05a4_9881-if01-event-mouse -> ../event4
lrwxrwxrwx 1 root root 9 Feb 14 10:07 usb-05a4_9881-if01-mouse -> ../mouse0

So we have to create our own list, fortunately this is very easy.

Create udev rule, as you can see, I use the names that have been returned by dmesg.
Code:
sudo vim /etc/udev/rules.d/10-irremote.rules
SUBSYSTEM=="input",ATTRS{name}=="HID 05a4:9881",SYMLINK+="input/irremote0"
SUBSYSTEM=="input",ATTRS{name}=="HID 05a4:9881 Mouse",SYMLINK+="input/irremote1"
SUBSYSTEM=="input",ATTRS{name}=="HID 05a4:9881 Consumer Control",SYMLINK+="input/irremote2"
SUBSYSTEM=="input",ATTRS{name}=="HID 05a4:9881 System Control",SYMLINK+="input/irremote3"
Other symlink naming would be possible and maybe better, such as SYMLINK+="input/ir-keyboard instead of SYMLINK+="input/irremote0", all config files below would need to be altered in this case to match the symlink naming.

Then trigger udev
Code:
sudo udevadm control --reload-rules
sudo udevadm trigger

If everything goes fine, I can list the new crated symlinks by
Code:
ls -l /dev/input | grep irremote

lrwxrwxrwx 1 root root 6 Feb 14 10:07 irremote0 -> event3
lrwxrwxrwx 1 root root 6 Feb 14 10:07 irremote1 -> event4
lrwxrwxrwx 1 root root 6 Feb 14 10:07 irremote2 -> event5
lrwxrwxrwx 1 root root 6 Feb 14 10:07 irremote3 -> event6

A test if multi-media-keys arrive can be done by a small application
Code:
sudo apt install evtest

sudo evtest /dev/input/irremote2

Step 2 - Install and configure inputlirc, lirc itself is not needed.
Code:
sudo apt install inputlirc

configure inputlirc
Code:
sudo vim /etc/default/inputlirc

remove everything and insert
Code:
# Options to be passed to inputlirc.
EVENTS="/dev/input/irremote*"
#-g exclusive -m 0 from message 0 -c capture modify to add shift etc, -r repeat 280 ms
#http://manpages.ubuntu.com/manpages/trusty/man8/inputlircd.8.html
OPTIONS="-g -m 0 -c -r 280"

restart inputlirc
Code:
sudo systemctl restart inputlirc

Optional - to test it or to find keycodes, irw from lirc is required. So install it and disable lirc
Code:
sudo apt install lirc
sudo systemctl disable lirc

run the test
Code:
irw

Step 3 - Configure Kodi - the following example is for the Hama Remote MCE

I use here the record button to easily come back from menu browsing to the fullscreen video and the explorer key for the powerdown menu.
 
Code:
vim ~/.kodi/userdata/Lircmap.xml

and insert
Code:
<lircmap>
<remote device="/dev/input/irremote3">
<power>KEY_SLEEP</power>
</remote>
<remote device="/dev/input/irremote2">
<play>KEY_PLAYPAUSE</play>
<stop>KEY_STOPCD</stop>
<skipplus>KEY_NEXTSONG</skipplus>
<skipminus>KEY_PREVIOUSSONG</skipminus>
<start>KEY_HOMEPAGE</start>
<volumeplus>KEY_VOLUMEUP</volumeplus>
<volumeminus>KEY_VOLUMEDOWN</volumeminus>
<mute>KEY_MUTE</mute>
</remote>
<remote device="/dev/input/irremote1">
<menu>BTN_MOUSE</menu>
<title>BTN_RIGHT</title>
</remote>
<remote device="/dev/input/irremote0">
<record>CTRL_KEY_R</record>
<reverse>CTRL_SHIFT_KEY_B</reverse>
<forward>CTRL_SHIFT_KEY_F</forward>
<left>KEY_LEFT</left>
<right>KEY_RIGHT</right>
<up>KEY_UP</up>
<down>KEY_DOWN</down>
<select>KEY_ENTER</select>
<pageplus>KEY_PAGEUP</pageplus>
<pageminus>KEY_PAGEDOWN</pageminus>
<back>KEY_BACKSPACE</back>
<info>ALT_META_KEY_ENTER</info>
<display>KEY_ESC</display>
<myvideo>CTRL_KEY_E</myvideo>
<mymusic>CTRL_KEY_M</mymusic>
<mypictures>CTRL_KEY_I</mypictures>
<mytv>CTRL_SHIFT_KEY_T</mytv>
<one>KEY_KP1</one>
<two>KEY_KP2</two>
<three>KEY_KP3</three>
<four>KEY_KP4</four>
<five>KEY_KP5</five>
<six>KEY_KP6</six>
<seven>KEY_KP7</seven>
<eight>KEY_KP8</eight>
<nine>KEY_KP9</nine>
<zero>KEY_KP0</zero>
<star>KEY_KPASTERISK</star>
<hash>ALT_KEY_KP5</hash>
<clear>CTRL_KEY_O</clear>
<teletext>CTRL_KEY_G</teletext>
<obc1>CTRL_KEY_T</obc1>
<obc3>CTRL_SHIFT_KEY_M</obc3>
<obc2>ALT_KEY_F4</obc2>
</remote>
</lircmap>0
 
Code:
vim ~/.kodi/userdata/keymaps/remote.xml
 
Code:
<keymap>
<global>
<remote>
<start>ActivateWindow(shutdownmenu)</start>
<teletext>XBMC.RunScript(service.xbmc.tts,key.ITEM_EXTRA)</teletext>
<record>FullScreen</record>
<power>Powerdown</power>
</remote>
<universalremote>
<obc1>XBMC.RunScript(service.xbmc.tts,key.REPEAT)</obc1>
<obc2>XBMC.RunScript(special://home/addons/service.xbmc.tts/enabler.py)</obc2>
<obc3>XBMC.RunScript(service.xbmc.tts,key.STOP)</obc3>
</universalremote>
</global>
<MyVideoFiles>
<remote>
<clear>Delete</clear>
</remote>
</MyVideoFiles>
<MyMusicFiles>
<remote>
<clear>Delete</clear>
</remote>
</MyMusicFiles>
<Home>
<remote>
<title>ActivateWindow(favourites)</title>
</remote>
</Home>
</keymap>

That's it for the standard setup. How to setup the OS Equalizer / Autogain and to split out the volume control might be a topic for a different post.
Reply


Messages In This Thread
[No subject] - by darkscout - 2011-06-29, 20:11
[No subject] - by LB06 - 2011-06-29, 20:27
[No subject] - by gazrat - 2011-06-30, 00:09
[No subject] - by Anastrophe - 2011-06-30, 16:48
[No subject] - by gazrat - 2011-06-30, 21:48
[No subject] - by LB06 - 2011-06-30, 22:34
[No subject] - by gazrat - 2011-07-04, 18:28
[No subject] - by LB06 - 2011-07-04, 18:59
[No subject] - by gazrat - 2011-07-04, 23:52
[No subject] - by LB06 - 2011-07-04, 23:58
[No subject] - by gazrat - 2011-07-05, 00:28
[No subject] - by LB06 - 2011-07-05, 01:17
[No subject] - by wsnipex - 2011-07-05, 09:37
[No subject] - by darkscout - 2011-07-05, 10:23
[No subject] - by LB06 - 2011-07-05, 10:37
[No subject] - by gazrat - 2011-07-05, 20:45
[No subject] - by LB06 - 2011-07-05, 22:11
[No subject] - by gazrat - 2011-07-05, 22:31
[No subject] - by LB06 - 2011-07-05, 23:10
[No subject] - by gazrat - 2011-07-05, 23:16
[No subject] - by SirHc - 2011-07-07, 22:07
Nesting actions? - by konti - 2011-07-08, 12:19
[No subject] - by SirHc - 2011-07-08, 12:45
[No subject] - by LB06 - 2011-07-08, 13:30
[No subject] - by LB06 - 2011-07-08, 13:33
[No subject] - by mason - 2011-07-08, 13:51
[No subject] - by SirHc - 2011-07-08, 20:22
[No subject] - by teeedubb - 2011-07-10, 11:47
[No subject] - by LB06 - 2011-07-10, 13:02
[No subject] - by LB06 - 2011-07-10, 13:55
[No subject] - by teeedubb - 2011-07-10, 14:10
[No subject] - by LB06 - 2011-07-10, 14:56
[No subject] - by gazrat - 2011-07-12, 19:40
[No subject] - by LB06 - 2011-07-12, 22:20
[No subject] - by blubyu - 2011-07-13, 03:03
[No subject] - by teeedubb - 2011-07-14, 05:21
[No subject] - by toliman - 2011-07-27, 14:58
[No subject] - by LB06 - 2011-07-27, 16:16
[No subject] - by Jayphen - 2011-08-24, 06:27
[No subject] - by recluce - 2011-08-24, 19:16
[No subject] - by LB06 - 2011-08-24, 19:19
[No subject] - by Jayphen - 2011-08-25, 00:42
[No subject] - by LB06 - 2011-08-25, 00:57
[No subject] - by Jayphen - 2011-08-25, 01:18
[No subject] - by recluce - 2011-08-25, 01:21
[No subject] - by LB06 - 2011-08-25, 01:27
[No subject] - by LB06 - 2011-08-25, 01:29
[No subject] - by Jayphen - 2011-08-25, 01:30
[No subject] - by LB06 - 2011-08-25, 01:31
[No subject] - by Jayphen - 2011-08-25, 01:33
[No subject] - by LB06 - 2011-08-25, 01:52
[No subject] - by recluce - 2011-08-25, 01:57
[No subject] - by Jayphen - 2011-08-25, 02:10
[No subject] - by LB06 - 2011-08-25, 10:25
[No subject] - by koekiemonster - 2011-09-15, 23:29
RE: - by GreatEmerald - 2013-03-11, 20:57
[No subject] - by stefanwa - 2011-09-20, 16:50
RE: How to get a seamless remote experience - by wastis - 2021-02-14, 12:51
Logout Mark Read Team Forum Stats Members Help
How to get a seamless remote experience9