From owner-freebsd-current@FreeBSD.ORG Tue Jan 19 17:56:14 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BCE76106568F; Tue, 19 Jan 2010 17:56:14 +0000 (UTC) (envelope-from henry.hu.sh@gmail.com) Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.24]) by mx1.freebsd.org (Postfix) with ESMTP id 5D2CE8FC13; Tue, 19 Jan 2010 17:56:14 +0000 (UTC) Received: by qw-out-2122.google.com with SMTP id 5so947851qwd.7 for ; Tue, 19 Jan 2010 09:56:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=jBoaQWg8CFuleeXNeyGQumCcDv+CMxvJ0CmQG/JUs+I=; b=OeNDYezXVeZsc5CUgjwIBO+DlgJ0kODcRiwruV2AGzN3J3Sbc9isv5iYGxMqbwrMwz Ou+OpqC+sDgnQRb2R3LkPOfh9YShNUJeU1aimqJNFCR7oQjzgR7DqqFfMQ9BXfrYPUlg eU8+GcJcN1zQSkaz+fisDe0DT7YWihU9w55UE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=tEk8nkvWOMxtdHE5x25Cm/v+rMNMqyJ6xzdPNw8zDMzaN5crSK/5+gckaBQvB7vN/x EorRhmgpPblY3rx8Tl7Ju0MPqgiePS6HiYrDsBsdAORgBLYW9Xm2eJKqsYQ0WIMwgKqA oYhHTr1bshwsjzfKoxidnSiO4Mq3rENxzATrc= MIME-Version: 1.0 Received: by 10.229.55.69 with SMTP id t5mr5102192qcg.34.1263922394571; Tue, 19 Jan 2010 09:33:14 -0800 (PST) In-Reply-To: <201001101437.37269.hselasky@c2i.net> References: <201001101437.37269.hselasky@c2i.net> Date: Wed, 20 Jan 2010 01:33:14 +0800 Message-ID: <53a1e0711001190933y64a41e98h60fa3dec641d44fd@mail.gmail.com> From: Henry Hu To: Hans Petter Selasky Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Mailman-Approved-At: Tue, 19 Jan 2010 18:01:21 +0000 Cc: freebsd-multimedia@freebsd.org, freebsd-current@freebsd.org, freebsd-usb@freebsd.org Subject: Re: [FreeBSD 8/9] USB webcamd and video4bsd: Call for testing 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: , X-List-Received-Date: Tue, 19 Jan 2010 17:56:14 -0000 Hello, On Sun, Jan 10, 2010 at 9:37 PM, Hans Petter Selasky wro= te: > Hi, > > During the last couple of days I've spent some time to finish my webcam > daemon. My webcam daemon is basically an application which consists of > userspace Video4Linux USB webcam drivers and some uLinux glue code which = links > with libc, pthreads and libusb. The webcamd talks to /dev/video_daemonX w= hich > is provided by the video4bsd kernel module. There is full support for > mmap/read/write/open/close. poll is not supported. I've tested on my webcam and it works here. I have an USB Video Class webcam: ugen2.2: at usbus2, cfg=3D0 md=3DHOST spd=3DHIGH (480Mbps) pwr=3DON This is the first time it works in FreeBSD! Thanks a lot! Currently, it works with -s vga and -s cif. There are many other modes supported by the webcam, but pwcview just does not support them. This webcam supports at most 1280x1024, and the quality is clearly better than 640x480. There are some problems, however. First, when I start pwcview with an unsupported mode, the content of the window is green, and I cannot kill the process. Only after terminating webcamd can I terminate the process. Second, I cannot restart pwcview without restarting webcamd. At the second time I start pwcview with -s vga, the window is green, and I cannot kill it. The situation is similar to unsupported size. I've also tried applications such as pidgin, skype and mplayer. However no one successfully played from the webcam. I doubt it needs some extra work. I've changed pwcview a bit to keep the settings in internal variables instead of fetching them every time. Else I cannot change most parameters. Maybe the webcam only supports a certain set of setting values, and use the nearest value after setting them. Thanks again for the great work! It never caused any kernel panic, and the programs are fairly stable. > Basic operation and idea: > > /dev/video_daemonX is the interface for the webcamd. /dev/videoX is the > interface for the V4L application. The video4bsd transports all data betw= een > these two devices. In the case the V4L application is using mmap, no data= is > copied due to shared kernel memory buffer! > > Licensing issues: > > Effectivly the webcamd userland program becomes GPL'ed due to the V4L USB > drivers which are GPL licensed. Some files inside the webcamd remains BSD > licensed which allows for building similar BSD licensed daemons. > > The rest of the code is BSD licensed. > > Source code: > > 1) FreeBSD 8-stable > > 2) Apply the patch below and re-install libusb in /usr/src/lib/libusb: > > http://p4web.freebsd.org/chv.cgi?CH=3D172876 > > http://perforce.freebsd.org/chv.cgi?CH=3D172876 > > 3) Compile ulinux (webcamd + libv4l + pwcview) and video4bsd (must be che= cked > out in the same folder due to dependencies) > > svn --username anonsvn --password anonsvn \ > =A0 =A0 =A0checkout svn://svn.turbocat.net/i4b/trunk/usbcam/video4bsd > > make all install > kldload video4bsd > > svn --username anonsvn --password anonsvn \ > =A0 =A0 =A0checkout svn://svn.turbocat.net/i4b/trunk/usbcam/ulinux > > make fetch > make patch > make all > make install > > # this will attach to the first detected webcam: > ./webcamd > > # this will try to attach to the given USB unit, interface and V4B unit. > ./webcamd -d ugen4.1 -i 0 -v 0 > > # this will display webcam contents from /dev/video0 by default. > ./pwcview/pwcview > > Feedback and bug reports are welcome. > > Yes, I am working on getting this into ports! > > Known issues: > > 1) If you detach the USB webcam you need to manually restart the webcamd. > > --HPS > > Support: I will be available at #bsdusb on efnet during the day. > _______________________________________________ > freebsd-multimedia@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-multimedia > To unsubscribe, send any mail to "freebsd-multimedia-unsubscribe@freebsd.= org" > Cheers, Henry