public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Stefano Sabatini <stefano.sabatini-lala@poste.it>
To: video4linux-list Mailing List <video4linux-list@redhat.com>
Subject: Re: gspca, linux 2.6.26 and ioctl(VIDIOC_QUERYCAP) returning -1, what's wrong?
Date: Wed, 24 Dec 2008 18:40:30 +0100	[thread overview]
Message-ID: <20081224174030.GC31194@geppetto> (raw)
In-Reply-To: <1230137224.1700.10.camel@localhost>

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

      reply	other threads:[~2008-12-24 17:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081224174030.GC31194@geppetto \
    --to=stefano.sabatini-lala@poste.it \
    --cc=video4linux-list@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox