Asus DH Remote: Crafting an OS X driver 2009-11-02
Some ASUS mainboards are supplied with a remote control, the "Asus DH Remote". I'm running Mac OS X Snow Leopard on a P5W DH Deluxe, which is quite old from a technical point of view, but actually doing a good job. As often, there are only Windows drivers for the remote, but none for Linux or even OS X. For the Linux part, there is already a driver for LIRC.
When I realized that the IR receiver is a simple USB HID device, I started brewing an OS X user-space utility together that interfaces the receiver. It is merely a hack based off example code I found at the Mac Dev Center, but that got it to work in a short time.
Basically, what you get from the receiver is the message that a key on the remote was pressed or released. Using this information, the tool is using Brandon Holland's IRKeyboardEmu to emulate HID command reports sent by an Apple Remote. This allows you to use the Asus DH Remote as a controller for FrontRow or iTunes!
It is far from being perfect, but I think it's a good starting point for your own inventions.
Download
Source and Universal Binary: AsusRemote-v0.1.zip
Installation
- Download and extract the archive.
- Install the binary:
# sudo cp AsusRemote /usr/local/bin/AsusRemote
# sudo chown root:wheel /usr/local/bin/AsusRemote
# sudo chmod +s /usr/local/bin/AsusRemote
Note the SUID bit for AsusRemote. It needs superuser rights to interface to IRKeyboardEmu! Else it will issue an error issuing a sysctl command. - To be able to use the daemon right after booting OS X, you need to copy com.tinowagner.AsusRemote.plist to /Library/LaunchDaemons/:
# sudo cp com.tinowagner.AsusRemote.plist /Library/LaunchDaemons/
# sudo chown root:wheel /Library/LaunchDaemons/com.tinowagner.AsusRemote.plist
- Finally, you should download the newest binary of IRKeyboardEmu and copy it to /System/Library/Extensions. Just follow the instructions in the readme.
- After rebooting, check that the daemon is running. There should be a process called AsusRemote.
Key assignment
This is a hard coded part. It tries to match the keys on the Apple Remote.
- AP LAUNCH: Menu. Start FrontRow.
- + and -: Up and down arrows, Volume up/down.
- Reverse and Forward: Previous/Rewind, Next/Fast-forward
- Play/Pause: Enter, Play/Pause
There is no action assigned to the other keys.
Troubleshooting
If nothing happens after pressing a key, try running AsusRemote from command line. First kill the daemon running in the background:
# sudo killall AsusRemote
# AsusRemote
You should now see a version message. Pressing an arbitrary key on the remote should produce an output:
AsusRemote v0.1
2009, (c) Tino Wagner <ich@tinowagner.com>Key: Plus
Key: Minus
Key: Reverse
Key: Forward
Key: Play/Pause
Key pressed: Plus
Key released: Plus
Key pressed: Minus
Key released: Minus
Key pressed: Forward
Key released: Forward
Key pressed: Reverse
Key released: Reverse
Key: AP Launch
Key: AP Launch
^C
Notes
Feel free to modify the code to your likes! But please drop me a note if it's an improvement that could be useful for everybody, so I can post it here.