# usb-pwc-re won't compile

## Joffer

I'm trying to install the usb-pwc-re driver, but it won't compile:

```
armour linux # emerge -av usb-pwc-re

These are the packages that would be merged, in order:

Calculating dependencies... done!

[ebuild   R   ] media-video/usb-pwc-re-10.0.11  0 kB

Total size of downloads: 0 kB

Do you want me to merge these packages? [Yes/No] y

>>> Emerging (1 of 1) media-video/usb-pwc-re-10.0.11 to /

>>> checksums files   ;-) usb-pwc-re-10.0.11.ebuild

>>> checksums files   ;-) usb-pwc-re-10.0.10.ebuild

>>> checksums files   ;-) usb-pwc-re-10.0.7.ebuild

>>> checksums files   ;-) files/digest-usb-pwc-re-10.0.7

>>> checksums files   ;-) files/digest-usb-pwc-re-10.0.10

>>> checksums files   ;-) files/digest-usb-pwc-re-10.0.11

>>> checksums src_uri ;-) pwc-10.0.11.tar.bz2

 * Determining the location of the kernel source code

 * Found kernel source directory:

 *     /usr/src/linux

 * Found sources for kernel version:

 *     2.6.16-gentoo-r1-7ctsmp

>>> Unpacking source...

>>> Unpacking pwc-10.0.11.tar.bz2 to /var/tmp/portage/usb-pwc-re-10.0.11/work

>>> Source unpacked.

>>> Compiling source in /var/tmp/portage/usb-pwc-re-10.0.11/work/pwc-10.0.11 ...

make -C /usr/src/linux SUBDIRS=/var/tmp/portage/usb-pwc-re-10.0.11/work/pwc-10.0.11 modules

make[1]: Entering directory `/usr/src/linux-2.6.16-gentoo-r1'

  CC [M]  /var/tmp/portage/usb-pwc-re-10.0.11/work/pwc-10.0.11/pwc-if.o

  CC [M]  /var/tmp/portage/usb-pwc-re-10.0.11/work/pwc-10.0.11/pwc-misc.o

  CC [M]  /var/tmp/portage/usb-pwc-re-10.0.11/work/pwc-10.0.11/pwc-ctrl.o

  CC [M]  /var/tmp/portage/usb-pwc-re-10.0.11/work/pwc-10.0.11/pwc-v4l.o

  CC [M]  /var/tmp/portage/usb-pwc-re-10.0.11/work/pwc-10.0.11/pwc-uncompress.o

  CC [M]  /var/tmp/portage/usb-pwc-re-10.0.11/work/pwc-10.0.11/pwc-dec1.o

  CC [M]  /var/tmp/portage/usb-pwc-re-10.0.11/work/pwc-10.0.11/pwc-dec23.o

/var/tmp/portage/usb-pwc-re-10.0.11/work/pwc-10.0.11/pwc-v4l.c: In function 'pwc_video_do_ioctl':

/var/tmp/portage/usb-pwc-re-10.0.11/work/pwc-10.0.11/pwc-v4l.c:371: error: 'v4l2_ioctl_names' undeclared (first use in th is function)

/var/tmp/portage/usb-pwc-re-10.0.11/work/pwc-10.0.11/pwc-v4l.c:371: error: (Each undeclared identifier is reported only o nce

/var/tmp/portage/usb-pwc-re-10.0.11/work/pwc-10.0.11/pwc-v4l.c:371: error: for each function it appears in.)

  CC [M]  /var/tmp/portage/usb-pwc-re-10.0.11/work/pwc-10.0.11/pwc-kiara.o

make[2]: *** [/var/tmp/portage/usb-pwc-re-10.0.11/work/pwc-10.0.11/pwc-v4l.o] Error 1

make[2]: *** Waiting for unfinished jobs....

make[1]: *** [_module_/var/tmp/portage/usb-pwc-re-10.0.11/work/pwc-10.0.11] Error 2

make[1]: Leaving directory `/usr/src/linux-2.6.16-gentoo-r1'

make: *** [all] Error 2

!!! ERROR: media-video/usb-pwc-re-10.0.11 failed.

Call stack:

  ebuild.sh, line 1526:   Called dyn_compile

  ebuild.sh, line 923:   Called src_compile

  usb-pwc-re-10.0.11.ebuild, line 25:   Called die

!!! make failed

!!! If you need support, post the topmost build error, and the call stack if relevant.
```

IF I compile the kernel with the pwc module and restart with that kernel, then I'm able to compile it. But loading the pwc module gives me the kernel provided module  :Sad: 

Any solutions?

----------

## treat

Just download a snapshot from http://www.saillard.org/linux/pwc/snapshots and create a portage overlay. i'm using pwc-v4l2-20060331-042701.tar.bz2 it seems to work just fine.

----------

## Joffer

I tried to hack together an overlay ebuild but it won't compile at all. Could you send me your overlay ebuild? I sent my email on PM.

----------

## Joffer

 *treat wrote:*   

> Just download a snapshot from http://www.saillard.org/linux/pwc/snapshots and create a portage overlay. i'm using pwc-v4l2-20060331-042701.tar.bz2 it seems to work just fine.

 

I can't emerge the ebuild you sent me  :Sad:  I get the same error. Am I missing some modules / settings in the kernel perhaps? I have enabled "Video for linux"

----------

## Joffer

I'm giving it another go here now.

I have activated "Video For Linux" as module (loading videodev module on startup).

I havne not compiled the kernel provided module (pwc) for USB Philips Webcam, as I thought usb-pwc-re was supposed to be the new module.. am I right?

Do I need to activate other kernel options?

----------

## ank

Compile pwc as module and then emerge usb-pwc-re which will replace the kernels pwc. This works for me.

----------

## Joffer

 *ank wrote:*   

> Compile pwc as module and then emerge usb-pwc-re which will replace the kernels pwc. This works for me.

 

I did that some time ago, but all I got was a black square instead of video  :Sad:  Could try again though.. won't hurt..

How can I verify that I load the stand-alone compiled version, is that possible?

----------

## ank

I get a grey screen instead of video with kernels pwc. With usb-pwc-re video works. So this is the proof that the usb-pwc-re is loaded.

----------

## Joffer

 *ank wrote:*   

> I get a grey screen instead of video with kernels pwc. With usb-pwc-re video works. So this is the proof that the usb-pwc-re is loaded.

 

I would say so  :Very Happy:  Will try this weekend  :Smile: 

----------

## Primozic

I copied the usb-pwc-re-10.0.11.ebuild to my Portage overlay, renamed it to usb-pwc-re-10.0.12_rc1.ebuild, digested it, and emerged it.  It works fine for me.

I don't have the kernel PWC enabled at all, just Video For Linux (and CX88, if that matters).

----------

## ank

Primozic tnx. usb-pwc-re-10.0.12_rc1.ebuild works fine without kernel pwc.   :Very Happy: 

----------

## Joffer

 *Primozic wrote:*   

> I copied the usb-pwc-re-10.0.11.ebuild to my Portage overlay, renamed it to usb-pwc-re-10.0.12_rc1.ebuild, digested it, and emerged it.  It works fine for me.
> 
> I don't have the kernel PWC enabled at all, just Video For Linux (and CX88, if that matters).

 

What is CX88 ?

----------

## ank

CX88 is driver for TV card. You dont need them for web cam.

http://linux.bytesex.org/v4l2/cx88.html

----------

## Joffer

 *Primozic wrote:*   

> I copied the usb-pwc-re-10.0.11.ebuild to my Portage overlay, renamed it to usb-pwc-re-10.0.12_rc1.ebuild, digested it, and emerged it.  It works fine for me.
> 
> I don't have the kernel PWC enabled at all, just Video For Linux (and CX88, if that matters).

 

