This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours
Bug 457796 - PATCH(es): fixes + libv4l support + more fixes
PATCH(es): fixes + libv4l support + more fixes
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: xawtv (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Dmitry Butskoy
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-08-04 13:32 EDT by Hans de Goede
Modified: 2008-08-27 05:55 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-08-26 12:58:20 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
xawtv-3.95-fixes.patch (2.80 KB, patch)
2008-08-04 13:32 EDT, Hans de Goede
no flags Details | Diff
xawtv-3.95-libv4l2.patch (5.50 KB, patch)
2008-08-04 13:46 EDT, Hans de Goede
no flags Details | Diff
xawtv-3.95-no-dga.patch (3.83 KB, patch)
2008-08-04 13:46 EDT, Hans de Goede
no flags Details | Diff
xawtv-3.95-v4l-conf-user-bpl.patch (2.40 KB, patch)
2008-08-04 14:20 EDT, Hans de Goede
no flags Details | Diff

  None (edit)
Description Hans de Goede 2008-08-04 13:32:35 EDT
Created attachment 313380 [details]
xawtv-3.95-fixes.patch

Short intro: I'm a long time Linux developer currently working on improving
webcam support in Linux, see:
http://fedoraproject.org/wiki/Features/BetterWebcamSupport

I'm one of the authors of the v4l2 rewrite of the gspca usb webcam driver
framework (which supports more then 100 different cams), this v4l2 rewrite has
been merged into the 2.6.27 kernel and thus will become available in the
official Linux kernel soon.

One of the parts of the v4l2 rewrite has been removing conversion from various
manufacturer cam specific video formats to more normal videoformats from the
drivers, as this really does not belong in kernel space.

As a result of this the gspca subdrivers can generate raw video frames in the
following formats:

#define V4L2_PIX_FMT_SN9C10X  v4l2_fourcc('S', '9', '1', '0') /* SN9C10x
compressed bayer
#define V4L2_PIX_FMT_SPCA501  v4l2_fourcc('S', '5', '0', '1') /* YUYV per line 
#define V4L2_PIX_FMT_SPCA505  v4l2_fourcc('S', '5', '0', '5') /* YYUV per line 
#define V4L2_PIX_FMT_SPCA508  v4l2_fourcc('S', '5', '0', '8') /* YUVY per line 
#define V4L2_PIX_FMT_SPCA561  v4l2_fourcc('S', '5', '6', '1') /* compressed
GBRG bayer
#define V4L2_PIX_FMT_PAC207   v4l2_fourcc('P', '2', '0', '7') /* compressed
BGGR bayer

As we do not want to see each application implement (nor having to implement)
support for these various formats, as we like to have one code base and only
one code base for these formats. A library has been written (with me as the
main author) to convert from these formats to BGR24 or YUV420. For more on this
library see:
http://hansdegoede.livejournal.com/3636.html

As such I've been working (for a number of days!) on a patch to add support for libv4l to xawtv. This has resulted in my doing a whole patch series, listed in the order in which the patches should be applied.

xawtv-3.95-fixes.patch
----------------------
Some small fixes which are needed for xawtv-3.95 to work with some v4l2 devices at all.

xawtv-3.95-libv4l2.patch
------------------------
Use libv4l2 to gain support for all kind of camera specific video formats

xawtv-3.95-no-dga.patch
-----------------------
xawtv does not work on many videocards without specifying -nodga, this patch
fixes this by catching the error and continuing as if the server does not support DGA at all

xawtv-3.95-v4l-conf-user-bpl.patch
----------------------------------
Allow root to override the detected number of bytes per line, this is needed
to get direct pci transfers to the framebuffer to work on my ati x1950pro


Note that for xawtv to work properly atleast version 0.4.0 of libv4l is needed,
rawhide currently has 0.3.9 and I cannot build 0.4.0 due to an error in the kernel-headers package.


p.s.

While writing all these patches and with all my recent v4l work in general I've become quite familiar with the xawtv code, so if you want I can become a co-maintainer (and push these patches myself).
Comment 1 Hans de Goede 2008-08-04 13:46:25 EDT
Created attachment 313381 [details]
xawtv-3.95-libv4l2.patch
Comment 2 Hans de Goede 2008-08-04 13:46:58 EDT
Created attachment 313382 [details]
xawtv-3.95-no-dga.patch
Comment 3 Hans de Goede 2008-08-04 14:20:31 EDT
Created attachment 313392 [details]
xawtv-3.95-v4l-conf-user-bpl.patch
Comment 4 Hans de Goede 2008-08-23 03:41:07 EDT
Ping,

I would really like to see this fixed before F10-beta freeze so that the better webcam support feature can get some good testing in the Beta.
Comment 5 Dmitry Butskoy 2008-08-25 12:36:06 EDT
Pong.

I am still thinking how to make libv4l2 support optional...

It seems that an option is not suitable here, as there are several applications (xawtv, streamer, fbtv, ...) and it is not good to hack all their cmdline interfaces.

Perhaps LD_PRELOAD is a way? If the only application still used by "end users" is "xawtv", then maybe just add "LD_PRRELOAD=..." into its .desktop file? (Saving all another utils unchanged).

P.S. Could you add autoconf stuff for libv4l2 patch as well?
Comment 6 Hans de Goede 2008-08-25 12:45:15 EDT
(In reply to comment #5)
> Pong.
> 
> I am still thinking how to make libv4l2 support optional...
> 

Why would you want todo that? libv4l was explicitly designed to be transparent to the application.

With the current patch, libv4l does not get used / linked in to the lowlevel v4l-info, v4l-conf and v4lctl programs, so those are not affected, all the others actually stream data from the cam in one form or the other and thus need libv4l to work with cams which have funky video formats (IOW most of them!!).

> P.S. Could you add autoconf stuff for libv4l2 patch as well?

Why? Its a distro specific patch and we will always want to enable libv4l support, I will take a look at autoconf support when a new upstream is formed and patches need to become non distro specific so that they can be merged upstream.
Comment 7 Dmitry Butskoy 2008-08-25 13:02:56 EDT
> libv4l does not get used / linked in to the lowlevel
> v4l-info, v4l-conf and v4lctl programs

"v4lctl" actually uses libng drivers, ie. the patch affects it as well.
Comment 8 Hans de Goede 2008-08-25 14:09:59 EDT
(In reply to comment #7)
> > libv4l does not get used / linked in to the lowlevel
> > v4l-info, v4l-conf and v4lctl programs
> 
> "v4lctl" actually uses libng drivers, ie. the patch affects it as well.

Ah I didn't know that even then though, this is not a problem as libv4l does not touch any of the CTRL related ioctl's it passes them through to the kernel *completely* unmodified.
Comment 9 Dmitry Butskoy 2008-08-26 12:58:20 EDT
OK

I've added your patches (I have a little touched them, and add manual stuff for the "-p pitch"). Additionally, I've added some debian ones.

The results are available in Koji:
http://kojipkgs.fedoraproject.org/packages/xawtv/3.95/10.fc10/
Comment 10 Hans de Goede 2008-08-27 05:55:46 EDT
Looks (In reply to comment #9)
> OK
> 
> I've added your patches (I have a little touched them, and add manual stuff for
> the "-p pitch"). Additionally, I've added some debian ones.
> 
> The results are available in Koji:
> http://kojipkgs.fedoraproject.org/packages/xawtv/3.95/10.fc10/

Works like a charm, including accessing webcams which do not work without libv4l and using my bttv tv card.

Thanks!

Note You need to log in before you can comment on or make changes to this bug.