Google Site SearchFN Site Search FN Blog Login FN Blog Login
Site Navigation:
 
 

Installing and Using an ATI USB Remote Wonder

by Youssef Makki on Mar 29, 2004

1. Introduction

This tutorial will help you install and use an ATI usb Remote Wonder with LIRC.

This is tested on a Remote Wonder I, which came included in an ATI TV-Wonder Pro Remote Control Edition package.
It is the same version that ships with recent ATI All-In-Wonder cards and also sold separately.
If you get this working on other models drop me an email, I'll add it to the list here.

Various other ways to install these remotes exist. You can use the Gatos ati_remote module, which allows your remote to be used as a regular input device in X. Some info can be found here.
This also involves configuring keymaps in X with xmodmap, and using plugins like xmms-itouch to grab keys for events (something I like to keep exclusive to my multimedia keyboard). I prefered LIRC since it is easier to use and configure in general.

2. Required software

The only package you really need is LIRC, but to use it with other programs you'll need a couple more:

  • lirc-0.7.0pre4-1.i386.rpm, compiled with the atiusb driver, built with CheckInstall.
    You could build it yourself from source here. Be sure to get the latest snapshot.
    Use "./configure --with-driver=atiusb".
  • xmms-lirc-1.4-2.fr, an LIRC plugin for XMMS.
  • Mplayer built with LIRC support.
    Install it with "yum install mplayer", or grab it from Livna or Freshrpms.

You will also need the following configuration files I have modified and written for use here:

  • lircd.conf, from ../source/remotes/atiusb/lircd.conf.atiusb-unknown_ch
  • lircdmd.conf, configuration file for the lirc mouse daemon.
  • lircrc, configuration for application specific key bindings. place in your home directory as .lircrc

3. Installing the Remote and the Software

Make sure your remote is plugged in, and run the following command as root to check:
root@galileo:~# lsusb
Bus 001 Device 003: ID 0bc7:0004 X10 Wireless Technology, Inc.

3.1 Install LIRC

root@galileo:~# rpm -Uvh lirc-0.7.0pre4-1.i386.rpm
Preparing...                ########################################### [100%]
   1:lirc                   ########################################### [100%]
root@galileo:~#

3.2 Install the XMMS plugin

root@galileo:~# rpm -Uvh xmms-lirc-1.4-2.fr.i386.rpm
Preparing...                ########################################### [100%]
   1:xmms-lirc              ########################################### [100%]
root@galileo:~#
After you install xmms-lirc, restart XMMS if it is running, then enable the plugin in the Options window.

3.3 Update configuration files

Now that everything is installed, you'll need to place the configuration files in the appropriate places.
root@galileo:~# mv lircd.conf /etc/lircd.conf
root@galileo:~# mv lircmd.conf /etc/lircmd.conf
Don't forget to move lircrc to your home directory, name it /home/yourusername/.lircrc

In order to use the remote as a mouse in XFree86, add the following section to your X configuration (/etc/X11/XF86Config):
Section "InputDevice"
        Identifier  "LIRC-Mouse"
        Driver      "mouse"
        Option      "Device" "/dev/lircm"
        Option      "Protocol" "IMPS/2"
        Option      "SendCoreEvents"
        Option      "Buttons" "5"
        Option      "ZAxisMapping" "4 5"
EndSection
Add the following to your ServerLayout section in XF86Config, it should look something like this:
Section "ServerLayout"
    Identifier "ServerLayout"
    Screen "Screen0"
    InputDevice "Mouse1" "CorePointer"
    InputDevice "LIRC-mouse" "CorePointer"
    InputDevice "Keyboard1" "CoreKeyboard"
EndSection

3.4 Fix permissions on /dev/lircd

Set proper permissions on /dev/lircd so everyone can access it:
root@galileo:~# chmod 666 /dev/lircd

This should cover all installation needed. Let's test it!

4. Testing the Remote and the Software

4.1 Test core programs

Let's start with testing lircd in the foreground (non-daemon) as root:
root@galileo:~# lircd --nodaemon
lircd 0.7.0pre3: lircd(atiusb) ready
If you get no error messages, then all is fine. Control-c to kill it, and run it in the background as a daemon (without '--nodaemon')

As a regular user, test your remote by running irw and pressing buttons:
ymakki@galileo:~$ irw
00000014c702f000 00 power atiusb
00000014c702f000 01 power atiusb
00000014c702f000 02 power atiusb
00000014c702f000 03 power atiusb
00000014c702f000 04 power atiusb
00000014ce09f000 00 vol-down atiusb
00000014ce09f000 01 vol-down atiusb
00000014ce09f000 02 vol-down atiusb
00000014ce09f000 03 vol-down atiusb
00000014ce09f000 04 vol-down atiusb
If you see similar output, then everything is working perfectly fine so far. To test using the remote as a mouse, first restart X with the mentioned modifications to the configuration above. Then run lircmd to test it:
root@galileo:~# lircmd --nodaemon

Again, if you get no error messages, go ahead and run it without '--nodaemon'.

Move your mouse around with the top pad, try the right and left click buttons, they should all work.

