Tuesday, January 13, 2009

Gumstix UVC drivers

This post describes gumstix uvc driver installation for a Logitech QuickCam Pro 9000. It follows this wiki page as a guideline.
It requires that the steps in this wiki have been performed.
Firstly check-out the old driver sources from:

 svn co svn://svn.berlios.de/linux-uvc/linux-uvc/trunk

After file checkout, one should change the Makefile.
Change the KERNEL_DIR var to point to your gumstix kernel path, as in:

KERNEL_DIR    :=
/home/developer/gumstix/gumstix-oe/tmp/work/gumstix-custom-verdex-angstrom-linux-gnueabi/gumstix-kernel-2.6.21-r1/linux-2.6.21/

Define the CROSS_COMPILE var:

CROSS_COMPILE   := /home/developer/gumstix/gumstix-oe/tmp/cross/bin/arm-angstrom-linux-gnueabi-

Change make lines so that they include your CROSS_COMPILE and ARCH=arm vars:
From:
       @(make -C $(KERNEL_DIR) M=$(PWD) CROSS_COMPILE=$(CROSS_COMPILE) modules)

to:

       @(make -C $(KERNEL_DIR) M=$(PWD) ARCH=arm CROSS_COMPILE=$(CROSS_COMPILE) modules)

And from:
       @(make -C $(KERNEL_DIR) M=$(PWD) INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) INSTALL_MOD_PATH=$(INSTALL_MOD_PATH) modules_install)
to:
       @(make -C $(KERNEL_DIR) M=$(PWD) ARCH=arm
INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) INSTALL_MOD_PATH=$(INSTALL_MOD_PATH)
modules_install)

Now, type make uvcvideo
The file uvcvideo.ko is built. This file should be copied to /lib/modules/2.6.21/kernel/drivers/media/video/uvcvideo.ko

Nevertheless, if you type make, you'll notice a message like:

-------------------------------- WARNING ---------------------------------------
 The USB Video Class driver has moved to http://linuxtv.org/.
 Using the Berlios SVN repository is now deprecated.
 Please check http://linux-uvc.berlios.de/ for download instructions.
 If you really want to compile this historical version, run 'make uvcvideo'.
--------------------------------------------------------------------------------
which tells us that we are using deprecated files for the driver.
I've tried to use the latest drivers from the Mercurial clone repository, but I'm getting this error:

"/home/developer/uvc-new/uvcvideo-90c7dc24fb4d/v4l/cx18-driver.h:65:4: error: #error "This driver requires kernel PCI support." "

In order to build it, I've changed the root Makefile to:

CROSS_COMPILE   := /home/developer/gumstix/gumstix-oe/tmp/cross/bin/arm-angstrom-linux-gnueabi-

install:
        $(MAKE) -C $(BUILD_DIR) ARCH=arm CROSS_COMPILE=$(CROSS_COMPILE) install

%::
        $(MAKE) -C $(BUILD_DIR) ARCH=arm CROSS_COMPILE=$(CROSS_COMPILE) $(MAKECMDGOALS)

And the v4l/Makefile to:

OUTDIR ?= /home/developer/gumstix/gumstix-oe/tmp/work/gumstix-custom-verdex-angstrom-linux-gnueabi/gumstix-kernel-2.6.21-r1/image/lib/modules/2.6.21/build
SRCDIR ?= /home/developer/gumstix/gumstix-oe/tmp/work/gumstix-custom-verdex-angstrom-linux-gnueabi/gumstix-kernel-2.6.21-r1/image/lib/modules/2.6.21/source

I've tried to issue some "make -i" command, but I doubt it will work. If you've made any progress with the new drivers, feel free to comment.
The old drivers have worked pretty fine as well.


5 comments:

Anonymous said...

Hi!
I'm tryin to follow your guide but it seems that the :
svn co svn://svn.berlios.de/linux-uvc/linux-uvc/trunk

doesn't work!
It says "svn: Can't connect to host 'svn.berlios.de': Connection timed out"

Any help would be really appreciated!!!

Thanks
Marco

Daniel Lélis Baggio said...
This comment has been removed by the author.
Daniel Lélis Baggio said...

Hi,
I have just tested and it worked fine.
See if you are not behind a firewall or proxy. Try to download it from some other computer/connection. Also make sure it was not some sort of "upgrade time" in their servers and try again ;)

Well, I know the post does not talk about the newer drivers but I'd suggest try to use them. I've had some problems, but you might as well try this:

http://linux-uvc.berlios.de/#download

Good luck!

Anonymous said...

hi! tnx for your help, i managed to DL all the stuff, followed the instructions to have the .ko file and it worked!

Now after installing the .ko on gumstix when i plug my camera (a logitech orbit) i get this error message:

root@gumstix-custom-verdex:~$ usb 1-2: new full speed USB device using pxa27x-o2
usb 1-2: configuration #1 chosen from 1 choice
uvcvideo: Found UVC 1.00 device unnamed (046d:08c2)
uvcvideo: Failed to query (135) UVC control 1 (unit 0) : -110 (exp. 26).
uvcvideo: Failed to query (129) UVC control 1 (unit 0) : -110 (exp. 26).
uvcvideo: Failed to initialize the device (-5).
2:3:3: cannot set freq 16000 to ep 0x86
usbcore: registered new interface driver snd-usb-audio


any hints? maybe there's some steps to do?
with lsmod i
get

uvcvideo 53512 0
videodev 24512 1 uvcvideo
v4l2_common 16224 2 uvcvideo,videodev
v4l1_compat 12164 2 uvcvideo,videodev
compat_ioctl32 992 1 uvcvideo

Daniel Lélis Baggio said...

Hi :)

It's great the compilation worked out.
I had a couple problems trying to detect my camera, but after I unplugged and plugged back it was recognized.
Well, I'd advise you to send your doubt to the Berlios Linux UVC team, I think they will be capable to help you better :)
Sorry for not solving your problem, and thanks for your feedback
kind regards :)