No driver for eHome IR Transceiver

  • Hi,

    I recently installed Libreelec on an old VAIO home PC and ran into issues with my ir remote control.

    libreelec: 8.2.4

    Architecture: Generic.x86_64

    hardware: VAIO VGX-TP3E

    ir transceiver: Build in Sony eHome Tranceiver


    When I try to run ir-keytable I get: /sys/class/rc/: No such file or directory

    According to the wiki that means no driver is loaded.

    dmesg | grep -i usb output list the IR receiver:


    [ 2.549355] hid-generic 0003:046D:C016.0002: input,hidraw1: USB HID v1.10 Mouse [Logitech Optical USB Mouse] on usb-0000:00:1d.0-2/input0

    [ 3.102884] usb 4-1: new full-speed USB device number 2 using uhci_hcd

    [ 3.297191] input: Sony RF Receiver as /devices/pci0000:00/0000:00:1d.2/usb4/4-1/4-1:1.0/0003:054C:024B.0003/input/input3

    [ 3.353222] sony 0003:054C:024B.0003: input,hiddev0,hidraw2: USB HID v1.11 Keyboard [Sony RF Receiver] on usb-0000:00:1d.2-1/input0

    [ 3.360983] input: Sony RF Receiver as /devices/pci0000:00/0000:00:1d.2/usb4/4-1/4-1:1.1/0003:054C:024B.0004/input/input4

    [ 3.361187] sony 0003:054C:024B.0004: input,hiddev0,hidraw3: USB HID v1.11 Mouse [Sony RF Receiver] on usb-0000:00:1d.2-1/input1

    [ 4.116208] usb 4-2: new full-speed USB device number 3 using uhci_hcd

    [ 4.319438] input: SONY IR Receiver as /devices/pci0000:00/0000:00:1d.2/usb4/4-2/4-2:1.1/0003:054C:037C.0005/input/input5

    [ 4.373101] hid-generic 0003:054C:037C.0005: input,hiddev0,hidraw4: USB HID v1.10 Device [SONY IR Receiver] on usb-0000:00:1d.2-2/input1

    And also the output of cat /proc/bus/input/devices show the the sony hardware.

    I: Bus=0003 Vendor=054c Product=024b Version=0111

    N: Name="Sony RF Receiver"

    P: Phys=usb-0000:00:1d.2-1/input0

    S: Sysfs=/devices/pci0000:00/0000:00:1d.2/usb4/4-1/4-1:1.0/0003:054C:024B.0003/input/input3

    U: Uniq=

    H: Handlers=sysrq kbd leds event3

    B: PROP=0

    B: EV=12001f

    B: KEY=3007f 0 0 4c3ffff17aff32d bf54445600000000 ff 130c130b17c007 ffa67bfad951dfff febeffdfffefffff fffffffffffffffe

    B: REL=40

    B: ABS=10100000000

    B: MSC=10

    B: LED=1f

    I: Bus=0003 Vendor=054c Product=024b Version=0111

    N: Name="Sony RF Receiver"

    P: Phys=usb-0000:00:1d.2-1/input1

    S: Sysfs=/devices/pci0000:00/0000:00:1d.2/usb4/4-1/4-1:1.1/0003:054C:024B.0004/input/input4

    U: Uniq=

    H: Handlers=mouse1 event4

    B: PROP=0

    B: EV=17

    B: KEY=1f0000 0 0 0 0

    B: REL=143

    B: MSC=10

    I: Bus=0003 Vendor=054c Product=037c Version=0110

    N: Name="SONY IR Receiver"

    P: Phys=usb-0000:00:1d.2-2/input1

    S: Sysfs=/devices/pci0000:00/0000:00:1d.2/usb4/4-2/4-2:1.1/0003:054C:037C.0005/input/input5

    U: Uniq=SA080206200000a

    H: Handlers=kbd event5

    B: PROP=0

    B: EV=1b

    B: KEY=ffffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffff 0 40000010cc00 10168000000000 0

    B: ABS=10000000000

    B: MSC=10


    Any ideas how to get the driver for the SONY IR Receiver loaded?

    Tadzio

  • There's not much you can do about it, there's no linux driver for this IR receiver - this is why it's showing up as a generic HID device.

    so long,

    Hias

  • Thanks Hilas,

    The driver is supposed to be the mceusb driver. Currently the driver is set as usbhid. I tried unbinding this driver.

    echo -n "4-2:1.1" > /sys/bus/usb/drivers/usbhid/unbind

    Which was successful. However trying to bind it to the mceusb driver returned:

    echo -n "4-2:1.1" > /sys/bus/usb/drivers/mceusb/bind

    -sh: write error: No such device


    Rebinding it to the (wrong) original driver did however work:

    echo -n "4-2:1.1" > /sys/bus/usb/drivers/usbhid/bind

    I'm fairly certain the drive should be the mceusb driver. Under windows, this transceiver does show up as a regular Microsoft eHome transceiver. A similar (external) IR device gets bound to the correct driver. Below an extract from dmesg showing the Internal Sony ehome transceiver and the external Philips transceiver.

    [ 5.069102] input: SONY IR Receiver as /devices/pci0000:00/0000:00:1d.2/usb4/4-2/4-2:1.1/0003:054C:037C.0005/input/input5

    [ 5.125138] hid-generic 0003:054C:037C.0005: input,hiddev0,hidraw4: USB HID v1.10 Device [SONY IR Receiver] on usb-0000:00:1d.2-2/input1

    [ 14.176836] rc rc0: Media Center Ed. eHome Infrared Remote Transceiver (0471:0815) as /devices/pci0000:00/0000:00:1d.1/usb3/3-1/3-1:1.0/rc/rc0

    [ 14.214514] rc rc0: lirc_dev: driver ir-lirc-codec (mceusb) registered at minor = 0

    [ 14.289974] input: Media Center Ed. eHome Infrared Remote Transceiver (0471:0815) as /devices/pci0000:00/0000:00:1d.1/usb3/3-1/3-1:1.0/rc/rc0/input6

    [ 14.505328] mceusb 3-1:1.0: Registered Philips eHome Infrared Transceiver with mce emulator interface version 1

    [ 14.505331] mceusb 3-1:1.0: 2 tx ports (0x3 cabled) and 2 rx sensors (0x1 active)

    [ 14.505414] usbcore: registered new interface driver mceusb


    Remains the question how to bind the sony transceiver to mceusb driver.

    Tadzio

  • Ah, sorry, I completely forgot about the dynamic device id feature.

    The unbind from usbhid looks fine, but to use the device with the mceusb driver you have to extend mceusb's device id table. Try this:

    Code
    echo -n "054c 037c" > /sys/bus/usb/drivers/mceusb/new_id

    There exist several variants/generations of MCE USB receivers, the line above will use the MCE Gen2 variant (which is also used by the Philips eHome receiver). If this doesn't work you can tell new_id to copy the configuration from an existing device.

    This line should make mceusb use the original Microsoft (MCE GEN1) protocol version:

    Code
    echo -n "054c 037c 0 045e 006d" > /sys/bus/usb/drivers/mceusb/new_id

    "045e 006d" are the USB vendor/product ID of the microsoft MCE receiver. Have a look at the usb device id table in the mceusb driver for supported devices / variants linux/mceusb.c at master · torvalds/linux · GitHub (VENDOR_XXX definitions are a few lines above).

    so long,

    Hias

  • Hi Hias,

    Thanks again! Made great progress today with the input you provided. Here are the commands I run to make the remote work:

    modprobe mceusb

    echo -n "4-2:1.1" > /sys/bus/usb/drivers/usbhid/unbind

    echo -n "054c 037c 0 0609 0322" > /sys/bus/usb/drivers/mceusb/new_id

    I'm now struggling with two more issues:

    1) How do I make this configuration "permanent"? Now I have to run the above commands at each reboot.

    2) All button on the remote seem to work fine, but none of the keys on my mce keyboard are recognized. Is there a way to have the keystrokes of the keyboard recognized. Even tho I use mostly the remote, the keyboard comes in handy for searches, passwords, etc.


    Big thanks for all the support,

    Tadzio

  • Thanks a lot for the feedback, glad you got it working!

    To make this permanent create a /storage/.config/autostart.sh file with the 2 commands. You might have to put a "sleep 1" after the unbind command so the kernel has some time to do the unbinding.

    Using an MCE keyboard is going to be tricky.

    These keyboards use a special IR protocol (mce_kbd) which you have to enable in addition to the rc-6 protocol used for MCE remotes:

    Code
    ir-keytable -p rc-6,mce_kbd

    Now you should see scancodes in ir-keytable -t which you can map to keycodes (not 100% sure, never tried this, I don't have such a keyboard).

    One problem though will be that all these scancodes/keycodes will hit kodi as LIRC events, meaning you'd have to map A-Z keys and special keys like "Shift" etc won't be processed as usual.

    One way around this would be to disable eventlircd (which translates input to lirc events). If you do this you'll have to use a modified rc6_mce keytable as some keycodes (eg "KEY_OK") aren't supported by kodi.

    so long,

    Hias

  • Hi Hias,

    Again great tips! Got my IR receiver recognized from boot. My keyboard keystrokes do show up in kodi. And the mouse pointer seems to work too. The keystrokes are however recognized as long presses. A single character would be repeated forever. Here is an example from kodi.log:

    13:32:59.329 T:140300526767424 DEBUG: Keyboard: scancode: 0x09, sym: 0x001b, unicode: 0x001b, modifier: 0x0 13:33:20.505 T:140298833385216 DEBUG: Previous line repeats 526 times.

    The keystrokes from the keyboard do not show up in irww or ir-keytable -p mce_kbd -t even after stopping kodi and eventlircd. Those from the remote appear just fine.

    BTW: I did replace the rc6_mce keytable replacing keycodes such as KEY_OK, KEY_PVR, KEY_CHANNELUP, KEY_CHANNELDOWN, etc.

    Any idea what causes the keys to be repeated, and why they aren't visible in ir-keytable -t?

    Thanks!

    Tadzio

  • Interesting. It looks like the mce_kbd decoder might be sending a key down event but no key up event.

    Also odd that ir-keytable -t doesn't show anything, I'd expected to see KEY_... events from the driver.

    Could you install the system tools addon and check with evtest instead of ir-keytable -t? Kodi and eventlircd must be stopped, as usual. Please post the evtest output of a short keypress.

    It would also be interesting to have a capture of the raw IR signals, then I could try to reproduce that here. Could you run the following command

    Code
    ir-ctl --receive=rawkey.txt

    then press a key on the IR keyboard, then abort ir-ctl with control-c and upload the file "rawkey.txt" here?

    so long,

    Hias

  • Hi Hias,

    I noticed indeed that it's sending only down keys and no up keys.

    Below to extract from evtest (short press 'e' followed by short press 'h'):

    And the result of ir-ctl --receive=rawkey.txt is attached.

    Thanks,

    Tadzio

    rawkey.txt

  • Thanks a lot for the test output and the capture!

    I could reproduce the issue here, it looks like it's a bug in the kernel's MCE keyboard decoder (or probably multiple issues in there).

    I'll have a closer look at it and discuss it with the kernel maintainer. I'll keep you posted about the status.

    so long,

    Hias