[SOLVED] MCE Remote On Debian

Have a MythTV related problem? Ask for help from other MythTV users here.

Moderator: Forum Moderators

Post Reply
chadhogg
Newcomer
Posts: 5
Joined: Wed Jul 02, 2014 2:30 pm
United States of America

[SOLVED] MCE Remote On Debian

Post by chadhogg »

I am running Debian Wheezy with stock 3.2.0-4 kernel. I am trying to configure a Rosewill RHRC-11001 MCE remote control. I thought that the documentation I read (like http://www.mythtv.org/wiki/Generic_HID_ ... 22_Remotes and http://www.mythtv.org/wiki/MCE_Remote) suggested that with a modern kernel it should be automatically recognized and at least partially work, but that is not the experience I am having.

The IR receiver blinks with each press of a button on the remote control, but none of the buttons have any effect while mythfrontend is in the foreground. Thinking that perhaps it is just myth that needs to be configured, I also tried opening a document in gedit, sticking my cursor in the middle of it, and pressing buttons on the remote to see if it would insert characters or move the cursor or anything, and still none of the buttons have any effect.

When I connect the receiver, dmesg shows the following:

[ 216.846126] usb 3-7: new full-speed USB device number 2 using xhci_hcd
[ 216.865547] usb 3-7: New USB device found, idVendor=147a, idProduct=e042
[ 216.865554] usb 3-7: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 216.865559] usb 3-7: Product: eHome Infrared Transceiver
[ 216.865563] usb 3-7: Manufacturer: Formosa21
[ 216.865567] usb 3-7: SerialNumber: 0000DD8F
[ 216.865778] usb 3-7: ep 0x83 - rounding interval to 64 microframes, ep desc says 80 microframes
[ 226.985282] generic-usb 0003:147A:E042.0001: timeout initializing reports
[ 226.985579] generic-usb 0003:147A:E042.0001: hiddev0,hidraw0: USB HID v1.00 Device [Formosa21 eHome Infrared Transceiver] on usb-0000:00:14.0-7/input1
[ 226.985644] usbcore: registered new interface driver usbhid
[ 226.985650] usbhid: USB HID core driver

Syslog also gets this following those lines:

Jul 2 09:25:47 myth-livingroom minissdpd[2982]: 4 new devices added
Jul 2 09:26:23 myth-livingroom minissdpd[2982]: 12 new devices added
Jul 2 09:27:36 myth-livingroom minissdpd[2982]: 51 new devices added

`lsusb` produces the following:

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:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 8087:8008 Intel Corp.
Bus 002 Device 002: ID 8087:8000 Intel Corp.
Bus 003 Device 002: ID 147a:e042 Formosa Industrial Computing, Inc.

Although I had read that MCE remotes were now supposed to work without lirc, since I was having no luck I installed the lirc package. It comes with empty configuration files, but I copied http://lirc.sourceforge.net/remotes/mce ... onf.mceusb to /etc/lirc/lircd.conf. However, to start lirc I also need to change /etc/lirc/hardware.conf to specify a driver, and none on the supported list look like they obviously match my hardware.

There are no special files /dev/lirc*. [Some of what I have read suggests that there should be, but I am not sure. I imagine that if I got lircd to start it would probably create this.]
None of the special files in /dev/input/ match this device. [Some of what I have read suggests that one should, but I am not sure.]
Module usbhid is loaded, but mceusb is not. Manually loading mceusb does not seem to have any effect. [Some of what I have read suggests that this module should be loaded, but I am not sure.]
`irw` produces an error, because /var/run/lirc/lircd does not exist.
I *do* have a special file /dev/hidraw0 after connecting my receiver, but I am not sure how to use it for anything.

Any suggestions that you might have would be greatly appreciated.
Last edited by chadhogg on Sun Jul 06, 2014 3:43 pm, edited 1 time in total.
wesnewell
Senior
Posts: 731
Joined: Mon Jun 23, 2014 6:54 pm
Location: Wylie TX, USA
United States of America

Re: MCE Remote On Debian

Post by wesnewell »

