AVS Forum banner

1 - 20 of 31 Posts

·
Banned
Joined
·
1,686 Posts
Discussion Starter #1
This week I've struggled (all week) to get LIRC working on Debian Testing, and it is hopeless. Every single one of the instruction pages, docs, and even the /usr/share/doc/lirc, are all completely wrong for installing for an iMon setup. I can not make this work.


I am told in backchannel that lirc_* modules are obsolete, even though they come with the 3.2 kernel, and that I must use the kernel imon module with devinput driver for LIRC. Only thing is, it doesn't work. irw /run/lirc/lircd yields, "connect: Connection refused".
Code:
Code:
[CODE]# lsmod |grep imon
imon                   25733  0 
rc_core                18286  3 imon,cx23885
usbcore               128498  9 ehci_hcd,ohci_hcd,usbhid,uhci_hcd,imon,uas,usb_storage

# lsmod |grep lirc

# lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 002: ID 046d:c030 Logitech, Inc. iFeel Mouse
Bus 003 Device 003: ID 15c2:0035 SoundGraph Inc. 
Bus 002 Device 002: ID 0547:1002 Anchor Chips, Inc. Python2 WDM Encoder
Bus 002 Device 003: ID 0bda:0151 Realtek Semiconductor Corp. Mass Storage Device (Multicard Reader)

# ls -al /dev/input/by-id
total 0
drwxr-xr-x 2 root root 140 Jul 20 08:37 ./
drwxr-xr-x 4 root root 360 Jul 20 08:37 ../
lrwxrwxrwx 1 root root   9 Jul 20 08:37 usb-15c2_0035-event-if00 -> ../event4
lrwxrwxrwx 1 root root   9 Jul 20 08:37 usb-15c2_0035-event-mouse -> ../event2
lrwxrwxrwx 1 root root   9 Jul 20 08:37 usb-15c2_0035-mouse -> ../mouse1
lrwxrwxrwx 1 root root   9 Jul 20 08:32 usb-Logitech_Inc._iFeel_Mouse-event-mouse -> ../event1
lrwxrwxrwx 1 root root   9 Jul 20 08:32 usb-Logitech_Inc._iFeel_Mouse-mouse -> ../mouse0

# /etc/init.d/lirc start
[ ok ] Loading LIRC modules:.
[ ok ] Starting remote control daemon(s) : LIRC :.
[ ok ] Starting execution daemon: irexec:.

# ps aux |grep lirc
root     15766  0.0  0.0  20364   608 ?        Ss   13:42   0:00 /usr/sbin/lircd --driver=devinput --device=/dev/input/by-id/usb-15c2_0035-event-if00
root     15790  0.0  0.0   6128   104 ?        Ss   13:42   0:00 /usr/bin/irexec -d /etc/lirc/lircrc
root     15813  0.0  0.0   7816   892 pts/8    S+   13:42   0:00 grep --color=auto lirc

# ps aux |grep irexec
root     15790  0.0  0.0   6128   104 ?        Ss   13:42   0:00 /usr/bin/irexec -d /etc/lirc/lircrc
root     16585  0.0  0.0   7816   892 pts/8    S+   13:48   0:00 grep --color=auto irexec

# /etc/init.d/lirc stop
[ ok ] Stopping execution daemon: irexec:.
[ ok ] Stopping remote control daemon(s): LIRC:.

# ps aux |grep lirc
root     15710  0.0  0.0   7816   892 pts/8    S+   13:42   0:00 grep --color=auto lirc

# ls -al /run/lirc
total 0
drwxr-xr-x  2 root root  60 Jul 20 08:35 ./
drwxr-xr-x 25 root root 800 Jul 20 08:34 ../
srw-rw-rw-  1 root root   0 Jul 20 08:32 lircd=

# ls -al /var/run
lrwxrwxrwx 1 root root 4 Mar 15 08:20 /var/run -> run

# irw /run/lirc/lircd
connect: Connection refused

#
[/CODE]


Anyone who has this PoS running on Debian Testing or newer, must be intensely psychic. It's an order of magnitude harder than it used to be, in fact I'll say infinity since it's busted.
 

·
Registered
Joined
·
1,280 Posts
If you are using the in-kernel module, then you need to forget about lirc. Read this blog about it:

http://wyliecoyoteuk.wordpress.com/2012/01/30/how-to-forget-lirc-for-mythtv-remotes/


Install the ir-keytable package:
Code:
Code:
[CODE]sudo apt-get install ir-keytable
[/CODE]
This gives you some tools, plus a large list of key map files. These are found in /lib/udev/rc_keymaps/, and it looks like there are two for the iMon:


