I am trying to compile usbvision-0.9.6_040229 on Fedora, but somehow it does not work.
my kernel is: 2.4.22-1.2179.nptl
please help me :)
this is the complete output:
make -C /lib/modules/2.4.22-1.2179.nptl/build SUBDIRS=/root/usb/usbvision-0.9.6/src modules
make: Entering directory `/usr/src/linux-2.4.22-1.2179.nptl'
gcc32 -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -o scripts/split-include scripts/split-include.c
scripts/split-include include/linux/autoconf.h include/config
make -r -f tmp_include_depends all
make: Entering directory `/usr/src/linux-2.4.22-1.2179.nptl'
make: Leaving directory `/usr/src/linux-2.4.22-1.2179.nptl'
make -C /root/usb/usbvision-0.9.6/src CFLAGS="-D__KERNEL__ -I/usr/src/linux-2.4.22-1.2179.nptl/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -fomit-frame-pointer -pipe -mpreferred-stack-boundary=2 -march=i686 -DMODULE -DMODVERSIONS -include /usr/src/linux-2.4.22-1.2179.nptl/include/linux/modversions.h" MAKING_MODULES=1 modules
make: Entering directory `/root/usb/usbvision-0.9.6/src'
gcc32 -D__KERNEL__ -I/usr/src/linux-2.4.22-1.2179.nptl/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -fomit-frame-pointer -pipe -mpreferred-stack-boundary=2 -march=i686 -DMODULE -DMODVERSIONS -include /usr/src/linux-2.4.22-1.2179.nptl/include/linux/modversions.h -nostdinc -iwithprefix include -DKBUILD_BASENAME=i2c_algo_usb -DEXPORT_SYMTAB -c i2c-algo-usb.c
i2c-algo-usb.c:205: unknown field `owner' specified in initializer
i2c-algo-usb.c:205: warning: missing braces around initializer
i2c-algo-usb.c:205: warning: (near initialization for `i2c_usb_algo.name')
i2c-algo-usb.c:205: warning: initialization makes integer from pointer without a cast
i2c-algo-usb.c:205: initializer element is not computable at load time
i2c-algo-usb.c:205: (near initialization for `i2c_usb_algo.name')
i2c-algo-usb.c:208: initializer element is not constant
i2c-algo-usb.c:208: (near initialization for `i2c_usb_algo.name')
make: *** [i2c-algo-usb.o] Error 1
make: Leaving directory `/root/usb/usbvision-0.9.6/src'
make: *** [_mod_/root/usb/usbvision-0.9.6/src] Error 2
make: Leaving directory `/usr/src/linux-2.4.22-1.2179.nptl'
make: *** [default] Error 2
Just so you don't feel it's your system I'll chirp in here too with a report that a compile attempt produces the very same error on i2c_usb_algo.name with the nptl.2174 kernel as well. Interestingly, another Fedora user I've been emailing has successfully gotten a compile to work with the ntpl.2115 kernel after doing a make mrproper and make menuconfig, but I don't know exactly what options he selected beyond P4 support and loadable modules, so I'm not sure if it's a kernel config issue or not.
I see different file dates on the source at www.emuit.com/webcam.html so since I've also been using the _040229 code from sf.net, I'm gonna go get that source and try again--I don't know what source the nptl.2115 user was using, but if it makes any difference I'll post back.
Eureka! Well, at least I can smell Eureka from here...
The i2c_algorithm structure being used by i2c-algo-usb.c is presuming that there is a .owner field defined by include/i2c.h but the nptl.2174 (and nptl.2179 apparently) Fedora kernels' header file does not define such a field.
The i2c-algo-usb.c code has a little test built in to it in order to to only use the .owner field if the kernel version is higher than 2.4.20 but lower than 2.6.0, leading me to guess that, at least with genuine Linus kernels, the .owner field is only part of that structure between those two versions. RedHat kernels, I am further guessing, don't quite fit those characteristics, probably through their bittersweet gift of backporting patches.
So I took a guess and commented out the entire #if and the .owner line, to make it compile as though the kernel were 2.4.20 or > 2.6.0, and the compile proceeded past that line with no problem. Of course, there's another instance of this type of problem in usbvision.c at line 2936 (using the emuit.com latest versions, mind you) so I guess I will have to keep plugging away at it before the whole thing will compile.
Of course a real programmer could probably easily figure out a more elegant accomodation for RedHat kernel oddities, but since I'm only faking it my guess will just be to let the compiler discover where these problems exist and "fix" them as I find them. Either way, I hope to be able to figure out diff well enough to post a patch for this. Don't hold your breath!
I couldn't find where the i2c_algorithm structure is defined in the include files that would be in /usr/include/linux on a fresh install of Fedora, but I changed /usr/include/linux to be a symlink to the actual directory in /usr/src/linux-2.4, so perhaps that might explain why the nptl.2115 user didn't see this problem, perhaps not. Jin, are you using the /usr/include/linux directory "as-is" from a clean install, or did you also make the symlink I made? And, if you're reading this, Phil, I guess I'd be curious to know if you made the symlink as well.
More status...and this time it's good news.
I sniffed out all the instances of the .owner field in i2c-algo-usb.c, usbvision.c, saa7113.c, and saa7111-new.c, had to change line 37 in saa7113.c to look for compat.h in the include/linux directory (instead of the usbvision directory as it had been, as so: #include "compat.h") and had to include i2c-compat.h from /usr/src/linux/drivers/media/video in order to get around a few trickier oddities at line 216. Don't ask me to explain *any* of this, because I'm just stabbing in the dark.
But...it works! Pardon my language, but HOLY SHIT! I got usbvision to compile with a RedHat kernel (anyone who's been following my story for the past six months should know just how jaw-droppingly tickled I am!) And I even get a solid picture, compression and all! Totally tripendicular, man.
So what this tells me is that it should be a simple matter of patching or rigging the usbvision codebase to accomodate RedHat's backports, through a combination of dealing with the .owner field in some of the i2c structures, and then allowing the code to #include the i2c-compat.h defines from that other directory. Strangely enough, I did not have to deal with the vma patch in the usbvision_v4l_mmap function, so the kernel version test near line 4713 must still be valid for RedHat kernels, or at least the nptl.2174 one. Does anyone know an elegant way of doing all of this? I'm going to try to jot down what I did and try to proceduralize it, in addition to trying it from scratch one more time.
Gotta rule out luck, don't ya know...
Alright. I'd really appreciate it if people could test this process on Fedora Core 1. If all you want is to compile the usbvision module, you oughta be up and running in under ten minutes! I recently upgraded to the 2179.nptl kernel from 2174.nptl and doing so reduced the number of things I had to do to compile usbvision to the following:
1. If all you are doing is building the module and not rebuilding the kernel, you will need to edit the kernel top-level Makefile to remove the "custom" from the EXTRAVERSION define.
2. Copy the Fedora-included .config file that matches your system from the configs directory of your kernel source tree to .config in the top-level directory.
3. Do a make oldconfig and make dep to produce the version.h and tmp_include_depends files needed by usbvision.
4. Edit the following usbvision source files and comment out the entire "#if ... #endif" section that defines the .owner field in the i2c structure. Below are the files and line numbers relative to the current (040229) usbvision source tarball:
i2c-algo-usb.c lines 203 to 207
usbvision.c lines 2931 to 2933
saa7113.c lines 451 to 453
saa7111-new.c lines 462 to 464
NOTE: If anyone out there has performed the I2C 2.8.x patches as listed at http://www.ensicaen.ismra.fr/~delvare/devel/i2c/ on a Fedora kernel and found that doing so eliminates the need for the changes I'm listing, it would be lovely if you'd mention it. I don't use any i2c stuff except the usbvision module, so I didn't feel like messing with patching and rebuilding the kernel.
5. make, make install, modprobe usbvision. Smile.
On a 2179.nptl kernel, that should really be all there is do it. If you're using 2174.nptl and you still get compile errors, take a peek at the previous entries in this thread. I'd really appreciate it if people could post back with successes or failures using this method.
Oh, and I suppose you'll need to deal with lines 530-532 in bt819-new.c if your hardware needs it.
(maybe if I just keep talking to myself someone will take note and join in my otherwise schizophrenic postincs...)
For the interested, the method works fine with the newest Fedora (2188.nptl) kernel, too. If you're a newbie trying to make sense of my directions, make sure to do a "make mrproper" on your kernel sources before doing any of this...I forgot when I upgraded kernels and got bombed with a zillion compile errors.
thanks for your effort!
unfortunately my harddisk crashed, so I was not around for the last 1-2 weeks and it will probably take one more week until I can retry compiling.
I will let you know, as soon as I have some results
You are the man Paul W. Morehead !!!!!
This works under Fedora 2188.nptl.
My cable TV got disconnected, but I made a temporary antenna and was able to pull in a channel.
I do not need a dual boot laptop anymore!!
It is time for bed, but I will play around with this some more. I want to see if I can hook up my game cube and play video games using my laptop as a monitor. I hope the frame rate is fast enough.
Me? No, no, no...Dwaine and Joerg and David and Akinobu and Florent deserve the kudos. I'm impressed if getting the module to work obviated your need for dual-boot, though...I wish I could find some software that, say, obviated my need for sleep, but they all seem to simply compete with it instead. Thanks should also go to Phil for the confidence boost, Jin for making me feel like I'm not the only one doubting their own sanity, and once again to the developers for writing software enticing enough to compel a non-programmer to persevere in the face of frustration. I'm already feeling pretty groovy having gotten it to work, but I'll take a mini-bow in appreciation anyways.
Just be sure to stay tuned (pardon the pun) for when the 1.0 version comes out so we Fedorites can figure this all out again right away. Anyone wanna race? ;)
You have done well.. I was installing Gentoo onto my xbox and wanted to hookup my Nogatech USB TV but had that same problem. I didn't read this and ended up doing exactly what you did. hahaha.. But also had to add the Nogatech USB TV PAL to usbvision.h (why the NTSC was added without its PAL counterpart is somewhat a mystery).
It seems the test for kernel version is incorrect and I'm not sure why it is there? Anyway, Easily fixed.. If I had read this last month i would have been able to help ya.
I should list my site with search engines as i had the fixed USBVision driver there. :c)
Well there are a number of things which will have to change for the fedora stuff. I'm getting my box setup with Fedora test 3 stuff. So I can test out the driver and hopefully fix some of the compiling issues.
Problem is.... All the differences between each distrubution. Everyone has there own littles patches that breaks everyones driver. That's why people are having trouble.
The driver is changed based on the released kernel from www.kernel.org. This is the standard kernel.
I have been the last month busy with upgrading my box to Fedora 2 test 3. In a hope to identify any problems. Man, I haved a LOT of problems. hehehhehehe.....
Still trying to recover. Lost the partition of linux.
Anyway, there is another concern. xawtv is removed from the distrubution of Fedora. So the driver will not load with any application. TVtime is the replacement.
Also, the site www.emuit.com/webcam.html is not working. I forgot to renew the url. hehehehe... have to wait for 30 days for the name to be public again.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.