Xbox Live Camera on Linux (Part 4)

The promised instructions on rebuilding the kernel UVC kernel module. Here’s what I did on my Ubuntu 11.10 Aspire 1. If you substitute in your own kernel version number then you should be ok if you’re running other releases. I may experiment with something RedHat-ish later to find out how to do it there. Because I’m lazy, and because I’ve spent many years working as a sysadmin, I do this all whilst logged in as root. I’ve reconstructed the sequence of commands from my shell history, so it should be correct, but let me know if you have problems.

# apt-get install linux-source-3.0.0 kernel-package linux-headers-`uname -r`
# cd /usr/src
# tar jxvf linux-source-3.0.0.tar.bz2
# cd linux-source-3.0.0
# ln -s /boot/config-`uname -r` .config
# ln -s /usr/src/linux-headers-`uname -r`/Module.symvers .

At this point you can patch the UVC driver, and assuming that went well, continue:

# make modules_prepare
# make M=drivers/media/video/uvc

And you should now have a re-built driver. To load it manually you can just do:

# insmod drivers/media/video/uvc/uvcvideo.ko ctrltimeout=10000 timeout=10000

But to get it loaded into the kernel automagically a little more work is required:

# mkdir -p /lib/modules/`uname -r`/updates
# cp drivers/media/video/uvc/uvcvideo.ko /lib/modules/`uname -r`/updates
# depmod -a
# echo "options uvcvideo ctrltimeout=10000 timeout=10000" > /etc/modprobe.d/uvcvideo.conf

The patched module should now be loaded when your camera is hooked up. To check that the settings have been changed you can see their current values using:

$ cat /sys/module/uvcvideo/parameters/ctrltimeout
$ cat /sys/module/uvcvideo/parameters/timeout

Or if you want to reload the module manually:

# modprobe -r uvcvideo
# modprobe -v uvcvideo
This entry was posted in Astroimaging, Astronomy, Computing, Linux. Bookmark the permalink.

1 Response to Xbox Live Camera on Linux (Part 4)

  1. astro says:

    Your instructions for patching the kernel worked perfectly on my Ubuntu 12.04 system. Thanks so much! The xbox live camera is probably not the greatest for taking full sky pictures but it’s a fun gadget to play around with, without spending much money.

Leave a Reply

Your email address will not be published. Required fields are marked *