Lirc_RPI on Libreelec 7 / 8
#1
Today ive added a tsop4838 to my new RPI3.
Ive added dtoverlay=lirc-rpi to my config and started libreelec 7. When i now check for the device (ls /dev/lirc*) or the module lsmod i dont see the module. When i try to modprobe lirc-rpi, dmesg shows me lirc_rpi: gpio chip not found!
Ive tried to enable lirc in libreelec-settings but that did not change anything.

When i switch the sd-card to one with raspian installed, the module loads without problems and the lirc-daemon is working so the tsop is working.
Reply
#2
This is a known issue. Work-around is to install OE and then upgrade/transition to LE.
Server: Asus Sabertooth Z77 | Intel Core i5 3.4 GHz | 16 GB DDR3 | 128 GB SSD, 82 TB (9 x 6 TB, 7 x 4 TB)
HTPC 1: Raspberry Pi 2 | HTPC 2: Raspberry Pi 2 | HTPC 3: Raspberry Pi
Reply
#3
I'd recommend using dtoverlay=gpio-ir instead of lirc-rpi. gpio-ir supports in-kernel decoding and you don't need to run the userspace lirc daemon (make sure you have lirc disabled in LE settings).

The old lirc-only drivers from the kernel staging directory are being phased out and replaced by the newer rc-core drivers. In LibreELEC we're doing the same, LE 9.0 will ship without these - current LibreELEC Milhouse builds already drop it.

so long,

Hias
Reply
#4
HiassofT i think ive found your git-hub-tutorial yesterday but im into lirc since over 15 years now and that was an easy to use way for me.

Could you give me a short information how i can learn the keys from the remote? whats the counterpart of irrecord with gpio-ir?
Where to place the config-file for the remote in libreelec?
Reply
#5
If you've got some standard remote have a look if there's already a keymap included in the linux kernel: https://github.com/raspberrypi/linux/tre...c/keymaps/ - if yes, you can use the rc_map_name parameter of the overlay to select it. eg:
Code:
dtoverlay=gpio-ir,rc_map_name=rc-technisat-usb2

Have a look at this thread for infos on how to manually create and use a keymap with ir-keytable: https://forum.libreelec.tv/thread/7152-w...#post43745

If you have an odd remote with no protocol support in the kernel you can still use lircd to decode the signals (gpio-ir also provides a /dev/lirc0 device) - make sure lirc is enabled in LE settings.

so long,

Hias
Reply
#6
Ah ok.Ive already learned the remote-keys with irrecord on raspian. The codes seem to be the same so i could create a keymap without problems. its a technisat-remote i want to use for that tv.
is it true that the keymaps are stored in /etc/rc_keymaps?

Greetings from Imst, Austria btw and thanks for the help ;-)
Reply
#7
For the technisat remote the rc-technisat-usb2 should already be a good start - or maybe all you need to get it working Smile

In LE /etc/rc_keymaps is a symlink to /storage/.config/rc_keymaps and you should place your custom keymaps there (the root filesystem in LE is read-only, therefore the symlinks to the writable /storage partition).

The system keymaps are in the usual place, /usr/lib/udev/rc_keymaps/ - you can use these as templates to create your own, eg if you only need to change a few keys.

/etc/rc_maps.cfg (which controls overriding the kernel-module keymaps with custom, userspace keymaps) is read-only, but you can override that with a /storage/.config/rc_maps.cfg file.

so long & greetings back to Tirol,

Hias
Reply
#8
Hello Hias,
i dont get the custom map to load. What do i need to add to the config.txt?
Ive placed a file called technisat in /storage/.config/rc_keymaps/
Ive created a rc_maps.cfg in /.config with "* * technisat"
Ive tried the "ir-keytable -c -w /storage/.config/rc_keymaps/technisat -t" and it shows me the codes i push on the remote.

Ive tried dtoverlay=gpio-ir,rc_map_name=rc-technisat and it told me file not found and
dtoverlay=gpio-ir,rc_map_name=technisat didnt work neither
Both commands load the empty keymap.

What do i need to insert to config.txt to get the remote working on startup?
Reply
#9
If you use an rc_maps.cfg with "* * technisat" the map name in the dtoverlay line doesn't matter, as your user map will override that.

On bootup "ir-keytable -a /storage/.config/rc_maps.cfg -s rc0" is run - try to run that manually. to see if it has the desired effect Especially have a look at the enabled protocols (in "ir-keytable" output), and/or in "ir-keytable -r" output. If you have a typo in the first ("comment") line of the map it might not pick up the protocol.

Ah, BTW, which LE version are you using? The ir-keytable stuff is rather new so better use the latest (8.0.2) LE release.

so long,

