Forum

Full Version: Trouble getting lircd to work as expected, also is something else handling IR input?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Thank you.

Could you please guide me a little bit further?


Now here I present you the output of my kodi debug log:

Code:
#Pressed key UP and then DOWN, these are working correctly,

2020-06-04 19:19:17.023 T:2963271888   DEBUG: CLibInputKeyboard::ProcessKey - using delay: 500ms repeat: 125ms
2020-06-04 19:19:17.023 T:2693779664   DEBUG: Thread Timer start, auto delete: false
2020-06-04 19:19:17.031 T:2983550240   DEBUG: Keyboard: scancode: 0x67, sym: 0x0111, unicode: 0x0000, modifier: 0x0
2020-06-04 19:19:17.031 T:2983550240   DEBUG: HandleKey: up (0xf080) pressed, action is up
2020-06-04 19:19:17.263 T:2693779664   DEBUG: Thread Timer 2693779664 terminating
2020-06-04 19:19:17.264 T:2983550240   DEBUG: Keyboard: scancode: 0x67, sym: 0x0111, unicode: 0x0000, modifier: 0x0

2020-06-04 19:19:19.527 T:2963271888   DEBUG: CLibInputKeyboard::ProcessKey - using delay: 500ms repeat: 125ms
2020-06-04 19:19:19.527 T:2983550240   DEBUG: Keyboard: scancode: 0x6c, sym: 0x0112, unicode: 0x0000, modifier: 0x0
2020-06-04 19:19:19.527 T:2693779664   DEBUG: Thread Timer start, auto delete: false
2020-06-04 19:19:19.527 T:2983550240   DEBUG: HandleKey: down (0xf081) pressed, action is down
2020-06-04 19:19:19.763 T:2693779664   DEBUG: Thread Timer 2693779664 terminating
2020-06-04 19:19:19.766 T:2983550240   DEBUG: Keyboard: scancode: 0x6c, sym: 0x0112, unicode: 0x0000, modifier: 0x0


Code:
#Pressed OK key. The action is apparetly "go back" which is not what I want the OK key to be doing...

2020-06-04 19:25:24.207 T:2983550240   DEBUG: Keyboard: scancode: 0x00, sym: 0x0000, unicode: 0x0000, modifier: 0x0
2020-06-04 19:25:24.208 T:2983550240   DEBUG: GetActionCode: Trying Hardy keycode for 0xf200
2020-06-04 19:25:24.208 T:2983550240   DEBUG: Previous line repeats 1 times.
2020-06-04 19:25:24.208 T:2983550240   DEBUG: HandleKey: long-0 (0x100f200, obc-16838913) pressed, action is back
2020-06-04 19:25:24.208 T:2983550240   DEBUG: CGUIWindowManager::PreviousWindow: Deactivate
2020-06-04 19:25:24.428 T:2983550240   DEBUG: Keyboard: scancode: 0x00, sym: 0x0000, unicode: 0x0000, modifier: 0x0


Code:
#then there is a lot of keys, whose all apparentely do action "go back"

2020-06-04 19:31:38.017 T:2983550240   DEBUG: Previous line repeats 1 times.
2020-06-04 19:31:38.017 T:2983550240   DEBUG: GetActionCode: Trying Hardy keycode for 0xf200
2020-06-04 19:31:38.017 T:2983550240   DEBUG: Previous line repeats 1 times.
2020-06-04 19:31:38.018 T:2983550240   DEBUG: HandleKey: long-0 (0x100f200, obc-16838913) pressed, action is back
2020-06-04 19:31:38.018 T:2983550240   DEBUG: CGUIWindowManager::PreviousWindow: Deactivate
2020-06-04 19:31:38.263 T:2983550240   DEBUG: Keyboard: scancode: 0x00, sym: 0x0000, unicode: 0x0000, modifier: 0x0

2020-06-04 19:31:39.775 T:2983550240   DEBUG: Previous line repeats 1 times.
2020-06-04 19:31:39.776 T:2983550240   DEBUG: GetActionCode: Trying Hardy keycode for 0xf200
2020-06-04 19:31:39.776 T:2983550240   DEBUG: Previous line repeats 1 times.
2020-06-04 19:31:39.776 T:2983550240   DEBUG: HandleKey: long-0 (0x100f200, obc-16838913) pressed, action is back
2020-06-04 19:31:39.776 T:2983550240   DEBUG: CGUIWindowManager::PreviousWindow: Deactivate
2020-06-04 19:31:40.006 T:2983550240   DEBUG: Keyboard: scancode: 0x00, sym: 0x0000, unicode: 0x0000, modifier: 0x0

2020-06-04 19:31:41.502 T:2983550240   DEBUG: Previous line repeats 1 times.
2020-06-04 19:31:41.502 T:2983550240   DEBUG: GetActionCode: Trying Hardy keycode for 0xf200
2020-06-04 19:31:41.502 T:2983550240   DEBUG: Previous line repeats 1 times.
2020-06-04 19:31:41.502 T:2983550240   DEBUG: HandleKey: long-0 (0x100f200, obc-16838913) pressed, action is back
2020-06-04 19:31:41.502 T:2983550240   DEBUG: CGUIWindowManager::PreviousWindow: Deactivate
2020-06-04 19:31:41.735 T:2983550240   DEBUG: Keyboard: scancode: 0x00, sym: 0x0000, unicode: 0x0000, modifier: 0x0

