Page 1 of 1

PWC camera stopped working after upgrade to 1.24

Posted: Tue May 05, 2009 6:16 pm
by thedayofcondor
Hi,
I just upgraded to version 1.24, and my two usb cameras both stopped working.

I spent the day troubleshooting it, with no luck.

My cameras are both using the pwc driver and while different (philips and logitech) they seems to be based on same chipset.

Both the cameras work with aMSN, cheese and xawtv. YUV420p is the only format supported by the camera.

With 1.23 (v4l 1?) I used them in YUV420P without any problem.

With 1.24 I tried v4l 1 - YUV420P fails to initialise the camera.

I also tried v4l 2. Only YUV420 initialises the camera successfully, (all the other make zmc crash) but the colours are all wrong (the white become a bright green), and the YUV420P does not seem to be available.

Am I missing something obvious?

v4l-info /dev/video2

### v4l2 device info [/dev/video2] ###
general info
VIDIOC_QUERYCAP
driver : "pwc"
card : "Philips 680 webcam"
bus_info : "usb-0000:00:02.0-3"
version : 10.0.12
capabilities : 0x5000001 [VIDEO_CAPTURE,READWRITE,STREAMING]

standards
VIDIOC_ENUMSTD(0)
index : 0
id : 0x0 []
name : "webcam"
frameperiod.numerator : 0
frameperiod.denominator : 0
framelines : 0

inputs
VIDIOC_ENUMINPUT(0)
index : 0
name : "usb"
type : unknown
audioset : 0
tuner : 0
std : 0x0 []
status : 0x0 []

video capture
VIDIOC_ENUM_FMT(0,VIDEO_CAPTURE)
index : 0
type : VIDEO_CAPTURE
flags : 1
description : "Raw Philips Webcam"
pixelformat : 0x32435750 [PWC2]
VIDIOC_ENUM_FMT(1,VIDEO_CAPTURE)
index : 1
type : VIDEO_CAPTURE
flags : 0
description : "4:2:0, planar, Y-Cb-Cr"
pixelformat : 0x32315559 [YU12]
VIDIOC_G_FMT(VIDEO_CAPTURE)
type : VIDEO_CAPTURE
fmt.pix.width : 352
fmt.pix.height : 288
fmt.pix.pixelformat : 0x32315559 [YU12]
fmt.pix.field : NONE
fmt.pix.bytesperline : 528
fmt.pix.sizeimage : 152064
fmt.pix.colorspace : unknown
fmt.pix.priv : 0

controls
VIDIOC_QUERYCTRL(BASE+0)
id : 9963776
type : INTEGER
name : "Brightness"
minimum : 0
maximum : 128
step : 1
default_value : 64
flags : 0
VIDIOC_QUERYCTRL(BASE+1)
id : 9963777
type : INTEGER
name : "Contrast"
minimum : 0
maximum : 64
step : 1
default_value : 0
flags : 0
VIDIOC_QUERYCTRL(BASE+2)
id : 9963778
type : INTEGER
name : "Saturation"
minimum : -100
maximum : 100
step : 1
default_value : 0
flags : 0
VIDIOC_QUERYCTRL(PRIVATE_BASE+0)
id : 134217728
type : BUTTON
name : "Save User Settings"
minimum : 0
maximum : 0
step : 0
default_value : 0
flags : 0
VIDIOC_QUERYCTRL(PRIVATE_BASE+1)
id : 134217729
type : BUTTON
name : "Restore User Settings"
minimum : 0
maximum : 0
step : 0
default_value : 0
flags : 0
VIDIOC_QUERYCTRL(PRIVATE_BASE+2)
id : 134217730
type : BUTTON
name : "Restore Factory Settings"
minimum : 0
maximum : 0
step : 0
default_value : 0
flags : 0
VIDIOC_QUERYCTRL(PRIVATE_BASE+3)
id : 134217731
type : BOOLEAN
name : "Colour mode"
minimum : 0
maximum : 1
step : 1
default_value : 0
flags : 0
VIDIOC_QUERYCTRL(PRIVATE_BASE+4)
id : 134217732
type : BOOLEAN
name : "Auto contour"
minimum : 0
maximum : 1
step : 1
default_value : 0
flags : 0
VIDIOC_QUERYCTRL(PRIVATE_BASE+5)
id : 134217733
type : INTEGER
name : "Contour"
minimum : 0
maximum : 63
step : 1
default_value : 0
flags : 0
VIDIOC_QUERYCTRL(PRIVATE_BASE+6)
id : 134217734
type : BOOLEAN
name : "Backlight compensation"
minimum : 0
maximum : 1
step : 1
default_value : 0
flags : 0
VIDIOC_QUERYCTRL(PRIVATE_BASE+7)
id : 134217735
type : BOOLEAN
name : "Flickerless"
minimum : 0
maximum : 1
step : 1
default_value : 0
flags : 0
VIDIOC_QUERYCTRL(PRIVATE_BASE+8)
id : 134217736
type : INTEGER
name : "Noise reduction"
minimum : 0
maximum : 3
step : 1
default_value : 0
flags : 0

### video4linux device info [/dev/video2] ###
general info
VIDIOCGCAP
name : "Philips 680 webcam"
type : 0x1 [CAPTURE]
channels : 1
audios : 1
maxwidth : 640
maxheight : 480
minwidth : 128
minheight : 96

channels
VIDIOCGCHAN(0)
channel : 0
name : "Webcam"
tuners : 0
flags : 0x0 []
type : CAMERA
norm : 0

tuner
ioctl VIDIOCGTUNER: Invalid argument

audio
VIDIOCGAUDIO
audio : -1
volume : 0
bass : 0
treble : 0

picture
VIDIOCGPICT
brightness : 32256
hue : 65535
colour : 65535
contrast : 0
whiteness : 0
depth : 24
palette : YUV420P

buffer
VIDIOCGFBUF
base : (nil)
height : 0
width : 0
depth : 0
bytesperline : 0

window
VIDIOCGWIN
x : 0
y : 0
width : 352
height : 288
chromakey : 0
flags : 655360

Posted: Wed May 06, 2009 3:36 pm
by thedayofcondor
Am I the only one experiencing this problem?

This is what I get with v4l 1:

May 6 16:29:06 xxxxxxxx zmc_dvideo0[11842]: INF [Starting Capture]
May 6 16:29:06 xxxxxxxx zmc_dvideo0[11842]: ERR [Capture failure for frame 0: Invalid argument]
May 6 16:29:06 xxxxxxxx zmc_dvideo0[11842]: ERR [Failed to prime capture of initial monitor]
May 6 16:29:06 xxxxxxxx zmdc[22929]: ERR ['zmc -d /dev/video0' exited abnormally, exit status 255]

I am not sure the problem is related to v4l.
With v4l 2 I can connect to the camera, too bad I cannot upload a screenshot. I can recognise the shape of my livingroom, but the colours are all screwed.

Posted: Fri Aug 14, 2009 6:53 am
by cgutierrez
This reply will probably come a few months late; however I have just got my Phillips SPC 900NC USB camera, which uses the pwc driver, to work with Zoneminder 1.24.2.

I used the following settings:

General / Source Type: Local

Source / Device Path: /dev/video0
Source / Capture Method: Video For Linux version 2
Source / Device Channel: 0
Source / Device Format: PAL
Source / Capture Palette: YUV420
Source / Capture Width: 640
Source / Capture Height: 480

As you have all correctly noted, these cameras will only work with the YUV420 palette, but you probably are using NTSC instead of PAL.

There is another setting that is probably important: set compression to zero. However, you can not change this setting via ZoneMinder. I downloaded and compiled setpwc:

http://www.vanheusden.com/setpwc/

I then ran:

setpwc -d /dev/video0 -c 0

Hopefully, this post will help other people to get their pwc-based cameras working.

Posted: Thu Aug 20, 2009 8:32 am
by JakeFinn
I have exactly the same problem with my Philips 740 webcam and ZoneMinder 1.24. The colours are all messed up. I have the correct settings and I also tried to set compression to zero - no luck.

I tried to upload an example example screenshot. Let' see if it works...

Image

As you can clearly see, there is a couch in the screenshot. :) Actually the data is there, but the colours are all wrong.

Any idea how to fix this....?!?

Posted: Fri Sep 25, 2009 8:15 am
by mentopolis
Hello,
the same problem here with a Logitech Quickcam 3000 Pro. Did anyone find a solution for this problem, yet? I would apreciate any help...

Posted: Tue Dec 01, 2009 8:30 am
by acrisp
I'm having this exact same problem!

I have a Logitech Orbit (PWC driver)

Works fine with other webcam/video apps, but all the colours are messed up like the picture posted above with ZoneMinder.

I'm running Fedora Core 11 and 1.24.x

I've read a lot of people posting about this problem and no solutions still!

I also read the problem is not in 1.23.3 and below if that helps.

It has to be a bug in ZoneMinder 1.24.x.

Posted: Tue Dec 01, 2009 10:40 am
by acrisp
This is in my /var/log/messages

