You are not logged in.

#1 2012-10-26 13:36:01

wdirksen
Member
From: New Zealand
Registered: 2012-02-23
Posts: 107

Getting LIRC to work under systemd [SOLVED]

I have been checking into this for a few days now but to no avail. Problem is that it has also become broken after reverting back to sysvinit. I would be happy to get it back working with either one at this point

With original sysvinit + initscripts it was working fine as follows:
installed lirc and lirc-utils
lircd.conf for Win MCE was stored in /etc/lirc with working lircrc
/etc/conf.d/lircd.conf was left unconfigured
mceusb was modprobed
ir-keytable -p LIRC is needed in rc.local otherwise it wouldn't work either
Interesting is that this has always worked with multiple kernels, arch, ck and lts, without having to install the specific lirc packages for those kernels
I use a somewhat modified LXDE with LXDM. I don't know if that matters any. lxdm.service seems to work fine with systemd.

Then I tried systemd: After following the wiki and settting up .service files everything boots and runs perfect with systemd except for LIRC.
I tried reinstalling lirc + lirc-utils and repeat modprobe
I have looked at:
https://bugs.archlinux.org/task/31890 and used this lirc.service example
https://bbs.archlinux.org/viewtopic.php?id=150379
https://wiki.archlinux.org/index.php?ti … did=225468 and used this older lirc.service which worked for someone just last week
https://bbs.archlinux.org/viewtopic.php?id=141300

From the above links I have also tried the following:
Fill in values (which were blank) in /etc/conf.d/lircd.conf: Tried LIRC_DRIVER="default" and "mceusb" and using LIRC_DEVICE="/dev/lirc0"
lsmod still shows mceusb.ko.gz as being loaded

Thanks a bunch

Both systemd with initscripts and with sysvinit work fine except for LIRC

Last edited by wdirksen (2012-11-28 07:04:37)


Research | Trial | Make Mistakes | Ask questions | Learn | Repeat

Offline

#2 2012-10-26 15:46:42

aking9
Member
Registered: 2009-03-30
Posts: 65

Re: Getting LIRC to work under systemd [SOLVED]

Do you have a systemd service file for it?

I've not used this before so I don't know what it should create. The wiki page for it hasn't been updated to reflect systemd.

What errors do you get?

What does

sudo systemctl status lirc.service 

produce?

Offline

#3 2012-10-27 09:07:26

wdirksen
Member
From: New Zealand
Registered: 2012-02-23
Posts: 107

Re: Getting LIRC to work under systemd [SOLVED]

Thanks for the reply aking9.

I've tried a few lirc.service configs of which none work. The "old" sysvinit way doesn't work anymore either which is weird. Your advice does shed some light on this as you can see below. What would libportaudio.so.2 have to do with any of this?

[mythtv@bedroom ~]$ sudo systemctl status lirc.service
lirc.service - LIRC Daemon
	  Loaded: loaded (/etc/systemd/system/lirc.service; enabled)
	  Active: failed (Result: exit-code) since Sat, 27 Oct 2012 05:25:34 +0200; 5h 32min ago
	 Process: 351 ExecStart=/usr/sbin/lircd -d $LIRC_DEVICE -P /run/lirc/lircd.pid -H $LIRC_DRIVER $LIRC_CONFIGFILE (code=exited, status=127)
	 Process: 348 ExecStartPre=/bin/ln -s /run/lirc/lircd /dev/lircd (code=exited, status=0/SUCCESS)
	 Process: 344 ExecStartPre=/bin/rm -f /run/lirc/lircd (code=exited, status=0/SUCCESS)
	 Process: 341 ExecStartPre=/bin/rm -f /dev/lircd (code=exited, status=0/SUCCESS)
	 Process: 329 ExecStartPre=/bin/mkdir -p /run/lirc (code=exited, status=0/SUCCESS)
	  CGroup: name=systemd:/system/lirc.service

Oct 27 05:25:34 bedroom lircd[351]: /usr/sbin/lircd: error while loading shared libraries: libportaudio.so.2: cannot open shared object file: No such file or directory
Oct 27 05:25:34 bedroom systemd[1]: Failed to start LIRC Daemon.

Does any of the above help to understand the problem?


Research | Trial | Make Mistakes | Ask questions | Learn | Repeat

Offline

#4 2012-10-27 09:21:54

litemotiv
Forum Fellow
Registered: 2008-08-01
Posts: 5,026

Re: Getting LIRC to work under systemd [SOLVED]

Lirc stopped working for me too and i had to switch to the in-kernel module for rc6 to get things working again. Lirc is supposedly being deprecated in favor of rc6, so i didn't really mind making the change. It seems to work just as well while removing an extra layer of complexity (and possible breakage, lirc).


ᶘ ᵒᴥᵒᶅ

Offline

#5 2012-10-27 09:30:04

wdirksen
Member
From: New Zealand
Registered: 2012-02-23
Posts: 107

Re: Getting LIRC to work under systemd [SOLVED]

