Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a camera but i do not have a driver for Linux. So i am trying to install the driver for 05e1:0b01. But its still getting failed.

Device plug/unplug shows correctly in /var/log/messages

Aug 19 19:15:47 example kernel: [39339.374902] usb 1-3: USB disconnect, device number 16
Aug 19 19:16:52 example kernel: [39404.464068] usb 1-3: new high speed USB device number 17 using ehci_hcd
Aug 19 19:16:55 example kernel: [39407.152965] usb 1-3: New USB device found, idVendor=05e1, idProduct=0b01
Aug 19 19:16:55 example kernel: [39407.152976] usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Aug 19 19:16:55 example kernel: [39407.152984] usb 1-3: Product: USB Camera
Aug 19 19:16:55 example kernel: [39407.152990] usb 1-3: Manufacturer: Syntek
Aug 19 19:16:55 example kernel: [39407.152997] usb 1-3: SerialNumber: 0123456789AC
Aug 19 19:16:55 example mtp-probe: checking bus 1, device 17: "/sys/devices/pci0000:00/0000:00:1d.7/usb1/1-3"
Aug 19 19:16:55 example mtp-probe: bus: 1, device: 17 was not an MTP device

Step 1: I downloaded this camera driver from http://sourceforge.net/projects/syntekdriver/

Step 2: README file told to do so.

stk11xx-2.1.0]# make -f Makefile.standalone
make -C /lib/modules/2.6.40.3-0.fc15.i686/build SUBDIRS=/home/sun/Downloads/stk11xx-2.1.0 modules
make[1]: Entering directory `/usr/src/kernels/2.6.40.3-0.fc15.i686'
  CC [M]  /home/sun/Downloads/stk11xx-2.1.0/stk11xx-usb.o
/home/sun/Downloads/stk11xx-2.1.0/stk11xx-usb.c: In function ‘usb_stk11xx_probe’:
/home/sun/Downloads/stk11xx-2.1.0/stk11xx-usb.c:803:2: error: implicit declaration of function ‘init_MUTEX’ [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors

make[2]: *** [/home/sun/Downloads/stk11xx-2.1.0/stk11xx-usb.o] Error 1
make[1]: *** [_module_/home/sun/Downloads/stk11xx-2.1.0] Error 2
make[1]: Leaving directory `/usr/src/kernels/2.6.40.3-0.fc15.i686'
make: *** [driver] Error 2

Step 3: Searching on the Internet, I found I have to add to stk11xx-usb.c these new lines:

#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26) 
#include <linux/semaphore.h> 
#else 
#include <asm/semaphore.h> 
#endif 
#define init_MUTEX(LOCKNAME) sema_init(LOCKNAME,1);

Step 4: Try to build again fail.

stk11xx-2.1.0]# make -f Makefile.standalone
make -C /lib/modules/2.6.40.3-0.fc15.i686/build SUBDIRS=/home/sun/Downloads/stk11xx-2.1.0 modules
make[1]: Entering directory `/usr/src/kernels/2.6.40.3-0.fc15.i686'
  CC [M]  /home/sun/Downloads/stk11xx-2.1.0/stk11xx-usb.o
  CC [M]  /home/sun/Downloads/stk11xx-2.1.0/stk11xx-v4l.o
/home/sun/Downloads/stk11xx-2.1.0/stk11xx-v4l.c:43:28: fatal error: linux/videodev.h: No such file or directory
compilation terminated.
make[2]: *** [/home/sun/Downloads/stk11xx-2.1.0/stk11xx-v4l.o] Error 1
make[1]: *** [_module_/home/sun/Downloads/stk11xx-2.1.0] Error 2
make[1]: Leaving directory `/usr/src/kernels/2.6.40.3-0.fc15.i686'
make: *** [driver] Error 2
stk11xx-2.1.0]# 

Can anyone advise me how to solve this now? I am blocked. More details are available on the SourceForge forum).

share|improve this question

3 Answers 3

up vote 1 down vote accepted

The error message you have at step 4 says that the compiler is not able to find the file videodev.h on your system. The file videodev.h comes with the kernel source code (on my system it is linux-2.6.37.3/include/kernel/videodev.h and it should be in a comparable location on any kernel source version). When you install the kernel headers this file will be installed to /usr/include/linux/videodev.h - and this is what you are missing.

So, (1) install the kernel-devel RPM provided by Fedora or (2) you may have the download the appropriate kernel version (see uname -r but it looks like you have linux-2.6.40.3) source code and then install the kernel headers (read the kernel source code README and then run make headers_install - you may have to configure the kernel source, but you probably should not have to make and make install the kernel. Your goal is to get a copy of videodev.h and any supporting header files from the kernel source to the usable place on your disk (probably /usr/include and /usr/include/linux).

If you already have /usr/include/linux/videodev.h on your disk, verify that the INCLUDE environment variable points to /usr/include.

Now looking more closely, it looks like the kernel.org people have obsoleted videodev.h and removed it from the source code prior to version 2.6.39.3 (and replaced it with videodev2.h? - not clear at this point) and it looks like you have linux-2.6.40.3. I suggest you get an older copy of the kernel source and manually copy videodev.h to /usr/include/linux (or wherever you now have videodev2.h).

share|improve this answer
    
thanks finally it did not worked and i returned to the suppliers by asking my money back. –  YumYumYum Aug 26 '11 at 20:58

If still actual - put that file to /usr/src/(uname -a)/include/linux.

It helped me for Arch and 3.9.2-1 kernel

share|improve this answer
    
Can this be cleaned up? At current it reads more like a comment or approximation of an answer. –  AthomSfere May 12 '13 at 16:32

videodev.h is from v4l1 which has changed a lot in support in newer kernels, even getting that header (it's now v4l1-videodev.h) won't fix your problem.

It's better to strip all of the v4l1 support out of the driver you're compiling. I've done this and it's compiled just fine for me now.

most of the code is in stk11xx-v4l.c in the

static long v4l_stk11xx_do_ioctl(struct file *fp,
    unsigned int cmd, void __user *arg)

function. Just get rid of all case statements up until you see the v4l2 comment.

Then get rid of the references to the includes of videodev.h

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.