You are not logged in.

#1 2012-08-31 19:12:25

jrussell
Member
From: Cape Town, South Africa
Registered: 2012-08-16
Posts: 510

LIRC and ir-keytable help - /sys/class/rc/rcX/ X keeps incrementing

Hi, Im having a little trouble understanding how things work with IR remotes (possible any usb reciever/device)

At the moment, this is how things are:

1) I boot up my PC and have a usb IR reciever plugged in.

2) If I then run "ir-keytable" I get "Found /sys/class/rc/rc0/ (/dev/input/event4)"

3) I run "ir-keytables -p LIRC" to tell the receiver to use LIRC (I think) (without this command, the remote works with volume, play and arrow keys, nothing with LIRC works)

4) If I then run "ir-keytable" I still get "Found /sys/class/rc/rc0/ (/dev/input/event4)"

5) The remote works with my config file that I made with LIRC and irrecord as expected, everything is how I want it, the remote works perfectly with XBMC.

6) If I then unplug and replug the receiver into the same or different usb port "ir-keytable" returns  "Found /sys/class/rc/rc1/ (/dev/input/event4)"
and the remote doesnt work with LIRC, I have to run "ir-keytables -s rc1 -p LIRC" to get it to work again

My problem:
the rcX is confusing me, where X increments upon every replugging in of the receiver.
I have to run ir-keytables -s rcX -p LIRC upon every reconnection of the receiver.


Here are my config files:
/etc/conf.d/lirc has "LIRC_DEVICE="/dev/lirc0""

Its not so much of a problem in that the computer stays on and connected to a TV all the time, so there is no reconnecting of the usb receiver, but I would like to know how this all fits together.

