Posts by HiassofT

    Kodi already supports context-specific keymapping. For example to map up/down on the navigation wheel to volume-up/down when visualization/full-screen music or full-screen video is playing you can use add the following block (between </global> and </keymap>) to keymap.xml:

    The main reasons for dropping atvclient is that it didn't really work perfect and was constantly causing issues over the past few years. And as no one on the team is using an Apple IR remote testing and fixing was rather cumbersome.


    As in the meanwhile the Apple IR receiver is perfectly supported by the linux kernel and with kodi keymap configuration people have a far more flexible possibility to map and configure the remote the decision to drop atvclient wasn't a really hard one - as a better alternative to it exists.


    I'm a bit undecided if we should route it through eventlircd (like a few other remotes) by default, the pro of that would be that you could use the navigation wheel to navigate through the menus OOTB, but you'd also loose the possibility to use longpress mappings - which some users prefer to have on low-button-count remotes like the Apple one.


    so long,


    Hias

    Good to know that navigation works now!


    How did you previously (with atvclient) get volume up/down?


    With keyboard input in kodi (which is how the remote is recognized/setup at the moment) you can assign separate functions to long-pressing a button.


    eg to get volume-up/down when long-pressing up/down add the following 2 lines after the volume_up / down entires in your keymap:

    Code
    1. <volume_up mod="longpress">VolumeUp</volume_up>
    2. <volume_down mod="longpress">VolumeDown</volume_down>


    PS: forget about lirc, it's not needed and you would loose longpress support in kodi.


    so long,


    Hias

    Thanks for the info!


    The info on the kodi wiki page looks a bit outdated. Please try with this keymap instead:

    This maps the "menu" button on the remote to "Back" (something in kodi's "menu" key handling doesn't look quite right, therefore I had to use the id variant), long-pressing on the center return/OK/select button will bring up the context menu (that's the default action in kodi, so it's not listed in the keymap above).


    so long,


    Hias

    First install the System Tools addon (from the LibreELEC repository, in the section "Programs") and enable debug logging in kodi. Then reboot.


    Now press up/down/left/right/OK buttons (plus any other buttons on the remote) and observe if they trigger some obvious functions in kodi.


    Then ssh into LE and run the following commands and post the output:

    Code
    1. systemctl stop kodi
    2. systemctl stop eventlircd
    3. paste .kodi/temp/kodi.log
    4. journalctl -a | paste
    5. lsusb


    Then run

    Code
    1. evtest

    and choose the event device number of the Apple IR receiver (it should have appleir or something similar in it's description. evtest will then output some info, ignore that.


    Now press all of the buttons, one after the other. You should see some lines like

    Code
    1. Event: time 1565859742.121362, type 4 (EV_MSC), code 4 (MSC_SCAN), value c00e9
    2. Event: time 1565859742.121362, type 1 (EV_KEY), code 115 (KEY_VOLUMEUP), value 1
    3. Event: time 1565859742.121362, -------------- SYN_REPORT ------------
    4. Event: time 1565859742.137362, type 4 (EV_MSC), code 4 (MSC_SCAN), value c00e9
    5. Event: time 1565859742.137362, type 1 (EV_KEY), code 115 (KEY_VOLUMEUP), value 0
    6. Event: time 1565859742.137362, -------------- SYN_REPORT ------------

    for each button press. Post that output here, too.


    so long,


    Hias

    atvclient has been dropped in LibreELEC master and 9.2 because it was constantly causing troubles.


    The remote should be supported by the linux kernel, but probably the buttons need to be remapped - the hid-appleir kernel driver sends volume-up/down and back/forward when you press the navigation keys.


    Please post dmesg, lsusb and journal from LE 9.1.002 and a kodi debug log where you pressed the various buttons on the remote - this should allow us to create a proper default config for the remote.


    so long,


    Hias

    This is due to an upstream kernel change, previously the mce keyboard events were sent from a separate linux input device, with recent kernels they are sent from the standard rc core input device - and the events are routed through eventlircd (so normal keyboard handling is semi-broken in kodi).


    You can disable routing through eventlircd by creating an empty 98-eventlircd.rules udev rules file:

    Code
    1. : > /storage/.config/udev.rules.d/98-eventlircd.rules


    This will re-establish keyboard functionality with mce_kbd but also means IR remote events (eg from an MCE remote) will show up as keyboard events in kodi and several buttons like KEY_OK won't work anymore.


    This can be solved quite easily, as you are already use a custom rc keymap just change the non working keycodes in it (eg use KEY_ENTER instead of KEY_OK).


    so long,


    Hias

    Actually this is more of a Kodi thing than a Linux one. keyboard.xml is one of Kodi's configuration files where user settings are stored.


    Kodi first loads it's default configuration files (from /usr/share/kodi/system) and then the user config files (from /storage/.kod/userdata). The user config files can add new key mappings or override existing ones - we are doing the latter here, the default mapping for the power button is ActivateWindow(ShutdownMenu) - which brings up the shutdown menu.


    For more details have a look at the Kodi wiki: Keymap - Official Kodi Wiki


    PS: you can also change keyboard mapping with the "Keymap Editor" addon, but personally I find it a bit cumbersome to use. Creating the config files manually with an editor (nano or vi) isn't much more complicated, you see all changes you made without having to navigate through tons of submenus in the addon, and is even more flexible as you are not restricted to the functions/mappings the addon knows about.


    so long,


    Hias

    You need to create a /storage/.kodi/userdata/keymaps/keyboard.xml file with the following contents:

    Code
    1. <keymap>
    2. <global>
    3. <keyboard>
    4. <power>ShutDown()</power>
    5. </keyboard>
    6. </global>
    7. </keymap>

    The default kodi configuration is to show the shutdown menu.


    so long,


    Hias

    I was wondering if you could enable support for gpio-fan overlay on Raspberry Pi images, since both the 3B+ and 4B would benefit from it.

    Ah, yes, that makes sense. I though we already had the gpio-fan driver enabled, but at a closer look we only enabled the fan driver for the RPi POE HAT.


    I've added the config change to the LE9.2 kernel update PR so it should be included in LE 9.1.003

    linux (RPi) update to 4.19.58+ by HiassofT · Pull Request #3696 · LibreELEC/LibreELEC.tv · GitHub


    so long,


    Hias

    If you stuck your RPi somewhere in the back of your TV/shelf/... try connecting the receiver with a ~1m USB extension cable and place it somewhere in the front of the TV - so there's nothing (metal) between the keyboard and the receiver that might block RF.


    so long,


    Hias

    The interesting line in your dmesg is this one, 2 minutes after system startup:

    Code
    1. [ 121.582064] logitech-hidpp-device 0003:046D:400E.0004: HID++ 2.0 device connected.


    I can get this on my RPi4, too, when I switch the keyboard off and then back on.


    So it very much looks like the Logitech unifying receiver lost the connection to your keyboard and then reconnects. This can be for a number of reasons - RF interference, keyboard switched off/on, keyboard too far away from receiver or receiver shielded by some metal etc.


    Not much we can do about it, you have to check for these things in your setup.


    BTW: A couple of years ago I had connection issues with the unifying receiver plugged directly into one of the back USB ports of my PC (with metal case). Using the ~5cm adapter that shipped with it was enough to cure these. Problem in this case was the metal case shielded the receiver. So if in doubt always use the adapter.


    so long,


    Hias

    I just noticed that the latest RPi firmware contains a fix for 1366x768 mode - see bug discussion here rpi4 hdmi not working with motorola atrix lapdock · Issue #1202 · raspberrypi/firmware · GitHub


    Testing with that might be worth a try (drop hdmi_drive/group/mode from config.txt and only keep hdmi_force_hotplug=1). Use the following commands to update to the latest firmware:


    Code
    1. mount -o remount,rw /flash
    2. wget -O /flash/start.elf https://github.com/raspberrypi/firmware/raw/master/boot/start4x.elf
    3. wget -O /flash/fixup.dat https://github.com/raspberrypi/firmware/raw/master/boot/fixup4x.dat


    so long,


    Hias

    Edit the cmdline.txt file on the FAT partition of the SD card and add "ssh" (after "quiet", with a space between) - ths will enable ssh. You can do this from Windows, but make sure you use an editor that uses unix line endings, like Notepad++


    Then ssh in and post the outputs of the following commands

    Code
    1. journalctl -a | pastebinit
    2. tvservice -s
    3. tvservice -m CEA
    4. tvservice -m DMT
    5. pastebinit .kodi/temp/kodi.log


    BTW: Do you see the LibreELEC splash screen when the system starts or is the screen scrambled from the beginning?


    so long,


    Hias