Using TV remote to control Kodi on Pi5

  • Hi. I have installed LibreELEC 12/Kodi 21 on my Raspberry Pi 5 and connected it to my Sony TV. I tried to go through the 'new device found' setup after I connected the Pi to the TV, but because it is not a standard TV box it wouldn't go through the setup. Despite that, pretty much everything works fine and I can control Kodi using the TV remote via HDMI, apart from:
    1. Scrolling up/down in Kodi is really slow. It would seem the default button repeat rate on the remote is not very useful for scrolling through a large library. Can that be fixed?
    2. Long-press (press-and-hold) on the Select/OK button does not bring up the context menu as it should, instead it repeats the SELECT button press. Is it possible to fix that somehow, even by assigning the context menu command to another button?
    The TV remote model is RMF-TX500P and the Sony TV runs Android TV.

  • Yes, I have considered switching to FLIRC if the TV remote cannot be made to work. The OSMC remote is not sold in Australia, but some other RF remotes are available, so will look at those as well.

  • There is a solution to the long-press issue in a previous post:

    kapqa
    April 16, 2024 at 8:26 PM
  • The linked thread is correct because the TV is the receiver of the IR signals and sends a button code (the duration info seems not parsed or reliable) to the RPi5 via CEC.

    Technically possible, but I don't expect this behavior on a TV:
    If the TV interprets the buttons based on how long they were held down, it may be sending a different CEC button code.

    The important part regarding the breaking change seems the Android/Google TV generation. Previous generations of SONY TVs are able to passthrough the tuning and menu keys to CEC, if you configure this in the Bravia Sync settings for external inputs.
    After switching to a newer TV of the same brand, I'm facing for the issue, that the menu keys and some other keys aren't passthrough anymore. Before it was possible to use the channel-up/down keys to navigate page wise through long listings. Now it's possible to open an additional menu for HDMI via info key and send a CEC command in behalf of the TV, but this key was also usable before directly.

    My workaround is currently to move one step to right in the movie list to focus the scroll bar and move then with the cursor keys to jump to the next page(s) faster.

    If this, that you meant with slow scrolling, perhaps you should map one of the color keys to the channel-up/down function. If not, you can only try to play a little bit with the CEC settings at System -> Input -> Peripherals.

    To check which keys are going passthrough via CEC with your TV, you can stop KODI and use the cec-client command.

    • Stop KODI
      systemctl stop kodi
    • Start the CEC-client
      cec-client
    • Press the keys on your remote control step by step and write down a list of all available keys. Here an example for cursor right:

      Code
      DEBUG:   [          189968]     SetCurrentButton right (4) D:0ms cur:17f
      DEBUG:   [          189968]     key pressed: right (4) current(ff) duration(0)
    • Stop the cec-client process with CTRL-C
    • Start KODI again
      systemctl start kodi

    With that information you can make then the changes like you want to the keymap file.

    EDIT:
    I played a little bit with the settings (System -> Input -> Peripherals -> CEC Adapter) and could clarify 2 things:

    • Set „Remote button press repeat rate (ms)“ to 100ms fixes the „slow“ repeat rate compared to a IR remote control.
      Reducing "Remote button press delay before repeating (ms)" to 200 makes it even faster to switch in repeat mode (scrolling), but could be make some trouble if there is "longpress" support in the future.
    • It‘s important to switch the TV to the HDMI sub input/device -> "Kodi HDMI 1 Player" not only "HDMI 1" to get the tuning and number keys to work.

    Edited 7 times, last by HarryH (May 27, 2024 at 10:00 PM).

  • Thanks Harry. I don't seem to have a menu item System -> Input on my Sony TV. I did find a menu item to pass through the Tuning Keys via CEC and have now mapped Next Letter and Previous Letter to those Channel Down/Up to speed up scrolling, which helps a lot. I have also mapped the context menu to the Red key on the remote. That's good enough for me :)