Posts by Cygn

    Hey there,

    I try to get my AVR's remote to control kodi. Onkyo TX-L20D.

    CEC is enabled on both sides, and kodi.log as well as cec-client show keypress events from the remote [complete log here].

    Code
    ...
    2021-04-29 01:38:03.764 T:1501246336   DEBUG: CecLogMessage - >> 51:44:44
    2021-04-29 01:38:03.764 T:1501246336   DEBUG: CecLogMessage - SetCurrentButton play (44) D:0ms cur:44
    2021-04-29 01:38:03.764 T:1501246336   DEBUG: CecLogMessage - key pressed: play (44) current(ff) duration(0)
    ...

    But kodi does not register those apparently. Nothing happens :(

    I've tried to generate a custom keymap xml with keymap editor extension, but it doesn't seem to get the key presses too.

    What I'm missing?

    What exactly is hardcoded? Because It should set correct device based on it's name with using evtest program.

    My problem was that when exporting TSLIB_TSDEVICE as /dev/input/eventN (hardcoded in ts_env or autodetected) it didn't survive turning the screen off and on. eventN changes, ts_uinput hangs or dies when the dev dissapears, and had to be manually tinkered to restart properly. udev automates all these: symlinking TSLIB_TSDEVICE=/dev/touchscreen to correct eventN and start/stopping the service on plug-unplug.

    (By the way, thx a lot for this neat piece of work, I was brooding on how to make this screen work on LE until I found this)

    Hey folks,

    Not a help request: I've kind of made automatic detection work as well as hotplugging. Mine is a"D-WAV Ltd eGalax TouchScreen" as reported by lsusb. But instructions should work for other devices, eventually with a bit of tweaking.This is how it goes; and requires that you managed to install and calibrate the extension first.

    I was buggered that hardcoding /dev/input/eventX in ts_env.sh went wrong especially when I've plugged in other devices, or when I turn off and back on the touchscreen. So I've setup udev and systemd to make the work. Bear with me:

    in /storage/.kodi/userdata/addon_data/service.touchscreen/ts_env.sh set the TSLIB_TSDEVICE to /dev/touchscreen:

    Code
    export TSLIB_TSDEVICE="/dev/touchscreen"

    Create a udev rule as /storage/.config/udev.rules.d/90-touchscreen.rules

    Code
    KERNEL=="event*", SUBSYSTEM=="input", ATTRS{name}=="*Touchscreen*|*touchscreen*|*TOUCHSCREEN*", SYMLINK+="touchscreen", TAG+="systemd", ENV{SYSTEMD_ALIAS}="/dev/touchscreen", ENV{SYSTEMD_WANTS}="service.touchscreen.service"

    Attention, no line breaks! Hopefully your device reports itself as Touchscreen (eGalax does) but you may need to change ATTRS{name} bit.

    You can verify the rule by checking if /dev/touchscreen gets created when you plug in the screen (or turn it on). Oh: its udevadm control --reload-rules to apply your fresh rule. And you can dig ATTRS{name} with udevadm info --attribute-walk /dev/input/eventX if you need it.

    Last part, we'll hook this to systemd service so it get started and stopped with the device. Edit /storage/.config/system.d/service.touchscreen.service and add at the end of [Unit] section:

    Code
    [Unit]
    ...
    BindsTo=dev-touchscreen.device
    After=dev-touchscreen.device

    apply changes with systemctl daemon-reload

    And voilà! Your device should now be autodetected and recalibrated on hotplug.

    Hope this is helpful to some :)