2020-06-04 19:31:43.667 T:2983550240   DEBUG: Previous line repeats 1 times.
2020-06-04 19:31:43.667 T:2983550240   DEBUG: GetActionCode: Trying Hardy keycode for 0xf200
2020-06-04 19:31:43.667 T:2983550240   DEBUG: Previous line repeats 1 times.
2020-06-04 19:31:43.667 T:2983550240   DEBUG: HandleKey: long-0 (0x100f200, obc-16838913) pressed, action is back
2020-06-04 19:31:43.667 T:2983550240   DEBUG: CGUIWindowManager::PreviousWindow: Deactivate
2020-06-04 19:31:43.900 T:2983550240   DEBUG: Keyboard: scancode: 0x00, sym: 0x0000, unicode: 0x0000, modifier: 0x0

2020-06-04 19:31:44.923 T:2983550240   DEBUG: Previous line repeats 1 times.
2020-06-04 19:31:44.924 T:2983550240   DEBUG: GetActionCode: Trying Hardy keycode for 0xf200
2020-06-04 19:31:44.924 T:2983550240   DEBUG: Previous line repeats 1 times.
2020-06-04 19:31:44.924 T:2983550240   DEBUG: HandleKey: long-0 (0x100f200, obc-16838913) pressed, action is back
2020-06-04 19:31:44.924 T:2983550240   DEBUG: CGUIWindowManager::PreviousWindow: Deactivate
2020-06-04 19:31:45.165 T:2983550240   DEBUG: Keyboard: scancode: 0x00, sym: 0x0000, unicode: 0x0000, modifier: 0x0

#These were keys 1, 2, 3, 4, 5 (on remoteĀ“s keypad), and all of their action is "go back"



Code:
#lastly, there are keys that I assigned action to with the help of "keymap editor" add-on, rewind, forward and ACTUAL "go back" key.


2020-06-04 19:35:09.751 T:2963271888   DEBUG: CLibInputKeyboard::ProcessKey - using delay: 500ms repeat: 125ms
2020-06-04 19:35:09.751 T:2693779664   DEBUG: Thread Timer start, auto delete: false
2020-06-04 19:35:09.763 T:2983550240   DEBUG: Keyboard: scancode: 0xa8, sym: 0x00ba, unicode: 0x0000, modifier: 0x0
2020-06-04 19:35:09.763 T:2983550240   DEBUG: HandleKey: rewind (0xf0c4) pressed, action is rewind
2020-06-04 19:35:09.987 T:2693779664   DEBUG: Thread Timer 2693779664 terminating
2020-06-04 19:35:09.993 T:2983550240   DEBUG: Keyboard: scancode: 0xa8, sym: 0x00ba, unicode: 0x0000, modifier: 0x0

2020-06-04 19:35:11.171 T:2963271888   DEBUG: CLibInputKeyboard::ProcessKey - using delay: 500ms repeat: 125ms
2020-06-04 19:35:11.171 T:2693779664   DEBUG: Thread Timer start, auto delete: false
2020-06-04 19:35:11.179 T:2983550240   DEBUG: Keyboard: scancode: 0xd0, sym: 0x00bb, unicode: 0x0000, modifier: 0x0
2020-06-04 19:35:11.180 T:2983550240   DEBUG: HandleKey: fastforward (0xf0c5) pressed, action is fastforward
2020-06-04 19:35:11.411 T:2693779664   DEBUG: Thread Timer 2693779664 terminating
2020-06-04 19:35:11.422 T:2983550240   DEBUG: Keyboard: scancode: 0xd0, sym: 0x00bb, unicode: 0x0000, modifier: 0x0

2020-06-04 19:35:13.487 T:2963271888   DEBUG: CLibInputKeyboard::ProcessKey - using delay: 500ms repeat: 125ms
2020-06-04 19:35:13.487 T:2693779664   DEBUG: Thread Timer start, auto delete: false
2020-06-04 19:35:13.495 T:2983550240   DEBUG: Keyboard: scancode: 0xae, sym: 0x0000, unicode: 0x0000, modifier: 0x0
2020-06-04 19:35:13.495 T:2983550240   DEBUG: GetActionCode: Trying Hardy keycode for 0xf200
2020-06-04 19:35:13.495 T:2983550240   DEBUG: Previous line repeats 1 times.
2020-06-04 19:35:13.495 T:2983550240   DEBUG: HandleKey: 0 (0xf200, obc-61697) pressed, action is back
2020-06-04 19:35:13.495 T:2983550240   DEBUG: CGUIWindowManager::PreviousWindow: Deactivate
2020-06-04 19:35:13.727 T:2693779664   DEBUG: Thread Timer 2693779664 terminating
2020-06-04 19:35:13.729 T:2983550240   DEBUG: Keyboard: scancode: 0xae, sym: 0x0000, unicode: 0x0000, modifier: 0x0


So, I supose I could manually map out the keys on my remote using keymap editor addon, for forward and rewind it worked flawlessly, but for key "OK", no matter to what action I assign it, it always does "go back", so it looks like some other keymap catches it earlier, with wrong action. It isnt obvious for me, what map contains mapping for these keys, that all do "go back", and I cant assign otherwise using keymap editor (I can, but it has no effect).

