Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 Apr 2010 04:30:15 GMT
From:      Henry Hu <henry.hu.sh@gmail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/145770: [patch] multimedia/gstreamer-plugins-v4l2 says Device not configured
Message-ID:  <201004170430.o3H4UFjQ013469@www.freebsd.org>
Resent-Message-ID: <201004170440.o3H4e1HS017719@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         145770
>Category:       ports
>Synopsis:       [patch] multimedia/gstreamer-plugins-v4l2 says Device not configured
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Apr 17 04:40:01 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Henry Hu
>Release:        FreeBSD 8.0-STABLE
>Organization:
Tsinghua University, Beijing, China
>Environment:
FreeBSD henryhu9.net9.org 8.0-STABLE FreeBSD 8.0-STABLE #2: Sat Apr 10 22:11:13 CST 2010     root@henryhu9.net9.org:/usr/obj/usr/src/sys/MYKERNEL  i386

>Description:
After installing multimedia/gstreamer-plugins-v4l2, I still cannot use my webcam in programs such as emesene (SVN version).
With a simple test program, I found that v4l2 plugins failed to enumerate inputs, and says "Device not configured".
Later I found that the v4l2 layer returns EINVAL in linux, but returns ENXIO in freebsd, and the v4l2 plugin did not expect ENXIO.
So I changed the references to EINVAL in v4l2_calls.c to ENXIO, and the webcam works.
Maybe it's better to change the return code of the v4l2 layer in freebsd, so other programs would not bother from this problem.
>How-To-Repeat:
1. Install webcamd, video4bsd-kmod, and other v4l2 related things
2. Install gstreamer-plugins-v4l2
3. Try the following program, or test with emesene SVN version, or with pidgin.
http://giss.tv/wiki/index.php/Streaming_Tools#GStreamer_2
However, since the 320x240 mode does not work here, I changed it to 640x480.
>Fix:
see the patch below.

Patch attached with submission follows:

--- sys/v4l2/v4l2_calls.c.bak	2010-02-24 18:42:07.000000000 +0800
+++ sys/v4l2/v4l2_calls.c	2010-04-17 12:05:30.000000000 +0800
@@ -129,7 +129,7 @@
 
     input.index = n;
     if (v4l2_ioctl (v4l2object->video_fd, VIDIOC_ENUMINPUT, &input) < 0) {
-      if (errno == EINVAL)
+      if (errno == EINVAL || errno == ENXIO)
         break;                  /* end of enumeration */
       else {
         GST_ELEMENT_ERROR (e, RESOURCE, SETTINGS,
@@ -203,7 +203,7 @@
     standard.index = n;
 
     if (v4l2_ioctl (v4l2object->video_fd, VIDIOC_ENUMSTD, &standard) < 0) {
-      if (errno == EINVAL || errno == ENOTTY)
+      if (errno == EINVAL || errno == ENOTTY || errno == ENXIO)
         break;                  /* end of enumeration */
       else {
         GST_ELEMENT_ERROR (e, RESOURCE, SETTINGS,
@@ -247,7 +247,7 @@
 
     control.id = n;
     if (v4l2_ioctl (v4l2object->video_fd, VIDIOC_QUERYCTRL, &control) < 0) {
-      if (errno == EINVAL) {
+      if (errno == EINVAL || errno == ENXIO) {
         if (n < V4L2_CID_PRIVATE_BASE) {
           GST_DEBUG_OBJECT (e, "skipping control %08x", n);
           /* continue so that we also check private controls */


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201004170430.o3H4UFjQ013469>