Why did you make an overlay? Did you change anything? Otherwise I don't see the need to make an overlay...

----------

## Joffer

Ok. pwc module loaded. Trying to get video running:

```
xawtv -c /dev/v4l/video0
```

All I get is a window which is all black. Output from terminal:

```
xawtv -c /dev/v4l/video0

This is xawtv-3.95, running on Linux/x86_64 (2.6.16-ck6-r1-14ctsmp)

WARNING: v4l-conf is compiled without DGA support.

/dev/v4l/video0 [v4l2]: no overlay support

v4l-conf had some trouble, trying to continue anyway

Warning: Cannot convert string "-*-ledfixed-medium-r-*--39-*-*-*-c-*-*-*" to type FontStruct

v4l2: oops: select timeout
```

Does it say anything useful for troubleshooting?

----------

## Primozic

 *Joffer wrote:*   

> Why did you make an overlay? Did you change anything? Otherwise I don't see the need to make an overlay...

 

I didn't make any changes.  However, if you don't use an overlay, the ebuild will get deleted on your next Portage tree sync.

----------

## Joffer

 *Primozic wrote:*   

>  *Joffer wrote:*   Why did you make an overlay? Did you change anything? Otherwise I don't see the need to make an overlay... 
> 
> I didn't make any changes.  However, if you don't use an overlay, the ebuild will get deleted on your next Portage tree sync.

 

But why did you make an overlay if you didn't change anything? Then you might just as well use the one in portage? Or are you trying to say you are using one of the snapshots which 'treat' mentioned earlier in this thread?

----------

## Primozic

 *Joffer wrote:*   

> But why did you make an overlay if you didn't change anything? Then you might just as well use the one in portage? Or are you trying to say you are using one of the snapshots which 'treat' mentioned earlier in this thread?

 

I did change something.  The renaming of the ebuild changes which file it fetches and compiles.  This is significant, since the lastest version in Portage, at least in my experience, will not compile with anything equal to or greater than 2.6.16.

Like I said earlier, you'll lose it if you don't put it in your overlay.  This version is not in Portage yet, and I'm not sure if/when it will be.  I sync at least once a day, and I fiddle around with kernels quite often.  It doesn't make much sense to keep on renaming an ebuild because a recent Portage tree sync deleted it.

----------

## Primozic

It's now officially in Portage, in case anyone was interested.

----------

## Joffer

 *Primozic wrote:*   

> It's now officially in Portage, in case anyone was interested.

 

This may sound stupid, but I just don't understand what changes you are talking about? Which version?

I'm using 2.6.16-ck3 kernel and I've compiled the usb-pwc-re-10.0.11 version.

Edit:

Ok.. I did a emerge --sync now and the latest usb-pwc-re version is 10.0.12_rc1..

----------

## Joffer

Doesn't look like this module likes my cam.. well it probably do, but something is wrong. I get this in 'dmesg':

```
pwc: Philips webcam module version 10.0.12-rc1 loaded.

pwc: Supports Philips PCA645/646, PCVC675/680/690, PCVC720[40]/730/740/750 & PCVC830/840.

pwc: Also supports the Askey VC010, various Logitech Quickcams, Samsung MPC-C10 and MPC-C30,

pwc: the Creative WebCam 5 & Pro Ex, SOTEC Afina Eye and Visionite VCS-UC300 and VCS-UM100.

pwc: Philips PCVC740K (ToUCam Pro)/PCVC840 (ToUCam II) USB webcam detected.

pwc: Registered as /dev/video0.

usbcore: registered new driver Philips webcam
```

and then when I try to start xawtv I get this (if i run 'dmesg' or tail /var/log/messages):