So, do you have any Idea as what to do next? Would it be possible to simply disable all keymaps so only the user defined one is used so there are no conflicts other maps catching keys earlier?
Something is wrong, kernel sends 0 as keycode, that is definitely an invalid code

Code:
2020-06-04 19:25:24.207 T:2983550240   DEBUG: Keyboard: scancode: 0x00, sym: 0x0000, unicode: 0x0000, modifier: 0x0
2020-06-04 19:25:24.208 T:2983550240   DEBUG: GetActionCode: Trying Hardy keycode for 0xf200
2020-06-04 19:25:24.208 T:2983550240   DEBUG: Previous line repeats 1 times.

So, either the the ir protocol is wrong or the used keytable or the rc sends garbage, no idea since you're always so sparing with information, I can only guess

So, please install evtest package and run it:

Terminal

root@kmxbilr2 /lib/udev/rc_keymaps # sudo evtest
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0: HID 05a4:9881
/dev/input/event1: HID 05a4:9881 Mouse
/dev/input/event2: HID 05a4:9881 Consumer Control
/dev/input/event3: HID 05a4:9881 System Control
/dev/input/event4: Logitech USB Receiver
/dev/input/event5: Logitech USB Receiver Consumer Control
/dev/input/event6: Logitech USB Receiver System Control
/dev/input/event7: Dell USB Keyboard
/dev/input/event8: gpio_ir_recv
Select the device event number [0-8]: 2
Input driver version is 1.0.1
Input device ID: bus 0x3 vendor 0x5a4 product 0x9881 version 0x110
Input device name: "HID 05a4:9881 Consumer Control"
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
Event code 113 (KEY_MUTE)
Event code 114 (KEY_VOLUMEDOWN)
Event code 115 (KEY_VOLUMEUP)
Event code 128 (KEY_STOP)
Event code 140 (KEY_CALC)
Event code 144 (KEY_FILE)
Event code 155 (KEY_MAIL)
Event code 156 (KEY_BOOKMARKS)
Event code 158 (KEY_BACK)
Event code 159 (KEY_FORWARD)
Event code 163 (KEY_NEXTSONG)
Event code 164 (KEY_PLAYPAUSE)
Event code 165 (KEY_PREVIOUSSONG)
Event code 166 (KEY_STOPCD)
Event code 171 (KEY_CONFIG)
Event code 172 (KEY_HOMEPAGE)
Event code 173 (KEY_REFRESH)
Event code 209 (KEY_BASSBOOST)
Event code 217 (KEY_SEARCH)
Event code 240 (KEY_UNKNOWN)
Event type 4 (EV_MSC)
Event code 4 (MSC_SCAN)
Properties:
Testing ... (interrupt to exit)
Event: time 1591360694.706580, type 4 (EV_MSC), code 4 (MSC_SCAN), value c00cd
Event: time 1591360694.706580, type 1 (EV_KEY), code 164 (KEY_PLAYPAUSE), value 1
Event: time 1591360694.706580, -------------- SYN_REPORT ------------
Event: time 1591360694.706630, type 1 (EV_KEY), code 164 (KEY_PLAYPAUSE), value 0
Event: time 1591360694.706630, -------------- SYN_REPORT ------------
Event: time 1591360014.383399, type 4 (EV_MSC), code 4 (MSC_SCAN), value 7004f
Event: time 1591360014.383399, type 1 (EV_KEY), code 106 (KEY_RIGHT), value 1
Event: time 1591360014.383399, -------------- SYN_REPORT ------------
Event: time 1591360014.511393, type 4 (EV_MSC), code 4 (MSC_SCAN), value 7004f
Event: time 1591360014.511393, type 1 (EV_KEY), code 106 (KEY_RIGHT), value 0
root@kmxbilr2 /lib/udev/rc_keymaps #

this is what Kodi gets:

Code:
Jun  5 14:44:54 kmxbilr2 2020-06-05 14:44:54.707 T:7438    DEBUG <general>: Keyboard: scancode: 0x6a, sym: 0x0113, unicode: 0x0000, modifier: 0x0
Jun  5 14:44:54 kmxbilr2 2020-06-05 14:44:54.708 T:7438    DEBUG <general>: HandleKey: right (0xf083) pressed, action is Right

So, you can see that (EV_KEY), code 164 is the relevant information, Kodi gets scancode: 0x6a for this button (0x6a == 106)

