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.
Am 30. November 2009 um 12:11 Uhr
Hi, I followed your step by step tutorial and I get this errors for:
Keys: Play/Pause, +, -, FW and RW
ERROR: Unable issuing sysctl command, errno = 2!
what am I doing wrong?
I’m on Snow Leopard 10.6.2, Asus P5B Vista Edition, Asus IR and remote.
Thank you.
Iulian
Am 30. November 2009 um 12:51 Uhr
Hi Iulian,
have you checked that IRKeyboardEmu is installed correctly and loaded? You can check so by running “sudo kextstat | grep IRKeyboardEmu” in a terminal. If there’s a line indicating the kernel extension is loaded, everything should be fine. If not, you could try loading the kernel extension manually using kextload.
Best regards,
Tino
Am 7. Dezember 2009 um 11:59 Uhr
Hi
Got also problems with the install.
AsusRemote works and receives commands form the Remote checked while running AsusRemote via interactive mode.
IRKeyboardEmu is running.
But it looks that ther is no mapping from AsusRemote to IRKeyboardEmu.
Which version of IRKeyboardEmu do you used?
THX
gigo
Am 7. Dezember 2009 um 12:00 Uhr
.. running un 10.5.8 leopard, MAc Mini G4
Am 7. Dezember 2009 um 21:19 Uhr
HI
Started AsusRemote from CommandLine and keys are recognized and forwarded to theIRKeybooardEmu.
Looks that id don’t work only if startet as daemon. Do you have any hints?
Thank you
Gigo
Am 7. Dezember 2009 um 21:35 Uhr
Hi,
it seems AsusRemote is not running with super-user priviledges. If you run “ps aux | grep AsusRemote” in a terminal window, you should see a line starting with “root”. If this line is missing, AsusRemote is unable to forward the commands to IRKeyboardEmu. Is it possible that you missed changing the owner of /usr/local/bin/AsusRemote to root?
HTH
Best regards,
Tino
Am 13. Dezember 2009 um 16:46 Uhr
HI
Thank you for your response but this is not the solution/problem.
Process is running as root user.
Maybe the problem is the latency until the kernel extension is loaded.
Will make a test with kextload from the launch daemon to see if this will fix it,
thx Gigo
Am 2. Januar 2010 um 13:30 Uhr
HI
Fixed the problem I had with a shellscript that starts in the background via a Apple Script Application Bundle as a User Startup Item.
One problem is still left:
The Application Launch Button is recognized by the program, but it seems that ther is no mapping to “Start Frontrow” or “Menu”
Any hints?
Thx gigo
Am 3. März 2010 um 21:39 Uhr
Hello,
If I buy the IR receiver will it work with snow leopard and a normal apple remote? I don’t need the remote, I have the Apple one, just not the receiver.
Thanks.
Am 3. März 2010 um 22:42 Uhr
Hello Alex,
the receiver is listening only for commands of the Asus remote. So I don’t think it is possible to use it with a normal Apple Remote.
Best regards,
Tino
Am 6. März 2010 um 08:30 Uhr
Hello,
I succeeded to an installation
Thank you.
Not yet Snow Leopad 64bit.