Bug 492233

Summary: Bad data from Pixart based camera in zoneminder
Product: [Fedora] Fedora Reporter: Matt Hirsch <matthew.hirsch>
Component: zoneminderAssignee: Martin Ebourne <fedora>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 10CC: fedora, j
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-11-18 16:21:47 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Matt Hirsch 2009-03-26 02:13:37 UTC
Description of problem:

When I attempt to add my pixart based webcam as a source in zoneminder, the window is either black or shows garbage data.

Version-Release number of selected component (if applicable):

zoneminder-1.23.3-2.fc10.x86_64

How reproducible:

Always

Steps to Reproduce:
1. Attach camera (gspca drivers are automatically loaded, /dev/video0 devnode created)
2. Start mysqld, httpd, and zoneminder services
3. Correctly setup zoneminder sql database (run /usr/share/zoneminder/db/zm_create.sql) and configure mysql permissions and /etc/zm.conf for access
4. Open localhost/zm and Add New Monitor
5. Select a local source under the general tab, and configure the format, palette and image dimensions under source tab.
6. Save.
7. View new source (click on its name).
  
Actual results:

A black window or a window showing colored bands of random noise

Expected results:

Should see video

Additional info:

These packages are also relevant:

kernel-2.6.27.19-170.2.35.fc10.x86_64
mysql-server-5.0.77-1.fc10.x86_64
httpd-2.2.11-2.fc10.x86_64

The camera uses the gspca pac7311 driver:
$ lsmod | grep gspca
gspca_pac7311          21888  0 
gspca_main             29184  1 gspca_pac7311
compat_ioctl32         16512  1 gspca_main
videodev               40704  2 gspca_main,compat_ioctl32

The camera:
$ lsusb 
Bus 001 Device 011: ID 093a:2601 Pixart Imaging, Inc. SPC 610NC Laptop Camera

The camera works in cheese, from which I extracted this gstreamer command, which also works:

gst-launch v4l2src name=video_source device=/dev/video0 ! video/x-raw-yuv,width=320,height=240,framerate=30/1 ! autovideosink

Here's the v4l-info output:
$ v4l-info 

### v4l2 device info [/dev/video0] ###
general info
    VIDIOC_QUERYCAP
	driver                  : "pac7311"
	card                    : "VGA Single Chip"
	bus_info                : "0000:00:1d.7"
	version                 : 2.2.0
	capabilities            : 0x5000001 [VIDEO_CAPTURE,READWRITE,STREAMING]

standards

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

video capture
    VIDIOC_ENUM_FMT(0,VIDEO_CAPTURE)
	index                   : 0
	type                    : VIDEO_CAPTURE
	flags                   : 0
	description             : "PJPG"
	pixelformat             : 0x47504a50 [PJPG]
    VIDIOC_G_FMT(VIDEO_CAPTURE)
	type                    : VIDEO_CAPTURE
	fmt.pix.width           : 320
	fmt.pix.height          : 240
	fmt.pix.pixelformat     : 0x47504a50 [PJPG]
	fmt.pix.field           : NONE
	fmt.pix.bytesperline    : 320
	fmt.pix.sizeimage       : 29390
	fmt.pix.colorspace      : JPEG
	fmt.pix.priv            : 1

controls
    VIDIOC_QUERYCTRL(BASE+1)
	id                      : 9963777
	type                    : INTEGER
	name                    : "Contrast"
	minimum                 : 0
	maximum                 : 255
	step                    : 1
	default_value           : 127
	flags                   : 0

### video4linux device info [/dev/video0] ###
general info
    VIDIOCGCAP
	name                    : "VGA Single Chip"
	type                    : 0x1 [CAPTURE]
	channels                : 1
	audios                  : 0
	maxwidth                : 640
	maxheight               : 480
	minwidth                : 48
	minheight               : 32

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

tuner
ioctl VIDIOCGTUNER: Invalid argument

audio
ioctl VIDIOCGAUDIO: Invalid argument

picture
    VIDIOCGPICT
	brightness              : 0
	hue                     : 0
	colour                  : 0
	contrast                : 32639
	whiteness               : 0
	depth                   : 8
	palette                 : unknown

buffer
ioctl VIDIOCGFBUF: Invalid argument

window
    VIDIOCGWIN
	x                       : 0
	y                       : 0
	width                   : 320
	height                  : 240
	chromakey               : 0
	flags                   : 0


I unloaded the driver and reloaded it with:
# modprobe gspca_main debug=0x08
# modprobe gspca_pac7311

To see stream debugging information (from dmesg):

gspca: init transfer alt 8
gspca: use ISOC alt 7 ep 0x85
gspca: isoc 32 pkts size 896 (bsize:28672)
gspca: stream on OK PJPG 320x240
gspca: stream on OK PJPG 320x240
gspca: stream on OK PJPG 320x240
gspca: stream on OK PJPG 320x240
gspca: zmc close
gspca: kill transfer
gspca: stream off OK
gspca: frame free
gspca: close done

Seems like zoneminder closes the stream right away.

I also see lots of:
gspca: usb_submit_urb [0] err -28

I think the problem is that zoneminder does not support PJPG format. I have tried with each of the formats (palettes) offered by zoneminder, with no luck.

Thanks. Let me know if more info is needed.

Comment 1 Martin Ebourne 2009-04-11 01:50:34 UTC
ZoneMinder has been upgraded to 1.24.1 for Fedora 11. Please test again with this new version to see if the video is still black. Your options include:
1. Use rawhide now
2. Wait for the Fedora 11 preview release on 28th April
3. Wait for the Fedora 11 final release on 26th May
After testing if the issue still persists then please take it upstream to the forums on zoneminder.org. (Upstream does not have a bug tracker.) Unfortunately the Fedora project only has the resources to package ZoneMinder, not develop new features and fix bugs (unless they are Fedora specific).

Comment 2 Bug Zapper 2009-11-18 11:36:37 UTC
This message is a reminder that Fedora 10 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 10.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '10'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 10's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 10 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 3 Jason Tibbitts 2009-11-18 16:21:47 UTC
Ah, the uselessness of automated bug resolution messages.

This was fixed; we were just waiting for testing which never came.