Menu

#97 Error: unable to open '/dev/lircd1'

Future
closed
nobody
None
notabug,
2015-02-05
2015-01-30
BytEvil
No

I have two lirc devices on my system (Arch Linux). Devices is working properly, but the logs Errors occur frequently after starting Kodi(XBMC) application with --lircdev /dev/lircd1 parameter.

3 Attachments

Discussion

  • Alec Leamas

    Alec Leamas - 2015-01-30

    Looking at lircd:pd3.service: I don't understand what's going on here. What kind of device is /var/run/lircd1? Is arch creating the regular kernel devices in /var/run?
    Why a symlink instead of just giving the device to lircd?

    "Confused"

     
  • BytEvil

    BytEvil - 2015-01-30

    Kodi (XBMC) app use /dev/lircd by default. I have multiseat system on Arch, and 3 running instances of Kodi (with command line parameters, --lircdev...). 1st instance use /dev/lircd by default with devinput driver on HP Media Remote, 2nd instance with USB-CEC adapter without lirc and 3rd instance with Bluetooth PS3 BD remote (bdremote-ng+lirc) (/dev/lircd1). All worked, but the logs errors occur frequently. On older versions of lirc`s all worked fine, without errors.

     
    • Alec Leamas

      Alec Leamas - 2015-01-30

      Kodi (XBMC) app use /dev/lircd by default

      For what? What does Kodi expect on this device?

      I'm really lost here. In a sane setup /dev/lirc* devices are read by lircd which then provides data which applications such as Kodi can read on /var/run/lircd. When using multiple lircd instances, the usual setup is to create more output sockets in /var/run/lirc

       
    • Alec Leamas

      Alec Leamas - 2015-01-30

      Kodi (XBMC) app use /dev/lircd by default

      Nope, it does not: current kodi 14.0 uses /var/run/lirc/lircd:

      Usage: kodi [OPTION]... [FILE]...
      
      Arguments:
        -d <n>            delay <n> seconds before starting
        -fs               Runs Kodi in full screen
        --standalone      Kodi runs in a stand alone environment without a window
                          manager and supporting applications. For example, that
                          enables network settings.
        -p or --portable  Kodi will look for configurations in install folder
                          instead of ~/.kodi
        --legacy-res      Enables screen resolutions such as PAL, NTSC, etc.
        -l or --lircdev   LircDevice to use default is /var/run/lirc/lircd .
        [cut]
      
       
  • BytEvil

    BytEvil - 2015-01-30

    ExecStartPre=/usr/bin/ln -sf /var/run/lirc/lircd1 /dev/lircd1 not needed, removed.

     
  • Alec Leamas

    Alec Leamas - 2015-01-30

    I tend to think that this is not really a lircd bug. When you run lircd without kodi there's really no problem. right?

    To make any conclusion here, we need to reproduce the problem without running Kodi. Can you do that, using the /dev/lirc* devices as as input and sane output socket devices in /var/run/lirc?

    EDIT: Raising the debug level to 'debug' to get some more info in the logs is also helpful

     

    Last edit: Alec Leamas 2015-01-30
  • BytEvil

    BytEvil - 2015-01-30

    I understand, lirсd trying to connect to a device /dev/lircd1 that is already occupied by KODI, but why?

    The scheme is:
    1.Starting Lirc...and all is super fine :)

    янв 30 14:58:07 KODI lircd-0.9.2[13501]: Notice: Running as user vis2
    янв 30 14:58:07 KODI lircd-0.9.2[13501]: Info: Using remote: devinput.
    янв 30 14:58:07 KODI lircd-0.9.2[13501]: Info: Using remote: devinput.
    янв 30 14:58:07 KODI lircd-0.9.2[13503]: Notice: lircd(devinput) ready, using /var/run/lirc/lircd1
    янв 30 14:58:07 KODI lircd-0.9.2[13503]: Notice: connected to 127.0.0.1

    2.Waiting... hour...two...no errors

    2.Starting Kodi
    $ DISPLAY=:2 /usr/local/bin/kodi2 --lircdev /dev/lircd1
    ....Started...Remote working...

    3.Lircd sends greetings with errors:
    янв 30 15:16:16 KODI lircd-0.9.2[13503]: Error: unable to open '/dev/lircd1'
    янв 30 15:16:17 KODI lircd-0.9.2[13503]: Info: initializing '/dev/lircd1'
    янв 30 15:16:17 KODI lircd-0.9.2[13503]: Error: unable to open '/dev/lircd1'
    янв 30 15:16:18 KODI lircd-0.9.2[13503]: Info: initializing '/dev/lircd1'

     
  • Alec Leamas

    Alec Leamas - 2015-01-30

    Well, from lircds' perspective this is as expected. It needs to have exclusive access to the /dev/lircd* devices, and when Kodi accesses these as well there is conflicts.

    What I really can't understand is why Kodi should access /dev/lircd1. This is raw timing or driver data, not decoded button press events. Why should Kodi read this? I don't know kodi thouroghly, but lirc-enabled applications normally read the button events lircd makes available on (in this case) /var/run/lircd1.

    And if Kodi really needs to access /dev/lirc1, then you can't have a lircd instance reading from that device. It's as simple as that.

    EDIT: A simple google shows that the kodi option should indeed be --lircdev /var/run/lircd1.

    Also this search revealed "advices" that users should do what you did: 'ln -s /var/run/lircd /dev/lirc0' or so. However, as this actually is to link the output device to the input one this advice makes no sense, and in those cases it has worked it's a lircd bug. It shouldn't, really.

    There is strange stuff floating around out there, for sure.

     

    Last edit: Alec Leamas 2015-01-30
  • Alec Leamas

    Alec Leamas - 2015-01-30

    Frankly, this just looks like a messed up installation. Unless there is more input I will close this as NOTABUG.

     
  • BytEvil

    BytEvil - 2015-01-30

    On the previous versions of lircd i never had a problems. :)
    e.g.:
    lirc-1:0.9.1.a-12-x86_64.pkg.tar.xz
    lirc-utils-1:0.9.1.a-9-x86_64

    How can I completely disable lircd logs? Сonstantly writes to the journalctl log these errors ^_^

     
  • Alec Leamas

    Alec Leamas - 2015-01-31
    • status: open --> closed
    • Resolution: na, --> notabug,
     
  • Alec Leamas

    Alec Leamas - 2015-01-31

    Well, if this configuration worked, that was a bug. Which is now fixed, since lircd now writes proper warning messages :) Your setup just isn't sane.

    As of now, there is no UI to completely disable the logging.

    You should not have these messages, and as I understand it you will get rid of them by giving kodi the correct device option --lircdev /var/run/lirc/lircd1. Having conflicts on the input device as you have just isn't supported.

    Closing as NOTABUG. If you have more problems, please use the mailing list (which more folks are reading) until we can agree upon that there is a lircd bug.

     
  • BytEvil

    BytEvil - 2015-01-31

    I`m starting Kodi with --lircdev /var/run/lirc/lircd1 and disable "device" option in /etc/lirc/lirc_ps3.conf. Remote working, lircd send:
    янв 31 09:18:10 KODI lircd-0.9.2[28365]: Info: initializing '/dev/lirc0'
    янв 31 09:18:10 KODI lircd-0.9.2[28365]: Error: unable to open '/dev/lirc0'
    янв 31 09:18:11 KODI lircd-0.9.2[28365]: Info: initializing '/dev/lirc0'
    etc...
    Why does he do it? It is not clear ...

    Thanks for help :))

     
    • Alec Leamas

      Alec Leamas - 2015-01-31

      You still don't get it.

      A lircd instance reads raw driver data from a kernel device such as /dev/lirc1 and writes decoded button-press events to a socket, in your case /var/run/lirc/lircd1.

      lirc-enabled applications such as kodi reads the decoded button-press events from the socket.

      The kodi setup looks OK (fingers crossed, don't really know kodi).

      But: lircd always needs an input device. If you disable the
      'device' option (why?) it will fall back to a driver-dependent default. Using the devinput driver it will then use /dev/lirc0. But I presume that your setup have the kernel data on /dev/lircd1, right?.

      So: why did come up with this idea to disable the 'device' argument?

       
  • BytEvil

    BytEvil - 2015-01-31

    I did a rollback to a previous version of a package

    lirc-1:0.9.1.a-12-x86_64.pkg.tar.xz

    lirc-utils-1:0.9.1.a-9-x86_64.pkg.tar.xz

    No errors at all.

    ● lircd_ps3.service - LIRC Daemon for SonyBDRemote
       Loaded: loaded (/usr/lib/systemd/system/lircd_ps3.service; enabled; vendor preset: disabled)
       Active: active (running) since Сб 2015-01-31 13:33:52 SAMT; 5min ago
      Process: 2331 ExecStart=/usr/sbin/lircd --driver=devinput --device=/dev/lircd1 --output=/var/run/lirc/lircd1 --pidfile=/var/run/lirc/lircd1.pid --connect=127.0.0.1:8888 (code=exited, status=0/SUCCESS)
      Process: 2328 ExecStartPre=/usr/bin/ln -sf /var/run/lirc/lircd1 /dev/lircd1 (code=exited, status=0/SUCCESS)
     Main PID: 2332 (lircd)
       CGroup: /system.slice/lircd_ps3.service
               └─2332 /usr/sbin/lircd --driver=devinput --device=/dev/lircd1 --output=/var/run/lirc/lircd1 --pidfile=/var/run/lirc/lircd1.pid --connect=127.0.0.1:8888

    ● lircd_hp.service - LIRC Daemon for HP Remote
       Loaded: loaded (/usr/lib/systemd/system/lircd_hp.service; enabled; vendor preset: disabled)
       Active: active (running) since Сб 2015-01-31 13:33:25 SAMT; 6min ago
     Main PID: 2303 (lircd)
       CGroup: /system.slice/lircd_hp.service
               └─2303 /usr/sbin/lircd --driver devinput --device /dev/input/by-path/pci-0000:00:14.0-usb-0:14:1.0-event

    янв 31 13:33:25 KODI ir-keytable[2304]: Protocols changed to RC-6

     

     

     

     
  • Alec Leamas

    Alec Leamas - 2015-01-31

    This is an insane configuration. The results when symlinking the output device /var/run/lirc/lircd1 to the input device /dev/lirc1 are undefined.

    Besides that, what processes listens to the output sockets /var/run/lirc/lircd (default, used by lircd_hp.service) and /var/run/lirc/lircd1? Have you verified that these sockets works as intended using irw(1)?

     
  • BytEvil

    BytEvil - 2015-02-03

    This is an insane configuration.

    Then please tell me how to organize the work of two remote controls simultaneously. ;)

    However, at this moment all worked fine.

    [root@KODI ~]# irw /dev/lircd
    000000008001006a 00 KEY_RIGHT devinput
    0000000080010069 00 KEY_LEFT devinput
    0000000080010067 00 KEY_UP devinput
    000000008001006c 00 KEY_DOWN devinput
    ^C
    [root@KODI ~]# irw /dev/lircd1
    000E 00 return SonyBDRemote
    000E 00 return SonyBDRemote
    0057 00 left SonyBDRemote
    0055 00 right SonyBDRemote
    ^C
    [root@KODI ~]#

    All information about configuring these remotes was taken

    here: IR Remote

    and here: PS3 BD Remote

    Thanks for help. :)

     
  • Alec Leamas

    Alec Leamas - 2015-02-03

    Frankly, no. This bug is closed, and the ticket system is not a help forum. This is partly my bad, I should have stopped this when the bug was closed.

    The support forum is the mailing list.

    Before that, please look at the Configuration Guide.

    Note that lirc is shipped with systemd service and socket files.

    The general approach to two independent services for two remotes w different drivers:

    • Configure the first driver as described in the Configuration Guide. This will
      end up in /etc/lirc/lircd.conf and /etc/lirc/lirc_options.conf. It will use the
      default services in /lib/systemd/system/{lircd.socket, lircd.service}
    • Create a new socket definition

      cp /lib/system/system/lircd.socket /etc/systemd/system/lircd_2.socket
      

      Edit lircd_2.socket so it uses a new socket, update the Description.

    • Create a new service definition

      cp /lib/system/system/lircd.service /etc/systemd/system/lircd_2.service
      

      Edit lircd_2.service by adding at least --device, --output, --driver + a
      lircd.conf file to ExecStart. Also change the Description to something sane.
      The --output socket should match lircd_2.socket.

    At this point you should have two services lircd.service and lircd_2.service, one for each remote. They must not use the same input device or output socket. When everything is fine, use systemctl enable lircd.socket to make autostart work as intended.

    Also note that this approach means that applications can connect to either of the two remotes, but not both. This is a basic design problem with current lirc, see [#37]

    I will not answer anything more in this bug, which is closed.

     

    Related

    Tickets: #37


    Last edit: Alec Leamas 2015-02-03
  • BytEvil

    BytEvil - 2015-02-05

    Ok! Thanks for all! :)

     

Log in to post a comment.