Dec 1 20:35:22 chaos zmpkg[407]: INF [Command: start]
Dec 1 20:35:44 chaos zmdc[441]: INF [Server starting at 09/12/01 20:35:44]
Dec 1 20:35:47 chaos zmdc[502]: INF ['zmc -d /dev/video0' started at 09/12/01 20:35:47]
Dec 1 20:35:47 chaos zmdc[441]: INF ['zmc -d /dev/video0' starting at 09/12/01 20:35:47, pid = 502]
Dec 1 20:35:47 chaos zmc_dvideo0[502]: INF [Debug Level = 0, Debug Log = <none>]
Dec 1 20:35:47 chaos zmc_dvideo0[502]: INF [Starting Capture]
Dec 1 20:35:48 chaos zmc_dvideo0[502]: INF [Brightness 2 40]
Dec 1 20:35:48 chaos zmc_dvideo0[502]: ERR [Unable to set brightness: Invalid argument]
Dec 1 20:35:48 chaos zmc_dvideo0[502]: INF [Brightness 3 40]
Dec 1 20:35:48 chaos zmc_dvideo0[502]: WAR [Hue control is not suppported]

funny colours fixed for my cam -Microdia webcam works now!!

Posted: Tue Feb 23, 2010 4:24 pm
by ukripper
I had the similiar problem with colours going all funny and image not appearing. I fixed it by adding LD_PRELOAD environment in zmdc.pl file.

If you on ubuntu 9.10 do following:

Open file â€

Posted: Wed Apr 28, 2010 7:54 am
by user888
I have the same problem with my Philips PCVC740K camera, see this topic.

I can confirm that adding the LD_PRELOAD line doesn't solve the green screen: when using 'Video for Linux v 2' as capture mode it still shows the green screen. When using v 1 it still crashes with 'zmc -d /dev/video0' exited abnormally, exit status 255'

It seems that a YUV420P mode is missing in the palette options when 'Video for Linux v 2' is selected.

Posted: Tue Aug 03, 2010 5:25 pm
by russell_i_brown
BUMP!
user888 wrote:I have the same problem with my Philips PCVC740K camera, see this topic.
I have exactly the same problem here. My PCVC740K worked well under 1.23 but is broken with weird colours on 1.24.2 (I've even tried the svn version and that's also broken).

It still works fine with things like Cheese and XAWTV so it's definately something in Zoneminder that's broken.
user888 wrote:It seems that a YUV420P mode is missing in the palette options when 'Video for Linux v 2' is selected.
Looking at the code, YUV420 is treated as YUV420P for A4l2 in zm_local_camera.cpp. No help I know but it discounts one area.

Does anyone have any clue how to fix this? I can put in debug, compile and run things but I don't know enough, anything!, about video handling to do any sensible debugging myself.

Can anyone point me in the right direction?

Posted: Fri Aug 06, 2010 5:25 pm
by Havokmon
The problem is in src/zm_local_camera.cpp:

case VIDEO_PALETTE_YUV420P :
#ifdef ZM_V4L2
// case V4L2_PIX_FMT_YUV420 :
#endif // ZM_V4L2
{


Notice I remarked out case V4L2_PIX_FMT_YUV420 part. Recompile, and you get garbage.
If you move that case to the next YUV422 section, you get orange instead of green.

case VIDEO_PALETTE_YUV422P :
#ifdef ZM_V4L2
case V4L2_PIX_FMT_YUV422P :
case V4L2_PIX_FMT_YUV420 :
#endif // ZM_V4L2
{

I tried comparing that section of code with 1.23's YUV420P pallete code, but it looks the same to me. I'm not exactly sure what the problem is, but IMHO it's definitely in that section..

What the hell?

Posted: Tue Aug 10, 2010 2:03 am
by Havokmon
Ok, so in an effort to get ANYTHING useful out of the quickcam 3000s I have (both are green, like above example, but my bttv and cheapo dynex work fine) I decided to create an mjpeg screen. I figured since ffmpeg can create video just fine, I can just work around the zm issue.

So I created an ffserver:
<Feed>
#WebCam
File /tmp/feed2.ffm
FileMaxSize 501K
Launch /usr/bin/ffmpeg -f video4linux2 -r 25 -s 320x240 -i /dev/video1 -f oss -i /dev/dsp1
</Feed>

Note, I can create mpg and mjpg just fine with the above line.

<Stream>
Feed feed2.ffm
Format mpjpeg
VideoFrameRate 2
VideoIntraOnly
</Stream>

Then I create a remote source in zm:
host: localhost
port: 8090
path: /feed2.mjpg

Guess what - Same green screen? WTH? I'm confused. Can anyone help us out?

SOLVED

Posted: Tue Oct 26, 2010 9:24 pm
by msmith9xr4
I have the same green issue in 1.24.2 with a creative webcam pro ex and an old logitech orbit usb.

Both work perfectly in v1.22.2 (live CD) and both show green glitch in 1.24

Same condition- cameras only initialize with UV420.

Check this post:

http://www.zoneminder.com/forums/viewtopic.php?p=63649

totally solved using libv4l tweak as described-Not perfect (brightnees weird) but 95% functional. For me both cams work w rgb24 now, I think this workaround broke the broken green images on YUV420