Next, try irexec. Run it as a daemon first:
ymakki@galileo:~$ irexec --daemon
irexec lets you bind commands to buttons on your remote, which you configure in ~/.lircrc in the first section. For example:
begin
     button = web
     prog = irexec
     repeat = 0
     config = firefox
end
This will launch FireFox when you press the Web button on the remote. Very cool!

4.2 Test other external programs

You could now test XMMS by running it and using the play/pause/forward ..etc buttons on your remote, they should also work.

You could also try mplayer, which I have configured in the included .lircrc. To check if it is loading LIRC support properly, play a file and keep an eye out for the output:
ymakki@galileo:~$ mplayer test.avi
MPlayer dev-CVS--3.3.2 (C) 2000-2003 MPlayer Team
 
CPU: Intel Celeron 2/Pentium III Tualatin 1005 MHz (Family: 6, Stepping: 1)
Detected cache-line size is 32 bytes
CPUflags:  MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 0
..
..
Falling back on default (hardcoded) input config
Opening joystick device /dev/input/js0
Can't open joystick device /dev/input/js0 : No such device
Can't init input joystick
Setting up LIRC support...
 
Playing test.avi.

5. Making Settings Permanent

You'll need to add lircd and lircmd to a startup script so they run next time you boot.
They can be added to /etc/rc.local as such:
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
 
touch /var/lock/subsys/local
 
lircd
lircmd
You also need to run irexec on startup. In Gnome, add 'irexec --daemon' to Applications -> Preferences -> More Preferences -> Sessions (gnome-session-properties). You can also add it to ~/.xinitrc or other startup scripts you run (.bashrc serves another purpose, but it you can add it there too).
However irexec doesn't seem to check if there are running instances of it already, so if you restart X you might end up with more than 1 running, which has undesirable effects. So you should make sure you kill any running instances first by adding 'killall irexec' and then 'irexec --daemon' to your scripts in that order (in Gnome Sessions you can adjust the order, but that didn't work for me). If you have a better way let me know.

6. Troubleshooting

6.1 Permission denied

One problem I ran into was a permissions problem on /dev/lircd:
ymakki@galileo:~$ mplayer test.avi
MPlayer dev-CVS--3.3.2 (C) 2000-2003 MPlayer Team
 
CPU: Intel Celeron 2/Pentium III Tualatin 1005 MHz (Family: 6, Stepping: 1)
Detected cache-line size is 32 bytes
CPUflags:  MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 0
..
..
Falling back on default (hardcoded) input config
Opening joystick device /dev/input/js0
Can't open joystick device /dev/input/js0 : No such device
Can't init input joystick
Setting up LIRC support...
mplayer: could not connect to socket
mplayer: Permission denied
Failed to open LIRC support.
You will not be able to use your remote control.

Playing test.avi.
This is easily fixed by setting proper permissions on /dev/lircd:
root@galileo:~# chmod 666 /dev/lircd

6.2 Buttons assigned to programs don't work

If you try to run configured programs in .lircrc (like FireFox) and they fail, make sure irexec is running:
ymakki@galileo:~$ ps -aux | grep irexec
ymakki      5991  0.0  0.0  2460  352 ?        S    14:47   0:00 irexec
ymakki@galileo:~$

6.3 Programs configured in .lircrc launch more than once

As previously mentioned, irexec doesn't check if there are any previous running instances of itself before starting. Having multiple irexec daemons can cause this behaviour.
Make sure you kill all running instances before starting irexec in your startup scripts, or whichever method you're using.

7. More Info on LIRC Configuration, Other Software, and TODO List

As you recall, we used irw to test the remote initially. You could use this to grab the names of all buttons on your remote, for use in various programs. Here's a list I put together while configuring mine, you can also find them in /etc/lircd.conf.

Regarding specific programs like XMMS and Mplayer, you'll find detailed info on commands you can send them in their documentation. The xmms-lirc contains all the info you need in /usr/share/doc/xmms-lirc-1.4/README, and Mplayer has an LIRC section in their documentation online. I found some other sources for Mplayer, you'll find them in the links section.

You shouldn't really need to change anything in /etc/lircd.conf, but have a look at /etc/lircmd.conf. You could change mouse cursor acceleration rates, and change which buttons are used as the mouse wheel. I currently set those to the up/down arrow buttons on the bottom. The syntax is pretty straight-forward so it shouldn't be tough.

You'll definitely want to look at .lircrc and change it to your liking. It's very simple, check the documentation on lirc.org.

One other program I'd like to mention is XOSD, which I find extremely useful. It displays OSD style info on your screen, and has an xmms plugin. It's triggered by events such as volume/song change, and is configurable. You can find it here. You'll need both xosd and xmms-xosd.

If you have any suggestions or additions to this faq, drop me an email. Check my TODO list to see if you can help in any way.

Thanks go to the authors of the docs in the Links section.

8. Links You'll find the links I used to find info while installing the remote and writing this document here.


License and Copyright

Copyright (c) 2004, Youssef Makki.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is located at www.gnu.org/copyleft/fdl.html.