All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* gspca: Logitech QuickCam Messenger worked last with external gspcav1-20071224
@ 2009-05-26 11:44 Guennadi Liakhovetski
  2009-05-26 11:50 ` Hans de Goede
  0 siblings, 1 reply; 5+ messages in thread
From: Guennadi Liakhovetski @ 2009-05-26 11:44 UTC (permalink / raw
  To: Linux Media Mailing List; +Cc: moinejf

Hi all

I think it would be agood time now to get my Logitech QuickCam Messenger 
camera working with the current gspca driver. It used to work with 
gspcav1-20071224, here's dmesg output:

/tmp/gspcav1-20071224/gspca_core.c: USB GSPCA camera found.(ZC3XX)
/tmp/gspcav1-20071224/gspca_core.c: [spca5xx_probe:4275] Camera type JPEG
/tmp/gspcav1-20071224/Vimicro/zc3xx.h: [zc3xx_config:669] Find Sensor HV7131R(c)

with more USB related messages following. Now dmesg with some debug turned 
on looks like

gspca: probing 046d:08da
zc3xx: probe 2wr ov vga 0x0000
zc3xx: probe sensor -> 11
zc3xx: Find Sensor HV7131R(c)
gspca: probe ok
usbcore: registered new interface driver zc3xx
zc3xx: registered

and the camera is not working, the light on its case doesn't go on. If I 
try "force_sensor=15" to match sensor tas5130cxx, as was detected by the 
old driver, dmesg reports

gspca: probing 046d:08da
zc3xx: probe 2wr ov vga 0x0000
zc3xx: probe sensor -> 11
zc3xx: sensor forced to 15
gspca: probe ok
usbcore: registered new interface driver zc3xx
zc3xx: registered

and otherwise nothing changes. I could spend some time trying to find the 
problem, but I would prefer if someone could suggest some debugging, I am 
not familiar with gspca internals. Ideas anyone?

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: gspca: Logitech QuickCam Messenger worked last with external gspcav1-20071224
  2009-05-26 11:44 gspca: Logitech QuickCam Messenger worked last with external gspcav1-20071224 Guennadi Liakhovetski
@ 2009-05-26 11:50 ` Hans de Goede
  2009-05-26 12:08   ` Guennadi Liakhovetski
  0 siblings, 1 reply; 5+ messages in thread
From: Hans de Goede @ 2009-05-26 11:50 UTC (permalink / raw
  To: Guennadi Liakhovetski; +Cc: Linux Media Mailing List, moinejf



On 05/26/2009 01:44 PM, Guennadi Liakhovetski wrote:
> Hi all
>
> I think it would be agood time now to get my Logitech QuickCam Messenger
> camera working with the current gspca driver. It used to work with
> gspcav1-20071224, here's dmesg output:
>
> /tmp/gspcav1-20071224/gspca_core.c: USB GSPCA camera found.(ZC3XX)
> /tmp/gspcav1-20071224/gspca_core.c: [spca5xx_probe:4275] Camera type JPEG
> /tmp/gspcav1-20071224/Vimicro/zc3xx.h: [zc3xx_config:669] Find Sensor HV7131R(c)
>
> with more USB related messages following. Now dmesg with some debug turned
> on looks like
>
> gspca: probing 046d:08da
> zc3xx: probe 2wr ov vga 0x0000
> zc3xx: probe sensor ->  11
> zc3xx: Find Sensor HV7131R(c)
> gspca: probe ok
> usbcore: registered new interface driver zc3xx
> zc3xx: registered
>
> and the camera is not working, the light on its case doesn't go on. If I
> try "force_sensor=15" to match sensor tas5130cxx, as was detected by the
> old driver, dmesg reports
>
> gspca: probing 046d:08da
> zc3xx: probe 2wr ov vga 0x0000
> zc3xx: probe sensor ->  11
> zc3xx: sensor forced to 15
> gspca: probe ok
> usbcore: registered new interface driver zc3xx
> zc3xx: registered
>
> and otherwise nothing changes. I could spend some time trying to find the
> problem, but I would prefer if someone could suggest some debugging, I am
> not familiar with gspca internals. Ideas anyone?
>

First of all, which app are you using to test the cam ? And are you using that
app in combination with libv4l ?

Also why do you say the original driver used to identify it as a tas5130cxx,
the dmesg lines you pasted from gspcav1 also say it is a HV7131R

Regards,

Hans

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: gspca: Logitech QuickCam Messenger worked last with external gspcav1-20071224
  2009-05-26 11:50 ` Hans de Goede
@ 2009-05-26 12:08   ` Guennadi Liakhovetski
  2009-05-26 12:27     ` Hans de Goede
  0 siblings, 1 reply; 5+ messages in thread
From: Guennadi Liakhovetski @ 2009-05-26 12:08 UTC (permalink / raw
  To: Hans de Goede; +Cc: Linux Media Mailing List, moinejf

On Tue, 26 May 2009, Hans de Goede wrote:

> First of all, which app are you using to test the cam ? And are you using that
> app in combination with libv4l ?

xawtv, no, it doesn't use libv4l, but it works with the old 
gspcav1-20071224. Ok, maybe it used a different v4l version, but I have 
v4l1_compat loaded.

> Also why do you say the original driver used to identify it as a tas5130cxx,
> the dmesg lines you pasted from gspcav1 also say it is a HV7131R

In the old sources you see

	switch (vendor) {
	...
	case 0x046d:		/* Logitech Labtec */
	...
		switch (product) {
		...
		case 0x08da:
			spca50x->desc = QCmessenger;
			spca50x->bridge = BRIDGE_ZC3XX;
			spca50x->sensor = SENSOR_TAS5130CXX;
			break;

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: gspca: Logitech QuickCam Messenger worked last with external gspcav1-20071224
  2009-05-26 12:08   ` Guennadi Liakhovetski
@ 2009-05-26 12:27     ` Hans de Goede
  2009-05-26 12:58       ` Guennadi Liakhovetski
  0 siblings, 1 reply; 5+ messages in thread
From: Hans de Goede @ 2009-05-26 12:27 UTC (permalink / raw
  To: Guennadi Liakhovetski; +Cc: Linux Media Mailing List, moinejf

[-- Attachment #1: Type: text/plain, Size: 1300 bytes --]



On 05/26/2009 02:08 PM, Guennadi Liakhovetski wrote:
> On Tue, 26 May 2009, Hans de Goede wrote:
>
>> First of all, which app are you using to test the cam ? And are you using that
>> app in combination with libv4l ?
>
> xawtv, no, it doesn't use libv4l, but it works with the old
> gspcav1-20071224. Ok, maybe it used a different v4l version, but I have
> v4l1_compat loaded.
>

xawtv has known bugs making it not work with gspca (or many other
properly implemented v4l drivers that is). Now those bugs are fixed in
some distro's but this might very well be the cause. Try using ekiga
(together with LD_PRELOAD=..../v4l1compat.so)

>> Also why do you say the original driver used to identify it as a tas5130cxx,
>> the dmesg lines you pasted from gspcav1 also say it is a HV7131R
>
> In the old sources you see
>
> 	switch (vendor) {
> 	...
> 	case 0x046d:		/* Logitech Labtec */
> 	...
> 		switch (product) {
> 		...
> 		case 0x08da:
> 			spca50x->desc = QCmessenger;
> 			spca50x->bridge = BRIDGE_ZC3XX;
> 			spca50x->sensor = SENSOR_TAS5130CXX;
> 			break;
>

Hmm, weird it still prints that other message then. Anyways please
try with another application both with and without the force_sensor
parameter.

Regards,

Hans

p.s.

I've attached a patch to xawtv which I use in Fedora's packages.

[-- Attachment #2: xawtv-3.95-fixes.patch --]
[-- Type: text/plain, Size: 2626 bytes --]

diff -Nrbu xawtv-3.95/libng/plugins/drv0-v4l2.c xawtv-3.95-OK/libng/plugins/drv0-v4l2.c
--- xawtv-3.95/libng/plugins/drv0-v4l2.c	2005-02-11 20:56:24.000000000 +0300
+++ xawtv-3.95-OK/libng/plugins/drv0-v4l2.c	2008-08-26 19:27:18.000000000 +0400
@@ -91,6 +91,7 @@
     struct ng_video_fmt            fmt_me;
     struct v4l2_requestbuffers     reqbufs;
     struct v4l2_buffer             buf_v4l2[WANTED_BUFFERS];
+    int                            buf_v4l2_size[WANTED_BUFFERS];
     struct ng_video_buf            buf_me[WANTED_BUFFERS];
     unsigned int                   queue,waiton;
 
@@ -166,7 +167,7 @@
     int rc;
 
     rc = ioctl(fd,cmd,arg);
-    if (0 == rc && ng_debug < 2)
+    if (rc >= 0 && ng_debug < 2)
 	return rc;
     if (mayfail && errno == mayfail && ng_debug < 2)
 	return rc;
@@ -768,6 +769,7 @@
     /* get it */
     memset(&buf,0,sizeof(buf));
     buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+    buf.memory = V4L2_MEMORY_MMAP;
     if (-1 == xioctl(h->fd,VIDIOC_DQBUF,&buf, 0))
 	return -1;
     h->waiton++;
@@ -812,6 +814,7 @@
 	h->buf_v4l2[i].memory = V4L2_MEMORY_MMAP;
 	if (-1 == xioctl(h->fd, VIDIOC_QUERYBUF, &h->buf_v4l2[i], 0))
 	    return -1;
+	h->buf_v4l2_size[i] = h->buf_v4l2[i].length;
 	h->buf_me[i].fmt  = h->fmt_me;
 	h->buf_me[i].size = h->buf_me[i].fmt.bytesperline *
 	    h->buf_me[i].fmt.height;
@@ -865,12 +868,16 @@
 	    ng_waiton_video_buf(&h->buf_me[i]);
 	if (ng_debug)
 	    print_bufinfo(&h->buf_v4l2[i]);
-	if (-1 == munmap(h->buf_me[i].data,h->buf_me[i].size))
+	if (-1 == munmap(h->buf_me[i].data, h->buf_v4l2_size[i]))
 	    perror("munmap");
     }
     h->queue = 0;
     h->waiton = 0;
 
+    /* unrequest buffers (only needed for some drivers) */
+    h->reqbufs.count = 0;
+    xioctl(h->fd, VIDIOC_REQBUFS, &h->reqbufs, EINVAL); 
+
     /* turn on preview (if needed) */
     if (h->ov_on != h->ov_enabled) {
 	h->ov_on = h->ov_enabled;
@@ -907,6 +914,17 @@
     fmt->width        = h->fmt_v4l2.fmt.pix.width;
     fmt->height       = h->fmt_v4l2.fmt.pix.height;
     fmt->bytesperline = h->fmt_v4l2.fmt.pix.bytesperline;
+    /* struct v4l2_format.fmt.pix.bytesperline is bytesperline for the
+       main plane for planar formats, where as we want it to be the total 
+       bytesperline for all planes */
+    switch (fmt->fmtid) {
+        case VIDEO_YUV422P:
+          fmt->bytesperline *= 2;
+          break;
+        case VIDEO_YUV420P:
+          fmt->bytesperline = fmt->bytesperline * 3 / 2;
+          break;
+    }
     if (0 == fmt->bytesperline)
 	fmt->bytesperline = fmt->width * ng_vfmt_to_depth[fmt->fmtid] / 8;
     h->fmt_me = *fmt;

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: gspca: Logitech QuickCam Messenger worked last with external gspcav1-20071224
  2009-05-26 12:27     ` Hans de Goede
@ 2009-05-26 12:58       ` Guennadi Liakhovetski
  0 siblings, 0 replies; 5+ messages in thread
From: Guennadi Liakhovetski @ 2009-05-26 12:58 UTC (permalink / raw
  To: Hans de Goede; +Cc: Linux Media Mailing List, moinejf

On Tue, 26 May 2009, Hans de Goede wrote:

> 
> 
> On 05/26/2009 02:08 PM, Guennadi Liakhovetski wrote:
> > On Tue, 26 May 2009, Hans de Goede wrote:
> > 
> > > First of all, which app are you using to test the cam ? And are you using
> > > that
> > > app in combination with libv4l ?
> > 
> > xawtv, no, it doesn't use libv4l, but it works with the old
> > gspcav1-20071224. Ok, maybe it used a different v4l version, but I have
> > v4l1_compat loaded.
> > 
> 
> xawtv has known bugs making it not work with gspca (or many other
> properly implemented v4l drivers that is). Now those bugs are fixed in
> some distro's but this might very well be the cause. Try using ekiga
> (together with LD_PRELOAD=..../v4l1compat.so)

Coooooool! Loading the driver without parameters and using

LD_LIBRARY_PATH="v4l2-apps/libv4l/libv4l1/:v4l2-apps/libv4l/libv4l2/:v4l2-apps/libv4l/libv4lconvert/" \
LD_PRELOAD=v4l2-apps/libv4l/libv4l1/v4l1compat.so mplayer tv:// -tv \
driver=v4l:device=/dev/video0 -vo x11

started the video! Thanks a million, Hans!

Cheers
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-05-26 12:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-26 11:44 gspca: Logitech QuickCam Messenger worked last with external gspcav1-20071224 Guennadi Liakhovetski
2009-05-26 11:50 ` Hans de Goede
2009-05-26 12:08   ` Guennadi Liakhovetski
2009-05-26 12:27     ` Hans de Goede
2009-05-26 12:58       ` Guennadi Liakhovetski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.