/lib/udev/rc_keymaps/imon_mce

/lib/udev/rc_keymaps/imon_pad


I set up a MCE remote using this, but it is on Fedora, so things are different. Plus I forgot most of what I did.
 

·
Registered
Joined
·
4,894 Posts

Quote:
Originally Posted by quantumstate  /t/1421174/anyone-have-lirc-working#post_22237056


This week I've struggled (all week) to get LIRC working on Debian Testing, and it is hopeless. ....

While it looks like waterhead might have already covered your specific issue. This brings up the issue that Debian is currently working on stripping out all the "non-free" code from their distro in order to become an FSF certified "free" distro.


This means no binary blobs at all provided by Debian, not even in a separate repo like the current case. So no libdvdcss, no mp3, no mpeg2, no h264, no flash, no win32codec, no broadcom drivers, no Nvidea drivers, no ATI drivers, no firmware blobs that are needed by a bunch of the Tuner devices.


I think it's going to become a massive PITA to try to build a HTPC directly on top of Debian in the near future. To maintain your sanity, you'll probably want to build on top of Ubuntu or Mint who will hopefully add all the non-free stuff back in to their distros.


[Since you're using the Testing repo, it does make me wonder if your LIRC problems could be related to things that they've begun to strip out of the Testing repo.]
 

·
Banned
Joined
·
1,686 Posts
Discussion Starter #4
eh heh


I haven't heard this. Although Debian is radical open-source, it's hard to believe that they would take steps to effectively shut out firmware, radio MACs, etc. No sign of this on their News page.
 

·
Banned
Joined
·
1,686 Posts
Discussion Starter #6

Quote:
Originally Posted by waterhead  /t/1421174/anyone-have-lirc-working#post_22237400


If you are using the in-kernel module, then you need to forget about lirc. Read this blog about it:
http://wyliecoyoteuk.wordpress.com/2012/01/30/how-to-forget-lirc-for-mythtv-remotes/

He doesn't explain how things work. Far out.

# ir-keytable

Found /sys/class/rc/rc0/ (/dev/input/event3) with:

Driver imon, table rc-empty

Supported protocols: RC-6 other

Enabled protocols:

Repeat delay = 500 ms, repeat period = 125 ms


