ATI Remote Wonder II
One common remote used for controlling MythTV is the ATI Remote Wonder II. Highly popular for Windows and MacOS machines, the RWII is also supported under linux with the LIRC project. Here is a short guide for getting it configured with MythTV.
Contents
LIRC, MythTV, and the ATI Remote Wonder II
Please note that this is not highly-detailed, may contain mistakes, and assumes little knowledge of your particular linux distro. The differences should be minor, if any, but for frame of reference I am using Slack10. If you spot mistakes or think you can make this guide more clear, please feel free to edit it.
Note: I have found the RWII receiver to be somewhat temperamental. If you plug it in after the computer has booted and then push a button, the internal LED ceases to flash and receive input. Unplug and re-plug it in, push buttons on your remote again, and the LED should flash normally. If the receiver is plugged in at boot it doesn't seem to be a problem.
Before we even install lirc, we're going to get a config file for MythTV to use your remote properly. This will aid you later if you need to generate a new configuration file. I pulled my configuration file from here but will also reprint it at the bottom of this page in case that link breaks. See Appendix A. Feel free to modify it to suit your needs once it's working. The text goes in ~/.mythtv/lircrc
, with ~ being the home directory of the user that starts mythfrontend (probably your user or the mythtv user). If you have a different remote then you might want to see if there are any /Lircrc Files for it.
Next, you'll need to install LIRC. The latest official release of LIRC as of this writing is 0.70 and I don't believe it will work properly with all models of the RWII. If there is a later official release, get it, or get the latest from CVS. You can do this via CVS snapshots or straight from CVS.
Follow the instructions in the INSTALL document, which should be something like
./configure make sudo make install
You may wish to do ./configure --help
first to see what options are available. The defaults should be ok. After it's installed, modprobe the ATI driver to load it with modprobe lirc_atiusb
(remember you'll need to be root). You can make sure LIRC detected the USB receiver by searching dmesg
for lines similar to (dmesg | grep lirc
):
lirc_dev: IR Remote Control driver registered, at major 61 lirc_atiusb: USB remote driver for LIRC v0.4 lirc_atiusb: Paul Miller <pmiller9@users.sourceforge.net> usb.c: registered new driver lirc_atiusb lirc_dev: lirc_register_plugin:sample_rate: 0 lirc_atiusb[5]: on usb2:5
Next, do ls -l /dev/ | grep lirc
and see if the devices have been created. If nothing displays or dmesg
doesn't indicate LIRC loaded, try rebooting. If /dev/lirc displays (among others) but /dev/lirc0 does not, I recommend you create a link called lirc0 to lirc as I seemed to have problems before doing this. However, I could be off-base on that one. You can create the link with ln -s /dev/lirc /dev/lirc0
.
Next, you can either try using the RWII LIRC config files that come with LIRC, or create your own. I had to create my own but your milage may vary. To find out if we need to create one, do the following:
Start the LIRC daemon by issuing the following command (as root):
lircd -d /dev/lirc0 /path/to/config.conf
Optionally you may pass --debug after the config file path if it doesn't seem to be starting right. Normal output will be:
lircd 0.7.1-CVS: started server socket lircd 0.7.1-CVS: parsing remote lircd 0.7.1-CVS: parsing /root/ati2_full.conf remote lircd 0.7.1-CVS: config file read
Note the "parsing ..." line will output the name of the read configuration name, not the physical file path! Also, if the daemon has an error reading your configuration file, it will start anyway and you'll need to kill it before you can restart it with a correct config file.
Now run irw
and start pushing buttons. If nothing displays, you'll need to generate a new configuration file. If you get an error about being unable to connect to socket, your daemon didn't start or isn't started properly (possibly an invalid device or configuration path).
Note if you use the config files below, make sure the button names are the same in both files.
Creating a New Configuration File
To create a new configuration file, you'll probably want to kill the daemon first although I don't think it's required. As root, killall lircd
. Then run irrecord with a path to the new configuration file as the parameter, like:
irrecord /path/to/config.conf
Follow the instructions and note that when naming the control buttons, you'll want to name them to match up with what MythTV needs to process. These button names are located in the ~/.mythtv/lircrc
file we created at the very beginning. For each "begin...end" entry, the "button" line is what MythTV is looking for from LIRC. For example, name your stop button "stop", channel up/down "ch+" and "ch-". You can always edit either of the config files to match, so don't feel pressure to get it exact right now. In fact, irrecord will time-out if you don't give it input in 10 seconds, so it's best to get the config file created first and then match up button names later.
Now that your new configuration file is created load the daemon again as you did above, this time with the config path pointing to the new one. Load irw and push buttons. You should see output now. If you don't see output here, go back and try to find the problem as continuing through this guide will not help you. See For Additional Help if you get stuck.
Building LIRC Support into MythTV
If that's working well, only one more step is required for full MythTV integration. If you didn't already compile MythTV will LIRC support, you'll need to do so now. Don't worry, while MythTV does take awhile to build, reinstalling it won't cause you to lose any of your configuration files, saved footage, music, etc. At least, it didn't for me with MythTV 0.16. You may wish to double-check the MythTV documentation, but as of this writing the only configuration changes you need to make are to open the settings.pro file in the mythtv build directory, look for the line '# Native lirc support' and uncomment the two lines underneath it.
# Native lirc support CONFIG += using_lirc LIRC_LIBS = -llirc_client
Build and install (qmake mythtv.pro, make, sudo make install I think, check the docs). You'll probably want to kill mythfrontend and mythbackend before reinstalling. Start-up MythTV backend and frontend and see if your remote works!
For Additional Help
For additional help, check the MythTV documentation, the LIRC documentation, the #mythtv-users IRC channel on irc.freenode.net, and the LIRC dev mailing list.
Starting LIRC Daemon on Boot
Optionally, to start the LIRC daemon on boot, I have the following line in my rc.local file:
/usr/local/sbin/lircd -d /dev/lirc0 /etc/ati2_full.conf ;
That's it! Good luck!
Appendix A - MythTV lircrc
# config file for # the ATI-Wonder Remote # using lirc_atiusb driver # begin prog = mythtv button = a config = E repeat = 5 end begin prog = mythtv button = b config = O repeat = 5 end begin prog = mythtv button = tv config = Key Alt-T [[Current Window]] repeat = 5 end #duplicate? #begin #prog = mythtv #button = stop #config = Esc #repeat = 5 #end begin prog = mythtv button = stop config = Esc repeat = 5 end begin prog = mythtv button = fastforward config = Right repeat = 5 end begin prog = mythtv button = rewind config = Left repeat = 5 end begin prog = mythtv button = pip config = V repeat = 5 end #duplicate? #begin #prog = mythtv #button = pause #config = P #repeat = 5 #end begin prog = mythtv button = pause config = P repeat = 5 end begin prog = mythtv button = play config = P repeat = 5 end begin prog = mythtv button = mute config = F9 repeat = 5 end begin prog = mythtv button = vol- config = F10 repeat = 5 end begin prog = mythtv button = vol+ config = F11 repeat = 5 end begin prog = mythtv button = f config = [[Pg Down]] repeat = 5 end begin prog = mythtv button = d config = [[Pg Up]] repeat = 5 end begin prog = mythtv button = c config = F4 repeat = 5 end begin prog = mythtv button = e config = Esc repeat = 5 end begin prog = mythtv button = right config = Right repeat = 5 end begin prog = mythtv button = left config = Left repeat = 5 end begin prog = mythtv button = up config = Up repeat = 5 end begin prog = mythtv button = down config = Down repeat = 5 end begin prog = mythtv button = ch+ config = Up repeat = 5 end begin prog = mythtv button = ch- config = Down repeat = 5 end begin prog = mythtv button = rewind config = Left repeat = 5 end begin prog = mythtv button = ok config = Z repeat = 5 end #begin #prog = mythtv #button = 3 #config = Key Page_Up [[Current Window]] #repeat = 5 #end begin prog = mythtv button = select config = Return repeat = 5 end begin prog = mythtv button = 1 config = 1 repeat = 5 end begin prog = mythtv button = 2 config = 2 repeat = 5 end begin prog = mythtv button = 3 config = 3 repeat = 5 end begin prog = mythtv button = 4 config = 4 repeat = 5 end begin prog = mythtv button = 5 config = 5 repeat = 5 end begin prog = mythtv button = 6 config = 6 repeat = 5 end begin prog = mythtv button = 7 config = 7 repeat = 5 end begin prog = mythtv button = 8 config = 8 repeat = 5 end begin prog = mythtv button = 9 config = 9 repeat = 5 end begin prog = mythtv button = 0 config = 0 repeat = 5 end begin prog = mythtv button = ok config = I repeat = 5 end begin prog = mythtv button = record config = R repeat = 5 end begin prog = mythtv button = check config = Enter repeat = 5 end
Appendix B - A Sample remote configuration file. /etc/lircd.conf
# this config file was automatically generated # using lirc-0.7.0(atiusb) on Sat Feb 12 13:22:29 2005 # # contributed by Steffen # # brand: ATI Sapphire Remote Bob II USB # model no. of remote control: 5000024400 # devices being controlled by this remote: MythTV # begin remote name 5000024400 bits 16 eps 30 aeps 100 one 0 0 zero 0 0 pre_data_bits 8 pre_data 0x0 post_data_bits 16 post_data 0x0 gap 299851 toggle_bit 0 begin codes aux1 0x023F aux2 0x023F aux3 0x023F aux4 0x023F mouse_left_btn 0x02A9 mouse_right_btn 0x02AA a 0x0278 b 0x0279 power 0x020C dvd 0x0238 tv 0x0239 help 0x02BE pc 0x023F resize 0x02D5 hand 0x02D0 ati 0x028E vol_up 0x0210 vol_down 0x0211 mute 0x020D ch_up 0x0220 ch_down 0x0221 mouse_up 0x013F mouse_down 0x013F mouse_left 0x013F mouse_right 0x013F 1 0x0201 2 0x0202 3 0x0203 4 0x0204 5 0x0205 6 0x0206 7 0x0207 8 0x0208 9 0x0209 0 0x0200 list 0x0254 check 0x0282 info 0x02F9 timer 0x0296 arrow_up 0x0258 arrow_left 0x025A arrow_right 0x025B arrow_down 0x0259 ok 0x025C c 0x017A d 0x027B play 0x022C e 0x027C f 0x027D rewind 0x0229 rec 0x0237 stop 0x0231 pause 0x0230 ffwd 0x0228 end codes end remote