So the plot thickens. After a pacman update I noticed that both systemd and lirc were updated so I gave it another shot. It still doesn't work but the status looks beter:

[mythtv@bedroom ~]$ sudo systemctl status lirc.service
lirc.service - LIRC Daemon
	  Loaded: loaded (/etc/systemd/system/lirc.service; enabled)
	  Active: active (running) since Sat, 2012-10-27 11:11:52 CEST; 2min 50s ago
	 Process: 362 ExecStart=/usr/sbin/lircd -d $LIRC_DEVICE -P /run/lirc/lircd.pid -H $LIRC_DRIVER $LIRC_CONFIGFILE (code=exited, status=0/SUCCESS)
	 Process: 359 ExecStartPre=/bin/ln -s /run/lirc/lircd /dev/lircd (code=exited, status=0/SUCCESS)
	 Process: 356 ExecStartPre=/bin/rm -f /run/lirc/lircd (code=exited, status=0/SUCCESS)
	 Process: 352 ExecStartPre=/bin/rm -f /dev/lircd (code=exited, status=0/SUCCESS)
	 Process: 340 ExecStartPre=/bin/mkdir -p /run/lirc (code=exited, status=0/SUCCESS)
	Main PID: 389 (lircd)
	  CGroup: name=systemd:/system/lirc.service
		  └ 389 /usr/sbin/lircd -d /dev/lirc0 -P /run/lirc/lircd.p...

Oct 27 11:11:52 bedroom systemd[1]: Started LIRC Daemon.

Module is also loaded:

[mythtv@bedroom ~]$ modinfo mceusb
filename:       /lib/modules/3.6.3-1-ARCH/kernel/drivers/media/rc/mceusb.ko.gz
license:        GPL
author:         Jarod Wilson <jarod@redhat.com>
description:    Windows Media Center Ed. eHome Infrared Transceiver device driver
alias:          usb:v2596p8042d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2596p8016d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2596p8008d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0572p58A5d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0572p58A1d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v105Ap2000d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v04EBpE004d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v185Bp3082d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v185Bp3020d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0FB8p0002d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v1019p0F38d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2304p0225d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v1934p0702d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v1934p0602d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v1934p5168d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v147ApE042d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v147ApE03Ed*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v147ApE03Cd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v147ApE03Ad*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v147ApE018d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v147ApE017d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v147ApE016d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v147ApE015d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v045Ep00A0d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v043Ep9803d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v1509p9242d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v195Dp7002d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v179Dp0010d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v1784p0011d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v1784p000Ad*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v1784p0008d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v1784p0007d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v1784p0006d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v1784p0001d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v03EEp2501d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v107Bp3009d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v051CpC001d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v1308pC001d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v1460p9150d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0609p0353d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0609p0338d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0609p0334d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0609p0322d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0609p031Dd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp0161d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0471p2093d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0471p2088d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0471p206Cd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0471p0815d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0471p0613d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0471p060Fd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0471p060Dd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0471p060Cd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0471p0608d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v045Ep006Dd*dc*dsc*dp*ic*isc*ip*in*
depends:        usbcore,rc-core
intree:         Y
vermagic:       3.6.3-1-ARCH SMP preempt mod_unload modversions 
parm:           debug:Debug enabled or not (bool)

So lirc and the correct module are being loaded. Could it still be the issue that the lircd.conf located in /etc/lirc is not being read by LIRC? Here are the settings I'm using now. Are they OK?

lirc.service

[Unit]
Description=LIRC Daemon
After=network.target

[Service]
Type=forking
EnvironmentFile=/etc/conf.d/lircd.conf
PIDFile=/run/lirc/lircd.pid
ExecStartPre=/bin/mkdir -p /run/lirc
ExecStartPre=/bin/rm -f /dev/lircd
ExecStartPre=/bin/rm -f /run/lirc/lircd
ExecStartPre=/bin/ln -s /run/lirc/lircd /dev/lircd

ExecStart=/usr/sbin/lircd -d $LIRC_DEVICE -P /run/lirc/lircd.pid -H $LIRC_DRIVER $LIRC_CONFIGFILE
ExecStopPost=/bin/rm -f /dev/lircd
ExecStopPost=/bin/rm -fR /run/lirc

[Install]
WantedBy=multi-user.target

/etc/conf.d/lircd.conf

LIRC_DEVICE="/dev/lirc0"
LIRC_DRIVER="default"
LIRC_EXTRAOPTS=""
LIRC_CONFIGFILE="/etc/lirc/lircd.conf"

Research | Trial | Make Mistakes | Ask questions | Learn | Repeat

Offline

#6 2012-10-27 09:36:16

wdirksen
Member
From: New Zealand
Registered: 2012-02-23
Posts: 107

Re: Getting LIRC to work under systemd [SOLVED]

litemotiv wrote:

Lirc stopped working for me too and i had to switch to the in-kernel module for rc6 to get things working again. Lirc is supposedly being deprecated in favor of rc6, so i didn't really mind making the change. It seems to work just as well while removing an extra layer of complexity (and possible breakage, lirc).

