Confused with lirc

Help with using MiniMyth (except Booting)

Moderator: Pablo

Confused with lirc

Postby JoeHenley » Thu Aug 11, 2011 3:37 pm

Hi all,

I hate to admit this, but I have no freakin idea how lirc/event/etc works these days. I really need to find some documentation somewhere.

I'm working with MM 78b3 and it is better than 78b1. My remote is one of the mceusb clones (Hauppauge/Pinnacle PCTV Remote Control, usb = 2304:0225). My lirc section in minimyth.conf is:
As you can see, I've pretty much punted this. I can't figure out what to use, so I'm letting as much as possible go to default.

Several of the buttons don't do what I want them to do and I don't know how to change it. I cannot get anywhere with resume from S-3. Do I still need lircrc?, lircd.conf? Can I use irexec? Etc., etc.

With all the changes going on right now with Jarod's efforts on lirc, and Pablo's efforts with minimyth and eventlircd, anything you find via Google is suspect. You have to check very carefully the date something was written and what versions of Myth, lirc, etc, they are talking about. What worked on a prior version now screws everything up.

I thought I understood how lirc worked, and I certainly could get it do what I wanted/needed, but no more. I hate to admit it, but I'm lost. Does anyone know where there is some current info to explain how this works? How the info flows from one routine to the next; what files do what; maybe some comparison from the new to the old? Help!

Joe Henley
Posts: 185
Joined: Sun Aug 06, 2006 4:12 pm

Re: Confused with lirc

Postby Pablo » Wed Aug 17, 2011 5:47 am

It is rather confusing at this point.

The first step is getting the remote control signals from the remote control receiver. This is done by a Linux kernel driver. For many popular remotes, this was done by one of the out-of-tree LIRC lirc_* drivers. In the case of your remote, it was done by the lirc_mceusb driver.

The second step is translating remote control signals into Linux input events (i.e. KEY_* and BTN_* input events). For the out-of-tree lirc_* drivers, this was done in user space using the lircd daemon. For mapping the remote control signals to Linux input events, the lircd daemon relies on the /etc/lircd.conf file.

However, as part of including the lirc_* drivers in the kernel tree, translating remote control signals into Linux input events is being done in kernel space. This is the case for your remote, because it is using the mainline kernel mceusb driver now. These ported drivers convert the remote control signals to input event scan codes. These scan codes are then mapped to key codes. This scan code to key code mapping can be changed using the ir-keytable command, which is included in MiniMyth. However, I have not integrated into MiniMyth's init system yet, so using it to change mapping would be somewhat cumbersome at this point. Besides, it is not likely required because it is likely that all the scan codes are mapped to key codes, just not the ones that you want.

The third step is converting the Linux input event devices into an lircd socket. This could be done using the lircd daemon. However, for added flexibility in doing the conversion,I wrote the eventlircd daemon, which is what MiniMyth uses. The eventlircd daemon is capable of mapping key codes to other key codes. This is integrated into the MiniMyth init system. MiniMyth stores the mapping files in /etc/eventlircd.d. The mapping files are named <BUS_ID>_<VENDOR_ID>_<DEVICE_ID>.evmap.

The fourth step is mapping the key codes sent through the lircd socket to application behaviors, this is configured using the /etc/lircrc configuration file. Therefore, /etc/lircrc is still used. Also, since /etc/lircrc files maps key codes to application behaviors, as long the remote button you want to map produces a key code.

Since irexec is just another application that listens for events on the lircd socket, is still works.

Because the lircd daemon is not longer used to translate remote control signals to Linux input events for your remote, your /etc/lircd.conf file will do nothing. However, as mentioned above, if all of your remote buttons map to some key code, then you can add the file /etc/eventlircd.d/03_2304_0225.evmap to do the mapping or you can change /etc/lircrc to do the mapping. To find out whether or not all your remote buttons map to some key code, stop X, run the command irw and press each remote button. If all the buttons produce a key code then create file called 03_2304_0225.evmap (you can find example files in /etc/eventlircd.d) with mappings that match the mappings in your /etc/lircd.conf file, put it your MiniMyth read-only configuration directory, and add MM_LIRC_EVENTLIRCD_FILE_EVMAP_ADD='03_2304_0225.evmap' to your minimyth.conf file.

I will need to look into why resume from S3 is not working. What hardware do you have? If is VIA do you have MiniMyth stopping X before suspending?
MiniMyth running on an Acer ApireRevo 3610 and a Zotac ZBOX-ID80-U. Find out more at my MythTV page.
Site Admin
Posts: 4182
Joined: Tue Dec 14, 2004 2:13 am
Location: La Jolla

Re: Confused with lirc

Postby JoeHenley » Sun Aug 28, 2011 7:16 pm


Thank you very much for the detailed info. I suspect the documentation part of MiniMyth is the least fun. But it is greatly appreciated. By the way, the man files for your eventlircd on the Google site are helpful; please consider including them in the minimyth distribution.

I followed your outline and did the following:
- Delete lircd.conf
- Closed X and then ran irw. Pushed every button on the remote and used the resulting info to update my lircrc file (glommed from /etc/lirc/lircrc.d/mythtv/base) to whatever the kernel is using. There were a couple of changes to make.
- Decided to tweak lircrc instead of adding in the eventlircd map file. In my case, the changes are very minor, so it seems easier to take the more direct route. But the added flexibility from eventlircd will be handy if I need a more complex lircrc.

So now, the IR/lirc issues are in pretty decent shape.

I did have a question related to this effort. You suggested that "To find out whether or not all your remote buttons map to some key code, stop X, run the command irw and press each remote button." I telnet'd into the FE from another PC on the network, ran "killall X", and then ran "irw". Then I went into the room where the FE is, pushed every button on the remote, then returned to the room where the PC was running the telnet session and copied the info from the terminal. There was never any info on the FE client screen, so it was all guesswork (albeit, pretty simple guesswork).

I'm thinking there must be an easier way. How would I close minimyth on the FE, but leave it with an X screen so I could do these types of install/fix/figure-out/etc. work directly on the FE (not via the telnet terminal)?

With the lirc issue resolved, I'm turning to video problems I'm having with 0.23.1-78b3. I'm having alot of them, but I'll start a new thread.

Thanks again for all your help.

Joe Henley
Posts: 185
Joined: Sun Aug 06, 2006 4:12 pm

Return to General Help

Who is online

Users browsing this forum: No registered users and 1 guest