Loading lirc_odroid in LibreELEC (C2)

Moderators: mdrjr, odroid, Raybuntu, wrxtasy

Loading lirc_odroid in LibreELEC (C2)

Unread postby Domi » Wed Oct 24, 2018 9:59 pm

Hey,

I'm trying to load the lirc_odroid module from here in LibreELEC for the C2 in order to send a few IR codes. I built the image from source according to this, which works fine. I also copied the kernel module from the Hardkernel kernel into a new kernel module package, which also works fine.

I can load the module in LibreELEC without any issues now:
Code: Select all
modprobe lirc_odroid gpio_out_pin=249 softcarrier=1 invert=1


Code: Select all
[    3.154518@0] lirc_dev: IR Remote Control driver registered, major 233
[    3.155304@0] rc rc0: lirc_dev: driver ir-lirc-codec (meson-ir) registered at minor = 0
[ 3612.788543@0] lirc_odroid lirc_odroid.0: lirc_dev: driver lirc_odroid registered at minor = 1
[ 3612.788575@0] lirc_odroid: driver registered!


So far so good, /dev/lirc1 gets created when lirc_odroid gets loaded. However, upon trying to irsend something I get this in the logs:

Code: Select all
Oct 24 11:29:47.470716 LibreELEC lircd: Error: could not get hardware features
Oct 24 11:29:47.471085 LibreELEC lircd: Error: this device driver does not support the LIRC ioctl interface
Oct 24 11:29:47.472144 LibreELEC lircd: Error: major number of /dev/lirc1 is 233
Oct 24 11:29:47.472339 LibreELEC lircd: Error: make sure /dev/lirc1 is a LIRC device and use a current version of the driver


irsend simply fails with "hardware does not support sending".

Debug output from module:

Code: Select all
[  111.921428@0] lirc_odroid: driver registered!
[  140.108550@0] tx queueing
[  185.108510@0] tx queueing
[  192.293952@2] lirc_odroid is opened
[  192.294731@2] lirc_odroid is closed
[  192.298021@2] lirc_odroid is opened
[  192.299270@2] lirc_odroid is closed
[  199.108504@0] tx queueing
[  199.269968@2] lirc_odroid is opened
[  199.270777@2] lirc_odroid is closed
[  199.272680@2] lirc_odroid is opened
[  199.273587@2] lirc_odroid is closed
[  199.276451@2] lirc_odroid is opened
[  199.277248@2] lirc_odroid is closed
[  204.108501@0] tx queueing
[  208.642184@2] lirc_odroid is opened
[  208.642569@2] lirc_odroid is closed
[  208.643465@2] lirc_odroid is opened
[  208.643821@2] lirc_odroid is closed
[  208.646220@2] lirc_odroid is opened
[  208.646686@2] lirc_odroid is closed
[  213.108500@0] tx queueing


modinfo for module:

Code: Select all
filename:       /lib/modules/3.14.29/drivers/staging/media/lirc/lirc_odroid.ko
license:        GPL
author:         Joy Cho <joy.cho@hardkernel.com>
description:    GPIO based IR Transmitter driver for Odroid C/C2
depends:        lirc_dev
vermagic:       3.14.29 SMP mod_unload aarch64
parm:           gpio_out_pin:GPIO output/transmitter pin number (int)
parm:           softcarrier:Software carrier (0 = off, 1 = on, default on) (bool)
parm:           invert:Invert output (0 = off, 1 = on, default off (bool)
parm:           debug:Enable debugging messages (bool)


Things I noticed when comparing to the regular module on Ubuntu 16.04/18.04: Module is not marked as staging, intree and preempt. Maybe the issue is related to those?

Any idea what could be the cause of this? Is it not possible to just port the module from the regular o-droid C2 kernel? Any dependencies I missed?
Domi
 
Posts: 8
Joined: Thu Sep 20, 2018 8:44 pm
languages_spoken: english, german
ODROIDs: C2, XU4

Re: Loading lirc_odroid in LibreELEC (C2)

Unread postby joy » Thu Oct 25, 2018 3:36 pm

Hi Domi,
Can you show me the nodes under /dev/?
And please share files under /etc/lirc/*.
joy
 
Posts: 571
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X

Re: Loading lirc_odroid in LibreELEC (C2)

Unread postby Domi » Thu Oct 25, 2018 5:01 pm

joy wrote:Hi Domi,
Can you show me the nodes under /dev/?
And please share files under /etc/lirc/*.


Sure.

/dev:

Code: Select all
LibreELEC:~ # ls -l /dev
total 118868
-rwxr-xr-x    1 root     root     121720832 Jan  1  1970 SYSTEM
crw-------    1 root     root      266,  10 Jun 22 11:11 amaudio
crw-------    1 root     root      266,   0 Jun 22 11:11 amaudio_ctl
crw-------    1 root     root      266,   1 Jun 22 11:11 amaudio_utils
crw-------    1 root     root      250,   0 Jun 22 11:11 amhdmitx0
crw-------    1 root     root      255,   1 Jun 22 11:11 amstream_abuf
crw-------    1 root     root      255,   8 Jun 22 11:11 amstream_hevc
crw-------    1 root     root      255,   3 Jun 22 11:11 amstream_mpps
crw-------    1 root     root      255,   2 Jun 22 11:11 amstream_mpts
crw-------    1 root     root      255,   4 Jun 22 11:11 amstream_rm
crw-------    1 root     root      255,   5 Jun 22 11:11 amstream_sub
crw-------    1 root     root      255,   6 Jun 22 11:11 amstream_sub_read
crw-------    1 root     root      255,   7 Jun 22 11:11 amstream_userdata
crw-------    1 root     root      255,   0 Jun 22 11:11 amstream_vbuf
crw-------    1 root     root      241,   0 Jun 22 11:11 amsubtitle
crw-------    1 root     root      264,   0 Jun 22 11:11 amvideo
crw-------    1 root     root      242,   0 Jun 22 11:11 amvideo_poll
crw-------    1 root     root      243,   0 Jun 22 11:11 amvideocap0
crw-rw-rw-    1 root     root      234,   0 Jun 22 11:11 aocec
crw-------    1 root     root       10,  62 Jun 22 11:11 ashmem
crw-------    1 root     root      257,   0 Jun 22 11:11 audiodsp0
crw-------    1 root     root       10, 235 Jun 22 11:11 autofs
drwxr-xr-x    2 root     root           280 Jun 22 11:11 block
crw-------    1 root     root       10, 234 Jun 22 11:11 btrfs-control
drwxr-xr-x    3 root     root            60 Jan  1  1970 bus
drwxr-xr-x    2 root     root          3440 Oct 24 13:46 char
crw-------    1 root     root        5,   1 Jun 22 11:11 console
crw-------    1 root     root       10,  59 Jun 22 11:11 cpu_dma_latency
crw-------    1 root     root      240,   0 Jun 22 11:11 di0
drwxr-xr-x    7 root     root           140 Jun 22 11:11 disk
crw-------    1 root     root      249,   0 Jun 22 11:11 display
crw-------    1 root     root      239,   0 Jun 22 11:11 efuse
crw-------    1 root     root       60,   0 Jun 22 11:11 esm_rx
crw-rw----    1 root     video      29,   0 Jun 22 11:11 fb0
crw-rw----    1 root     video      29,   1 Jun 22 11:11 fb1
lrwxrwxrwx    1 root     root            13 Jun 22 11:11 fd -> /proc/self/fd
crw-rw-rw-    1 root     root        1,   7 Jun 22 11:11 full
crw-rw-rw-    1 root     root       10, 229 Jun 22 11:11 fuse
crw-------    1 root     root      244,   0 Jun 22 11:11 ge2d
crw-------    1 root     root      236,   0 Jun 22 11:11 gpio_keyboard
crw-------    1 root     root       10, 183 Jun 22 11:11 hwrng
crw-------    1 root     root       89,   1 Jun 22 11:11 i2c-1
lrwxrwxrwx    1 root     root            12 Jun 22 11:11 initctl -> /run/initctl
drwxr-xr-x    3 root     root           180 Jun 22 11:11 input
crw-------    1 root     root       10,  60 Jun 22 11:11 ion
crw-r-----    1 root     kmem        1,   2 Jun 22 11:11 kmem
crw-r--r--    1 root     root        1,  11 Jun 22 11:11 kmsg
crw-------    1 root     root      233,   0 Jun 22 11:11 lirc0
crw-------    1 root     root      233,   1 Oct 24 13:46 lirc1
lrwxrwxrwx    1 root     root            28 Jun 22 11:11 log -> /run/systemd/journal/dev-log
crw-rw----    1 root     disk       10, 237 Jun 22 11:11 loop-control
brw-rw----    1 root     disk        7,   0 Jun 22 11:11 loop0
brw-rw----    1 root     disk        7,   1 Jun 22 11:11 loop1
brw-rw----    1 root     disk        7,   2 Jun 22 11:11 loop2
brw-rw----    1 root     disk        7,   3 Jun 22 11:11 loop3
brw-rw----    1 root     disk        7,   4 Jun 22 11:11 loop4
brw-rw----    1 root     disk        7,   5 Jun 22 11:11 loop5
brw-rw----    1 root     disk        7,   6 Jun 22 11:11 loop6
brw-rw----    1 root     disk        7,   7 Jun 22 11:11 loop7
crw-------    1 root     root       10,  55 Jun 22 11:11 mali
crw-------    1 root     root      235,   0 Jun 22 11:11 media
crw-------    1 root     root      235,   4 Jun 22 11:11 media.amports
crw-------    1 root     root      235,   7 Jun 22 11:11 media.audio
crw-------    1 root     root      235,   6 Jun 22 11:11 media.codec_mm
crw-------    1 root     root      235,   1 Jun 22 11:11 media.decoder
crw-------    1 root     root      235,   2 Jun 22 11:11 media.parser
crw-------    1 root     root      235,   5 Jun 22 11:11 media.tsync
crw-------    1 root     root      235,   8 Jun 22 11:11 media.vfm
crw-------    1 root     root      235,   3 Jun 22 11:11 media.video
crw-r-----    1 root     kmem        1,   1 Jun 22 11:11 mem
brw-rw----    1 root     disk      179,   0 Jun 22 11:11 mmcblk0
brw-rw----    1 root     disk      179,   1 Jun 22 11:11 mmcblk0p1
brw-rw----    1 root     disk      179,   2 Jun 22 11:11 mmcblk0p2
brw-rw----    1 root     disk      179,  32 Jun 22 11:11 mmcblk0rpmb
drwxrwxrwt    2 root     root            40 Jan  1  1970 mqueue
drwxr-xr-x    2 root     root            60 Jan  1  1970 net
crw-------    1 root     root       10,  58 Jun 22 11:11 network_latency
crw-------    1 root     root       10,  57 Jun 22 11:11 network_throughput
crw-rw-rw-    1 root     root        1,   3 Jun 22 11:11 null
crw-------    1 root     root      238,   0 Jun 22 11:11 ppmgr
crw-------    1 root     root      108,   0 Jun 22 11:11 ppp
crw-rw-rw-    1 root     tty         5,   2 Oct 25 07:52 ptmx
drwxr-xr-x    2 root     root             0 Jan  1  1970 pts
crw-rw-rw-    1 root     root        1,   8 Jun 22 11:11 random
crw-rw-r--    1 root     root       10,  63 Jun 22 11:11 rfkill
drwxrwxrwt    2 root     root            40 Jun 22 11:11 shm
drwxr-xr-x    3 root     root           220 Jun 22 11:11 snd
lrwxrwxrwx    1 root     root            13 Jun 22 11:11 spidev0.0 -> spidev32766.0
crw-------    1 root     root      153,   0 Jun 22 11:11 spidev32766.0
lrwxrwxrwx    1 root     root            15 Jun 22 11:11 stderr -> /proc/self/fd/2
lrwxrwxrwx    1 root     root            15 Jun 22 11:11 stdin -> /proc/self/fd/0
lrwxrwxrwx    1 root     root            15 Jun 22 11:11 stdout -> /proc/self/fd/1
crw-------    1 root     root       10,  61 Jun 22 11:11 sw_sync
crw-rw-rw-    1 root     tty         5,   0 Jun 22 11:11 tty
crw--w----    1 root     tty         4,   0 Jun 22 11:11 tty0
crw--w----    1 root     tty         4,   1 Jun 22 11:11 tty1
crw--w----    1 root     tty         4,  10 Jun 22 11:11 tty10
crw--w----    1 root     tty         4,  11 Jun 22 11:11 tty11
crw--w----    1 root     tty         4,  12 Jun 22 11:11 tty12
crw--w----    1 root     tty         4,  13 Jun 22 11:11 tty13
crw--w----    1 root     tty         4,  14 Jun 22 11:11 tty14
crw--w----    1 root     tty         4,  15 Jun 22 11:11 tty15
crw--w----    1 root     tty         4,  16 Jun 22 11:11 tty16
crw--w----    1 root     tty         4,  17 Jun 22 11:11 tty17
crw--w----    1 root     tty         4,  18 Jun 22 11:11 tty18
crw--w----    1 root     tty         4,  19 Jun 22 11:11 tty19
crw--w----    1 root     tty         4,   2 Jun 22 11:11 tty2
crw--w----    1 root     tty         4,  20 Jun 22 11:11 tty20
crw--w----    1 root     tty         4,  21 Jun 22 11:11 tty21
crw--w----    1 root     tty         4,  22 Jun 22 11:11 tty22
crw--w----    1 root     tty         4,  23 Jun 22 11:11 tty23
crw--w----    1 root     tty         4,  24 Jun 22 11:11 tty24
crw--w----    1 root     tty         4,  25 Jun 22 11:11 tty25
crw--w----    1 root     tty         4,  26 Jun 22 11:11 tty26
crw--w----    1 root     tty         4,  27 Jun 22 11:11 tty27
crw--w----    1 root     tty         4,  28 Jun 22 11:11 tty28
crw--w----    1 root     tty         4,  29 Jun 22 11:11 tty29
crw--w----    1 root     tty         4,   3 Jun 22 11:11 tty3
crw--w----    1 root     tty         4,  30 Jun 22 11:11 tty30
crw--w----    1 root     tty         4,  31 Jun 22 11:11 tty31
crw--w----    1 root     tty         4,  32 Jun 22 11:11 tty32
crw--w----    1 root     tty         4,  33 Jun 22 11:11 tty33
crw--w----    1 root     tty         4,  34 Jun 22 11:11 tty34
crw--w----    1 root     tty         4,  35 Jun 22 11:11 tty35
crw--w----    1 root     tty         4,  36 Jun 22 11:11 tty36
crw--w----    1 root     tty         4,  37 Jun 22 11:11 tty37
crw--w----    1 root     tty         4,  38 Jun 22 11:11 tty38
crw--w----    1 root     tty         4,  39 Jun 22 11:11 tty39
crw--w----    1 root     tty         4,   4 Jun 22 11:11 tty4
crw--w----    1 root     tty         4,  40 Jun 22 11:11 tty40
crw--w----    1 root     tty         4,  41 Jun 22 11:11 tty41
crw--w----    1 root     tty         4,  42 Jun 22 11:11 tty42
crw--w----    1 root     tty         4,  43 Jun 22 11:11 tty43
crw--w----    1 root     tty         4,  44 Jun 22 11:11 tty44
crw--w----    1 root     tty         4,  45 Jun 22 11:11 tty45
crw--w----    1 root     tty         4,  46 Jun 22 11:11 tty46
crw--w----    1 root     tty         4,  47 Jun 22 11:11 tty47
crw--w----    1 root     tty         4,  48 Jun 22 11:11 tty48
crw--w----    1 root     tty         4,  49 Jun 22 11:11 tty49
crw--w----    1 root     tty         4,   5 Jun 22 11:11 tty5
crw--w----    1 root     tty         4,  50 Jun 22 11:11 tty50
crw--w----    1 root     tty         4,  51 Jun 22 11:11 tty51
crw--w----    1 root     tty         4,  52 Jun 22 11:11 tty52
crw--w----    1 root     tty         4,  53 Jun 22 11:11 tty53
crw--w----    1 root     tty         4,  54 Jun 22 11:11 tty54
crw--w----    1 root     tty         4,  55 Jun 22 11:11 tty55
crw--w----    1 root     tty         4,  56 Jun 22 11:11 tty56
crw--w----    1 root     tty         4,  57 Jun 22 11:11 tty57
crw--w----    1 root     tty         4,  58 Jun 22 11:11 tty58
crw--w----    1 root     tty         4,  59 Jun 22 11:11 tty59
crw--w----    1 root     tty         4,   6 Jun 22 11:11 tty6
crw--w----    1 root     tty         4,  60 Jun 22 11:11 tty60
crw--w----    1 root     tty         4,  61 Jun 22 11:11 tty61
crw--w----    1 root     tty         4,  62 Jun 22 11:11 tty62
crw--w----    1 root     tty         4,  63 Jun 22 11:11 tty63
crw--w----    1 root     tty         4,   7 Jun 22 11:11 tty7
crw--w----    1 root     tty         4,   8 Jun 22 11:11 tty8
crw--w----    1 root     tty         4,   9 Jun 22 11:11 tty9
crw-rw----    1 root     dialout   245,   0 Jun 22 11:11 ttyS0
crw-rw----    1 root     dialout   245,   1 Jun 22 11:11 ttyS1
crw-------    1 root     root        5,   3 Jun 22 11:11 ttyprintk
crw-------    1 root     root      254,   0 Jun 22 11:11 tv
crw-------    1 root     root       10,  56 Jun 22 11:11 ubi_ctrl
crw-------    1 root     root       10, 239 Jun 22 11:11 uhid
crw-------    1 root     root       10, 223 Jun 22 11:11 uinput
crw-------    1 root     root      247,   0 Jun 22 11:11 uio0
crw-rw-rw-    1 root     root        1,   9 Jun 22 11:11 urandom
crw-rw----    1 root     tty         7,   0 Jun 22 11:11 vcs
crw-rw----    1 root     tty         7,   1 Jun 22 11:11 vcs1
crw-rw----    1 root     tty         7,   2 Jun 22 11:11 vcs2
crw-rw----    1 root     tty         7,   3 Jun 22 11:11 vcs3
crw-rw----    1 root     tty         7,   4 Jun 22 11:11 vcs4
crw-rw----    1 root     tty         7,   5 Jun 22 11:11 vcs5
crw-rw----    1 root     tty         7,   6 Jun 22 11:11 vcs6
crw-rw----    1 root     tty         7, 128 Jun 22 11:11 vcsa
crw-rw----    1 root     tty         7, 129 Jun 22 11:11 vcsa1
crw-rw----    1 root     tty         7, 130 Jun 22 11:11 vcsa2
crw-rw----    1 root     tty         7, 131 Jun 22 11:11 vcsa3
crw-rw----    1 root     tty         7, 132 Jun 22 11:11 vcsa4
crw-rw----    1 root     tty         7, 133 Jun 22 11:11 vcsa5
crw-rw----    1 root     tty         7, 134 Jun 22 11:11 vcsa6
crw-------    1 root     root      269,   0 Jun 22 11:11 vfm
crw-rw----    1 root     video      81,   0 Jun 22 11:11 video10
crw-rw-rw-    1 root     root        1,   5 Jun 22 11:11 zero


lirc_options.conf:

Code: Select all
# These are the default options to lircd, if installed as
# /etc/lirc/lirc_options.conf. See the lircd(8) and lircmd(8)
# manpages for info on the different options.
#
# Some tools including mode2 and irw uses values such as
# driver, device, plugindir and loglevel as fallback values
# in not defined elsewhere.

[lircd]
nodaemon        = False
driver          = default
device          = /dev/lirc1
output          = /run/lirc/lircd1.socket
pidfile         = /run/lirc/lircd1.pid
plugindir       = /usr/lib/lirc/plugins
permission      = 666
allow-simulate  = No
repeat-max      = 600
#effective-user =
#listen         = [address:]port
#connect        = host[:port]
#loglevel       = 6
#release        = true
#release_suffix = _EVUP
#logfile        = ...
#driver-options = ...

[lircmd]
uinput          = False
nodaemon        = False

# [modinit]
# code = /usr/sbin/modprobe lirc_serial
# code1 = /usr/bin/setfacl -m g:lirc:rw /dev/uinput
# code2 = ...


# [lircd-uinput]
# add-release-events = False
# release-timeout    = 200
# release-suffix     = _EVUP


lircd.conf:

Code: Select all
include "/etc/lirc/lircd.conf.d/*.conf"


hs.conf (IR remote inside of lircd.conf.d):

Code: Select all
# Please take the time to finish this file as described in
# https://sourceforge.net/p/lirc-remotes/wiki/Checklist/
# and make it available to others by sending it to
# <lirc@bartelmus.de>
#
# This config file was automatically generated
# using lirc-0.9.4d(default) on Thu Oct 11 13:08:11 2018
# Command line used: -f hdmiswitch
# Kernel version (uname -r): 3.14.29
#
# Remote name (as of config file): hs
# Brand of remote device, the thing you hold in your hand:
# Remote device model nr:
# Remote device info url:
# Does remote device has a bundled capture device e. g., a
#     usb dongle? :
# For bundled USB devices: usb vendor id, product id
#     and device string (use dmesg or lsusb):
# Type of device controlled
#     (TV, VCR, Audio, DVD, Satellite, Cable, HTPC, ...) :
# Device(s) controlled by this remote:

begin remote

  name  hs
  flags RAW_CODES
  eps            30
  aeps          100

  gap          39544

      begin raw_codes

          name KEY_1
             9100    4530     640     520     640     530
              640     520     640     530     640     520
              640     530     630     530     640    1600
              640    1610     640    1600     640    1610
              640    1600     640    1610     630    1610
              640    1600     640     530     640     520
              640    1610     630     530     640     530
              600     560     610     560     600     560
              610     560     590    1650     600     570
              590    1650     590    1650     620    1630
              620    1620     620    1630     610    1630
              620

...

Domi
 
Posts: 8
Joined: Thu Sep 20, 2018 8:44 pm
languages_spoken: english, german
ODROIDs: C2, XU4

Re: Loading lirc_odroid in LibreELEC (C2)

Unread postby joy » Fri Oct 26, 2018 10:27 am

Hello Domi,
Thank you for sharing the information.

Do you use /dev/lirc0 for another purpose like ir receiver, so you assigned the node for ir tx on /dev/lirc1?
If not so, could you try /dev/lirc0 for IR blaster?
Code: Select all
$ sudo rmmod meson_ir

- change lirc_options.conf
https://wiki.odroid.com/odroid-c2/appli ... _odroid-c2

If you still have the issue even with /dev/lirc0, please share the result.
I've never try LIRC on LibreELEC image so I will try it.
But there may not be different with C2 ubuntu release image, I think.

(updated)
I found IR receiver with /dev/lirc0 is a default functionality on LibreELEC image.
I will check ir blaster functionality on LibreELEC
and also check if both of ir rx and tx are available at the same time.
joy
 
Posts: 571
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X

Re: Loading lirc_odroid in LibreELEC (C2)

Unread postby joy » Fri Oct 26, 2018 2:47 pm

Hi Domi,
Could you try the followings?

1. Set the lirc_options.conf file back as the initial release from LibreELEC
2. restart lircd service or reboot system
3. run this on command line
Code: Select all
# modprobe lirc_odroid gpio_out_pin=249 softcarrier=1 invert=1
# ls /dev/lirc*
/dev/lirc0   /dev/lirc1

# lircd --driver=default --device=/dev/lirc1 --output=/var/run/lirc/lirc1 --pidfile=/var/run/lirc/lirc1.pid
# ls /var/run/lirc
lirc0  lirc0.pid  lirc1  lirc1.pid  lircd  lircd.pid  lircm

# irsend LIST "" hs
# irsend SEND_ONCE hs KEY_1 -d /var/run/lirc/lirc1
joy
 
Posts: 571
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X

Re: Loading lirc_odroid in LibreELEC (C2)

Unread postby Domi » Tue Oct 30, 2018 5:32 pm

joy wrote:Hello Domi,
Thank you for sharing the information.

Do you use /dev/lirc0 for another purpose like ir receiver, so you assigned the node for ir tx on /dev/lirc1?
If not so, could you try /dev/lirc0 for IR blaster?
Code: Select all
$ sudo rmmod meson_ir

- change lirc_options.conf
https://wiki.odroid.com/odroid-c2/appli ... _odroid-c2

If you still have the issue even with /dev/lirc0, please share the result.
I've never try LIRC on LibreELEC image so I will try it.
But there may not be different with C2 ubuntu release image, I think.

(updated)
I found IR receiver with /dev/lirc0 is a default functionality on LibreELEC image.
I will check ir blaster functionality on LibreELEC
and also check if both of ir rx and tx are available at the same time.


joy wrote:Hi Domi,
Could you try the followings?

1. Set the lirc_options.conf file back as the initial release from LibreELEC
2. restart lircd service or reboot system
3. run this on command line
Code: Select all
# modprobe lirc_odroid gpio_out_pin=249 softcarrier=1 invert=1
# ls /dev/lirc*
/dev/lirc0   /dev/lirc1

# lircd --driver=default --device=/dev/lirc1 --output=/var/run/lirc/lirc1 --pidfile=/var/run/lirc/lirc1.pid
# ls /var/run/lirc
lirc0  lirc0.pid  lirc1  lirc1.pid  lircd  lircd.pid  lircm

# irsend LIST "" hs
# irsend SEND_ONCE hs KEY_1 -d /var/run/lirc/lirc1



Hey Joy,

yes, I am indeed trying to do RX and TX at the same time if possible. I also would be happy with just getting sending to work at all. :)

I tried stopping all LIRC services (lircd, eventlircd), disabling meson_ir, replaced the lirc_options.conf with the one the wiki and loaded the lirc_odroid module. That freed up lirc0 and put lirc_odroid on lirc0.
However, upon starting lirc these messages are repeated over and over again:

Code: Select all
Oct 30 08:08:52.601401 LibreELEC lircd: Error: major number of /dev/lirc0 is 233
Oct 30 08:08:52.601497 LibreELEC lircd: Error: make sure /dev/lirc0 is a LIRC device and use a current version of the driver
Oct 30 08:08:53.602839 LibreELEC lircd: Error: could not get hardware features
Oct 30 08:08:53.603045 LibreELEC lircd: Error: this device driver does not support the LIRC ioctl interface
Oct 30 08:08:53.603122 LibreELEC lircd: Error: major number of /dev/lirc0 is 233
Oct 30 08:08:53.603196 LibreELEC lircd: Error: make sure /dev/lirc0 is a LIRC device and use a current version of the driver
Oct 30 08:08:54.604696 LibreELEC lircd: Error: could not get hardware features
Oct 30 08:08:54.605037 LibreELEC lircd: Error: this device driver does not support the LIRC ioctl interface
Oct 30 08:08:54.605193 LibreELEC lircd: Error: major number of /dev/lirc0 is 233
Oct 30 08:08:54.605339 LibreELEC lircd: Error: make sure /dev/lirc0 is a LIRC device and use a current version of the driver
Oct 30 08:08:55.606779 LibreELEC lircd: Error: could not get hardware features
Oct 30 08:08:55.607688 LibreELEC lircd: Error: this device driver does not support the LIRC ioctl interface


I also tried the second approach you listed.

There's no difference between my lirc_options.conf and the one of LibreELEC (except some comments) so I just left it in place for now.

Code: Select all
LibreELEC:~/.config # modprobe lirc_odroid gpio_out_pin=249 softcarrier=1 invert=1
LibreELEC:~/.config # ls /dev/lirc*
/dev/lirc0  /dev/lirc1
LibreELEC:~/.config # lircd --driver=default --device=/dev/lirc1 --output=/var/run/lirc/lirc1 --pidfile=/var/run/lirc/lirc1.pid
LibreELEC:~/.config # ls /var/run/lirc
lirc1         lirc1.pid     lircd         lircd.pid     lircd.socket
LibreELEC:~/.config # irsend -d /var/run/lirc/lirc1 LIST "" hs

0000000000000001 KEY_1
0000000000000002 KEY_2
0000000000000003 KEY_3
0000000000000004 KEY_4
LibreELEC:~/.config # irsend SEND_ONCE hs KEY_1 -d /var/run/lirc/lirc1

hardware does not support sending
Error running command: Input/output error


Doing irsend LIST without -d just locks up. Probably because eventlircd uses /var/run/lirc/lircd and LIRC in LibreELEC actually uses /var/run/lirc/lircd.socket.

Is there a way to get more info as to what's going on behind the scene?

Thanks for your help this far, I really appreciate it.
Domi
 
Posts: 8
Joined: Thu Sep 20, 2018 8:44 pm
languages_spoken: english, german
ODROIDs: C2, XU4

Re: Loading lirc_odroid in LibreELEC (C2)

Unread postby joy » Wed Oct 31, 2018 3:33 pm

Domi wrote:I also tried the second approach you listed.
There's no difference between my lirc_options.conf and the one of LibreELEC (except some comments) so I just left it in place for now.

Hi Domi,
Thank you for sharing the info. :)

To make sure, I've checked lirc_options.conf in LibreELEC image.
As I checked, there are some different points from the lirc_options.conf you shared here.
Could you check it?
Code: Select all
# These are the default options to lircd, if installed as
# /etc/lirc/lirc_options.conf. See the lircd(8) and lircmd(8)
# manpages for info on the different options.
#
# Some tools including mode2 and irw uses values such as
# driver, device, plugindir and loglevel as fallback values
# in not defined elsewhere.

[lircd]
nodaemon        = False
driver          = default
device          = /dev/lirc0
output          = /run/lirc/lircd.socket
pidfile         = /run/lirc/lircd.pid
plugindir       = /usr/lib/lirc/plugins
permission      = 666
allow-simulate  = No
repeat-max      = 600
#effective-user =
#listen         = [address:]port
#connect        = host[:port]
#loglevel       = 6
#uinput         = ...
#release        = ...
#logfile        = ...

[lircmd]
uinput          = False
nodaemon        = False

# modinit is not supported in LibreELEC

# [modinit]
# code = /usr/sbin/modprobe lirc_serial
# code1 = /usr/bin/setfacl -m g:lirc:rw /dev/uinput
# code2 = ...

# [lircd-uinput]
# release-timeout = 200

There is a gap between LibreELEC and Ubuntu and I don't have much knowledge about LibreELEC. :(
And I couldn't reproduce the same issue on Ubuntu 18.04
so, it will be better that I try lirc_odroid on LibreELEC and run both of IR RX and TX.

Domi wrote:Doing irsend LIST without -d just locks up. Probably because eventlircd uses /var/run/lirc/lircd and LIRC in LibreELEC actually uses /var/run/lirc/lircd.socket.

Do you mean it works well with "-d" option? or even with "-d" option, you got same problem, irsend lock-up, too?
Domi wrote:Is there a way to get more info as to what's going on behind the scene?
Thanks for your help this far, I really appreciate it.

Well... on Ubuntu 18.04, I use tail -f /var/log/syslog and I can get information from lircd-related services,
but, there is no node in LibreELEC. :(
joy
 
Posts: 571
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X

Re: Loading lirc_odroid in LibreELEC (C2)

Unread postby Domi » Tue Nov 06, 2018 5:25 pm

joy wrote:
Domi wrote:I also tried the second approach you listed.
There's no difference between my lirc_options.conf and the one of LibreELEC (except some comments) so I just left it in place for now.

Hi Domi,
Thank you for sharing the info. :)

To make sure, I've checked lirc_options.conf in LibreELEC image.
As I checked, there are some different points from the lirc_options.conf you shared here.
Could you check it?
Code: Select all
# These are the default options to lircd, if installed as
# /etc/lirc/lirc_options.conf. See the lircd(8) and lircmd(8)
# manpages for info on the different options.
#
# Some tools including mode2 and irw uses values such as
# driver, device, plugindir and loglevel as fallback values
# in not defined elsewhere.

[lircd]
nodaemon        = False
driver          = default
device          = /dev/lirc0
output          = /run/lirc/lircd.socket
pidfile         = /run/lirc/lircd.pid
plugindir       = /usr/lib/lirc/plugins
permission      = 666
allow-simulate  = No
repeat-max      = 600
#effective-user =
#listen         = [address:]port
#connect        = host[:port]
#loglevel       = 6
#uinput         = ...
#release        = ...
#logfile        = ...

[lircmd]
uinput          = False
nodaemon        = False

# modinit is not supported in LibreELEC

# [modinit]
# code = /usr/sbin/modprobe lirc_serial
# code1 = /usr/bin/setfacl -m g:lirc:rw /dev/uinput
# code2 = ...

# [lircd-uinput]
# release-timeout = 200

There is a gap between LibreELEC and Ubuntu and I don't have much knowledge about LibreELEC. :(
And I couldn't reproduce the same issue on Ubuntu 18.04
so, it will be better that I try lirc_odroid on LibreELEC and run both of IR RX and TX.


Hey Joy,

I couldn't find any settings that are different between the original LibreELEC config and the IR blaster config except some commented out lines. I will try again with the original one though. In fact, I might just leave the regular LIRC alone and only start the TX LIRC as standalone application.

I already tested it on Ubuntu 16.04 and it works fine in a similar setup there, so I'm thinking something might really be wrong with the module itself if LIRC is complaining since I added it to the LibreELEC build process by myself.

joy wrote:
Domi wrote:Doing irsend LIST without -d just locks up. Probably because eventlircd uses /var/run/lirc/lircd and LIRC in LibreELEC actually uses /var/run/lirc/lircd.socket.

Do you mean it works well with "-d" option? or even with "-d" option, you got same problem, irsend lock-up, too?
Domi wrote:Is there a way to get more info as to what's going on behind the scene?
Thanks for your help this far, I really appreciate it.

Well... on Ubuntu 18.04, I use tail -f /var/log/syslog and I can get information from lircd-related services,
but, there is no node in LibreELEC. :(


It doesn't get stuck with the -d parameter (which is expected) but brings the error message instead.
I get my logs from LIRC directly with the --logfile parameter and from dmesg, anything else that's available on LibreELEC?

I can send you the image I built to test if you want. Or the changes I made so you can compile it yourself.
Domi
 
Posts: 8
Joined: Thu Sep 20, 2018 8:44 pm
languages_spoken: english, german
ODROIDs: C2, XU4

Re: Loading lirc_odroid in LibreELEC (C2)

Unread postby joy » Tue Nov 06, 2018 5:31 pm

Domi wrote:
joy wrote:
Domi wrote:I can send you the image I built to test if you want. Or the changes I made so you can compile it yourself.

Yes! Please share your test image including kernel and modules.

I tried to set up LibreELEC compile environment and did download the whole source codes,
but got compile errors. :(

Do you know the link that I can download only LibreELEC Kernel Source Code?
If so, please share it with me and also build instructions, too.
joy
 
Posts: 571
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X

Re: Loading lirc_odroid in LibreELEC (C2)

Unread postby Domi » Tue Nov 06, 2018 6:23 pm

joy wrote:
Domi wrote:
joy wrote:
Domi wrote:I can send you the image I built to test if you want. Or the changes I made so you can compile it yourself.

Yes! Please share your test image including kernel and modules.

I tried to set up LibreELEC compile environment and did download the whole source codes,
but got compile errors. :(

Do you know the link that I can download only LibreELEC Kernel Source Code?
If so, please share it with me and also build instructions, too.


The LibreELEC build process is automated, so I assume it fetches the kernel from a git repository like it does with everything else. I didn't check the exact process though.

I guess they use this one: https://github.com/LibreELEC/linux-amlogic since it's referenced in the linux package:
Code: Select all
  amlogic-3.14)
    PKG_VERSION="6d8fbb4ee61a7779ac57b5961e076f0c63ff8b65"
    PKG_SHA256="ef05c88779c893f92e92e5315d0e5396f34c32289726c301fae7ffe8c4214227"
    PKG_URL="https://github.com/LibreELEC/linux-amlogic/archive/$PKG_VERSION.tar.gz"
    PKG_SOURCE_NAME="linux-$LINUX-$PKG_VERSION.tar.gz"
    PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET aml-dtbtools:host"
    PKG_BUILD_PERF="no"
    ;;


Here's my build process, using the LibreELEC build process from https://wiki.libreelec.tv/compile (uses Docker on Linux):

* Pull master or latest tag from https://github.com/LibreELEC/LibreELEC.tv
* Serve the attached lirc-odroid-1.0.tar.gz from a web server (so it can be reached with "http://localhost/modules/lirc-odroid-1.0.tar.gz"; or adjust the path below)
* Extract the attached package.mk from package.zip to "packages/linux-drivers/lirc-odroid"; adjust PKG_URL if necessary
* Add lirc-odroid to ADDITIONAL_DRIVERS inside of "projects/Amlogic/options" like this: ADDITIONAL_DRIVERS="gpu-aml RTL8192CU RTL8192DU RTL8192EU RTL8812AU RTL8188EU-aml lirc-odroid"
* Run "docker build --pull -t libreelec tools/docker/xenial" in the root folder to build the Docker container
* Run "docker run -v /path/to/libreelec:/home/docker -h libreelec -it libreelec" to start the container
* Start the C2 build process with "PROJECT=Amlogic DEVICE=Odroid_C2 ARCH=arm make image" (make sure you're in the LibreELEC root inside of the Docker container before running this command)

The contents of lirc-odroid-1.0.tar.gz are just a straight copy from the Hardkernel repo. Docker commands probably need sudo.

Will upload my image later if you still need it then.
Attachments
package.zip
(530 Bytes) Downloaded 7 times
lirc-odroid-1.0.tar.gz
(53.92 KiB) Downloaded 13 times
Domi
 
Posts: 8
Joined: Thu Sep 20, 2018 8:44 pm
languages_spoken: english, german
ODROIDs: C2, XU4

Re: Loading lirc_odroid in LibreELEC (C2)

Unread postby joy » Wed Nov 07, 2018 9:21 am

Domi,
Thank you for sharing the detailed instructions.

I will build libreELEC kernel again including lirc_odroid and replace only kernel and modules,
then will try IR functions again on LibreELEC.

Sorry that I can't say any more guide now because I'm a newbie of LibreELEC.
joy
 
Posts: 571
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X

Re: Loading lirc_odroid in LibreELEC (C2)

Unread postby joy » Fri Nov 09, 2018 3:06 pm

Hi Domi,
Based on your instructions, I've compiled source codes and update my LibreELEC image with lirc_odroid module,
and I could reproduce the stuck issue when I try irsend.
But so far I can't figure it out.

(updated)
staging driver is missing. I will try to add it on kernel and check if it makes this issue.
joy
 
Posts: 571
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X

Re: Loading lirc_odroid in LibreELEC (C2)

Unread postby joy » Fri Nov 09, 2018 6:28 pm

Hi Domi,

As I checked, regardless of IR RX with meson-ir, IR TX with lirc_odroid doesn't work on LibreELEC image.
And I found staging media and lirc are missing.
I'm not sure it makes this issue, but it's worthy to check it.

Could you add these defconfig in kernel and check if IR tx works?
Code: Select all
LibreELEC.tv/build.LibreELEC-Odroid_C2.arm-9.0-devel/linux-6d8fbb4ee61a7779ac57b5961e076f0c63ff8b65/arch/arm64/configs/meson64_defconfig

Code: Select all
CONFIG_STAGING_MEDIA=y
CONFIG_LIRC_STAGING=y


And if you know, could you let me know how I change kernel configuration (using make menuconfig) on docker build environment?
LibreELEC full build process that you shared with me works perfectly. (Thanks again.)
joy
 
Posts: 571
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X

Re: Loading lirc_odroid in LibreELEC (C2)

Unread postby Domi » Wed Nov 14, 2018 9:48 pm

joy wrote:Hi Domi,

As I checked, regardless of IR RX with meson-ir, IR TX with lirc_odroid doesn't work on LibreELEC image.
And I found staging media and lirc are missing.
I'm not sure it makes this issue, but it's worthy to check it.

Could you add these defconfig in kernel and check if IR tx works?
Code: Select all
LibreELEC.tv/build.LibreELEC-Odroid_C2.arm-9.0-devel/linux-6d8fbb4ee61a7779ac57b5961e076f0c63ff8b65/arch/arm64/configs/meson64_defconfig

Code: Select all
CONFIG_STAGING_MEDIA=y
CONFIG_LIRC_STAGING=y


And if you know, could you let me know how I change kernel configuration (using make menuconfig) on docker build environment?
LibreELEC full build process that you shared with me works perfectly. (Thanks again.)


Hey Joy,

I added CONFIG_STAGING_MEDIA and CONFIG_LIRC_STAGING to projects/Amlogic/linux/linux.aarch64.conf, which hopefully ends up in the meson64_defconfig. Will update once the build finishes.

I'm not aware of any way to run menuconfig manually on the LibreELEC build process since it's all automatic, but the people on the LibreELEC forums might know more.
Domi
 
Posts: 8
Joined: Thu Sep 20, 2018 8:44 pm
languages_spoken: english, german
ODROIDs: C2, XU4

Re: Loading lirc_odroid in LibreELEC (C2)

Unread postby joy » Thu Nov 15, 2018 8:05 am

Domi wrote:I added CONFIG_STAGING_MEDIA and CONFIG_LIRC_STAGING to projects/Amlogic/linux/linux.aarch64.conf, which hopefully ends up in the meson64_defconfig. Will update once the build finishes.
I'm not aware of any way to run menuconfig manually on the LibreELEC build process since it's all automatic, but the people on the LibreELEC forums might know more.

Hi Domi,
Thank you for checking it.
I hope the modification makes IR TX work.
Once you're done testing it, please share the result.
joy
 
Posts: 571
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X

Re: Loading lirc_odroid in LibreELEC (C2)

Unread postby Domi » Thu Nov 15, 2018 7:37 pm

joy wrote:
Domi wrote:I added CONFIG_STAGING_MEDIA and CONFIG_LIRC_STAGING to projects/Amlogic/linux/linux.aarch64.conf, which hopefully ends up in the meson64_defconfig. Will update once the build finishes.
I'm not aware of any way to run menuconfig manually on the LibreELEC build process since it's all automatic, but the people on the LibreELEC forums might know more.

Hi Domi,
Thank you for checking it.
I hope the modification makes IR TX work.
Once you're done testing it, please share the result.


Hey Joy,

I'm still getting the error message.

The lines did not show up in meson64_defconfig but it asked me during the build process if I want to enable the staging media and lirc modules.

Any way to check if they actually loaded correctly?
Domi
 
Posts: 8
Joined: Thu Sep 20, 2018 8:44 pm
languages_spoken: english, german
ODROIDs: C2, XU4


Return to LibreELEC - Kodi Project for C1/C2

Who is online

Users browsing this forum: No registered users and 1 guest