and look if every button sends an individual scan code (MSC_SCAN) and an individual key code (EV_KEY)
I have exactly the same problem as Msprg. My RC worked fine until kernel linux-image-bcm2836 4.14.102+-1555993600 from Debian Stretch. With newer kernels some keys on the RC did not work (i guess it's related to "IR decoding with BPF" as described in https://lwn.net/Articles/759188/ ). I stood on the 4.14 kernel for quite a long time, but finally wanted to update to Buster. Since the upgrade did not work as expected I reinstalled Xbian from scratch, and now I have a quite clean Buster system.

Since the kernel decoding doesn't seem to work correctly with my remote i tried to use LIRC again. First of all you have to install a missing library (see errors in /var/log/upstart/lirc.log):

# apt install libusb-0.1-4

Also make sure that lircd is started in xbian-config.

Now all keys work, but... some keys cause duplicate events. It seems that all key presses are reported via LIRC, and some are also reported via the kernel interface. So I guess I have to deactivate the kernel decoding. I have to investigate how this can be done...
(16th Jun, 2020 05:22 PM)hge Wrote: [ -> ][...]

Now all keys work, but... some keys cause duplicate events. It seems that all key presses are reported via LIRC, and some are also reported via the kernel interface. So I guess I have to deactivate the kernel decoding. I have to investigate how this can be done...

Very interesting Idea

Maybe deactivating kernel protocol via ir-keytable and just keeping lirc as protocol active may help
(16th Jun, 2020 08:17 PM)Nachteule Wrote: [ -> ][...]
Maybe deactivating kernel protocol via ir-keytable and just keeping lirc as protocol active may help

Thank for the hint! "ir-keytable --protocol=lirc" did the trick:

Code:
# ir-keytable --read
...
Enabled kernel protocols: lirc rc-6

Code:
# ir-keytable --protocol=lirc
Protocols changed to lirc

Code:
# ir-keytable --read
...
Enabled kernel protocols: lirc

The RC now works perfectly!

I made this permanent with

Code:
# echo "@reboot root sleep 5 && ir-keytable --protocol=lirc > /dev/null 2>&1" > /etc/cron.d/ir-keytable_lirc_only && reboot

...but I guess there is a more elegant method as well...
Okay I ghosted you for a... few months... I was just frustrated with it and needed a break.

So, currently, I am in the position where ir-keytable -t appears to register every key on the remote appropriately, evtest also throws correct actions, at least it seems like it, but when I use plugin keymap editor in kodi, to assign keys on remote to the appropriate actions, I have problem where keys such as Left arrow, Right arrow, Up, down, are working ok, and they have different codes in the keymap editor as they should have.


But then there are keys such as OK, Info, ChUp, ChDown, and others that produce same keycode in keymap editor, I have no idea why.

Also I tried ir-keytable --protocol=lirc but then my remote doesn't work at all. On the other side, using rc-6 remote works... the same as without specifying protocol.


Terminal
root@xbian:/home/xbian# ir-keytable --read
#Omitted output...
Enabled kernel protocols: lirc rc-6



Here I am pressing up, down, left, right, then OK, info, ChUp and ChDown. They seem to be recognized correctly here:
Terminal
root@xbian:/home/xbian# ir-keytable -t
Testing events. Please, press CTRL-C to abort.
2222.844022: lirc protocol(rc6_mce): scancode = 0x800f041e
2222.844043: event type EV_MSC(0x04): scancode = 0x800f041e
2222.844043: event type EV_KEY(0x01) key_down: KEY_UP(0x0067)
2222.844043: event type EV_SYN(0x00).
2222.976019: event type EV_KEY(0x01) key_up: KEY_UP(0x0067)
2222.976019: event type EV_SYN(0x00).
2223.864035: lirc protocol(rc6_mce): scancode = 0x800f041f toggle=1
2223.864051: event type EV_MSC(0x04): scancode = 0x800f041f
2223.864051: event type EV_KEY(0x01) key_down: KEY_DOWN(0x006c)
2223.864051: event type EV_SYN(0x00).
2223.996028: event type EV_KEY(0x01) key_up: KEY_DOWN(0x006c)
2223.996028: event type EV_SYN(0x00).
2224.672032: lirc protocol(rc6_mce): scancode = 0x800f0420
2224.672046: event type EV_MSC(0x04): scancode = 0x800f0420
2224.672046: event type EV_KEY(0x01) key_down: KEY_LEFT(0x0069)
2224.672046: event type EV_SYN(0x00).
2224.776037: lirc protocol(rc6_mce): scancode = 0x800f0420
2224.776047: event type EV_MSC(0x04): scancode = 0x800f0420
2224.776047: event type EV_SYN(0x00).
2224.908015: event type EV_KEY(0x01) key_up: KEY_LEFT(0x0069)
2224.908015: event type EV_SYN(0x00).
2225.432034: lirc protocol(rc6_mce): scancode = 0x800f0421 toggle=1
2225.432050: event type EV_MSC(0x04): scancode = 0x800f0421
2225.432050: event type EV_KEY(0x01) key_down: KEY_RIGHT(0x006a)
2225.432050: event type EV_SYN(0x00).
2225.540020: lirc protocol(rc6_mce): scancode = 0x800f0421 toggle=1
2225.540032: event type EV_MSC(0x04): scancode = 0x800f0421
2225.540032: event type EV_SYN(0x00).
2225.672015: event type EV_KEY(0x01) key_up: KEY_RIGHT(0x006a)
2225.672015: event type EV_SYN(0x00).
2229.568033: lirc protocol(rc6_mce): scancode = 0x800f0422
2229.568047: event type EV_MSC(0x04): scancode = 0x800f0422
2229.568047: event type EV_KEY(0x01) key_down: KEY_OK(0x0160)
2229.568047: event type EV_SYN(0x00).
2229.676021: lirc protocol(rc6_mce): scancode = 0x800f0422
2229.676033: event type EV_MSC(0x04): scancode = 0x800f0422
2229.676033: event type EV_SYN(0x00).
2229.808015: event type EV_KEY(0x01) key_up: KEY_OK(0x0160)
2229.808015: event type EV_SYN(0x00).
2233.440025: lirc protocol(rc6_mce): scancode = 0x800f040f toggle=1
2233.440044: event type EV_MSC(0x04): scancode = 0x800f040f
2233.440044: event type EV_KEY(0x01) key_down: KEY_INFO(0x0166)
2233.440044: event type EV_SYN(0x00).
2233.544028: lirc protocol(rc6_mce): scancode = 0x800f040f toggle=1
2233.544041: event type EV_MSC(0x04): scancode = 0x800f040f
2233.544041: event type EV_SYN(0x00).
2233.676015: event type EV_KEY(0x01) key_up: KEY_INFO(0x0166)
2233.676015: event type EV_SYN(0x00).
2235.720026: lirc protocol(rc6_mce): scancode = 0x800f0412
2235.720042: event type EV_MSC(0x04): scancode = 0x800f0412
2235.720042: event type EV_KEY(0x01) key_down: KEY_CHANNELUP(0x0192)
2235.720042: event type EV_SYN(0x00).
2235.828020: lirc protocol(rc6_mce): scancode = 0x800f0412
2235.828032: event type EV_MSC(0x04): scancode = 0x800f0412
2235.828032: event type EV_SYN(0x00).
2235.960017: event type EV_KEY(0x01) key_up: KEY_CHANNELUP(0x0192)
2235.960017: event type EV_SYN(0x00).
2236.564027: lirc protocol(rc6_mce): scancode = 0x800f0413 toggle=1
2236.564043: event type EV_MSC(0x04): scancode = 0x800f0413
2236.564043: event type EV_KEY(0x01) key_down: KEY_CHANNELDOWN(0x0193)
2236.564043: event type EV_SYN(0x00).
2236.672021: lirc protocol(rc6_mce): scancode = 0x800f0413 toggle=1
2236.672033: event type EV_MSC(0x04): scancode = 0x800f0413
2236.672033: event type EV_SYN(0x00).
2236.804013: event type EV_KEY(0x01) key_up: KEY_CHANNELDOWN(0x0193)
2236.804013: event type EV_SYN(0x00).


Same keys here: up, down, left, right, then OK, info, ChUp and ChDown. Again, they seem to be recognized correctly in evtest as well:
Terminal
root@xbian:/home/xbian# evtest
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0: Trust Wireless Keyboard & Mouse
/dev/input/event1: Trust Wireless Keyboard & Mouse
/dev/input/event2: Trust Wireless Keyboard & Mouse Consumer Control
/dev/input/event3: Trust Wireless Keyboard & Mouse System Control
/dev/input/event4: Trust Wireless Keyboard & Mouse
/dev/input/event5: gpio_ir_recv
Select the device event number [0-5]: 5
Input driver version is 1.0.1
Input device ID: bus 0x19 vendor 0x1 product 0x1 version 0x100
Input device name: "gpio_ir_recv"
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
Event code 28 (KEY_ENTER)
Event code 103 (KEY_UP)
Event code 105 (KEY_LEFT)
Event code 106 (KEY_RIGHT)
Event code 108 (KEY_DOWN)
Event code 111 (KEY_DELETE)
Event code 113 (KEY_MUTE)
Event code 114 (KEY_VOLUMEDOWN)
Event code 115 (KEY_VOLUMEUP)
Event code 119 (KEY_PAUSE)
Event code 128 (KEY_STOP)
Event code 142 (KEY_SLEEP)
Event code 161 (KEY_EJECTCD)
Event code 164 (KEY_PLAYPAUSE)
Event code 167 (KEY_RECORD)
Event code 168 (KEY_REWIND)
Event code 174 (KEY_EXIT)
Event code 207 (KEY_PLAY)
Event code 208 (KEY_FASTFORWARD)
Event code 210 (KEY_PRINT)
Event code 212 (KEY_CAMERA)
Event code 224 (KEY_BRIGHTNESSDOWN)
Event code 225 (KEY_BRIGHTNESSUP)
Event code 226 (KEY_MEDIA)
Event code 352 (KEY_OK)
Event code 356 (KEY_POWER2)
Event code 358 (KEY_INFO)
Event code 365 (KEY_EPG)
Event code 366 (KEY_PVR)
Event code 368 (KEY_LANGUAGE)
Event code 369 (KEY_TITLE)
Event code 370 (KEY_SUBTITLE)
Event code 372 (KEY_ZOOM)
Event code 373 (KEY_MODE)
Event code 377 (KEY_TV)
Event code 385 (KEY_RADIO)
Event code 386 (KEY_TUNER)
Event code 387 (KEY_PLAYER)
Event code 389 (KEY_DVD)
Event code 392 (KEY_AUDIO)
Event code 393 (KEY_VIDEO)
Event code 398 (KEY_RED)
Event code 399 (KEY_GREEN)
Event code 400 (KEY_YELLOW)
Event code 401 (KEY_BLUE)
Event code 402 (KEY_CHANNELUP)
Event code 403 (KEY_CHANNELDOWN)
Event code 407 (KEY_NEXT)
Event code 412 (KEY_PREVIOUS)
Event code 425 (KEY_PRESENTATION)
Event code 430 (KEY_MESSENGER)
Event code 512 (KEY_NUMERIC_0)
Event code 513 (KEY_NUMERIC_1)
Event code 514 (KEY_NUMERIC_2)
Event code 515 (KEY_NUMERIC_3)
Event code 516 (KEY_NUMERIC_4)
Event code 517 (KEY_NUMERIC_5)
Event code 518 (KEY_NUMERIC_6)
Event code 519 (KEY_NUMERIC_7)
Event code 520 (KEY_NUMERIC_8)
Event code 521 (KEY_NUMERIC_9)
Event code 522 (KEY_NUMERIC_STAR)
Event code 523 (KEY_NUMERIC_POUND)
Event type 2 (EV_REL)
Event code 0 (REL_X)
Event code 1 (REL_Y)
Event type 4 (EV_MSC)
Event code 4 (MSC_SCAN)
Key repeat handling:
Repeat type 20 (EV_REP)
Repeat code 0 (REP_DELAY)
Value 500
Repeat code 1 (REP_PERIOD)
Value 125
Properties:
Property type 5 (INPUT_PROP_POINTING_STICK)
Testing ... (interrupt to exit)
Event: time 1599393018.880436, type 4 (EV_MSC), code 4 (MSC_SCAN), value 800f041e
Event: time 1599393018.880436, type 1 (EV_KEY), code 103 (KEY_UP), value 1
Event: time 1599393018.880436, -------------- SYN_REPORT ------------
Event: time 1599393018.988422, type 4 (EV_MSC), code 4 (MSC_SCAN), value 800f041e
Event: time 1599393018.988422, -------------- SYN_REPORT ------------
Event: time 1599393019.120407, type 1 (EV_KEY), code 103 (KEY_UP), value 0
Event: time 1599393019.120407, -------------- SYN_REPORT ------------
Event: time 1599393019.808435, type 4 (EV_MSC), code 4 (MSC_SCAN), value 800f041f
Event: time 1599393019.808435, type 1 (EV_KEY), code 108 (KEY_DOWN), value 1
Event: time 1599393019.808435, -------------- SYN_REPORT ------------
Event: time 1599393019.916422, type 4 (EV_MSC), code 4 (MSC_SCAN), value 800f041f
Event: time 1599393019.916422, -------------- SYN_REPORT ------------
Event: time 1599393020.048406, type 1 (EV_KEY), code 108 (KEY_DOWN), value 0
Event: time 1599393020.048406, -------------- SYN_REPORT ------------
Event: time 1599393021.028437, type 4 (EV_MSC), code 4 (MSC_SCAN), value 800f0420
Event: time 1599393021.028437, type 1 (EV_KEY), code 105 (KEY_LEFT), value 1
Event: time 1599393021.028437, -------------- SYN_REPORT ------------
Event: time 1599393021.136426, type 4 (EV_MSC), code 4 (MSC_SCAN), value 800f0420
Event: time 1599393021.136426, -------------- SYN_REPORT ------------
Event: time 1599393021.268407, type 1 (EV_KEY), code 105 (KEY_LEFT), value 0
Event: time 1599393021.268407, -------------- SYN_REPORT ------------
Event: time 1599393021.712425, type 4 (EV_MSC), code 4 (MSC_SCAN), value 800f0421
Event: time 1599393021.712425, type 1 (EV_KEY), code 106 (KEY_RIGHT), value 1
Event: time 1599393021.712425, -------------- SYN_REPORT ------------
Event: time 1599393021.816428, type 4 (EV_MSC), code 4 (MSC_SCAN), value 800f0421
Event: time 1599393021.816428, -------------- SYN_REPORT ------------
Event: time 1599393021.948407, type 1 (EV_KEY), code 106 (KEY_RIGHT), value 0
Event: time 1599393021.948407, -------------- SYN_REPORT ------------
Event: time 1599393022.408424, type 4 (EV_MSC), code 4 (MSC_SCAN), value 800f0422
Event: time 1599393022.408424, type 1 (EV_KEY), code 352 (KEY_OK), value 1
Event: time 1599393022.408424, -------------- SYN_REPORT ------------
Event: time 1599393022.512424, type 4 (EV_MSC), code 4 (MSC_SCAN), value 800f0422
Event: time 1599393022.512424, -------------- SYN_REPORT ------------
Event: time 1599393022.644406, type 1 (EV_KEY), code 352 (KEY_OK), value 0
Event: time 1599393022.644406, -------------- SYN_REPORT ------------
Event: time 1599393023.244428, type 4 (EV_MSC), code 4 (MSC_SCAN), value 800f040f
Event: time 1599393023.244428, type 1 (EV_KEY), code 358 (KEY_INFO), value 1
Event: time 1599393023.244428, -------------- SYN_REPORT ------------
Event: time 1599393023.348428, type 4 (EV_MSC), code 4 (MSC_SCAN), value 800f040f
Event: time 1599393023.348428, -------------- SYN_REPORT ------------
Event: time 1599393023.480405, type 1 (EV_KEY), code 358 (KEY_INFO), value 0
Event: time 1599393023.480405, -------------- SYN_REPORT ------------
Event: time 1599393025.672427, type 4 (EV_MSC), code 4 (MSC_SCAN), value 800f0412
Event: time 1599393025.672427, type 1 (EV_KEY), code 402 (KEY_CHANNELUP), value 1
Event: time 1599393025.672427, -------------- SYN_REPORT ------------
Event: time 1599393025.776430, type 4 (EV_MSC), code 4 (MSC_SCAN), value 800f0412
Event: time 1599393025.776430, -------------- SYN_REPORT ------------
Event: time 1599393025.908407, type 1 (EV_KEY), code 402 (KEY_CHANNELUP), value 0
Event: time 1599393025.908407, -------------- SYN_REPORT ------------
Event: time 1599393026.520424, type 4 (EV_MSC), code 4 (MSC_SCAN), value 800f0413
Event: time 1599393026.520424, type 1 (EV_KEY), code 403 (KEY_CHANNELDOWN), value 1
Event: time 1599393026.520424, -------------- SYN_REPORT ------------
Event: time 1599393026.624427, type 4 (EV_MSC), code 4 (MSC_SCAN), value 800f0413
Event: time 1599393026.624427, -------------- SYN_REPORT ------------
Event: time 1599393026.756409, type 1 (EV_KEY), code 403 (KEY_CHANNELDOWN), value 0
Event: time 1599393026.756409, -------------- SYN_REPORT ------------
^C



Yet again: up, down, left, right, then OK, info, ChUp and ChDown keys were pressed during logging:

Terminal
root@xbian:/home/xbian# tail -f /home/xbian/.kodi/temp/kodi.log
2020-09-06 12:00:34.769 T:2963271888 DEBUG: CLibInputKeyboard::ProcessKey - using delay: 500ms repeat: 125ms
2020-09-06 12:00:34.769 T:2611998928 DEBUG: Thread Timer start, auto delete: false
2020-09-06 12:00:34.774 T:2984017184 DEBUG: Keyboard: scancode: 0x67, sym: 0x0111, unicode: 0x0000, modifier: 0x0
2020-09-06 12:00:34.774 T:2984017184 DEBUG: HandleKey: up (0xf080) pressed, action is up
2020-09-06 12:00:34.901 T:2611998928 DEBUG: Thread Timer 2611998928 terminating
2020-09-06 12:00:34.901 T:2984017184 DEBUG: Keyboard: scancode: 0x67, sym: 0x0111, unicode: 0x0000, modifier: 0x0


2020-09-06 12:00:38.485 T:2963271888 DEBUG: CLibInputKeyboard::ProcessKey - using delay: 500ms repeat: 125ms
2020-09-06 12:00:38.485 T:2611998928 DEBUG: Thread Timer start, auto delete: false
2020-09-06 12:00:38.518 T:2984017184 DEBUG: Keyboard: scancode: 0x6c, sym: 0x0112, unicode: 0x0000, modifier: 0x0
2020-09-06 12:00:38.518 T:2984017184 DEBUG: HandleKey: down (0xf081) pressed, action is down
2020-09-06 12:00:38.721 T:2611998928 DEBUG: Thread Timer 2611998928 terminating
2020-09-06 12:00:38.751 T:2984017184 DEBUG: Keyboard: scancode: 0x6c, sym: 0x0112, unicode: 0x0000, modifier: 0x0


2020-09-06 12:00:40.629 T:2963271888 DEBUG: CLibInputKeyboard::ProcessKey - using delay: 500ms repeat: 125ms
2020-09-06 12:00:40.629 T:2611998928 DEBUG: Thread Timer start, auto delete: false
2020-09-06 12:00:40.630 T:2984017184 DEBUG: Keyboard: scancode: 0x69, sym: 0x0114, unicode: 0x0000, modifier: 0x0
2020-09-06 12:00:40.631 T:2984017184 DEBUG: HandleKey: left (0xf082) pressed, action is left
2020-09-06 12:00:40.873 T:2611998928 DEBUG: Thread Timer 2611998928 terminating
2020-09-06 12:00:40.874 T:2984017184 DEBUG: Keyboard: scancode: 0x69, sym: 0x0114, unicode: 0x0000, modifier: 0x0


2020-09-06 12:00:42.429 T:2963271888 DEBUG: CLibInputKeyboard::ProcessKey - using delay: 500ms repeat: 125ms
2020-09-06 12:00:42.429 T:2611998928 DEBUG: Thread Timer start, auto delete: false
2020-09-06 12:00:42.439 T:2984017184 DEBUG: Keyboard: scancode: 0x6a, sym: 0x0113, unicode: 0x0000, modifier: 0x0
2020-09-06 12:00:42.439 T:2984017184 DEBUG: HandleKey: right (0xf083) pressed, action is right
2020-09-06 12:00:42.669 T:2611998928 DEBUG: Thread Timer 2611998928 terminating
2020-09-06 12:00:42.701 T:2984017184 DEBUG: Keyboard: scancode: 0x6a, sym: 0x0113, unicode: 0x0000, modifier: 0x0


2020-09-06 12:00:57.701 T:2984017184 DEBUG: Keyboard: scancode: 0x00, sym: 0x0000, unicode: 0x0000, modifier: 0x0
2020-09-06 12:00:57.701 T:2984017184 DEBUG: GetActionCode: Trying Hardy keycode for 0xf200
2020-09-06 12:00:57.701 T:2984017184 DEBUG: Previous line repeats 1 times.
2020-09-06 12:00:57.701 T:2984017184 DEBUG: HandleKey: long-0 (0x100f200, obc-16838913) pressed, action is previousmenu
2020-09-06 12:00:57.701 T:2984017184 DEBUG: CGUIWindowManager::PreviousWindow: Deactivate
2020-09-06 12:00:58.041 T:2984017184 DEBUG: Keyboard: scancode: 0x00, sym: 0x0000, unicode: 0x0000, modifier: 0x0


2020-09-06 12:01:03.965 T:2984017184 DEBUG: Previous line repeats 1 times.
2020-09-06 12:01:03.965 T:2984017184 DEBUG: GetActionCode: Trying Hardy keycode for 0xf200
2020-09-06 12:01:03.965 T:2984017184 DEBUG: Previous line repeats 1 times.
2020-09-06 12:01:03.965 T:2984017184 DEBUG: HandleKey: long-0 (0x100f200, obc-16838913) pressed, action is previousmenu
2020-09-06 12:01:03.965 T:2984017184 DEBUG: CGUIWindowManager::PreviousWindow: Deactivate
2020-09-06 12:01:04.301 T:2984017184 DEBUG: Keyboard: scancode: 0x00, sym: 0x0000, unicode: 0x0000, modifier: 0x0


2020-09-06 12:01:06.622 T:2984017184 DEBUG: Previous line repeats 1 times.
2020-09-06 12:01:06.622 T:2984017184 DEBUG: GetActionCode: Trying Hardy keycode for 0xf200
2020-09-06 12:01:06.622 T:2984017184 DEBUG: Previous line repeats 1 times.
2020-09-06 12:01:06.623 T:2984017184 DEBUG: HandleKey: long-0 (0x100f200, obc-16838913) pressed, action is previousmenu
2020-09-06 12:01:06.623 T:2984017184 DEBUG: CGUIWindowManager::PreviousWindow: Deactivate
2020-09-06 12:01:06.977 T:2984017184 DEBUG: Keyboard: scancode: 0x00, sym: 0x0000, unicode: 0x0000, modifier: 0x0


2020-09-06 12:01:10.253 T:2984017184 DEBUG: Previous line repeats 1 times.
2020-09-06 12:01:10.253 T:2984017184 DEBUG: GetActionCode: Trying Hardy keycode for 0xf200
2020-09-06 12:01:10.253 T:2984017184 DEBUG: Previous line repeats 1 times.
2020-09-06 12:01:10.253 T:2984017184 DEBUG: HandleKey: long-0 (0x100f200, obc-16838913) pressed, action is previousmenu
2020-09-06 12:01:10.253 T:2984017184 DEBUG: CGUIWindowManager::PreviousWindow: Deactivate
2020-09-06 12:01:10.518 T:2984017184 DEBUG: Keyboard: scancode: 0x00, sym: 0x0000, unicode: 0x0000, modifier: 0x0
So for keys such as OK, info, Chup, ChDown is kodi getting scancode (and basically all other values) 0x0 .
I have no idea what's happening here...
I've been trying to set up my own keymaps as well, but they never seemed to have any effect on the outcome, I supose I am doing something wrong...
Don't know what to do now...



(BTW I also seem to have broken APT though I have no idea how that happenedSmile
Code:
root@xbian:/home/xbian# apt update
Get:1 http://deb.debian.org/debian buster InRelease [122 kB]
0% [Connecting to xbian-apt.mirrorservice.org]terminate called after throwing an instance of 'std::out_of_range'
  what():  basic_string::substr: __pos (which is 34) > this->size() (which is 33)
Aborted
root@xbian:/home/xbian# cat /etc/apt/sources.list
deb http://deb.debian.org/debian buster main non-free
root@xbian:/home/xbian# cat /etc/apt/sources.list.d/xbian.list
deb http://apt.xbian.org/      stable  main rpi2-buster    rpi2-buster    armv7l-buster
### deb http://apt.xbian.org/  staging main rpi2-buster    rpi2-buster    armv7l-buster
### deb http://apt.xbian.org/  devel   main rpi2-buster    rpi2-buster    armv7l-buster
root@xbian:/home/xbian# cat /etc/apt/sources.list.d/pilight.list
deb mirror://apt.pilight.org/mirror.txt stable main
root@xbian:/home/xbian#
@Msprg
I am sorry, but I have neither the time nor the desire to think about your problem again (!) after 2 months Undecided
I fully understand. Anyways, it turned out to be a "bug" in kodi, somewhere, where there are too few values for key events (I think it was 255 - that is, unsigned byte), so a lot of keys that are "out of range" of that byte in kodi, end up as 0x0000, so they're all treated like the same 0x0000 key - they are in fact indistinguishable for the following kodi procedures.
https://github.com/xbmc/xbmc/issues/16834
One way was to manually change type to integer or some like so, and build it yourself, but at that point, I just refused to be setting up build environment, and trying to build kodi in my free time, next 3 weeks... Another way was to change scan codes that gpio-ir was sending to system, but, again, I had no clue how to do that and was too tired and demotivated.

I haven't checked yet, but it seems that new kodi are being released around this time, so I have tiny little hope, that this was fixed - at least for anyone attempting to do same as me. (the issue is still opened though...) So, yes. Here is the reason I failed, Thank you thought, that you was willing to guide me through at least this point. At least, I learned some new things along the way...

Maybe another time...
Thanks for the information. Yes, of course this may be that the problem is directly in Kodi
Pages: 1 2
Reference URL's