v4l1_compat on Ubuntu12.04LTS

Asked by Yoshinari Kameda

Hi,
When I plug in a USB camera at Ubuntu 12.04 LTS, v4l1_compat does not come up (which comes up when I use Ubuntu 10.4.1/lucid).
(Well, it comes with uvcvideo, and so xawtv, guvcview, skype, cheese are all fine with the camera...)
Is that a right behaviour at Ubuntu 12.04 LTS? If so, how can I load v4l1_compat to the kernel?

I tried to load manually ($ modprobe v4l1_compat), but I failed.
Since I am trying to compile OpenCV 2.4 (Rev.8312) on Ubuntu12.04 LTS, I need V4L support.
(By default, cmake of OpenCV 2.4 reports "V4L/V4L2 = NO/YES")

On Ubuntu 10.04.1, v4l1_compat always comes up when I plug in a USB camera and I can use V4L.
I checked the package of libv4l-0 and I found there are differences, but I have no idea to solve this problem.
http://packages.ubuntu.com/search?keywords=libv4l-0

I appreciate any suggestions very much!
(I tested with 3 different note PCs and 3 different USB cameras, but all failed.)
(FYI, I am working on USB-boot-Ubuntu/OpenCV/AR project at http://www.kameda-lab.org/casper).

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu v4l-utils Edit question
Assignee:
No assignee Edit question
Solved by:
Yoshinari Kameda
Solved:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

Can you give the output of:

lsb_release -a; uname -a; lsusb

Thanks

Revision history for this message
Yoshinari Kameda (kameda) said :
#2

Hi, thank you for quick response.
Here are the info you requested (I should have put them first...).

ubuntu@ubuntu:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.04 LTS
Release: 12.04
Codename: precise

ubuntu@ubuntu:~$ uname -a
Linux ubuntu 3.2.0-23-generic-pae #36-Ubuntu SMP Tue Apr 10 22:19:09 UTC 2012 i686 i686 i386 GNU/Linux

ubuntu@ubuntu:~$ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 003: ID 090c:1000 Silicon Motion, Inc. - Taiwan (formerly Feiya Technology Corp.) 64MB QDI U2 DISK
Bus 001 Device 004: ID 5986:03b3 Acer, Inc
Bus 002 Device 003: ID 046d:080a Logitech, Inc. Portable Webcam C905

FYI, the log was taken at Lenovo E420 (which has on-board camera + Logicool C905), booting from USB-memory.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#3

If you install cheese, does it work there?

Revision history for this message
Yoshinari Kameda (kameda) said :
#4

After I cook the bootable USB memory (by Universal-USB-Installer-1.8.9.4.exe + ubuntu-12.04-desktop-i386.iso), what I have done on the Ubuntu (this time) were:

$ sudo apt-get install subversion
$ svn co http://code.opencv.org/svn/opencv/branches/2.4 (=> Rev. 8312)
$ sudo apt-get install cmake
$ sudo apt-get install build-essential
$ sudo apt-get update
$ sudo apt-get install guvcview
$ sudo apt-get install cheese
$ sudo apt-get update
$ mkdir opencv/release-04
$ cd opencv/release-04
$ cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_DIR=/usr/local ..
     and cmake tells
     "-- V4L/V4L2 NO/YES"
$ lsb_release -a
$ uname -a
$ lsusb
$ guvcview (=> good, on-board camera)
$ guvcview -d /dev/video0 (=> good, on-board camera)
$ guvcview -d /dev/video1 (=> good, Logicool C905)

I have tried with Ubuntu12.04/amd64, but it could not load v4l1_compat like Ubuntu 12.04/i386.

Revision history for this message
Yoshinari Kameda (kameda) said :
#5

Yes, cheese is fine (with on-board camera) too.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#6

You c an use LD_PRELOAD and preload the compat module, then launch the app you want. Not sure what the issue is if it shows up in cheese and so forth...

Revision history for this message
Yoshinari Kameda (kameda) said :
#7

$ cheese -d /dev/video0
$ cheese -d /dev/video1
Both fine (cheese complains about Gtk-WARNING, but as for video image, it works fine and I can enjoy effects too).

Revision history for this message
Yoshinari Kameda (kameda) said :
#8

Thank you for the comments of "LD_PRELOAD" issue.
But as my final goal is to let OpenCV's cmake recognize V4L is supported.

That's because after I install OpenCV lib, everytime when I compile a program which uses USB camera by way of highgui-sub-module of OpenCV library, I probably need V4L support to run the program.

I am trying to use LD_PRELOAD with cmake (and later running the compiled program with OpenCV), but it seems a long way ... So I am trying to find alternative way too B-)

Once again, thank you for all your responses and comments. Further info are really appriciated.

Revision history for this message
Yoshinari Kameda (kameda) said :
#9

FYI,
I DO NOT NEED to set "LD_PRELOAD" to run guvcview and cheese correctly in my current environment.
(Apart from V4L / v4l1_compat problem, they really work fine ...)

Revision history for this message
Yoshinari Kameda (kameda) said :
#10

Finally, by adding libv4l-dev to the Ubuntu 12.04, it turns out that programs compiled with OpenCV handles USB camera without v4l1_compat.
So I don't need to fight with LD_PRELOAD ^_^;
I always appeciate your works and wonderful Ubuntu!

Revision history for this message
Peter Retief (peterretief-gmail) said :
#11

Re make OpenCV and it will work