If you've never messed with lirc it cna be a nightmare until you figure it out. If you've loaded the lirc package, you should have all the tools that come with it. The main ones are mode2, irw, irrecord, and of course lircd, which is the actual program that runs. Try the man pages, they will tell you how to use the tools, or just enter the command with --help. For now look at /etc/lirc and see fi you have the required files. at minumum, you should have hardware.conf and lircd.conf and they need to be configured. Your hardware config should look like this for an mce remote receiver.
wes@mythfe1:~$ cat /etc/lirc/hardware.conf
# /etc/lirc/hardware.conf
#
#Chosen Remote Control
REMOTE="Windows Media Center Transceivers/Remotes (all)"
REMOTE_MODULES="lirc_dev mceusb"
REMOTE_DRIVER=""
REMOTE_DEVICE="/dev/lirc0"
REMOTE_SOCKET=""
REMOTE_LIRCD_CONF="mceusb/lircd.conf.mceusb"
REMOTE_LIRCD_ARGS=""

#Chosen IR Transmitter
TRANSMITTER="None"
TRANSMITTER_MODULES=""
TRANSMITTER_DRIVER=""
TRANSMITTER_DEVICE=""
TRANSMITTER_SOCKET=""
TRANSMITTER_LIRCD_CONF=""
TRANSMITTER_LIRCD_ARGS=""

#Disable kernel support.
#Typically, lirc will disable in-kernel support for ir devices in order to
#handle them internally. Set to false to prevent lirc from disabling this
#in-kernel support.
#DISABLE_KERNEL_SUPPORT="true"

#Enable lircd
START_LIRCD="true"

#Don't start lircmd even if there seems to be a good config file
#START_LIRCMD="false"

#Try to load appropriate kernel modules
LOAD_MODULES="true"

# Default configuration files for your hardware if any
LIRCMD_CONF=""

#Forcing noninteractive reconfiguration
#If lirc is to be reconfigured by an external application
#that doesn't have a debconf frontend available, the noninteractive
#frontend can be invoked and set to parse REMOTE and TRANSMITTER
#It will then populate all other variables without any user input
#If you would like to configure lirc via standard methods, be sure
#to leave this set to "false"
FORCE_NONINTERACTIVE_RECONFIGURATION="true"
START_LIRCMD=""
wes@mythfe1:~$
The lircd file needs to be for your remote. I don't use mce remotes and created my own lircd.conf file using irrecord years ago. This is what your's should probabvly look like.
#Configuration for the Windows Media Center Transceivers/Remotes (all) remote:
include "/usr/share/lirc/remotes/mceusb/lircd.conf.mceusb"
That should point to the correct file, and it needs to be in that location.
Once you've configured these restart lircd and then use irw to test the remote. If it works, you then need to configure an lircrc file for the program you are going to run it in if it's not there already. The location of the file should be in home/user/.mythtv although it may be a link to ~/.lirc/mythtv like mine does. i hate the way they package some of this stuff. Makes it hard to trace.

if nothing still works run irw and see if the you get codes. If nothing then run mode2 and see if you get raw signals from the remote.
Good luck. If you've never worked with lirc you'll probably need it, althoughI think i did a fair job of explaining it.
BE/FE-Asrock AB350 Pro Ryzen 3 3200G, 6 atsc tuners. FE's-GF8200's Athlon II, Ryzen 3 2200G. Mythtv user since 2005.
chadhogg
Newcomer
Posts: 5
Joined: Wed Jul 02, 2014 2:30 pm
United States of America

Re: MCE Remote On Debian

Post by chadhogg »

That hardware.conf sort-of works a little bit. Attempting to start the daemon through its init script fails with an entirely unhelpful error message, but I am able to just manually run it.

However, neither `irw` nor `mode2` produce any output no matter how many buttons I might press.

Trying to start the daemon through the init script writes nothing to syslog. Manually starting the daemon writes:

Code: Select all

Jul  3 12:44:57 myth-livingroom lircd-0.9.0-pre1[7980]: lircd(default) ready, using /var/run/lirc/lircd
Running `irw` with no arguments writes the following to syslog (while producing no output):

Code: Select all

Jul  3 12:46:22 myth-livingroom lircd-0.9.0-pre1[7980]: accepted new client on /var/run/lirc/lircd
Jul  3 12:46:22 myth-livingroom lircd-0.9.0-pre1[7980]: could not get file information for /dev/lirc
Jul  3 12:46:22 myth-livingroom lircd-0.9.0-pre1[7980]: default_init(): No such file or directory
Jul  3 12:46:22 myth-livingroom lircd-0.9.0-pre1[7980]: Failed to initialize hardware
Jul  3 12:46:27 myth-livingroom lircd-0.9.0-pre1[7980]: removed client
That's perhaps because I have /dev/lircd instead of /dev/lirc. Which is especially odd given that your hardware.conf file seems to be requesting /dev/lirc0 instead of either one. `irw` does not seem to have an option for choosing the device. But `mode2` does. But running `mode2 -d /dev/lircd` also writes this to syslog (while producing no output):