Hias
Reply
#10
Yesterday i tried with latest Openelec and than upgraded to latest libreelec. I will check all the parameters in the afternoon after work.Maybe ive missed something in the keymap-file.
Reply
#11
Im still trying to get the remote working. If i try my files manually everything works as expected but when starting kodi the remote does nothing.
When i start the raspberry and stop kodi and eventlircd and run ir-keytable -t the remote is working.
I dont find any switch inside kodi to enable eventlircd. Do i need something to add here? Any hint what i am missing?

when i stop kodi and eventlircd and run ir-keytable it tells me:

Found /sys/class/rc/rc0/ (/dev/input/event2) with:
Driver gpio-rc-recv, table rc-rc6-mce
Supported protocols: unknown other lirc rc-5 rc-5-sz jvc sony nec sanyo mce-kbd rc-6 sharp xmp
Enabled protocols: lirc rc-5
Name: gpio_ir_recv
bus: 25, vendor/product: 0001:0001, version: 0x0100
Repeat delay = 500 ms, repeat period = 125 ms


rc_keymaps file (location /storage/.config/rc_keymaps/jans)

Quote:# table jans, type: rc-5
0x0210 KEY_UP
0x0211 KEY_DOWN
0x0215 KEY_LEFT
0x0216 KEY_RIGHT
0x0217 KEY_OK
0x1222 KEY_EXIT
0x020F KEY_INFO
0x022B KEY_RED
0x022C KEY_GREEN
0x022D KEY_YELLOW
0x022E KEY_BLUE
0x1237 KEY_RECORD
0x022D KEY_PAUSE
0x022C KEY_STOP
0x122F KEY_EPG
0x0212 KEY_MENU
0x1201 KEY_1
0x1202 KEY_2
0x1203 KEY_3
0x1204 KEY_4
0x1205 KEY_5
0x1206 KEY_6
0x1207 KEY_7
0x1208 KEY_8
0x1209 KEY_9
0x1200 KEY_0

rc_maps.conf

Quote:# For example:
#
# driver table file
#
# gpio-rc-recv rc-streamzap streamzap
# gpio-rc-recv * justboom
# * rc-rc6-mce rc6_mce_new
# * * hauppauge_new
* * jans

Dmesg-Output:

Quote:[ 4.853828] Console: switching to colour dummy device 80x30
[ 4.952864] rc_core: loading out-of-tree module taints kernel.
[ 4.954031] WARNING: You are using an experimental version of the media stack.
[ 4.954031] As the driver is backported to an older kernel, it doesn't offer
[ 4.954031] enough quality for its usage in production.
[ 4.954031] Use it with care.
[ 4.954031] Latest git patches (needed if you report a bug to linux-media@Vger.kernel.org):
[ 4.954031] a02ff2e02bee64e9955dbfd8811874c3f3880f58 cx231xx: Fix TBS MAC reading.
[ 5.026396] gpiomem-bcm2835 3f200000.gpiomem: Initialised: Registers at 0x3f200000
[ 5.081558] Registered IR keymap rc-rc6-mce
[ 5.082194] input: gpio_ir_recv as /devices/platform/ir-receiver/rc/rc0/input2
[ 5.082550] rc rc0: gpio_ir_recv as /devices/platform/ir-receiver/rc/rc0
[ 5.144454] lirc_dev: IR Remote Control driver registered, major 243
[ 5.185676] rc rc0: lirc_dev: driver ir-lirc-codec (gpio-rc-recv) registered at minor = 0
[ 5.185691] IR LIRC bridge handler initialized
[ 5.315766] IR RC6 protocol handler initialized
[ 5.427444] IR RC5(x/sz) protocol handler initialized

config.txt
Quote:################################################################################
# License keys to enable GPU hardware decoding for various codecs
# to obtain keys visit the shop at http://www.raspberrypi.com
################################################################################

# decode_MPG2=0x00000000
# decode_WVC1=0x00000000
# decode_DTS=0x00000000
# decode_DDP=0x00000000
dtoverlay=gpio-ir
Reply
#12
This is odd, eventlircd should be started by default and pick up your devices.

You can check with ps: "ps | grep eventlircd" if it's there. Also run "irw", this will show the lirc events on the eventlircd lirc socket (which is used by kodi) - i.e. you should see your button presses here.

Another check is to run "ir-keytable -t" immediately after system startup (with both kodi and eventlircd running). You should get _no_ output when pressing keys, as eventlircd should have grabbed the input device. You could also test with evtest, this'll give you an error message if the device has been grabbed by another process.

If in doubt, do a fresh installation of LibreELEC, maybe there's some leftover cruft from OpenELEC that's interfering.

so long,

Hias
Reply
#13
Ive now simply copied a lircd.conf into config-directory and enabled lircd in libreelec-configuration.. and it works..
irw did not give any result while hitting buttons. eventlircd started when booting libreelec. when kodi + eventlircd was running ir-keytable -t did not show any keypresses.
I think i can live with that solution for now. thanks for your help!
Reply

Logout Mark Read Team Forum Stats Members Help
Lirc_RPI on Libreelec 7 / 80