Thank-you for joining in and I will do some searching on this. Do you have any quick tips on making the change to the in-kernel module for rc6?


Research | Trial | Make Mistakes | Ask questions | Learn | Repeat

Offline

#7 2012-10-27 09:53:15

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,600
Website

Re: Getting LIRC to work under systemd [SOLVED]

@OP - I have to use a custom service for lirc to work - very similar to your post #5.

[Unit]
Description=LIRC Daemon
After=network.target

[Service]
Type=forking
PIDFile=/run/lirc/lircd.pid
ExecStartPre=/bin/mkdir -p /run/lirc
ExecStartPre=/bin/rm -f /dev/lircd
ExecStartPre=/bin/rm -f /run/lirc/lircd
ExecStartPre=/bin/ln -s /run/lirc/lircd /dev/lircd

ExecStart=/usr/sbin/lircd -d /dev/lirc0 -P /run/lirc/lircd.pid
ExecStopPost=/bin/rm -f /dev/lircd
ExecStopPost=/bin/rm -fR /run/lirc

[Install]
WantedBy=multi-user.target

Last edited by graysky (2012-10-27 09:54:21)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#8 2012-10-27 10:03:28

litemotiv
Forum Fellow
Registered: 2008-08-01
Posts: 5,026

Re: Getting LIRC to work under systemd [SOLVED]

wdirksen wrote:

Thank-you for joining in and I will do some searching on this. Do you have any quick tips on making the change to the in-kernel module for rc6?

Well it was really simple, a matter of uninstalling lirc basically and the remote was then autoloaded by the kernel. With rc6, the remote acts like a keyboard, and the default mappings are in /etc/rc_keymaps/rc6_mce. You can change the mappings as needed.

You can check if rc6 support is enabled with:

# ir-keytable -v
[...]
/sys/class/rc/rc0/protocols protocol rc-6 (enabled)
[...]
Found /sys/class/rc/rc0/ (/dev/input/event3) with:
        Driver nuvoton-cir, table rc-rc6-mce
        Supported protocols: NEC RC-5 RC-6 JVC SONY LIRC other 
        Enabled protocols: RC-6 
        Repeat delay = 500 ms, repeat period = 125 ms

And you can test the buttons/mappings with:

# ir-keytable -t 

Last edited by litemotiv (2012-10-27 10:04:09)


ᶘ ᵒᴥᵒᶅ

Offline

#9 2012-10-27 13:24:34

almostalive
Member
Registered: 2012-10-27
Posts: 3

Re: Getting LIRC to work under systemd [SOLVED]

since I was directed to this thread from the one I made I figured I would share what I did to get lirc working for me.

Using grayskys service file I added an extra line:  ExecStartPost=/usr/bin/ir-keytable --protocol=LIRC
so my lirc.service file looks like

[Unit]
Description=LIRC Daemon
After=network.target

[Service]
Type=forking
PIDFile=/run/lirc/lircd.pid
ExecStartPre=/bin/mkdir -p /run/lirc
ExecStartPre=/bin/rm -f /dev/lircd
ExecStartPre=/bin/rm -f /run/lirc/lircd
ExecStartPre=/bin/ln -s /run/lirc/lircd /dev/lircd

ExecStart=/usr/sbin/lircd -d /dev/lirc0 -P /run/lirc/lircd.pid
ExecStopPost=/bin/rm -f /dev/lircd
ExecStopPost=/bin/rm -fR /run/lirc
ExecStartPost=/usr/bin/ir-keytable --protocol=LIRC

[Install]
WantedBy=multi-user.target

I'm not sure if this is proper or not but it works for me.

Offline

#10 2012-10-28 06:58:31

wdirksen
Member
From: New Zealand
Registered: 2012-02-23
Posts: 107

Re: Getting LIRC to work under systemd [SOLVED]

It's running again. Thanks again to the many who have contributed. I learned a few things as well. I'll elaborate below in case a search brings someone else here later:

It turned out that I was using table rc-rc6-mce the whole time. I assumed the lircd.conf I've used since 2007 was still necessary. The RC6 protocol wouldn't work completely with MythTV so I had to use the lirc.services from almostalive (post #9 ) to get it to work in LIRC mode. Graysky uses MythTV so maybe he has got MythTV to work with RC6 mode. Putting the command "ir-keytable -p LIRC" in rc.local works with sysvinit but not with systemd because it loads it too soon.

This is the /etc/conf.d/lircd.conf that works for me now:

LIRC_DEVICE="/dev/lirc0"
LIRC_DRIVER="default"
LIRC_EXTRAOPTS=""
LIRC_CONFIGFILE=""

Last edited by wdirksen (2012-10-28 06:58:51)


Research | Trial | Make Mistakes | Ask questions | Learn | Repeat

Offline

#11 2012-10-28 07:03:57

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: Getting LIRC to work under systemd [SOLVED]

wdirksen wrote:

Help, a tryout with systemd killed LIRC and the wife is unhappy

wdirksen wrote:

It's running again. Thanks again to the many who have contributed.

Ok, that's one problem solved. For the other, have you considered ReiserFS?

*ducks*


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#12 2012-10-28 09:12:28

litemotiv
Forum Fellow
Registered: 2008-08-01
Posts: 5,026

Re: Getting LIRC to work under systemd [SOLVED]

Xyne wrote:
wdirksen wrote:

Help, a tryout with systemd killed LIRC and the wife is unhappy

wdirksen wrote:

It's running again. Thanks again to the many who have contributed.

Ok, that's one problem solved. For the other, have you considered ReiserFS?

*ducks*

Oh boy..


ᶘ ᵒᴥᵒᶅ

Offline

#13 2012-11-01 19:10:28

vr4b4c
Member
Registered: 2008-12-30
Posts: 37

Re: Getting LIRC to work under systemd [SOLVED]

So it seems i have same issue. Just i cant get it working here. I used this iso archlinux-2012.11.01-dual.iso for new install. Installation went fine.

First its an USB X10 RF receiver which use lirc_atiusb (ati_remote is blacklisted in /etc/modprobe.d/modprobe.conf ).
modul is loaded:

# lsmod |grep lirc
lirc_atiusb            13124  0
lirc_dev                9039  1 lirc_atiusb
usbcore               150398  6 dvb_usb,ohci_hcd,ehci_hcd,usbhid,lirc_atiusb,dvb_usb_dw2102

modeinfo

[]# modinfo lirc_atiusb
filename:       /lib/modules/3.6.4-1-ARCH/extramodules/lirc_atiusb.ko.gz
license:        GPL
author:         Paul Miller <pmiller9@users.sourceforge.net>
description:    USB remote driver for LIRC
alias:          usb:vFFFFpFFFFd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v045Ep0284d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v040Bp6521d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0471p0603d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0471p0602d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BC7p000Fd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BC7p000Ed*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BC7p000Dd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BC7p000Cd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BC7p000Bd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BC7p000Ad*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BC7p0009d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BC7p0008d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BC7p0007d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BC7p0006d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BC7p0005d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BC7p0004d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BC7p0003d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BC7p0002d*dc*dsc*dp*ic*isc*ip*in*
depends:        usbcore,lirc_dev
vermagic:       3.6.4-1-ARCH SMP preempt mod_unload modversions
parm:           debug:Debug enabled or not (default: 0) (bool)
parm:           mask:Set channel acceptance bit mask (default: 0xFFFF) (int)
parm:           unique:Enable channel-specific codes (default: 0) (bool)
parm:           repeat:Repeat timeout (1/100 sec) (default: 10) (int)
parm:           mdeadzone:rw2 mouse sensitivity threshold (default: 0) (int)
parm:           emit_updown:emit press/release codes (rw2): 0:don't (default), 1:emit 2 codes only, 2:code for each button (int)
parm:           emit_modekeys:emit keycodes for aux1-aux4, pc, and mouse (rw2): 0:don't (default), 1:emit translated codes: one for mode switch, one for same mode, 2:raw codes (int)
parm:           mgradient:rw2 mouse: 1000*gradient from E to NE (default: 500 => .5 => ~27 degrees) (int)
[]#

Starting lirc.service:

Nov 01 19:46:46 vdrbox systemd[1]: Starting Linux Infrared Remote Control...
Nov 01 19:46:46 vdrbox lircd[698]: lircd: could not open config file '/etc/lirc/lircd.conf'
Nov 01 19:46:46 vdrbox lircd[698]: lircd: No such file or directory
Nov 01 19:46:46 vdrbox systemd[1]: Started Linux Infrared Remote Control.

lirc0 file is created

[]# ls -al /dev/ | grep lirc
crw-------  1 root root  251,   0 Nov  1 19:58 lirc0
[]#

If i create /etc/lirc/lircd.conf with info from old file which was/is /etc/confi.d/lircd.conf i get this:

Nov 01 19:48:18 vdrbox systemd[1]: Starting Linux Infrared Remote Control...
Nov 01 19:48:18 vdrbox lircd[713]: lircd: error in configfile line 5
Nov 01 19:48:18 vdrbox lircd[713]: lircd: reading of file '/etc/lirc/lircd.conf' failed
Nov 01 19:48:18 vdrbox lircd[713]: lircd: reading of config file failed
Nov 01 19:48:18 vdrbox systemd[1]: Started Linux Infrared Remote Control.

And the file have:

#
# Parameters for lirc daemon
#

LIRC_DEVICE="/dev/lirc0"
LIRC_DRIVER=""
LIRC_EXTRAOPTS=""
LIRC_CONFIGFILE="/etc/lirc/lircd_X10.conf"

So it seems it doesnt know what is "LIRC_DEVICE", well even if i comment that line it fails on second and so on till end? What actually should contain this file and what are default values?

The file /etc/conf.d/lircd_X10.conf contains the codes for buttons egg:

      begin codes
          3                        0x000000000000E40F
          2                        0x000000000000E30E
          1                        0x000000000000E20D
.....
[]# ir-keytable -v
Couldn't find any node at /sys/class/rc/rc*.
[]#

I tried using the lirc.services posted here but irw does not prompt me for anything when pressing buttons on remote.



SOLVED:
I got it working.
I needed to change /etc/conf.d/lircd.conf to this:

LIRC_DEVICE="/dev/lirc0"
LIRC_DRIVER="default"
LIRC_EXTRAOPTS=""
LIRC_CONFIGFILE="/etc/conf.d/lircd_X10.conf"

And i used lircd.service :

# cat /etc/systemd/system/lircd.service
[Unit]
Description=LIRC Daemon
After=network.target

[Service]
Type=forking
EnvironmentFile=/etc/conf.d/lircd.conf
PIDFile=/run/lirc/lircd.pid
ExecStartPre=/bin/mkdir -p /run/lirc
ExecStartPre=/bin/rm -f /dev/lircd
ExecStartPre=/bin/rm -f /run/lirc/lircd
ExecStartPre=/bin/ln -s /run/lirc/lircd /dev/lircd

ExecStart=/usr/sbin/lircd -d $LIRC_DEVICE -P /run/lirc/lircd.pid -H $LIRC_DRIVER $LIRC_CONFIGFILE
ExecStopPost=/bin/rm -f /dev/lircd
ExecStopPost=/bin/rm -fR /run/lirc

[Install]
WantedBy=multi-user.target
[]# 

Start went fine without any probelm.
systemctl enable lircd.service
systemctl start lircd.service

Nov 01 20:45:56 vdrbox systemd[1]: Starting LIRC Daemon...
Nov 01 20:45:56 vdrbox systemd[1]: Started LIRC Daemon.
[root@vdrbox ~]# irw
00000014e20d0000 00 1 Medion_X10
00000014e30e0000 00 2 Medion_X10
^C

Last edited by vr4b4c (2012-11-01 19:49:58)

Offline

#14 2012-11-06 01:21:36

wilberfan
Member
From: So. Cal
Registered: 2010-12-18
Posts: 264

Re: Getting LIRC to work under systemd [SOLVED]

Glad to see I'm not the only one struggling with this!  :-)

I had (have) a working arch/mythtv install that's 3 or 4 years old at this point.  For fun, I decided to do a 'clean' install on the same hardware (different partition) of both arch and mythtv.   I used the 2012.11.01 .iso, so it should be a 'systemd only' setup...

I've got everything working except LIRC.

I have a Hauppauge PVR-350 card with a wired infrared remote.   I'm in over my head with LIRC, so I'll try and follow vr4b4c's lead and list all of the same things he did.  Hopefully someone can steer me towards what I need to try.

LSMOD:

# lsmod |grep lirc
lirc_i2c                5067  0 
i2c_core               16943  18 bttv,ivtv,i2c_i801,lirc_i2c,tuner,saa7115,saa7127,tda8290,tda9887,i2c_algo_bit,cx8800,cx88xx,msp3400,nvidia,v4l2_common,tveeprom,tuner_simple,videodev
lirc_dev                7507  1 lirc_i2c

MODINFO:

# modinfo lirc_i2c
filename:       /lib/modules/3.6.5-1-ARCH/extramodules/lirc_i2c.ko.gz
license:        GPL
author:         Gerd Knorr, Michal Kochanowicz, Christoph Bartelmus, Ulrich Mueller, Stefan Jahn, Jerome Brock
description:    Infrared receiver driver for Hauppauge and Pixelview cards (i2c stack)
depends:        i2c-core,lirc_dev
vermagic:       3.6.4-1-ARCH SMP preempt mod_unload modversions 686 
parm:           minor:Preferred minor device number (int)
parm:           debug:Enable debugging messages (bool)

LIRC.SERVICE SEEMS TO BE RUNNING(?):

# systemctl status lirc.service
lirc.service - Linux Infrared Remote Control
	  Loaded: loaded (/usr/lib/systemd/system/lirc.service; enabled)
	  Active: active (running) since Mon, 2012-11-05 16:42:50 PST; 23min ago
	 Process: 2440 ExecStart=/usr/sbin/lircd --pidfile=/run/lirc/lircd.pid (code=exited, status=0/SUCCESS)
	 Process: 2436 ExecStartPre=/usr/bin/ln -sf /run/lirc/lircd /dev/lircd (code=exited, status=0/SUCCESS)
	Main PID: 2441 (lircd)
	  CGroup: name=systemd:/system/lirc.service
		  └ 2441 /usr/sbin/lircd --pidfile=/run/lirc/lircd.pid

Nov 05 16:42:50 arch32 systemd[1]: Starting Linux Infrared Remote Control...
Nov 05 16:42:50 arch32 systemd[1]: Started Linux Infrared Remote Control.
Nov 05 17:05:37 arch32 systemd[1]: Started Linux Infrared Remote Control.

But I noticed this in /var/log/lircd:

Nov  5 16:42:42 arch32 lircd: caught signal
Nov  5 16:42:50 arch32 lircd: lircd(default) ready, using /var/run/lirc/lircd
Nov  5 16:42:50 arch32 lircd: accepted new client on /var/run/lirc/lircd
Nov  5 16:42:50 arch32 lircd: could not get file information for /dev/lirc
Nov  5 16:42:50 arch32 lircd: default_init(): No such file or directory
Nov  5 16:42:50 arch32 lircd: WARNING: Failed to initialize hardware

lirc0 is created:

# ls -al /dev/ | grep lirc
crw-------   1 root      root    250,   0 Nov  5 16:16 lirc0
lrwxrwxrwx   1 root      root          15 Nov  5 16:42 lircd -> /run/lirc/lircd

Here's my /etc/conf.d/lircd.conf:

#
# Parameters for lirc daemon
#

LIRC_DEVICE="/dev/lirc0"
#LIRC_DRIVER=""
LIRC_DRIVER="default"
LIRC_EXTRAOPTS=""
#LIRC_CONFIGFILE=""
LIRC_CONFIGFILE="/etc/lirc/lircd.conf"

And, the /etc/lirc/lircd.conf file:

begin remote
 name            Hauppauge_350
 bits            13
 flags           RC5|CONST_LENGTH
 eps             30
 aeps            100
 one             969   811
 zero            969   811
 gap             114605
 toggle_bit      2
 plead           1097

 begin codes
      Go              0x00000000000017BB
      Power           0x00000000000017BD
      TV              0x000000000000179C
      Videos          0x0000000000001798
      Music           0x0000000000001799
      Pictures        0x000000000000179A
      Guide           0x000000000000179B
      Radio           0x000000000000178C
      Up              0x0000000000001794
      Left            0x0000000000001796
      Right           0x0000000000001797
      Down            0x0000000000001795
      OK              0x00000000000017A5
      Back/Exit       0x000000000000179F
      Menu/i          0x000000000000178D
      Vol+            0x0000000000001790
      Vol-            0x0000000000001791
      Prev.Ch         0x0000000000001792
      Mute            0x000000000000178F
      Ch+             0x00000000000017A0
      Ch-             0x00000000000017A1
      Record          0x00000000000017B7
      Stop            0x00000000000017B6
      Rewind          0x00000000000017B2
      Play            0x00000000000017B5
      Forward         0x00000000000017B4
      Replay/SkipBackward 0x00000000000017A4
      Pause           0x00000000000017B0
      SkipForward     0x000000000000179E
      1               0x0000000000001781
      2               0x0000000000001782
      3               0x0000000000001783
      4               0x0000000000001784
      5               0x0000000000001785
      6               0x0000000000001786
      7               0x0000000000001787
      8               0x0000000000001788
      9               0x0000000000001789
      Asterix         0x000000000000178A
      0               0x0000000000001780
      #               0x000000000000178E
      Red             0x000000000000178B
      Green           0x00000000000017AE
      Yellow          0x00000000000017B8
      Blue            0x00000000000017A9

 end codes

end remote

If you need to see anything else, please let me know!  I'm a little blurry at the moment, having been looking at this stuff for several hours now...  But it feels like I'm close??

Thanks in advance!

Last edited by wilberfan (2012-11-06 01:23:39)


Hey, be nice...I'm new at this!

Offline

#15 2012-11-08 00:01:35

wilberfan
Member
From: So. Cal
Registered: 2010-12-18
Posts: 264

Re: Getting LIRC to work under systemd [SOLVED]

Well, as above, I changed my /etc/systemd/system/multi-user.target.wants/lirc.service to:

[Unit]
Description=LIRC Daemon
After=network.target

[Service]
Type=forking
EnvironmentFile=/etc/conf.d/lircd.conf
PIDFile=/run/lirc/lircd.pid
ExecStartPre=/bin/mkdir -p /run/lirc
ExecStartPre=/bin/rm -f /dev/lircd
ExecStartPre=/bin/rm -f /run/lirc/lircd
ExecStartPre=/bin/ln -s /run/lirc/lircd /dev/lircd

ExecStart=/usr/sbin/lircd -d $LIRC_DEVICE -P /run/lirc/lircd.pid -H $LIRC_DRIVER $LIRC_CONFIGFILE
ExecStopPost=/bin/rm -f /dev/lircd
ExecStopPost=/bin/rm -fR /run/lirc

[Install]

:D
WantedBy=multi-user.target

And my remote is working now!  big_smile

Oh, and I'm not sure if it makes a diff, but my /etc/conf.d/lircd.conf looks like this now, too (also following the lead, above):

#
# Parameters for lirc daemon
#

LIRC_DEVICE="/dev/lirc0"
#LIRC_DRIVER=""
LIRC_DRIVER="default"
LIRC_EXTRAOPTS=""
#LIRC_CONFIGFILE=""
LIRC_CONFIGFILE="/etc/lirc/lircd.conf"

Hey, be nice...I'm new at this!

Offline

#16 2012-11-08 03:35:44

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,356

Re: Getting LIRC to work under systemd [SOLVED]

wilberfan wrote:

And my remote is working now!  big_smile

If its all solved please mark the thread as [solved]


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#17 2012-11-11 20:49:17

Ashren
Member
From: Denmark
Registered: 2007-06-13
Posts: 1,229
Website

Offline

#18 2012-11-23 10:26:43

wdirksen
Member
From: New Zealand
Registered: 2012-02-23
Posts: 107

Re: Getting LIRC to work under systemd [SOLVED]

The very helpful input above has helped alot of people, including myself, to get lirc up and running with systemd on Arch. Once thanks again for the tremendous help! Regretably this appears to be "almost solved" for me. I've got an intermittency problem which I've trying to solve to no avail.

I still have an ongoing issue with Lirc on a system only when the VGA output is being used. With a DVI or HDMI connection it works flawlessly and continually. However with a VGA connection, Lirc works perfectly in LIRC mode for only about 15 minutes and then somehow just dies. I have swapped displays to diagnose and problem follows the connection type (VGA vs DVI) and not the machine. All power saving etc is disabled in BIOS where possible and turned off in software where possible. Lirc will also stop working even when continually watching a program with the display active. Another oddity is that a xorg.conf is necessary with this TV to get the DPI settings right. 'sudo systemctl status lirc.service' shows lirc as still working, but it is not.

I wonder if lirc is not the culprit but some other base systemd setting. This also wasn't a factor with sysvinit.  Idea's?

Last edited by wdirksen (2012-11-24 23:05:33)


Research | Trial | Make Mistakes | Ask questions | Learn | Repeat

Offline

#19 2012-11-26 00:06:22

pistol-mcgee
Member
From: WA State
Registered: 2010-02-08
Posts: 12

Re: Getting LIRC to work under systemd [SOLVED]

Im also having an issue with systemd and lirc.

I had lirc previously working fine but just recently used a few new pieces in my computer and reinstalled now using systemd.

I use a xbox DVD remote plugged into USB. Everything works with no errors except my remote doesnt work and irw doesnt see any codes. Im not sure what to do next since ive used the example lircd.service files in this thread and a few others.

Let me know what info you guys would need to help me out, I normally can figure everything out on my own with google but this one has me stumped.

edit: okay i did some more playing after work this morning and i found that it sees the raw codes via mode2 but irw still does not see codes at all.

Last edited by pistol-mcgee (2012-11-26 16:38:21)

Offline

#20 2012-11-28 07:03:33

wdirksen
Member
From: New Zealand
Registered: 2012-02-23
Posts: 107

Re: Getting LIRC to work under systemd [SOLVED]

It looks as though it is solved for the masses if one uses one of the example lirc.services posted above. Did you take a good look at some of the above examples? In particular I get the impression that inclusion of the following line solved it for alot of people depending on the application LIRC is used for:

ExecStartPost=/usr/bin/ir-keytable --protocol=LIRC

I just don't understand why it "unsolves" itself for me a few minutes later on one machine that I have. Anyway, I think it is appropiate for me to change the topic to solved none-the-less. It might actually draw more people to this if there still are some issues.


Research | Trial | Make Mistakes | Ask questions | Learn | Repeat

Offline

#21 2012-12-08 15:51:40

ould
Member
Registered: 2007-05-22
Posts: 124

Re: Getting LIRC to work under systemd [SOLVED]

pistol-mcgee wrote:

Im also having an issue with systemd and lirc.

I had lirc previously working fine but just recently used a few new pieces in my computer and reinstalled now using systemd.

I use a xbox DVD remote plugged into USB. Everything works with no errors except my remote doesnt work and irw doesnt see any codes. Im not sure what to do next since ive used the example lircd.service files in this thread and a few others.

Let me know what info you guys would need to help me out, I normally can figure everything out on my own with google but this one has me stumped.

edit: okay i did some more playing after work this morning and i found that it sees the raw codes via mode2 but irw still does not see codes at all.

I don't know if you have fixed this yet but I use an xbox dongle and came across another post here that linked to a patch that can be applied to the lirc from git. Here is how I got it working:

1. git clone git://lirc.git.sourceforge.net/gitroot/lirc/lirc', you can put it wherever
2. copy the patch contents to a file named lirc_xbox_driver.patch in the folder you used above(will post patch below)
3. apply patch using 'patch -p1 < lirc_0.9.1_lirc_xbox_driver.patch'
4. run ./autogen.sh
5. run ./configure
    Select driver configuration (1)
    Select USB devices (8)
    Select XBOX DVD Dongle (A)
    Save configuration and run configure
6. make
7. cd drivers/lirc_dev/, copy lirc_dev.ko to /lib/modules/<kernel version>//kernel/drivers/media/rc/ this will overwrite the original lirc_dev.ko so you may want to back it up first just in case
8. cd drivers/lirc_xbox/, copy lirc_xbox.ko to /lib/modules/<kernel version>//kernel/drivers/media/rc/
9. run depmod -a(need to be root)
10. run modprobe lirc_xbox
11. you may need to blacklist the xpad module, can't remember if I needed that or not
12. your remote should show up now when you run IRW. Then you just need to configure your program to work with it.

Patch:
http://old.nabble.com/attachment/317875 … iver.patch

Hope that helps! Oh and you will need to do this again every time you update the kernel.

Kevin

Last edited by ould (2012-12-08 15:52:13)

Offline

#22 2012-12-10 08:55:07

wdirksen
Member
From: New Zealand
Registered: 2012-02-23
Posts: 107

Re: Getting LIRC to work under systemd [SOLVED]

OK, it seems it the intermittancy issue I had is also cleared up. (but I won't hold my breath)

The problem was particularly with MythTV and really didn't turn up when using XBMC. (weird because it did stop a few times with XBMC)
MythTV is set default to /var/run/lirc/lircd not /run/lirc/lircd. Changing the lirc.system above to link to /var/run . . . seems to solve this.


Research | Trial | Make Mistakes | Ask questions | Learn | Repeat

Offline

#23 2013-01-21 18:55:57

wdirksen
Member
From: New Zealand
Registered: 2012-02-23
Posts: 107

Re: Getting LIRC to work under systemd [SOLVED]

Ok so I'm glad I didn't hold my breath on this one. It actually worked fine on 3 arch machines for awhile. Then strangely when I changed all three nvidia graphics based machines to compiz-fusion because its OpenGL compositing was supposed to work cleaner with vdpau (and it does), lirc started doing its old trick again of suddenly stopping after about 30 minutes or so. Bizzarre!

Then I found this: https://bugs.archlinux.org/task/31890
This suggests that the lirc daemon isn't seeing the conf configs without specifically adding the environment variables to the main Exec line. This seems to have solved this for me once again but I still don't get why it does work at first and status lirc.service says it's working just to inexplicably die later. Hopefully solved for good this time but once again I won't hold my breath. So my working setup for mceusb device now looks like this:

lirc.service

[Unit]
Description=LIRC Daemon
After=network.target

[Service]
Type=forking
EnvironmentFile=/etc/conf.d/lircd.conf
PIDFile=/run/lirc/lircd.pid
ExecStartPre=/bin/mkdir -p /run/lirc
ExecStartPre=/bin/rm -f /dev/lircd
ExecStartPre=/bin/rm -f /run/lirc/lircd
ExecStartPre=/bin/ln -s /run/lirc/lircd /dev/lircd

ExecStart=/usr/sbin/lircd -d $LIRC_DEVICE -P /run/lirc/lircd.pid -H $LIRC_DRIVER $LIRC_CONFIGFILE
ExecStopPost=/bin/rm -f /dev/lircd
ExecStopPost=/bin/rm -fR /run/lirc
ExecStartPost=/usr/bin/ir-keytable --protocol=LIRC

[Install]
WantedBy=multi-user.target

With /etc/conf.d/lircd.conf

LIRC_DEVICE="/dev/lirc0"
LIRC_DRIVER="default"
LIRC_CONFIGFILE="/etc/lirc/lircd.conf"

Important: "#modprobe mceusb" if you haven't earlier
                  In mythfrontend setup: set to /run/lirc/lircd or /dev/lircd

If this doesn't work in the end, then considering the mceusb will now work out of the box as a keyboard, then as mentioned above, mapping keyboard strokes would be the way to go further.

Last edited by wdirksen (2013-01-21 19:26:01)


Research | Trial | Make Mistakes | Ask questions | Learn | Repeat

Offline

#24 2013-02-03 09:55:46

wdirksen
Member
From: New Zealand
Registered: 2012-02-23
Posts: 107

Re: Getting LIRC to work under systemd [SOLVED]

OK so the change above really didn't do squat as lirc can still unpredictably sometimes just stop. (primitive fantasy sometimes leads me to believe that the lirc daemon has consciousness, is in control, and is enjoying poking fun at me with this)

The plot has thickened as since XBMC has hit 12.0 with MythTV support I have been using XBMC alot and there it does not quit after days of being left on. So looks like the combo of MythTV frontend and lirc is causing the intermittent breakage. I'm hoping someone with higher insight can bring some light to this.


Research | Trial | Make Mistakes | Ask questions | Learn | Repeat

Offline

#25 2013-02-03 10:14:42

Ashren
Member
From: Denmark
Registered: 2007-06-13
Posts: 1,229
Website

Re: Getting LIRC to work under systemd [SOLVED]

wdirksen: Have you tried disabling any lirc kernel modules you don't use?

Here's what I use:

/etc/modprobe.d/blacklist_stuff.conf

# Disabling kernel modules for mce
install ir_rc6_decoder /bin/false
install rc_rc6_mce /bin/false
install ir_rc5_decoder /bin/false

Offline

Board footer

Powered by FluxBB