table rc-empty. Well the only files in the ir-keytable package are the /lib/udev/rc_keymaps/* files, /etc/rc_maps.cfg, and the directory rc_keymaps. So how to designate the table? Not being deeply psychic I inferred that you have to put a symlink in /etc/rc_keymaps pointing to the relevant driver in /lib/udev/rc_keymaps/, in my case imon_pad since I have the iMon Pad remote. Reboot and... no change. So then I linked imon_mce... no change.


After struggling for the whole past week on LIRC this is really frustrating. Nobody seems to understand how these systems work, much less explain it in reasonably comprehensive instructions, even on lirc.org. I haven't found a single set of instructions which cover the current state of affairs. I doubt that anyone has LIRC working, and I can't even make this bypass work, and as there is absolutely no clue how it actually works, I can't even work to fix it.



Edit: Maybe this sux. Maybe I should refocus on a bluetooth remote. Only thing is I need to control my projector, and that is IR only. In fact it has been the impetus behind all this wasted effort.
 

·
Registered
Joined
·
1,280 Posts
I thought that I had documented what I had to do, but I guess I didn't.


I believe that the link you are referring to are in the /etc/rc_maps.cfg file. I see in your output that for table it lists rc-empty, and I don't even see anything like that listed I thought that you needed the imon_mce key table. I see that the rc_maps.cfg file does contain the links to the files in the /lib/udev/rc_keymaps/ folder. Maybe you just need to tell it to load that file. The directions say to do this:
Code:
Code:
[CODE]ir-keytable -a
[/CODE]
If that doesn't work, try specifying the table:
Code:
Code:
[CODE]ir-keytable --auto-load=imon_mce
[/CODE]
It is also possible that if both the kernel module and LIRC are loaded, that nothing will work. You may need to remove one before the other will work. I uninstalled LIRC altogether.
 

·
Banned
Joined
·
1,686 Posts
Discussion Starter #8
Tried those too. It's acting like there's something wrong with the keytable, but no clue what.


# ir-keytable -a /lib/udev/rc_keymaps/imon_mce

Invalid parameter on line 2 of /lib/udev/rc_keymaps/imon_mce

Invalid parameter(s)

ir-keytable: -a: (PROGRAM ERROR) Option should have been recognized!?

Try `ir-keytable --help' or `ir-keytable --usage' for more information.


# ir-keytable -a /lib/udev/rc_keymaps/imon_pad

Invalid parameter on line 2 of /lib/udev/rc_keymaps/imon_pad

Invalid parameter(s)

ir-keytable: -a: (PROGRAM ERROR) Option should have been recognized!?

Try `ir-keytable --help' or `ir-keytable --usage' for more information.


# ir-keytable --auto-load=/lib/udev/rc_keymaps/imon_mce

Invalid parameter on line 2 of /lib/udev/rc_keymaps/imon_mce

Invalid parameter(s)

ir-keytable: --auto-load: (PROGRAM ERROR) Option should have been recognized!?

Try `ir-keytable --help' or `ir-keytable --usage' for more information.


# ir-keytable --auto-load=/lib/udev/rc_keymaps/imon_pad

Invalid parameter on line 2 of /lib/udev/rc_keymaps/imon_pad

Invalid parameter(s)

ir-keytable: --auto-load: (PROGRAM ERROR) Option should have been recognized!?

Try `ir-keytable --help' or `ir-keytable --usage' for more information.


I have LIRC stopped. Only thing related is the imon module which is loaded, but I think that's needed.


Code:
# table imon_mce, type: RC6

0x800ff415 KEY_REWIND

0x800ff414 KEY_FASTFORWARD

0x800ff41b KEY_PREVIOUS

0x800ff41a KEY_NEXT
 

·
Registered
Joined
·
1,280 Posts
I ended up making my own keymap file, for a WMC remote. Run it in test mode and press the keys. Write down the number that it says is associated with each button. You may want to save a copy of the original first.
Code:
Code:
[CODE]ir-keytable -t
[/CODE]
If I recall, there were several versions of the iMon. I had the original, that came with a case I bought. I ended up tossing it in the trash!
 

·
Banned
Joined
·
1,686 Posts
Discussion Starter #10
Yeah the iMon remote isn't very good, but I was just trying to get something, anything to work.


Maybe I'll see if I can make a keyfile.


I did manage to get my projector remote working tonight anyway, and that was the main impetus. Turns out the code set in the projector somehow got knocked to a different setting than the remote during a house move. I just tried the other codeset in the projector.


Anything else I can do with Bluetooth, so probably looking at a cheap bigscreen phone or small tablet to use as a remote, likely Android.
 

·
Banned
Joined
·
1,686 Posts
Discussion Starter #11
I may have found the problem. Discovered a little util called evtest. It says that something else has seized my remote port. lsof /dev/input/by-id/{device} shows it's taken by both acpid and lirc, acpid first. This would explain why I get nothing in irw, irrecord, or mode2.


Looking further into it tomorrow.
 

·
Registered
Joined
·
1,562 Posts
If your remote can be made to be recognized as an additional keyboard and mouse, then you don't need any kind of IR receiving software such as LIRC. This will be determined by the receiver that is plugged into the USB port. I have a Vista MCEUSB remote that's running as a KBD & mouse. I set them up in xorg.conf as input devices and then simply used Xmodmap to remap a few keys for MythTV.
 

·
Banned
Joined
·
1,686 Posts
Discussion Starter #13
False alarm. Stopped acpid and still no joy.
Code:
Code:
[CODE]Code:
# evtest 
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0:      AT Translated Set 2 keyboard
/dev/input/event1:      Logitech Inc. iFeel Mouse   
/dev/input/event2:      iMON Panel, Knob and Mouse(15c2:0035)
/dev/input/event3:      iMON Remote (15c2:0035)
/dev/input/event4:      iMON USB Touchscreen (15c2:0035)
/dev/input/event5:      Power Button
/dev/input/event6:      Power Button
/dev/input/event7:      PC Speaker
/dev/input/event8:      Video Bus
/dev/input/event9:      HDA Digital PCBeep
Select the device event number [0-9]: 3
Input driver version is 1.0.1
Input device ID: bus 0x3 vendor 0x15c2 product 0x35 version 0x3
Input device name: "iMON Remote (15c2:0035)"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
  Event type 4 (EV_MSC)
    Event code 4 (MSC_SCAN)
  Event type 20 (EV_REP)
[/CODE]


When I run this I should be connected directly to the remote pickup, but I get nothing. I do get gibberish in dmesg from the remote, but nothing in evtest. Starting to look like this is hopeless.
 

·
Banned
Joined
·
1,686 Posts
Discussion Starter #14
My God, I believe I have the horrid frightful LIRC working on my Silverstone HTPC case . Its display and touchscreen have always worked (I have Conky running in it to display system stats and bar graphs), but not the remote.


I've always known that for my Soundgraph remote I need the imon module and that the lirc_imon is obsolete. I've struggled for two weeks trying everything under the Sun to make this pig work, but it seems I may now have the way.


I finally determined that evtest is my best tool, as it is closest to the kernel module and device. I've almost always gotten the result in the prior post with it though, which was clearly wrong as no keys are mapped. But today I stopped lirc and unloaded and reloaded the imon module, and Lo it also loaded the rc_imon_pad module. I tried evtest and got this for a change:
Code:
Code:
[CODE]# evtest
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0:      AT Translated Set 2 keyboard
/dev/input/event1:      iMON Panel, Knob and Mouse(15c2:0035)
/dev/input/event2:      Logitech Inc. iFeel Mouse   
/dev/input/event3:      iMON Remote (15c2:0035)
/dev/input/event4:      iMON USB Touchscreen (15c2:0035)
/dev/input/event5:      Power Button
/dev/input/event6:      Power Button
/dev/input/event7:      Video Bus
/dev/input/event8:      PC Speaker
/dev/input/event9:      HDA Digital PCBeep
Select the device event number [0-9]: 3
Input driver version is 1.0.1
Input device ID: bus 0x3 vendor 0x15c2 product 0x35 version 0x3
Input device name: "iMON Remote (15c2:0035)"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 1 (KEY_ESC)
    Event code 14 (KEY_BACKSPACE)
    Event code 28 (KEY_ENTER)
    Event code 57 (KEY_SPACE)
    Event code 103 (KEY_UP)
    Event code 105 (KEY_LEFT)
    Event code 106 (KEY_RIGHT)
    Event code 108 (KEY_DOWN)
    Event code 113 (KEY_MUTE)
    Event code 114 (KEY_VOLUMEDOWN)
    Event code 115 (KEY_VOLUMEUP)
    Event code 119 (KEY_PAUSE)
    Event code 128 (KEY_STOP)
    Event code 139 (KEY_MENU)
    Event code 156 (KEY_BOOKMARKS)
    Event code 167 (KEY_RECORD)
    Event code 168 (KEY_REWIND)
    Event code 174 (KEY_EXIT)
    Event code 207 (KEY_PLAY)
    Event code 208 (KEY_FASTFORWARD)
    Event code 212 (KEY_CAMERA)
    Event code 368 (KEY_LANGUAGE)
    Event code 370 (KEY_SUBTITLE)
    Event code 372 (KEY_ZOOM)
    Event code 374 (KEY_KEYBOARD)
    Event code 375 (KEY_SCREEN)
    Event code 377 (KEY_TV)
    Event code 389 (KEY_DVD)
    Event code 392 (KEY_AUDIO)
    Event code 393 (KEY_VIDEO)
    Event code 402 (KEY_CHANNELUP)
    Event code 403 (KEY_CHANNELDOWN)
    Event code 407 (KEY_NEXT)
    Event code 412 (KEY_PREVIOUS)
    Event code 442 (?)
    Event code 512 (KEY_NUMERIC_0)
    Event code 513 (KEY_NUMERIC_1)
    Event code 514 (KEY_NUMERIC_2)
    Event code 515 (KEY_NUMERIC_3)
    Event code 516 (KEY_NUMERIC_4)
    Event code 517 (KEY_NUMERIC_5)
    Event code 518 (KEY_NUMERIC_6)
    Event code 519 (KEY_NUMERIC_7)
    Event code 520 (KEY_NUMERIC_8)
    Event code 521 (KEY_NUMERIC_9)
    Event code 522 (KEY_NUMERIC_STAR)
    Event code 523 (KEY_NUMERIC_POUND)
  Event type 4 (EV_MSC)
    Event code 4 (MSC_SCAN)
  Event type 20 (EV_REP)
Properties:
Testing ... (interrupt to exit)
[/CODE]


Holy cow, it's working! I tested all the buttons on this miserable Soundgraph Pad remote, and indeed they all work.


evtest will not run with lirc running as the interface is bound, so I then ^C evtest and started lirc, then ran irw (which can't run without lirc), and indeed it now sees the keys hit on my remote! I have yet to see if the remote works with MythTV and whether this method remains reliable after a boot. I have to stop lirc, unload the imon module, and modprobe it, then it should work. Why, I don't know. I've tried loading the rc_imon_pad module manually many times before but it would not work.


Next step is to test it in Myth, and then see about making my Dish 21.0 remote work, which doesn't get a peep out of evtest for some reason.
 

·
Banned
Joined
·
1,686 Posts
Discussion Starter #15
Yop, since I'm doing New Science here I might as well document it. This is Secret Information as it is posted nowhere else on The Internets. (PVR4craig you are ordered to not read this)


First of all you have to have lirc set up in /etc/lirc/hardware.conf. This is the high-level config file. Only thing you really need to have annotated here is DEVICE= pointing to the permanent name of your remote's incoming signal socket. In my case it's:

DEVICE="/dev/input/by-id/usb-15c2_0035-event-if00"

Supposedly LIRC should default to /dev/lirc (according to the man page) or /dev/lirc0 (according to hardware.conf), but I can tell you that neither one worked when I symlinked to /dev/input/by-id/usb-15c2_0035-event-if00. Now /dev/input/by-id/usb-15c2_0035-event-if00 is actually a symlink pointing to /dev/input/event3, but do not use that. It is subject to change any time you boot your system. Use the name in by-id.


The new paradigm with LIRC is that everything is treated as a keyboard by a translator called devinput. A remote control generates a given event (tested with evtest), and that is translated to a universal language, which I'll call KEY/BTN, by devinput, which is essentially the mapping file /etc/lirc/lirc.conf. It's not there by default, you have to copy it there from /usr/share/lirc/remotes/devinput, or get the newest one from lirc.org. In turn the KEY/BTN code is interpreted for apps through the /etc/lirc/lircrc file. I am not allowed to attach mine here, so your loss. Now, mythfrontend will only look for lircrc in /home/{user}/.mythtv or /home/{user} so you must symlink /etc/lirc/lircrc to /home/{user}/.mythtv or else Myth won't find it.


OK, I'm trying to use this rinky-dink iMon Pad remote, and it is not reliable. When I restart LIRC I make sure that lircd, lircmd, and irexec all start. lircmd translates mouse functions. The pad on the remote works as a mouse, and the left- and right-click buttons work well as well as Enter, but in Myth padding up, down, left, right made two clicks in the menu, not one. I think this is because both lircd and lircmd are translating the pad. Escape and Menu do work.


This remote uses 38KHz IR with the RC6 IR protocol. There are basically two remote protocols, RC6 by Philips and NEC for Japanese products, and there are many different frequencies. Well I want my better Dish 21.0 remote to work so I went to lirc.org and got the Dish lirc.conf . It appears that I should be able to replace devinput's lirc.conf with the Dish lirc.conf from lirc.org, but unfortunately that does not work. The Dish file has some very specific settings in it like:
Code:
Code:
[CODE]flags SPACE_ENC|NO_HEAD_REP
  eps 30
  aeps 100

  frequency 56000
#  duty_cycle 32

  one 440 1645
  zero 440 2780

  header 525 6045
  ptrail 450
  gap 6115

  min_repeat 6

  bits 6
  post_data_bits 10

  post_data 0x000
[/CODE]


Well this should set up LIRC when I rename it to lirc.conf, restart lirc, and test it with irw, but nothing. First problem is that with lirc stopped, evtest sees nothing from the Dish remote. This is looking at it right from the driver. Maybe I have to analyze the imon and rc_imon_pad drivers to see what the heck. It would make sense that rc_imon_pad sets up the freqs and spacing specific to the Pad remote. Supposedly it's RC6 so other RC6 remotes should work. I set my Dish TV button to a Philips TV, and I should have thought that would be recognized, but noOo. I notice that there are other interesting keymap files in /lib/modules/3.2.0-3-amd64/kernel/drivers/media/rc/keymaps .
 

·
Registered
Joined
·
1,515 Posts

·
Registered
Joined
·
1,280 Posts

Quote:
Originally Posted by quantumstate  /t/1421174/anyone-have-lirc-working#post_22259369


Man that would have saved me a week of agony if I'd been able to find it.
Isn't what Jarod is saying is to NOT use LIRC and use the kernel modules? Isn't that what I said back towards the beginning of this thread?
 

·
Registered
Joined
·
465 Posts

Quote:
Originally Posted by quantumstate  /t/1421174/anyone-have-lirc-working/0_50#post_22257848


... (PVR4craig you are ordered to not read this) ...

I didn't need to--LiRC works for me!


Craig
 

·
Registered
Joined
·
465 Posts

Quote:
Originally Posted by waterhead  /t/1421174/anyone-have-lirc-working/0_50#post_22259662


Isn't what Jarod is saying is to NOT use LIRC and use the kernel modules? Isn't that what I said back towards the beginning of this thread?

Um, are you saying that QuantumState may not have read and/or understood something that was written here? Gosh.





Craig
 
1 - 20 of 31 Posts
Top