Code: Select all

Jul  3 12:51:25 myth-livingroom lircd-0.9.0-pre1[8078]: accepted new client on /var/run/lirc/lircd
Jul  3 12:51:25 myth-livingroom lircd-0.9.0-pre1[8078]: could not get file information for /dev/lirc
Jul  3 12:51:25 myth-livingroom lircd-0.9.0-pre1[8078]: default_init(): No such file or directory
Jul  3 12:51:25 myth-livingroom lircd-0.9.0-pre1[8078]: Failed to initialize hardware
Jul  3 12:51:41 myth-livingroom lircd-0.9.0-pre1[8078]: removed client
So just for fun, I made /dev/lirc a hard link to /dev/lircd and tried running `mode2` again, receiving this more positive message in syslog:

Code: Select all

Jul  3 12:53:58 myth-livingroom lircd-0.9.0-pre1[8078]: accepted new client on /var/run/lirc/lircd
Jul  3 12:53:58 myth-livingroom lircd-0.9.0-pre1[8078]: accepted new client on /var/run/lirc/lircd
Jul  3 12:54:12 myth-livingroom lircd-0.9.0-pre1[8078]: removed client
... but still no actual output from the program indicating that it is receiving any signals.
wesnewell
Senior
Posts: 731
Joined: Mon Jun 23, 2014 6:54 pm
Location: Wylie TX, USA
United States of America

Re: MCE Remote On Debian

Post by wesnewell »

From the working system in my previous, this is what i have. Don't know if this will help, but it's all I can think of to do.
wes@mythfe1:~$ ls /dev/lirc*
/dev/lirc0 /dev/lircd
wes@mythfe1:~$ ls /etc/lirc/
hardware.conf hardware.conf.old lircd.conf~ lircmd.conf
hardware.conf~ lircd.conf lircd.conf.dpkg-old
wes@mythfe1:~$ su
Password:
root@mythfe1:/home/wes# lsmod|grep lirc
ir_lirc_codec 13021 3
lirc_dev 19980 1 ir_lirc_codec
rc_core 28124 12 lirc_dev,ir_lirc_codec,ir_rc5_decoder,ir_nec_decoder,ir_sony_decoder,mceusb,ir_mce_kbd_decoder,ir_jvc_decoder,ir_rc6_decoder,ir_sanyo_decoder,rc_rc6_mce
root@mythfe1:/home/wes# lsmod|grep mce
ir_mce_kbd_decoder 13214 0
rc_rc6_mce 12502 0
mceusb 21980 0
rc_core 28124 12 lirc_dev,ir_lirc_codec,ir_rc5_decoder,ir_nec_decoder,ir_sony_decoder,mceusb,ir_mce_kbd_decoder,ir_jvc_decoder,ir_rc6_decoder,ir_sanyo_decoder,rc_rc6_mce
edac_mce_amd 22617 0
root@mythfe1:/home/wes# lsusb
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 003: ID 05e3:0716 Genesys Logic, Inc. USB 2.0 Multislot Card Reader/Writer
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 002: ID 0471:0815 Philips (or NXP) eHome Infrared Receiver
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

When setting up this system I accidently used the wrong lircd.conf file. Used this when i got no output with irw to see what was happening. Dumb mistake took me 2 days to figure out.
root@mythfe1:/home/wes# mode2 -d /dev/lirc0 -H default

If there's no /dev/lirc0 mode2 won't work. Are you sure your hardware.conf file is configured properly? All appropiate modules loaded, etc?
BE/FE-Asrock AB350 Pro Ryzen 3 3200G, 6 atsc tuners. FE's-GF8200's Athlon II, Ryzen 3 2200G. Mythtv user since 2005.
chadhogg
Newcomer
Posts: 5
Joined: Wed Jul 02, 2014 2:30 pm
United States of America

Re: MCE Remote On Debian

Post by chadhogg »

