From owner-freebsd-current@FreeBSD.ORG Sat May 19 21:24:49 2007 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7DD1016A41F for ; Sat, 19 May 2007 21:24:49 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe12.swip.net [212.247.155.97]) by mx1.freebsd.org (Postfix) with ESMTP id E0F4813C457 for ; Sat, 19 May 2007 21:24:48 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] Received: from [193.217.102.48] (account mc467741@c2i.net HELO [10.0.0.249]) by mailfe12.swip.net (CommuniGate Pro SMTP 5.1.7) with ESMTPA id 322986463; Sat, 19 May 2007 23:24:46 +0200 From: Hans Petter Selasky To: freebsd-current@freebsd.org User-Agent: KMail/1.9.5 References: <200705191730.06964.hselasky@c2i.net> <20070519121417.A37468@xorpc.icir.org> In-Reply-To: <20070519121417.A37468@xorpc.icir.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200705192324.34663.hselasky@c2i.net> Cc: Luigi Rizzo Subject: Re: Video4Linux header files X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Sat, 19 May 2007 21:24:49 -0000 X-Original-Date: Sat, 19 May 2007 23:24:34 +0200 X-List-Received-Date: Sat, 19 May 2007 21:24:49 -0000 On Saturday 19 May 2007 21:14, Luigi Rizzo wrote: > On Sat, May 19, 2007 at 05:30:06PM +0200, Hans Petter Selasky wrote: > > Hi, > > > > The Video4Linux header files are dual BSD/GNU licensed! How nice! I want > > to put these into the kernel source tree. For example under > > /usr/src/sys/sys . > > > > The reason is that I want to implement a slightly modified version of the > > V4L so that I can have a well known Linux USB Webcam driver working on my > > FreeBSD using my new USB stack. > > > > Does anyone here have any comments on this ? > > the short answer is that in the short term you better rely on a port > e.g. v4lcompat > Ok. > The long answer is this: > There was a long discussion back in january about importing the > headers, and in the end the discussion somewhat stalled due to far > too many intertwined issues and the existence of a partial workaround > in ports/v4lcompat. > > As i recall/see it the problems were the following: > - licensing (at the time it was unclear; now this is solved); > - many v4l*-related programs are broken in various ways, typically > assuming that the existence of the v4l2 headers guarantees that the > OS supports the v4l2 api, so the program doesn't even try to check/use > v4l1 or something else at runtime. > At the moment, several of these ports get away with the problem by > ignoring it or removing v4l* support. Adding the headers in the base > system (which by itself is a desirable goal) requires working with > the maintainers to fix the build on the various os versions > (being ports not versioned, this could be slightly tricky). > - having v4l2 support makes no good to anyone now, since there is > no v4l2 driver available, and many linux v4l2 drivers use > USB2-isochronous transfers which are not supported on the current usb > stack; > - i don't know how problematic is this, but v4l2 headers seem to use > unnamed unions which, last time i tried, conflict with the compiler > setting used to build the kernel. While this is possibly an orthogonal > problem which we may have to address at some point (as unnamed unions > seem to be a common paradigm in linux headers), it is yet another hurdle. Unnamed unions are not so good. I suggest that we terminate unnamed unions with an "u". > > I suppose a suitable plan would be the following, but i have not had > the time to work on it: > > 1. add a v4lcompat build-dependency on the ports potentially affected, > making sure they still build correctly using v4l1 > 2. add v4l1 headers in the base system (possibly changing the v4lcompat > port to not install the headers if they are already in the base system); I want to put a V4L2.0 "videodev.h" under /usr/src/sys/sys/ with some modifications. What do you think about that? > 3. modify the vl4compat port to add the v4l2 headers, again fixing > any breakage in the builds > 4. as in step 2, add the v4l2 headers to the system, changing v4lcompat > as needed where the v4l* headers are in the base OS > Does anyone know which ports use the current Linux compat layer port and the v4lcompat port ? I think it is smarter to look forward. I'm going for V4L2.0 support in the FreeBSD kernel with some modifications. It looks much more coherent than the V4L1.0 support. --HPS PS: The Linux compat port is broken on FreeBSD-current, because "msleep" is being re-defined.