```
pwc: isoc_init() submit_urb 0 failed with error -38

pwc: isoc_init() submit_urb 1 failed with error -38

pwc: isoc_init() submit_urb 0 failed with error -38

pwc: isoc_init() submit_urb 1 failed with error -38

pwc: isoc_init() submit_urb 0 failed with error -38

pwc: isoc_init() submit_urb 1 failed with error -38

pwc: isoc_init() submit_urb 0 failed with error -38

pwc: isoc_init() submit_urb 1 failed with error -38

pwc: isoc_init() submit_urb 0 failed with error -38

pwc: isoc_init() submit_urb 1 failed with error -38

pwc: isoc_init() submit_urb 0 failed with error -38

pwc: isoc_init() submit_urb 1 failed with error -38

pwc: isoc_init() submit_urb 0 failed with error -38

pwc: isoc_init() submit_urb 1 failed with error -38
```

It also seems to freeze after I try to click on some options (after right-clicking on the window). I've got these modules loaded in regards to the webcam:

```
pwc                    88320  1

compat_ioctl32         10432  0

v4l2_common            10432  1 compat_ioctl32

videodev               12672  2 pwc
```

Suggestions?

----------

## Joffer

I also tried adding the 'dga' useflag and reemerge the needed packages, but then all I got was this:

```
This is xawtv-3.95, running on Linux/x86_64 (2.6.16-ck6-r1-15ctsmp)

X Error of failed request:  XF86DGANoDirectVideoMode

  Major opcode of failed request:  138 (XFree86-DGA)

  Minor opcode of failed request:  1 (XF86DGAGetVideoLL)

  Serial number of failed request:  67

  Current serial number in output stream:  67
```

----------

## nutznboltz

 *ank wrote:*   

> Compile pwc as module and then emerge usb-pwc-re which will replace the kernels pwc. This works for me.

 

If you do it this way the only flaw is that a kernel upgrade followed by a re-emerge of usb-pwc-re gratiutiosly removes the pwc.ko from the /lib/modules/... of the old kernel so if you reboot from the old kernel your driver is gone.

Should usb-pwc-re be a slot package?

----------

## ank

In 2.6.17 the kernel module pwc works without problem so i don't need usb-pwc-re   :Very Happy: 

The only problem is that in Camorama Color correction is on by default which get me picture with blue contrast and i have to switch it off every time to get good picture.

And the web cam dont go off automaticaly if i dont use it.

----------

## Thamuz

Yes, new Kernel is good for pwc.

I've the same problem, can't emerge pwc or cam not recognized, with new kernel it works without doing anything. My cam is a Logitech quickcam zoom.

----------

## JackBak

Well, this pwc vs. usb-pwc-re thing is a real pain from my perspective. As I have written my own application to use the Phillips Web cam I am intimately aware of past kernal oddities thanks to the original author, shall we say, losing interest in the pwc driver.

Thus, upon reading about how in 2.6.17-r7 (2006.1 LiveCD) just using pwc would "just work" I plowed ahead. NOT. The pwc that is included in that version is the old 9.x series that DOES NOT contain the compression/decompression needed by the Phillips WebCams. The series 10.x does - this is the usb-pwc-re version. So the street wisdom says just 'emerge usb-pwc-re'. Well, yes and no.

The pwc (9.x series) lives in .../drivers/media/video/pwc and the usb-pwc-re (10.x series) lives in .../drivers/usb/media/pwc

Having emerged usb-pwc-re one is told that it replaces pwc.ko but upon reboot /etc/modules.autoload/kernel-2.6 gets the old 9.x series from /lib/modules/2.6.17-gentoo-r7/kernel/drivers/media/video/pwc

I could find no way to tell autoload how to get the proper pwc.ko -- so I just overwrote the 9.x series pwc.ko in /lib/modules/2.6.17-gentoo-r7/kernel/drivers/media/video/pwc with the series 10.x pwc.ko. Reboot. My app now works I'm happy ... but usbview still thinks there is no driver for the Phillips WebCam (it shows up in red). Not going to wory about that one.

If there was a smoother way to accomplish this please tell us all.

----------