I had been under the impression that /dev/lirc0 was supposed to be created when the lirc daemon starts. But maybe that is incorrect? It sounds from some things I've read like /dev/lirc0 should be created by udev even without lirc running. It also sounds from other things like only older kernels would have created /dev/lirc0 and newer ones would create /dev/input/event[some number] for the IR receiver. (I don't have either.)

My hardware.conf came from you, but yours did not use the same option names as the empty default one on my system, so I tried changing things around a bit to just this:

Code: Select all

LIRCD_ARGS=""
LOAD_MODULES=true
DRIVER=""
DEVICE="/dev/lirc0"
MODULES="lirc_dev mceusb"
LIRCD_CONF=""
LIRCMD_CONF=""
With that modified configuration file, lirc now happily starts from its init script. But if I am (now) correct that lirc is not resposible for creating /dev/lirc0, then nothing in this file will be relevant until I get it created. Every module that sounds like it might be relevant is getting automatically loaded:

Code: Select all

root@myth-livingroom:~# lsmod | grep ir
ir_lirc_codec          12719  0 
ir_mce_kbd_decoder     12615  0 
ir_sony_decoder        12435  0 
ir_jvc_decoder         12433  0 
ir_rc6_decoder         12433  0 
ir_rc5_decoder         12433  0 
ir_nec_decoder         12433  0 
rc_core                18286  8 mceusb,ir_nec_decoder,ir_rc5_decoder,ir_rc6_decoder,ir_jvc_decoder,ir_sony_decoder,ir_mce_kbd_decoder,ir_lirc_codec
lirc_dev               17031  1 ir_lirc_codec
root@myth-livingroom:~# lsmod | grep mce
ir_mce_kbd_decoder     12615  0 
mceusb                 17039  0 
rc_core                18286  8 mceusb,ir_nec_decoder,ir_rc5_decoder,ir_rc6_decoder,ir_jvc_decoder,ir_sony_decoder,ir_mce_kbd_decoder,ir_lirc_codec
usbcore               128741  5 ehci_hcd,xhci_hcd,usbhid,mceusb
I can't help but think that the problem here is that udev is creating /dev/hidraw0 for me when it should be creating either /dev/lirc0 or /dev/input/event6 for me instead, and associating the wrong driver with it. Could you, perhaps, show me the output of the following commands on your working machine?

Code: Select all

root@myth-livingroom:~# ls /dev/lirc*
/dev/lircd
root@myth-livingroom:~# ls /dev/hid*
/dev/hidraw0
root@myth-livingroom:~# ls /dev/input/
by-path  event0  event1  event2  event3  event4  event5  mice  mouse0
root@myth-livingroom:~# 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:	Power Button
/dev/input/event2:	Power Button
/dev/input/event3:	PC Speaker
/dev/input/event4:	ImExPS/2 Generic Explorer Mouse
/dev/input/event5:	HDA Intel PCH Headphone
Select the device event number [0-5]: 
Many thanks for all of your help.
wesnewell
Senior
Posts: 731
Joined: Mon Jun 23, 2014 6:54 pm
Location: Wylie TX, USA
United States of America

Re: MCE Remote On Debian

Post by wesnewell »

Well, I'm about out of info. I just installed lirc on this machine for an mce remote even though I don't even have a receiver on it. The files are exacty as I posted earlier for the machine that does have a remote on it. The only device created was /dev/lircd. No /dev/lirc0, which seems reasonable since I don't have receiver on this machine. Perhaps it's not recognizing your receiver as an mce compatable receiver. if you can't findd any mistakes you've made then you're going to have to find someone more familiar with it than me to help. Here agian is the hardware config file.
# /etc/lirc/hardware.conf
REMOTE="Windows Media Center Transceivers/Remotes (all)"
REMOTE_MODULES="lirc_dev mceusb"
REMOTE_DRIVER=""
REMOTE_DEVICE="/dev/lirc0"
REMOTE_SOCKET=""
REMOTE_LIRCD_CONF="mceusb/lircd.conf.mceusb"
REMOTE_LIRCD_ARGS=""

START_LIRCD="true"
LOAD_MODULES="true"
LIRCMD_CONF=""
FORCE_NONINTERACTIVE_RECONFIGURATION="true"
START_LIRCMD=""
BE/FE-Asrock AB350 Pro Ryzen 3 3200G, 6 atsc tuners. FE's-GF8200's Athlon II, Ryzen 3 2200G. Mythtv user since 2005.
paulg
Newcomer
Posts: 9
Joined: Sat May 10, 2014 1:58 am

