Using a Linux Driver for a Device that is not yet supported without recompiling

If you have  a new shiny webcam or some other device you want to use in Linux, here is a quick short guide how you can have it runnig within minutes with a bit of luck.


The problem is that the Linux drivers need to know all the devices that "belong to them" in order to activate them. But that's a really difficult thing, because the guy who writes the driver doesn't always know e.g. the pci identification information of all devices.

But if you know to which driver your device belongs, there is a simple way to activate the driver immediately. But first let's find out how to identify the driver your device needs. One way is just googling for the device id. If you find it in combination with a driver name (do post this information once you have it!), then you can skip down to new_id.

One smart way is to take the windows driver and unpack it (unwise and WINE are your friends) and look into the .inf files. If you find several pci/usb/whatever ids in there you can try googling the other ids. If a Linux driver exists for them it is likely that is will work for your device as well.

CAUTION: 
If the driver is not right for your device, 
it may break your device, your computer 
and/or other things. I am not responsible for your actions!

Then simply echo the device id into /sys/bus/usb/drivers/<your driver>/new_id.
E.g. echo "04f2 b073" | sudo tee /sys/bus/usb/drivers/uvcvideo/new_id. This also works for pci etc. etc. If you're lucky, your device will start and now just work immediately without any further work. dmesg | tail will tell you what and if something just happened.

In the spirit of open source: If this works out and your device is now active, please submit the information to the driver developers. At the very least, leave a comment at this article with the information so I can notify them.

Note: This step by step is completely stolen from Wolfram Sang's kernel lecture presented at LinuxTag yesterday.

If you like this post, share it and subscribe to the RSS feed so you don't miss the next one. In any case, check the related posts section below. (Because maybe I'm just having a really bad day and normally I write much more interesting articles about theses subjects! Or maybe you'll only understand what I meant here once you've read all my other posts on the topic. ;) )

1 comment:

  1. Ok, I have got a microscope camera, and lsusb tells me: ID 199e:8101 The Imaging Source Europe GmbH DFx 21BU04 Camera
    I am using ubuntu 12.04 and no video device showed up when connecting the camera. I tried the latest uvcvideo driver source. No success. But when I did a root:
    root$> echo "199e 8101" > /sys/bus/usb/drivers/uvcvideo/new_id
    suddenly everything went fine :-)

    Erich
    etk(at)gluga(dot)de

    ReplyDelete

I appreciate comments. Feel free to write anything you wish. Selected comments and questions will be published.