The adventures of LibreElec and a really old IR remote..

  • So yes, I am very much aware I'm using ancient hardware, but I want to at least try to find a way to make this work before I just give up. A little background first: I've been using the really old original Xbox DVD dongle for years, ever since I first made the move from XMBC on the Xbox to XBMC on Ubuntu. It was the hardware I had available and I just kept using it. I kept it when I moved to OpenElec and then to LibreElec. However, on both OE and LE I had to add some custom files to make it work right. It would always work, as in the buttons respond, but there was this awful lag and then rapid button reaction. (I.E. If I press left 3 times quickly, it would move left once - pause - move left about 4 spaces, always more than I pressed it). Some way smarter people than me figured out that you needed a file named "lirc.conf" in "storage/.config/" that has this:

    And it was specifically the "gap" number that needed to be adjusted for this issue. Now I'm no expert on any of this, I could absolutely be wrong, I was just following a guide that was posted on the OE forums that fixed my issue. It did also mention using lirc_xbox which the wiki mentioned was not added to LE 9.x so maybe that's an issue as well?

    The problem I'm having now, is using the file above, I'm able to use this remote on LE 8.x without an issue, but when I move to LE 9.x I start having that same lag and rapid button press reaction again. Only now I have no idea what to do or how to fix it. The remote does technically work and all buttons are recognized and doing the proper command, but how do I stop the rapid button press issue?

    Thank you to anyone who can help me, and I am very sorry for wasting any time on ancient hardware!

  • If you are using LE on RPi or x86 just delete the lircd.conf file - kernel 4.19 ships with a driver for the old Xbox DVD remote/dongle so it should work fine out of the box.

    so long,

    Hias

  • I have problems with my MCE Remote as well. It worked fine for years but since updating to LE9.0.1 (clean install) it has problems with te power button. I can not correctly wake up from suspend. Is there a way to revert back to lirc, and not use the build-in linux driver ?

  • So after lots of trials and errors, and installing LE multiple times to confirm it's not a bad install, I'm still having the same issue. Yes the device does technically work out of the box like HiassofT mentioned, but it does not work well. The device is recognized and it does interpret button presses, but there are a few issues using it. Like I mentioned in my original post, if I press any button multiple times quickly, it'll register one press, pause and then rapidly trigger most of the other presses (not all of them, so it's kind of impossible to guess a reaction).

    All of this is done on a clean untouched install of LE 9.0.1 with no addons installed. Is there anything that can be done?

    Meganiekje You could try using a keymap editor and assign the key manually? I've had to do that with a few keys in the past. Not sure if that'll help though? Just thought I'd try!

  • Sluggish response to multiple presses seems to be a known issue with the current driver, see the discussion here: linux: restore Xbox DVD Movie Playback Kit support by benpicco · Pull Request #3015 · LibreELEC/LibreELEC.tv · GitHub

    The correct parameters (repeat period and timeout) haven't been measured and configured in the driver yet - see explanation here Re: [RFC] [PATCH] media: rc: Improve responsiveness of Xbox DVD Remote

    There's not much we can do about it until someone does that, there are no "knobs to turn".

    so long,

    Hias

  • [Meganiekje] You could try using a keymap editor and assign the key manually? I've had to do that with a few keys in the past. Not sure if that'll help though? Just thought I'd try!

    Good idear, P.Z. but it does not work, I can 'key edit' all the other buttons, but not the power-on button. It looks like it is kind of 'hard coded' into the kernal.

  • HiassofT is there a file somewhere that can be edited? I followed those two pages and tried to find a drivers deep in my install and tried to find config files somewhere, but I couldn't. I don't mean a fix or solution, but at least the file I can create or edit that can alter the response time? I'm thinking maybe you don't want to disclose this information because you don't want people editing system files, I've just always been a "do it yourself" kind of person over a "wait for someone else to do it". I do understand if you can't or wont share the files in question, but I also wonder if I can copy the file in question into the .config folder to edit safely? Since I likely have much much more free time than you busy programmers!

    Thanks so much for your help!

    Meganiekje I have no idea what can edit the power-on button. I've never really shut down my installs before, so I've never needed to power on any of my devices, I've always just left them on. I'm sorry I can't help anymore.

  • Unfortunately the parameters which are responsible for the bad response to repeated button presses are not configurable via config files or standard commands.

    One of them, the timeout value, can be set on some IR receivers with "ir-ctl -t ...", but the xbox dvd driver has that set to the default 125ms and doesn't allow changing it. The other parameter, the IR repeat period, is set by the IR core - and as the xbox dvd driver specifies RC_PROTO_UNKNOWN it's 125ms too. The repeat period probably isn't too far off, rc-5, rc-6 and NEC have a period of about 110-115ms, but the timeout is probably far too high.

    In combination this means pressing a button quicker than about 4 times a second (250ms) isn't recognized as separate button presses but interpreted as a button held down, so the normal key repeat will kick in after half a second. The key repeat settings are configurable (using ir-keytable -D ... -P ...) but that won't help you much with the case of quickly repeated button presses.

    so long,

    Hias

  • HiassofT Thank you so much for taking the time to explain that! I did read up on the changes that happened from LE8 to LE9, but a lot of it went over my head honestly. Was there a particular reason the system was changed so drastically within the IR devices? On a fresh install of LE8 the Xbox DVD controls exactly the same way, but is fixable with some file edits, so I'm just curious why it doesn't work the same way in LE9?

    I'm very sorry for all the questions, I'm just trying my best to stay on top of this, and I really do appreciate your time and effort!

  • The old lirc IR drivers in the linux kernel were rewritten and moved to the newer RC subsystem (which existed for quite some tine and allows IR decoding to be handled completely in the kernel, without needing to run lircd). When this was finished the old lirc code in the kernel was removed.

    The xbox dvd IR driver, which was based on the kernel lirc code, never made it into the linux kernel and for several years OpenELEC and LibreELEC included it as a separate kernel patch (which required updating on almost every kernel update so this meant quite a bit of work for us).

    As the base upon the driver was built was removed we had to remove the driver from LE - it was not longer possible to get it working without a major rewrite and as no one in the team had the hardware to test it the was nothing we could do.

    A few months ago Benjamin stepped up, rewrote the driver and submitted it to the Linux kernel and also created a backport for the kernel used in LibreELEC - which means current LibreELEC contains again support for the Xbox DVD remote (which was not available for several months during LE9 development).

    so long,

    Hias

  • HiassofT Wow, that was very informative, thank you! I had no idea it was so much work for this one specific thing! At this point, after so much work has been done, would it better to keep waiting and helping (in anyway that I or someone else can) so all this work wasn't wasted, or would it be better to just upgrade the IR hardware that I (or maybe others) have? In my other installs in my house I have an MCE remote with USB receiver for one and a flirc with a harmony remote with the other, and those work flawlessly in LE9.x. I am more than happy to be patient, I'm just a little confused on what's happening at this point. Is it something that might get better in time, or is it at a complete dead end and will not get worked on anymore?

    Thank you so much!

  • If your MCE USB receiver is a "real" MCE receiver (using the mceusb driver) or if you have an x86 box with a built-in IR receiver or a Raspberry Pi with a GPIO IR receiver we should be able to create a test setup to get the missing parameters and improve the current xbox driver.

    Could you run "ir-keytable" on the box where you use the Xbox DVD dongle and on the one with the MCE USB remote and post the output?

    I'lll then think about how to best get the needed info with that equipment (already have some ideas :)

    so long,

    Hias

  • Alright! Sorry for the delay, I had a small electrical emergency in my house! I ran the code on two device, both are running LE9.0.1. The first is an HTPC using the MCE USB Receiver, and the second is a Raspberry Pi running the Xbox DVD dongle. I'll put the outputs below.

    Code
    HTPC:~ # ir-keytable
    Found /sys/class/rc/rc0/ (/dev/input/event10) with:
            Name: Media Center Ed. eHome Infrared Remote Transceiver (1934:5168)
            Driver: mceusb, table: rc-rc6-mce
            lirc device: /dev/lirc0
            Supported protocols: other lirc rc-5 rc-5-sz jvc sony nec sanyo mce_kbd rc-6 sharp xmp
            Enabled protocols: lirc nec rc-6
            bus: 3, vendor/product: 1934:5168, version: 0x0001
            Repeat delay = 500 ms, repeat period = 125 ms

    Then on the Raspberry Pi:

    Code
    RPi:~ # ir-keytable
    Found /sys/class/rc/rc0/ (/dev/input/event0) with:
            Name: Xbox DVD USB Remote Control(045e,0284)
            Driver: xbox_remote, table: rc-xbox-dvd
            lirc device: /dev/lirc0
            Supported protocols: unknown
            Enabled protocols: unknown
            bus: 3, vendor/product: 045e:0284, version: 0x000a
            Repeat delay = 500 ms, repeat period = 125 ms

    I hope this helps! I'll gladly help in any other way that I can!

  • Thanks for the info, the MCE USB receiver looks fine, I have one with the same chipset here.

    I'd like you to run 3 tests, before each test do a cold boot and then stop kodi and eventlircd so they don't interfere with testing:

    Code
    systemctl stop kodi
    systemctl stop eventlircd

    For the first test plug in the Xbox DVD remote dongle, stop kodi/eventlircd and then run the following command

    Code
    ir-keytable -t

    Then press each of the buttons "1", "2", "3" for about 1-2 seconds, copy the output you got on the console to a text file and attach it here.

    For the second test plug in only the MCE USB receiver, stop kodi/eventlircd.

    Then grab the raw signals for each of the buttons "1", "2," and "3" while you press them for about 1-2 seconds. Run the following command (substituting 1.txt according to the button you'll press)

    Code
    ir-ctl -t 200000 -r1.txt

    Press the button for 1-2 seconds, then press control-c in the terminal to stop recording. Attach the 3 files (1.txt, 2.txt, 3.txt).

    For the third test plug in both the Xbox DVD receiver dongle and the MCE USB receiver.

    After bootup (and stopping kodi/eventlircd) run ir-keytable to see which rcX and /dev/lircX device was assigned to the MCE USB receiver (either the Xbox or the MCE device could be number zero and the other number one). The output should look like this

    Code
    Found /sys/class/rc/rc0/ (/dev/input/event10) with:
            Name: Media Center Ed. eHome Infrared Remote Transceiver (1934:5168)
            Driver: mceusb, table: rc-rc6-mce
            lirc device: /dev/lirc0
    ...
    Found /sys/class/rc/rc1/ (/dev/input/event0) with:
            Name: Xbox DVD USB Remote Control(045e,0284)
            Driver: xbox_remote, table: rc-xbox-dvd
            lirc device: /dev/lirc1

    Note the /sys/class/rc/rc0/ and lirc device: /dev/lirc0 in the output of the "Media Center Ed. eHome Infrared Remote Transceiver" / "Driver: mceusb" block - if you got rc1 and/or /dev/lirc1 or something else substitute rc0 and /dev/lirc0 with your values.

    Run the following commands:

    Code
    ir-keytable -s rc0 -p lirc -c
    ir-ctl -d /dev/lirc0 -t 20000
    echo "nop" > /sys/kernel/debug/tracing/current_tracer
    echo "rc_keydown" > /sys/kernel/debug/tracing/set_ftrace_filter
    echo "ir_raw_event_store_with_filter" >> /sys/kernel/debug/tracing/set_ftrace_filter
    echo "function" > /sys/kernel/debug/tracing/current_tracer

    Now press the button "1" for about 2 seconds. Then run the following command to grab the kernel trace:

    Code
    cat /sys/kernel/debug/tracing/trace | paste

    Note the URL you got on the console and post it here together with the files you grabbed in the previous 2 tests.

    With that info it should be rather easy to determine the missing parameters.

    so long,

    Hias

  • Sorry for the delay, but I've completed all the tests! I ran all the tests on my Raspberry Pi that has a clean untouched install of LE9.0.1

    TEST ONE

    Test One.txt

    TEST TWO

    Test Two - 1.txt

    Test Two - 2.txt

    Test Two - 3.txt

    TEST THREE

    http://ix.io/1ebd

    The only issue I had was when I ran the command "ir-ctl -t 200000 -r1.txt" nothing appeared to happen. I know it was supposed to export the data to a file named "1.txt" but it either didn't do it or I could not find the file. I was using Putty to do this. So instead, I just ran the code "ir-ctl -t 200000 -r" and copied all the data from the log into a text file. I hope that's acceptable and works!

    Please let me know if you need anything else!

  • Thanks for the tests! The output of test one looks fine, but the outputs of tests 2 and 3 look like you used the MCE remote.

    Can you please repeat these tests with the Xbox DVD remote?

    We need the specifics of the Xbox DVD remote protocol, and the MCE USB receiver is able to capture raw signals.

    So, for test 2, plug in the MCE USB receiver and capture the buttons 1, 2, 3 of your Xbox DVD remote.

    For test 3, plug in both recievers and press button 1 on your Xbox DVD remote for about 2 seconds.

    so long,

    Hias

  • I'm so sorry, I misunderstood that part! I'll include the revised results to test two and three now:

    TEST TWO:

    Test Two - Xbox Remote 1.txt

    Test Two - Xbox Remote 2.txt

    Test Two - Xbox Remote 3.txt

    TEST THREE:

    http://ix.io/1eer

    I didn't even know the MCE Receiver could receive the signal from the Xbox DVD remote. The one thing I did notice though, on the MCE Receiver if I'm using the MCE remote that came with it, if I hold down a button for 2 seconds, the light on the receiver will stay lit until I let the button go. However, if I use the Xbox DVD remote and I press a button, the light will only stay lit for about 1 full second and then the light turns off. I'm not sure why this is or if it affects the test in any way, just thought you should know!