The Intervideo XPC-RC01 Remote and Linux

Submitted by inducer on Mon, 29/01/2007 - 00:08

So you bought one of these remotes on ebay?

remote.jpeg

And you plugged it into your Linux box, and it doesn’t work? This page can probably help.

First off, here’s a description of the device: It’s a remote that comes with a USB receiver which will report itself to be a HID device with a VendorId:ProductId of 3351:3715. It can function as a USB keyboard and a USB mouse—the toggle button on the remote switches between the two uses. In “mouse” mode, the left mouse button supposedly is “back” and the right button is “ok”. The directional controls move the mouse. The device’s HID data is scattered over two interfaces (in the USB sense), each of which carries a HID descriptor and has one endpoint. Here’s one important piece of information: The device will not talk unless both endpoints have been opened. So much for the hardware description. Now how do you get this thing to work?

Out of the Box

When you plug it into a Linux system (as of 2.6.19.1), it does not work out of the box. It gets recognized as a mouse and a keyboard. For some reason, Linux opens only one endpoint, leaving the other as a user HID device (/dev/usb/hiddevN), and as mentioned above, the receiver will thus refuse to talk.

What to do

First, tell the kernel to ignore the device. We’ll talk to it via libusb. Go into drivers/hid/usbhid/hid-quirks.c (or drivers/usb/input/hid-core.c in older versions of Linux) and add a line

{ 0x3351, 0x3715, HID_QUIRK_IGNORE },

to the hid_blacklist. Recompile the module (or the whole kernel).

Next, get a thread-safe version of the libhid Python binding. I hacked thread safety into it, so it might take a while for the change to migrate upstream. I might update this page as this happens. For the time being, you may download a suitable set of Debian packages.

Finally, download and install my custom LIRC server. For now, the download directory also contains a file hidwrap.py that should be part of libhid-python, but while it still isn’t, install it to /usr/lib/pyton2.N/site-packages/hid (with appropriate permissions). Then run

su -c python setup.py install

in the package’s root. Next, run

su -c lircd-xpc -n

If you run irw or any lircd client, you should see button presses coming in. Once this works, you may install the init script from the initscript directory and set up a symlink to start lircd-xpc automatically.

NOTE: You do not need the actual LIRC daemon. You actually should not have it running. This is a replacement specifically for this remote. Why? Well, I found it easier to rewrite the relevant parts of lircd in python than to figure out how to interface to its C code. Maybe someone with more time than me will actually tie this into the LIRC framework.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

i have windows vista i pluged it in and it worked for about 2 weeks when it sopped work my usb keyboard stopped to work to is there a driver? or do i need to reinstall windows when i first insall widows the remote worked but no it dont can someone help me plz ..sorry my bad english..

Sorry for my english!! I don’t understand what I have to install about libhid. Do I install only python-hid_0.2.15.99-1_i386.deb? If I don’t use debian I can install libhid from Tarball….Is python-hid incluse?

I try to install all (incluse python-hid…..on frugalware isn’t problem to install .deb) but when I try lircd-xpc -n this message appears Traceback (most recent call last):

File “/usr/bin/lircd-xpc”, line 21, in import hid.hidwrap as hidwrap ImportError: No module named hid.hidwrap

Where is hid.hidwrap? I don’t find it

I was having the same problem. I ended up removing and reinstalling the three debian packages found at the Debian packages link in this article..

libhid-dev_0.2.15.99-1_i386.deb
libhid0_0.2.15.99-1_i386.deb
python-hid_0.2.15.99-1_i386.deb

Somehow /var/lib/python-support/python2.4/hid/hidwrap.py was no longer on the system. As a side note I was running debian unstable (which brought in python 2.5.2), but python 2.4 was still installed. I’m not sure if /usr/bin/python was symlinked to python2.5.

Anyways, hidwrap.py is provided by python-hid_0.2.15.99-1_i386.deb.

Once this was done, I found another problem in lircd-xpc. On line 440 the script calls hidwrap. However up at line 21 is calls import hid.hidwrap as hidwrap. Line 21 was suceeding, but the call on line 440 was failing. Since line 21 was there, I commented out 440 and everything started working.

The above work isn’t the prettiest and doesn’t actually point out the original problem, but it worked for me and my two mythfrontend machines are working with their remotes again. If anyone know what caused the problem, feel free to post up some more information.

Post new comment

  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>.
  • You can use Markdown syntax to format and style the text. Also see and Markdown Extra for tables, footnotes, and more.

More information about formatting options