I know about /dev/inputs/by-id/ but I dont know how to set up the device by-id - which is what I am looking for I think (so I dont have to worry about rc1 then rc2 then rc3 etc....

Any help would be much appreciated.

Last edited by jrussell (2012-09-01 12:24:24)


bitcoin: 1G62YGRFkMDwhGr5T5YGovfsxLx44eZo7U

Offline

#2 2012-08-31 20:11:18

teekay
Member
Registered: 2011-10-26
Posts: 270

Re: LIRC and ir-keytable help - /sys/class/rc/rcX/ X keeps incrementing

It should be as easy as loading the ir to lirc bridge kernel module and telling lircd to use /dev/lirc0.

I run a custom 3.6.0-rc3 kernel already, but I remeber at least kernel 3.4 and 3.5 required absolutely no setup - the receiver got detected, all modules including the lirc_dev and ir_lirc_codec got loaded automatically, and my /etc/conf.d/lirc looks like yours. It just works. I never uses ir-keytable since 2.6.35something.

Please check lsmod output if all required modules are loaded, and if /dev/lirc0 exists

Offline

#3 2012-08-31 20:30:32

jrussell
Member
From: Cape Town, South Africa
Registered: 2012-08-16
Posts: 510

Re: LIRC and ir-keytable help - /sys/class/rc/rcX/ X keeps incrementing

teekay wrote:

It should be as easy as loading the ir to lirc bridge kernel module and telling lircd to use /dev/lirc0.

What are the steps to doing this?


bitcoin: 1G62YGRFkMDwhGr5T5YGovfsxLx44eZo7U

Offline

#4 2012-08-31 20:35:18

jrussell
Member
From: Cape Town, South Africa
Registered: 2012-08-16
Posts: 510

Re: LIRC and ir-keytable help - /sys/class/rc/rcX/ X keeps incrementing

Just found this http://www.linuxquestions.org/questions … 5D-944015/, I'm going to try this quick.


bitcoin: 1G62YGRFkMDwhGr5T5YGovfsxLx44eZo7U

Offline

#5 2012-08-31 21:03:01

teekay
Member
Registered: 2011-10-26
Posts: 270

Re: LIRC and ir-keytable help - /sys/class/rc/rcX/ X keeps incrementing

Yup, basically that's how it works.

For mceusb add following to the default /etc/lirc/lircd.conf instead of downloading another config from their page:

include "/usr/share/lirc/remotes/mceusb/lircd.conf.mceusb"

I forgot to mention that little piece of setup it does require.

Last edited by teekay (2012-08-31 21:04:18)

Offline

#6 2012-08-31 21:47:38

jrussell
Member
From: Cape Town, South Africa
Registered: 2012-08-16
Posts: 510

Re: LIRC and ir-keytable help - /sys/class/rc/rcX/ X keeps incrementing

teekay wrote:

Yup, basically that's how it works.

For mceusb add following to the default /etc/lirc/lircd.conf instead of downloading another config from their page:

include "/usr/share/lirc/remotes/mceusb/lircd.conf.mceusb"

I forgot to mention that little piece of setup it does require.

http://www.linuxquestions.org/questions … 5D-944015/

All this does work, but I still dont understand why every time I replug the IR receiver in, rc0 increments by 1 every time causing me to have to run "ir-keytable -s rc0 -p LIRC" and then "ir-keytable -s rc1 -p LIRC" etc after each replug.

There must be a solution for this? maybe set RC-6 and LIRC as defaults or set the options by device ID or somthing?


bitcoin: 1G62YGRFkMDwhGr5T5YGovfsxLx44eZo7U

Offline

#7 2012-09-02 08:34:14

jrussell
Member
From: Cape Town, South Africa
Registered: 2012-08-16
Posts: 510

Re: LIRC and ir-keytable help - /sys/class/rc/rcX/ X keeps incrementing

bump, any help?


bitcoin: 1G62YGRFkMDwhGr5T5YGovfsxLx44eZo7U

Offline

#8 2012-09-02 08:57:40

SiD
Member
From: Germany
Registered: 2006-09-21
Posts: 729

Re: LIRC and ir-keytable help - /sys/class/rc/rcX/ X keeps incrementing

I had the same Problem, solved it with a udev rule and a little script

first udev rule to give the ir-reciever a fixed devicename for use in /etc/conf.d/lircd.conf

cat /etc/udev/rules.d/65-persistent-hauppauge.rules 
KERNEL=="event*", ATTRS{name}=="IR-receiver inside an USB DVB receiver", SYMLINK+="input/dvb-ir"

second rule calls a script with the ir-keytables command

$ cat /etc/udev/rules.d/70-irprotocol.rules 
KERNEL=="event*", ATTRS{name}=="IR-receiver inside an USB DVB receiver", RUN+="/usr/local/bin/change-irprotocol"

and the script

$ cat /usr/local/bin/change-irprotocol 
#!/bin/bash
# set IR-Protocol to NEC (for Terrarec USB Remote)

/usr/bin/ir-keytable --protocol=nec --sysdev=$(ls /sys/class/rc/)

does only work if in /sys/class/rc/ is only one rcX "file"

Don't know if you need a rule to give a fixed devicemane, but the second rule and the script should work for you.
Everytime the reciever is plugged in udev runs the script and $(ls /sys/class/rc/) gives the current number of rcX

Last edited by SiD (2012-09-02 09:02:57)

Offline

#9 2012-09-02 16:18:28

jrussell
Member
From: Cape Town, South Africa
Registered: 2012-08-16
Posts: 510

Re: LIRC and ir-keytable help - /sys/class/rc/rcX/ X keeps incrementing

Thanks Ill try this, do you think that rcX is ment to increment though? Or is it a bug?


bitcoin: 1G62YGRFkMDwhGr5T5YGovfsxLx44eZo7U

Offline

#10 2012-09-02 21:24:12

teekay
Member
Registered: 2011-10-26
Posts: 270

Re: LIRC and ir-keytable help - /sys/class/rc/rcX/ X keeps incrementing

This indeed looks buggy. Just tested here too

unplugging the receiver -> rc0 vanishes
plugging it again -> it shows up as rc1, and lirc stops working
unpluging a second time -> the box _hard_ locked up... outch.

Offline

#11 2012-09-03 03:01:19

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,412

Re: LIRC and ir-keytable help - /sys/class/rc/rcX/ X keeps incrementing

jrussell wrote:

bump, any help?

You didn't even glance at the forum rules did you?  They specifally mention not cross posting as well as no bumping...

Offline

#12 2012-09-03 08:50:15

jrussell
Member
From: Cape Town, South Africa
Registered: 2012-08-16
Posts: 510

Re: LIRC and ir-keytable help - /sys/class/rc/rcX/ X keeps incrementing

teekay wrote:

This indeed looks buggy. Just tested here too

unplugging the receiver -> rc0 vanishes
plugging it again -> it shows up as rc1, and lirc stops working
unpluging a second time -> the box _hard_ locked up... outch.

Strange, as far as I can tell my LIRC is fine and my computer doesn't lockup no matter how many times I do that.


bitcoin: 1G62YGRFkMDwhGr5T5YGovfsxLx44eZo7U

Offline

#13 2012-09-06 07:59:27

SiD
Member
From: Germany
Registered: 2006-09-21
Posts: 729

Re: LIRC and ir-keytable help - /sys/class/rc/rcX/ X keeps incrementing

jrussell wrote:
teekay wrote:

This indeed looks buggy. Just tested here too

unplugging the receiver -> rc0 vanishes
plugging it again -> it shows up as rc1, and lirc stops working
unpluging a second time -> the box _hard_ locked up... outch.

Strange, as far as I can tell my LIRC is fine and my computer doesn't lockup no matter how many times I do that.

same here

Offline

#14 2012-11-18 00:12:20

jrussell
Member
From: Cape Town, South Africa
Registered: 2012-08-16
Posts: 510

Re: LIRC and ir-keytable help - /sys/class/rc/rcX/ X keeps incrementing

Still haven't found anything, I think I will report a bug.


bitcoin: 1G62YGRFkMDwhGr5T5YGovfsxLx44eZo7U

Offline

#15 2014-10-20 20:48:19

Ikem
Member
Registered: 2012-08-10
Posts: 10
Website

Re: LIRC and ir-keytable help - /sys/class/rc/rcX/ X keeps incrementing

jrussell wrote:

Here are my config files:
/etc/conf.d/lirc has "LIRC_DEVICE="/dev/lirc0""

...

I know about /dev/inputs/by-id/ but I dont know how to set up the device by-id

Just replace "/dev/lirc0" by "/dev/inputs/by-id/"?

Offline

Board footer

Powered by FluxBB