Plug And Pray.

April 16, 2004

I read a joke recently, I don’t recall where, that went something like this:

Our Hero is a devout Christian and an inveterate smoker, and one day speaking to a priest, he says “Father, I would like to be a good Christian, but I am a heavy smoker – is it alright for me to smoke while I pray?”

To which the priest replies “My son, a prayer is a conversation with God. It would be wrong for you to indulge such an impure vice at such a time.”

Our Hero thinks about this, thanks the padre and goes on his way. The next week, he returns with another question; “Father, I would like to be a good Christian, but I am a heavy smoker; is it alright for me to pray while I smoke?”

To which the priest smiled, and replied “My son, you may pray anytime.”

This rambles a bit, and it’s pretty nerdy, so if you don’t have a little bit of time on your hands, and those hands happen to be connected to a nerd or nerd-like brain by some apparatus I leave to your discretion, you should probably skip this one.

I’ve got this camera, a Centrios DSC-214, that’s apparently Unsupported In Linux®.The digital camera part works fine, like a normal USB key, but apparently there’s some magical webcam functionality that I’m naively trying to get working, and I’m getting absolutely no love.

This is part of what’s confusing me: step 1, how does USB work?

mhoye@werewindle:/etc/usbmgr$ ls
class host network preload.conf usbmgr.conf vendor
mhoye@werewindle:/etc/usbmgr$ locate usb.ids
mhoye@werewindle:/etc/usbmgr$ _

All of those usb.ids files are different, and none of them seem to be related to the subdirectories of /etc/usbmgr/vendor/ where the magic apparently really happens.

mhoye@werewindle:/etc/usbmgr$ lsusb
Bus 001 Device 003: ID 052b:1708 Tekom Technologies, Inc.
Bus 001 Device 001: ID 0000:0000
mhoye@werewindle:/etc/usbmgr$ _

The way I understand that this is supposed to work is:

  • I plug in the camera.
  • usbmgr realizes I’ve plugged something in.
  • usbmgr associates that device with a driver.
  • usbmgr then points the /dev/video symlink towards
  • whatever the relevant /dev/video## node is.

Then, I run my webcam programs, whatever they are, point them at /dev/video and all is right with the world. What really happens is a lot of nothing, because none of the video nodes in /dev appear to think they’re plugged into anything. So I tried this:

cd /etc/usbmgr/vendors
mkdir 052b
cd 052b
mkdir 1708

and in there, in a file called “modules”, I put the the words “usbvideo” and “spca50x”, because
I’ve found some drivers here that have consented, after some wierd Makefile-fixing, to compile themselves and allow themselves to be insmodded on my machine. Tekom’s website is horribly crippled, like someone broke a vintage bottle of Chateau Macromedia ’98 over the bar and slashed its hamstrings, but I’ve managed to extract some information from this page that I found by, we’ll, let’s not talk about that, and some prodding at the windows drivers seems to imply that there’s a SunPlus chip in my oh-look-it’s-rebranded camera.

I suppose I could put that stuff in usbmgr.conf, but that didn’t take when I tried it with some random webcam drivers just for kicks – as in “no news in dmesg”, not “I can’t edit a file” or “hey, surprise, Ooog try hit hardware with random, rock-shaped driver, go crunch fall down.”

But now, of course, because Ooog compile module against source tree with changed extraversion entry in makefile, because that’s what Ooog apparently supposed to do, it fails installation calamitously, tells Ooog his kernel is tainted and dumps a distressing amount of what appears to be binary noise into Ooog’s logfiles:

Apr 15 01:20:17 werewindle kernel: spca50x: version magic '2.6.4-MH1 preempt PENTIUMIII gcc-3.3' should be '2.6.4-1-686 preempt 686
Apr 15 01:20:17 werewindle modprobe: FATAL: Error inserting spca50x (/lib/modules/2.6.4-1-686/kernel^@^@^@^@^@^@^@^@^@...

...for a page or three. So I may have just screwed my system for good. Woot. I'm going to have to get a clean set of kernel headers, recompile, fsck everything and keep my fingers crossed, I guess.

If you're out there, and you've made it this far, I'd like to know:

  • What's up with all those usb.ids files.
  • Roughly speaking, what's usbmgr really doing/supposed to be doing. I can't seem to find any docs on the topic.
  • Why I'm doing this at all.

This is a nice, knockaround digital camera. I like it a lot. But it would be really nice if I could get consumer hardware to work the way people who don't actually code for fun and sysadmin for a living apparently get to.

Whoops: found the joke here.