Posts by HiassofT

    With 2 IR receivers the configuration is a bit tricky.

    Your "* * avermedia_remote" rc_maps.cfg will configure both the gpio-ir receiver and the receiver on your DVB dongle to decode the signals of your remote. One possibility is to change the file so that only the gpio-ir receiver is configured:

    Code
    gpio-rc-recv * avermedia_remote

    Another thing to keep in mind is that it's not guaranteed that the gpio ir receiver will always be the first IR device (check the output of "ir-keytable"). If you manually run ir-keytable to change the config it'll apply the settings to the first rc device (rc0) unless you explicitly change that with the "-s" option.

    The automatic configuration run by the udev rules take care of that, ir-keytable -a will be run for all your IR receivers with -s set appropriately - so that rc_maps.cfg is applied to all IR receivers on your system.

    So, better remove the ir-keytable call from your autostart.sh.

    Instead of covering the IR receiver with black or aluminium tape it'd be better to blacklist the the driver for the IR receiver in your DVB dongle - or just use the IR receiver in your DVB and not add gpio-ir. With only one receiver life's a lot easier :)

    so long,

    Hias

    Connect the TSOP4838 to 3.3V and drop the voltage translation circuit - TSOP4838 can be powered from 2.5 to 5.5V (see the datasheet tsop48.pdf ).

    Also drop all modifications to autostart.sh - you only need to set up rc_maps.cfg and put the keytable in rc_keymaps. This config will be automatically picked up.

    If you still have problems post the output of ir-keytable. If you have another ir receiver (eg on a DVB USB dongle) you could get double keypresses as the signal will be received by 2 receivers.

    so long,

    Hias

    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

    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

    Make sure you are using the correct GPIO pins. The gpio_pin options of the overlays are a bit misleading. Despite their name they specify the GPIO number, not the header pin number...

    gpio-ir, gpio-ir-tx and pwm-ir-tx all default to GPIO 18 (pin 12 of the header) - see the README in /flash/overlays.

    gpio-ir defaulting to GPIO 18 is a relic of old lirc_rpi days which defaulted to GPIO 18 for input and GPIO 17 for output - which is a bit of a pity as GPIO 18 is the only one that's usable for PWM output.

    So, it's best to use pwm-ir-tx with the default GPIO 18 and use any other GPIO (eg GPIO 17 / header pin 11) for receiving IR:

    Code
    dtoverlay=gpio-ir,gpio_pin=17
    dtoverlay=pwm-ir-tx

    This will give you 2 /dev/lircX devices, one for receiving and one for transmitting. The device names could change so it's best to create a udev rule to setup persistent names. eg create a /storage/.config/udev.rules.d/90-lirc-devices.rules files with this content

    Code
    ACTION=="add|change", KERNEL=="lirc*", DRIVERS=="gpio-rc-recv", SYMLINK+="lirc-rx"
    ACTION=="add|change", KERNEL=="lirc*", DRIVERS=="pwm-ir-tx", SYMLINK+="lirc-tx"

    Then you can use the persistent device nodes in ir-ctl. eg

    Code
    ir-ctl -d /dev/lirc-tx -S rc5:0x1234
    ir-ctl -d /dev/lirc-rx -r

    so long,

    Hias

    AlleyCat just saw your additional comment (maybe it was held back for moderation?)

    Non-working passthrough and missing alsa card conf sounds familiar... Blame it on the RPi sound card manufacturers who build a plethora of cards based on the same chip (wm8804 in your case) and choose to write separate sound card drivers with different card names instead of using unified drivers per chip. And blame it on the RPi kernel maintainers for accepting that stuff in their tree - this is not allowed in the upstream Linux kernel for very good reasons (you just noticed one of these).

    Anyways, could you test if this build works?

    LibreELEC-RPi2.arm-8.2-devel-20180403014343-r26324-gd125c30462.tar


    so long,

    Hias

    The loaded modules look fine. Does it show up in Settings->System->Audio and can you select it as an audio output device?

    If yes and you still get no output (eg the GUI sound clicks) please use the Log Upload option in LibreELEC settings to upload full system logs.

    so long,

    Hias

    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

    In LE8.2 this doesn't work yet, but you'll be able to do that in LE9.0 (it'll work eg in current Milhouse builds).

    LE9.0 uses the newer 4.14 kernel which added support for gpio-ir-tx and pwm-ir-tx. With either one of these dtoverlays you can define a GPIO for transmitting IR data.

    If you don't need analog audio on the RPi I'd recommend using pwm-ir-tx, this results in lower CPU load compared to gpio-ir-tx (the latter has to bit-bang the GPIO at ~38kHz whereas the former offloads lots of the heavy lifting to the PWM).

    With these overlays you get a separate /dev/lircX device node and can use eg ir-ctl -S ... to transmit IR signals.

    so long,

    Hias

    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

    The build should automatically use all available cores.

    You can manually configure the number of parallel processes by setting the environment variable CONCURRENCY_MAKE_LEVEL (eg to 8).

    Also note that for a few packages parallel build is disabled as it doesn't work reliably (for example busybox).

    LTO also increases build time (and for most packages linking with LTO only uses a single core), so you could try setting LTO_SUPPORT="no" in ~/.libreeelc/options - but note this isn't always fully tested and building without LTO can sometimes result in link errors. PRs to fix this (mostly missing -fPIC options in libs) are welcome, though :)

    so long,

    Hias

    If the card doesn't have an eeprom with the dtoverlay (so it's automatically enabled) you could try adding this to your config.txt (remove the old dtoverlay=hifiberry... line first)

    Code
    dtoverlay=allo-digione

    so long,

    Hias

    There's not much info about the VS1838 except for a chinese datasheet and some posts stating that the Vishay (TSOP) receivers perform better.

    One thing you should check is that you have proper filitering on the IR receiver's VCC pin. The datasheet shows a 100uF capacitor in parallel to a 100nF - which usually should be soldered very near to the receiver. A 100 ohm series resistor can further help reducing noise on the VCC line. From the datasheet it's not clear if this is needed, but as noise on the VCC line can impact performance it won't hurt if you added that filtering.

    Personally I have only used Vishay parts so far, the well known TSOP34438 should do fine. I'm currently using the older TSOP34138 receivers here, which uses an older AGC version (1 instead of 4, the latter is recommended by Vishay for NEC and RC-5/6 remotes).

    So far I didn't have VCC noise issues with these receivers. The receivers are connected via approx. 0.5m long shielded cable and I haven't soldered filtering caps to the receiver.

    so long,

    Hias