Re: MCE Remote On Debian

Post by paulg »

Do you have any configuration files that tell lirc what to do? It's been a while since I've had to mess with it, but I haven't seen you mention any lircrc files set up in your user home directory.
wesnewell
Senior
Posts: 731
Joined: Mon Jun 23, 2014 6:54 pm
Location: Wylie TX, USA
United States of America

Re: MCE Remote On Debian

Post by wesnewell »

I don't think he's gotten to that point, but it got thinking about his ir receiver and i found this which may be pertinant. Seems the version he has had problems before.
http://forum.xbmc.org/showthread.php?tid=133026
http://ubuntuforums.org/archive/index.p ... 36393.html
https://bugs.launchpad.net/ubuntu/+sour ... bug/954772
https://bugs.archlinux.org/task/28904
And the list goes on and on.
BE/FE-Asrock AB350 Pro Ryzen 3 3200G, 6 atsc tuners. FE's-GF8200's Athlon II, Ryzen 3 2200G. Mythtv user since 2005.
chadhogg
Newcomer
Posts: 5
Joined: Wed Jul 02, 2014 2:30 pm
United States of America

Re: MCE Remote On Debian

Post by chadhogg »

Without seeing the last two posts here, as a last-ditch effort I upgraded from the Debian 7.5 stock kernel (3.2.0-4) to a backport of what will be the stock kernel in Debian 8.0 when it is released (3.14.7-1). And that seems to have been all that was necessary; device nodes /dev/lirc0 and /dev/input/event[a new number for this device] are now automatically created by udev. Apparently not all version 2 MCE remotes are the same, and the kernel needs to have been compiled with knowledge of this specific model.

With the seemingly insurmountable hurdle of getting those device nodes created passed, setting up my own /etc/lirc/hardware.conf, /etc/lirc/lircd.conf, and ~/.lircrc was quite straightforward. But I should point out for future users that I needed to use the devinput driver and the devinput lircd.conf rather than the mceusb one.

Thanks for all of your help!
wesnewell
Senior
Posts: 731
Joined: Mon Jun 23, 2014 6:54 pm
Location: Wylie TX, USA
United States of America

Re: [SOLVED] MCE Remote On Debian

Post by wesnewell »

Then your hardware is not mce compatible. Could you post your hardware.conf file and the top portion of the lircd.conf file for reference.
BE/FE-Asrock AB350 Pro Ryzen 3 3200G, 6 atsc tuners. FE's-GF8200's Athlon II, Ryzen 3 2200G. Mythtv user since 2005.
chadhogg
Newcomer
Posts: 5
Joined: Wed Jul 02, 2014 2:30 pm
United States of America

Re: [SOLVED] MCE Remote On Debian

Post by chadhogg »

My hardware.conf:

<code>
DRIVER="devinput"
DEVICE="/dev/input/by-id/usb-Formosa21_eHome_Infrared_Transceiver_0000DD8F-event-if00"
</code>

I am using that strange way of accessing the device ID because it tends to be a different event number every time I reboot.

My lircd.conf:

<code>
include "/usr/share/lirc/remotes/devinput/lircd.conf.devinput"
</code>

The package-provided file that is being included:

<code>
# generated by devinput.sh
begin remote
name devinput
bits 16
eps 30
aeps 100
pre_data_bits 16
pre_data 0x0001
post_data_bits 32
post_data 0x00000001
gap 132799
toggle_bit 0

begin codes
KEY_0 11
KEY_102ND 86
KEY_1 2
# Lots more codes ...
BTN_Z 0x135
end codes
end remote

# generated by devinput.sh (obsolete 32 bit version)
begin remote
name devinput
bits 16
eps 30
aeps 100
pre_data_bits 16
pre_data 0x8001
gap 132799
toggle_bit 0

begin codes
KEY_0 11
KEY_102ND 86
KEY_1 2
# Lots more codes ...
BTN_Z 0x135
end codes
end remote
</code>

I could be wrong, but my understanding as to why the devinput driver is the appropriate one is because the kernel is already recognizing the MCE device and translating its events into a standardized "linux input layer device" for me. The mce_usb driver does not actually appear in the list of supported drivers of my lirc version.
Post Reply