From owner-freebsd-ports-bugs@FreeBSD.ORG Sat Apr 17 04:40:01 2010 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ABBE81065670 for ; Sat, 17 Apr 2010 04:40:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 6E02B8FC27 for ; Sat, 17 Apr 2010 04:40:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o3H4e15g017720 for ; Sat, 17 Apr 2010 04:40:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o3H4e1HS017719; Sat, 17 Apr 2010 04:40:01 GMT (envelope-from gnats) Resent-Date: Sat, 17 Apr 2010 04:40:01 GMT Resent-Message-Id: <201004170440.o3H4e1HS017719@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Henry Hu Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 198F31065672 for ; Sat, 17 Apr 2010 04:30:16 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id E24A18FC0C for ; Sat, 17 Apr 2010 04:30:15 +0000 (UTC) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o3H4UFLB013470 for ; Sat, 17 Apr 2010 04:30:15 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id o3H4UFjQ013469; Sat, 17 Apr 2010 04:30:15 GMT (envelope-from nobody) Message-Id: <201004170430.o3H4UFjQ013469@www.freebsd.org> Date: Sat, 17 Apr 2010 04:30:15 GMT From: Henry Hu To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: ports/145770: [patch] multimedia/gstreamer-plugins-v4l2 says Device not configured X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Apr 2010 04:40:01 -0000 >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: