All of lore.kernel.org
 help / color / mirror / Atom feed
* gspca, linux 2.6.26 and ioctl(VIDIOC_QUERYCAP) returning -1, what's wrong?
@ 2008-12-24 16:00 Stefano Sabatini
  2008-12-24 16:47 ` Jean-Francois Moine
  0 siblings, 1 reply; 3+ messages in thread
From: Stefano Sabatini @ 2008-12-24 16:00 UTC (permalink / raw)
  To: video4linux-list Mailing List

Hi all,

I'm using linux 2.6.26 and the Debian gspca module, and I'm getting
ioctl(VIDIOC_QUERYCAP) return -1 after the device is opened.

Do you have any hint to share?

Here there are some relevant informations:

stefano@geppetto ~/s/ffmpeg> uname -a
Linux geppetto 2.6.26-1-686 #1 SMP Sat Oct 18 16:22:25 UTC 2008 i686 GNU/Linux
stefano@geppetto ~/s/ffmpeg> sudo modinfo gspca 
filename:       /lib/modules/2.6.26-1-686/kernel/drivers/usb/media/gspca.ko
author:         Michel Xhaard <mxhaard@users.sourceforge.net> based on spca50x driver by Joel Crisp <cydergoth@users.sourceforge.net>,ov511 driver by Mark McClelland <mwm@i.am>
description:    GSPCA/SPCA5XX USB Camera Driver
license:        GPL
vermagic:       2.6.26-1-686 SMP mod_unload modversions 686 
depends:        usbcore,videodev
alias:          usb:v093Ap2463d*dc*dsc*dp*ic*isc*ip*
[...]
parm:           force_gamma_id:Forced assigning ID of contrast settings (0=default,1,2,3) Zc03xx only (int)
parm:           force_sensor_id:Forced assigning ID sensor (Zc03xx only). Dangerous, only for experts !!! (int)
parm:           lightfreq:Light frequency banding filter. Set to 50 or 60 Hz, or 0 for NoFlicker (default=50) Zc03xx only (int)
parm:           usbgrabber:Is a usb grabber 0x0733:0x0430 ? (default 1)  (int)
parm:           compress:Turn on/off compression (not functional yet) (int)
parm:           GGreen:Gain Green setting range 0 to 512 /256  (int)
parm:           GBlue:Gain Blue setting range 0 to 512 /256  (int)
parm:           GRed:Gain Red setting range 0 to 512 /256  (int)
parm:           OffGreen:OffGreen setting range -128 to 128 (int)
parm:           OffBlue:OffBlue setting range -128 to 128 (int)
parm:           OffRed:OffRed setting range -128 to 128 (int)
parm:           gamma:gamma setting range 0 to 7 3-> gamma=1 (int)
parm:           force_rgb:Read RGB instead of BGR (int)
parm:           debug:Debug level: 0=none, 1=init/detection, 2=warning, 3=config/control, 4=function call, 5=max (int)
parm:           autoexpo:Enable/Disable auto exposure (default=1: enabled) (PC-CAM 600/Zc03xx/spca561a/Etoms Only !!!) (int)

stefano@geppetto ~/s/ffmpeg> dmesg
[...]
[38586.942147] Linux video capture interface: v2.00
[38586.945359] gspca: USB GSPCA camera found.(ZC3XX) 
[38586.945359] gspca: [spca5xx_probe:4275] Camera type JPEG 
[38587.582486] gspca: [zc3xx_config:669] Find Sensor HV7131R(c)
[38587.586948] gspca: [spca5xx_getcapability:1249] maxw 640 maxh 480 minw 160 minh 120
[38587.586948] usbcore: registered new interface driver gspca
[38587.586948] gspca: gspca driver 01.00.20 registered
[38611.561635] gspca: [spca5xx_set_light_freq:1932] Sensor currently not support light frequency banding filters.
[38611.561740] gspca: [gspca_set_isoc_ep:945] ISO EndPoint found 0x81 AlternateSet 7
[38627.563632] gspca: [spca5xx_set_light_freq:1932] Sensor currently not support light frequency banding filters.
[38627.563726] gspca: [gspca_set_isoc_ep:945] ISO EndPoint found 0x81 AlternateSet 7
[38629.217385] gspca: [spca5xx_do_ioctl:2124] Bridge ZC301-2 
[38634.087208] gspca: [spca5xx_set_light_freq:1932] Sensor currently not support light frequency banding filters.
[38634.087208] gspca: [gspca_set_isoc_ep:945] ISO EndPoint found 0x81 AlternateSet 7

The failing application is ffplay (ffplay -s 320x240 -f video4linux2
/dev/video0) if that matters.

Regards.

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

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

* Re: gspca, linux 2.6.26 and ioctl(VIDIOC_QUERYCAP) returning -1, what's wrong?
  2008-12-24 16:00 gspca, linux 2.6.26 and ioctl(VIDIOC_QUERYCAP) returning -1, what's wrong? Stefano Sabatini
@ 2008-12-24 16:47 ` Jean-Francois Moine
  2008-12-24 17:40   ` Stefano Sabatini
  0 siblings, 1 reply; 3+ messages in thread
From: Jean-Francois Moine @ 2008-12-24 16:47 UTC (permalink / raw)
  To: Stefano Sabatini; +Cc: video4linux-list Mailing List

On Wed, 2008-12-24 at 17:00 +0100, Stefano Sabatini wrote:
> Hi all,

Hi Stefano,

> I'm using linux 2.6.26 and the Debian gspca module, and I'm getting
> ioctl(VIDIOC_QUERYCAP) return -1 after the device is opened.
	[snip]
> stefano@geppetto ~/s/ffmpeg> sudo modinfo gspca 
> filename:       /lib/modules/2.6.26-1-686/kernel/drivers/usb/media/gspca.ko
> author:         Michel Xhaard <mxhaard@users.sourceforge.net> based on spca50x driver by Joel Crisp <cydergoth@users.sourceforge.net>,ov511 driver by Mark McClelland <mwm@i.am>
> description:    GSPCA/SPCA5XX USB Camera Driver
	[snip]

You use the gspca version 1. This one is obsoleted by the gspca v2 which
is included in the latest linux kernels (>= 2.6.27). You should try the
stable or development versions at LinuxTv.org. Look at my page (see
below) for more information.

Regards.

-- 
Ken ar c'hentañ |             ** Breizh ha Linux atav! **
Jef             |               http://moinejf.free.fr/


--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

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

* Re: gspca, linux 2.6.26 and ioctl(VIDIOC_QUERYCAP) returning -1, what's wrong?
  2008-12-24 16:47 ` Jean-Francois Moine
@ 2008-12-24 17:40   ` Stefano Sabatini
  0 siblings, 0 replies; 3+ messages in thread
From: Stefano Sabatini @ 2008-12-24 17:40 UTC (permalink / raw)
  To: video4linux-list Mailing List

On date Wednesday 2008-12-24 17:47:04 +0100, Jean-Francois Moine wrote:
> On Wed, 2008-12-24 at 17:00 +0100, Stefano Sabatini wrote:
> > Hi all,
> 
> Hi Stefano,
> 
> > I'm using linux 2.6.26 and the Debian gspca module, and I'm getting
> > ioctl(VIDIOC_QUERYCAP) return -1 after the device is opened.
> 	[snip]
> > stefano@geppetto ~/s/ffmpeg> sudo modinfo gspca 
> > filename:       /lib/modules/2.6.26-1-686/kernel/drivers/usb/media/gspca.ko
> > author:         Michel Xhaard <mxhaard@users.sourceforge.net> based on spca50x driver by Joel Crisp <cydergoth@users.sourceforge.net>,ov511 driver by Mark McClelland <mwm@i.am>
> > description:    GSPCA/SPCA5XX USB Camera Driver
> 	[snip]
> 
> You use the gspca version 1. This one is obsoleted by the gspca v2 which
> is included in the latest linux kernels (>= 2.6.27). You should try the
> stable or development versions at LinuxTv.org. Look at my page (see
> below) for more information.

Many thanks Jean-Francois,

indeed it was what I suspected, but the line I found in dmesg was misleading:

[38586.942147] Linux video capture interface: v2.00

BTW, would be possible to get a more informative error message from
the module (either in the kernel log either in the strerror string)?,
also I expected to get a different ioctl() code in that case (namely
ENOIOCTLCMD).

Check for example the code in libavdevice/v4l2.c of FFmpeg:

    res = ioctl(fd, VIDIOC_QUERYCAP, &cap);
    // ENOIOCTLCMD definition only availble on __KERNEL__
    if (res < 0 && errno == 515) {
        av_log(ctx, AV_LOG_ERROR, "QUERYCAP not implemented, probably V4L device but not supporting V4L2\n");
        close(fd);

        return -1;
    }
    if (res < 0) {
        av_log(ctx, AV_LOG_ERROR, "ioctl(VIDIOC_QUERYCAP): %s\n",
                 strerror(errno));
        close(fd);

        return -1;
    }

This is supposed to nicely warn the user if the device doesn't support
V4L2.

Is this a problem with V4L* or is the ENOIOCTLCMD assumption wrong?

Again thanks in advance.

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

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

end of thread, other threads:[~2008-12-24 17:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-24 16:00 gspca, linux 2.6.26 and ioctl(VIDIOC_QUERYCAP) returning -1, what's wrong? Stefano Sabatini
2008-12-24 16:47 ` Jean-Francois Moine
2008-12-24 17:40   ` Stefano Sabatini

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.