QuickCam Team Forums

Full Version: unable to compile libwebcam-0.1.1
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
ref: opensuse 10.3 64b
2.6.22.17-0.1-default
gcc 4.2.1
cmake version 2.4-patch 8
orbit -AF

I will keep working because I am sure I am missing something very obvious Sad
------------------------------------------------cmake-------------------------------------
tdec@amd:~/installations/libwebcam-0.1.1/build> cmake ..
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Check size of void*
-- Check size of void* - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Found LibXml2: /usr/lib64/libxml2.so
-- Configuring done
-- Generating done
-- Build files have been written to: /home/tdec/installations/libwebcam-0.1.1/bu
ild

---------------------------------------------------make ERRORS------------------------
tdec@amd:~/installations/libwebcam-0.1.1/build> make
[ 16%] Building C object Libs/libwebcam/CMakeFiles/webcam.dir/libwebcam.o
/home/tdec/installations/libwebcam-0.1.1/Libs/libwebcam/libwebcam.c: In function ‘get_control_id_from_v4l2’:
/home/tdec/installations/libwebcam-0.1.1/Libs/libwebcam/libwebcam.c:1683: error: ‘V4L2_CID_PANTILT_RESET’ undeclared (first use in this function)
/home/tdec/installations/libwebcam-0.1.1/Libs/libwebcam/libwebcam.c:1683: error: (Each undeclared identifier is reported only once
/home/tdec/installations/libwebcam-0.1.1/Libs/libwebcam/libwebcam.c:1683: error: for each function it appears in.)
/home/tdec/installations/libwebcam-0.1.1/Libs/libwebcam/libwebcam.c:1688: error: ‘V4L2_CID_WHITE_BALANCE_TEMPERATURE_AUTO’ undeclared (first use in this function)
make[2]: *** [Libs/libwebcam/CMakeFiles/webcam.dir/libwebcam.o] Error 1
make[1]: *** [Libs/libwebcam/CMakeFiles/webcam.dir/all] Error 2
make: *** [all] Error 2

TIA
-=terry=-
There have been some changes to the UVC driver recently in preparation for its merge into the kernel. Try rolling it back to revision 178, that should fix the problem. libwebcam 0.1.2 will bring some updates addressing these issues. I'll check tomorrow whether there's a quick fix possible for this ...

mrubli Wrote:
There have been some changes to the UVC driver recently in preparation for its merge into the kernel. Try rolling it back to revision 178, that should fix the problem. libwebcam 0.1.2 will bring some updates addressing these issues. I'll check tomorrow whether there's a quick fix possible for this ...

Martin,

I am a litte confused what you suggested.
revison 178 of what?

I am using the kernel module
uvcvideo-kmp-default r117_2.6.22.17_0.1-1.1@x86_64

BTW ekiga and skype seems to work well, at leat I have an excellent image and sound. I have not use them yet.

Thxs,

-=terry=-

Terry - Did you follow the steps in the README? You need the two header files uvcvideo.h & uvc_compat.h.

V4L2_CID_PANTILT_RESET is defined in uvcvideo.h.
pwright thxs, that may be the problem ?
tdec@amd:/usr/include> ls uvc* -l
-rw-r--r-- 1 root root 7933 2008-02-16 10:17 uvc_compat.h
-rw-r--r-- 1 root root 22623 2008-02-16 10:17 uvcvideo.h
However neither of both define those variable, they are just not there!

----few minutes later Smile
I found two older files under
http://svn.berlios.de/svnroot/repos/linu...es/dynctrl
both define those variables, so I compiled them without problems and I created a small rpm for my distro.
So now I have to figure out what to do with it ;-)
Thank you much for the info

-=terry=-
What I meant was to check out r178 of the UVC driver. Like this:

svn co -r178 http://svn.berlios.de/svnroot/repos/linu...-uvc/trunk

The reason this control has been removed is that there are now pan/tilt controls in V4L2 (well, they will be, IIRC for kernel 2.6.26). I will have to adapt libwebcam.

(Probably you've followed the README instructions but those don't work anymore with the latest UVC driver. So just add the -r178 parameter to the two "svn co" commands in the README and it should work again.)

mrubli Wrote:
Probably you've followed the README instructions but those don't work anymore


That's why you're here :-)
Thxs Martin, hope I have some time this week. I'll get back with the result.

-=terry(Denver)=-

I'll be -v so you can catch any errors . I got the same errors in make :-(

1. Remove the uvc that was in the opensuse rep. Check with lsmod and no uvc modules is loaded

2. dn the r178 of the uvc. Here is the the content of version.h
#define DRIVER_VERSION "SVN r178"

3. compile uvc without errors.

4. Before install uvc:
# modinfo uvcvideo
#modinfo: could not open /lib/modules/2.6.22.17-0.1-default/usb/media/uvcvideo.ko: No such file or directory

5. After I install the r178 uvc:
# modinfo uvcvideo
filename: /lib/modules/2.6.22.17-0.1-default/usb/media/uvcvideo.ko
license: GPL
description: USB Video Class driver
author: Laurent Pinchart <laurent.pinchart@skynet.be>
srcversion: 66AD42C53751D2C1748BA01
alias: usb:v*p*d*dc*dsc*dp*ic0Eisc01ip00*
alias: usb:v5986p0200d*dc*dsc*dp*ic0Eisc01ip00*
alias: usb:v5986p0102d*dc*dsc*dp*ic0Eisc01ip00*
alias: usb:v5986p0100d*dc*dsc*dp*ic0Eisc01ip00*
alias: usb:v19ABp1000d*dc*dsc*dp*ic0Eisc01ip00*
alias: usb:v18CDpCAFEd*dc*dsc*dp*ic0Eisc01ip00*
alias: usb:v174Fp5212d*dc*dsc*dp*ic0Eisc01ip00*
alias: usb:v0E8Dp0004d*dc*dsc*dp*ic0Eisc01ip00*
alias: usb:v090CpB371d*dc*dsc*dp*ic0Eisc01ip00*
alias: usb:v05ACp8501d*dc*dsc*dp*ic*isc*ip*
alias: usb:v046Dp08C7d*dc*dsc*dp*icFFisc01ip00*
alias: usb:v046Dp08C6d*dc*dsc*dp*icFFisc01ip00*
alias: usb:v046Dp08C5d*dc*dsc*dp*icFFisc01ip00*
alias: usb:v046Dp08C3d*dc*dsc*dp*icFFisc01ip00*
alias: usb:v046Dp08C2d*dc*dsc*dp*icFFisc01ip00*
alias: usb:v046Dp08C1d*dc*dsc*dp*icFFisc01ip00*
alias: usb:v045Ep00F8d*dc*dsc*dp*ic0Eisc01ip00*
alias: usb:v041Ep4057d*dc*dsc*dp*ic0Eisc01ip00*
alias: usb:v0402p5606d*dc*dsc*dp*ic0Eisc01ip00*
depends: usbcore,videodev,v4l2-common,v4l1-compat,compat_ioctl32
vermagic: 2.6.22.17-0.1-default SMP mod_unload
parm: trace:uint

6. Reboot and test with Ekiga and works OK

6. trying to compile libwebcam-0.1.1

$tdec@amd:~/installations/libwebcam-0.1.1/build> cmake ..
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Check size of void*
-- Check size of void* - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Found LibXml2: /usr/lib64/libxml2.so
-- Configuring done
-- Generating done
-- Build files have been written to: /home/tdec/installations/libwebcam-0.1.1/build

$tdec@amd:~/installations/libwebcam-0.1.1/build> make
Scanning dependencies of target webcam
[ 16%] Building C object Libs/libwebcam/CMakeFiles/webcam.dir/libwebcam.o
/home/tdec/installations/libwebcam-0.1.1/Libs/libwebcam/libwebcam.c: In function ‘get_control_id_from_v4l2’:
/home/tdec/installations/libwebcam-0.1.1/Libs/libwebcam/libwebcam.c:1683: error: ‘V4L2_CID_PANTILT_RESET’ undeclared (first use in this function)
/home/tdec/installations/libwebcam-0.1.1/Libs/libwebcam/libwebcam.c:1683: error: (Each undeclared identifier is reported only once
/home/tdec/installations/libwebcam-0.1.1/Libs/libwebcam/libwebcam.c:1683: error: for each function it appears in.)
/home/tdec/installations/libwebcam-0.1.1/Libs/libwebcam/libwebcam.c:1688: error: ‘V4L2_CID_WHITE_BALANCE_TEMPERATURE_AUTO’ undeclared (first use in this function)
make[2]: *** [Libs/libwebcam/CMakeFiles/webcam.dir/libwebcam.o] Error 1
make[1]: *** [Libs/libwebcam/CMakeFiles/webcam.dir/all] Error 2
make: *** [all] Error 2

Martin TIA

-=terry=-
Mia Culpa, I feel embarrassed! I compiled and installed the uvcvideo r178, then I tried to compile lbwebcam and give me the make error. The problem is because I ignored the most important part and it was the replacement of
uvc_compat.h
uvc_compat.h
under /usr/include
with the ones form r178
Well I did and this is the result:

-------------------
tdec@amd:~/installations/libwebcam-0.1.1/build> make
Scanning dependencies of target webcam
[ 16%] Building C object Libs/libwebcam/CMakeFiles/webcam.dir/libwebcam.o
[ 33%] Building C object Libs/libwebcam/CMakeFiles/webcam.dir/dynctrl.o
Linking C shared library libwebcam.so
[ 33%] Built target webcam
Scanning dependencies of target uvcdynctrl
[ 50%] Building C object Apps/uvcdynctrl/CMakeFiles/uvcdynctrl.dir/main.o
[ 66%] Building C object Apps/uvcdynctrl/CMakeFiles/uvcdynctrl.dir/controls.o
[ 83%] Building C object Apps/uvcdynctrl/CMakeFiles/uvcdynctrl.dir/cmdline.o
Linking C executable uvcdynctrl
[100%] Built target uvcdynctrl
---------------------------
I tested one command and the camera moved!!.
I still have to do more work but the worst is over. Thxs Martin and I will report later.

-=terry(Denver)=-
Martin,
A couple of things:

1. the paths are ok for opensuse 10.3 and the make install works OK. So the controls can be run as user from any place. I leave the # because you have to run it as root if you do it after make from the /libwebcam-0.1.1/build/Apps/uvcdynctrl

2. The following are my observation. Appreciate any additional info. If everything is OK, I want to write a small guide for orbit-AF under opensuse 10.3

Controls that work

# uvcdynctrl -s "Pan/tilt Reset" -- 1
reset pan
# uvcdynctrl -s "Pan/tilt Reset" -- 2
resets tilt
# uvcdynctrl -s "Pan/tilt Reset" -- 3
resets pan/tilt

# uvcdynctrl -s "Pan (relative)" -- -700
clockwise from the top
$ uvcdynctrl -s "Pan (relative)" -- 700
anticlockwise from the top
The range is 70º; 700 is about 5º steps

# uvcdynctrl -s "Tilt (relative)" -- -500
tilts up
# uvcdynctrl -s "Tilt (relative)" -- 500
tilts down
The range is 30º and 400 is about 4.3º steps

# uvcdynctrl -s "Brightness" -- 1
# uvcdynctrl -s "Brightness" -- 255

# uvcdynctrl -s "Contrast" -- 1
# uvcdynctrl -s "Contrast" -- 255

# uvcdynctrl -s "Saturation" -- 1
# uvcdynctrl -s "Saturation" -- 255

# uvcdynctrl -s "Gain" -- 1
# uvcdynctrl -s "Gain" -- 255
I do not see any any effect

# uvcdynctrl -s "Backlight Compensation" -- 0
# uvcdynctrl -s "Backlight Compensation" -- 1
# uvcdynctrl -s "Backlight Compensation" -- 2


# uvcdynctrl -s "Power Line Frequency" -- 0
# uvcdynctrl -s "Power Line Frequency" -- 1
# uvcdynctrl -s "Power Line Frequency" -- 2

# uvcdynctrl -s "White Balance Temperature" -- x
I do not see anything neither errors The same with
Exposure, Auto Priority
White Balance Temperature, Auto

# uvcdynctrl -s "LED1 Mode" -- 0 LED off
# uvcdynctrl -s "LED1 Mode" -- 1 LED on
# uvcdynctrl -s "LED1 Mode" -- 2 LED blinking
# uvcdynctrl -s "LED1 Mode" -- 3 LED on
I do not know what these modes do except in mode 2 the LED blinks

Martin I could not find any documentation related to those controls, where is it.

Thanks for your great work. This camera is excellent.

-=terry(Denver)=-
The documentation for the controls that get added with "uvcdynctrl -i" is in the XML file itself. :-) I know, it's a bad place but I just haven't had the time to extract it and put it in a more prominent place yet.
Martin, thanks the documentation is pretty clear. I have to spent a little more time looking at the uvc module more for curiosity than needs. I loaded luvcview which is nice however I just look at the picture when I'm using skype and control the image and the camera using uvcdynctrl. All of you have done a fantastic work.
A couple of questions

Do the automatic focus and the automatic tracking work under linux? I do not think so but just to be sure

Martin thanks again.

-=terry=-
You're welcome. :-)

Here is a link to another thread that pretty much covers your latest questions. Unfortunately, the answer is no at this point.

terryxela Wrote:
# uvcdynctrl -s "Gain" -- 1
# uvcdynctrl -s "Gain" -- 255
I do not see any any effect


I've just checked that and the problem is that the auto exposure control needs to be disabled before the gain works. Otherwise, the auto exposure algorithm will take control over both, the exposure time, and the gain.

Thxs Martin

uvcdynctrl -s "Exposure, Auto" -- 0 disable
uvcdynctrl -s "Exposure, Auto" -- 3 enable

If 0 then
uvcdynctrl -s "Gain" -- 1 image becomes black
uvcdynctrl -s "Gain" -- 255 image is light

If 3 whatever is the gain it will not change.

Works great.

-=terry(Denver)=-
I just downloaded and installed the new uvc trunk rev 193. Compiles and installs OK. It works, you can see the image well and the camera motors also work. Some of the controls like autoexposure or gain do not work any more. This weekend I will look into the changes in the new uvc module. In the meantime I am back to rev 178 that works great all around. Opensuse users have rev 117 in the repositories and it works as well.
This uvc is a fast moving target Smile

-=terry=-
It is indeed! So we have decided to fight fire with fire. :-)

No, seriously: I have actually set up a SVN repository for libwebcam and uvcdynctrl last week. Now, I'm just waiting for the DNS entry. I'll post an announcement once it's up. The repository should make it a little easier for you guys to download the latest working version without having to wait for a release.
Greaaaaaaat!!!

-=terry=-
Hi,

I solved the problem with last uvc versions with a #ifdef of the 2 controls:

Code:
--- libwebcam-0.1.1_orig/Libs/libwebcam/libwebcam.c     2008-01-29 08:18:18.000000000 +0100
+++ libwebcam-0.1.1/Libs/libwebcam/libwebcam.c  2008-03-16 20:23:46.000000000 +0100
@@ -1680,12 +1680,16 @@
#ifdef V4L2_CID_TILT_RELATIVE
                        case V4L2_CID_TILT_RELATIVE:                                    return CC_TILT_RELATIVE;
#endif
+#ifdef V4L2_CID_PANTILT_RESET
                        case V4L2_CID_PANTILT_RESET:                                    return CC_LOGITECH_PANTILT_RESET;
+#endif

                        case V4L2_CID_EXPOSURE_AUTO:                                    return CC_AUTO_EXPOSURE_MODE;
                        case V4L2_CID_EXPOSURE_ABSOLUTE:                                return CC_EXPOSURE_TIME_ABSOLUTE;

+#ifdef V4L2_CID_WHITE_BALANCE_TEMPERATURE_AUTO
                        case V4L2_CID_WHITE_BALANCE_TEMPERATURE_AUTO:   return CC_AUTO_WHITE_BALANCE_TEMPERATURE;
+#endif
                        case V4L2_CID_WHITE_BALANCE_TEMPERATURE:                return CC_WHITE_BALANCE_TEMPERATURE;
                }
        }


HTH
Philipp

The DNS update is in effect now, so you can get the latest version directly from the SVN repository.

You will see that there is a very similar fix to the one Philipp proposed, with the exception that it comes with a new header file (generated via XSLT from the logitech.xml file) that contains the correct IDs if they're not defined yet. One quick note: Please use the latest UVC driver (not r178) with the SVN version.
Martin thxs. Everything seems to be working very well
I am running
uvc v-195
uvcdynctrl 0.2
I 'll tested for a couple of days

-=terry(Denver)=-
Thanks for the feedback; I appreciate it!
Philipp,

Your patch works very well too. Thxs.

-=terry(Denver)=-
So, it works also for me. Thanks a lot !!

I update the uvc kernel module, then installed libwebcam via
svn from the above link. I then "hacked" into logitech.xml to
change it to

..
<id>V4L2_CID_PAN_RELATIVE</id>
<value>0x08000007
..
<id>V4L2_CID_TILT_RELATIVE</id>
<value>0x08000008</value
..
<id>V4L2_CID_PANTILT_RESET</id>
<value>0x08000009</value>
..

I still had to comment out V4L2_CID_PAN_RESET and V4L2_CID_TILT_RESET but then I could load it fine with
uvcdynctrl -i

still after a reboot lucview came off with the wrong values so
now I put a wrapper around it in /usr/local/bin. It is fine enough
for now. Certainly different than having a package with the right
luvcview and libwebcam, but it works. Thanks again
We are currently moving the luvcview into a new SVN repository, here on quickcamteam.net. The latest source code should fix this sort of problem. I will post an announcement to the Announcements forum as soon as it's ready.
Pages: 1 2
Reference URL's