Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 240090 - libv4l userspace v4l libraries (libv4l1, libv4l2, libv4lconvert) abstraction layer
Summary: libv4l userspace v4l libraries (libv4l1, libv4l2, libv4lconvert) abstraction ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Linux
: High enhancement (vote)
Assignee: Default Assignee for New Packages
URL: http://people.atrpms.net/~hdegoede/
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-05 19:22 UTC by George Wu
Modified: 2010-02-22 19:41 UTC (History)
10 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
libv4l-0.5.0 ebuild (libv4l-0.5.0.ebuild,537 bytes, patch)
2008-10-05 19:24 UTC, George Wu
Details | Diff
libv4l-0.5.0 ebuild (libv4l-0.5.0.ebuild,521 bytes, text/plain)
2008-10-05 19:32 UTC, George Wu
Details
libv4l-0.5.1.ebuild (libv4l-0.5.1.ebuild,648 bytes, text/plain)
2008-10-15 05:45 UTC, Alexandre Rostovtsev (RETIRED)
Details
improved ebuild (libv4l-0.5.1.ebuild,1.09 KB, text/plain)
2008-10-17 22:29 UTC, Alexandre Rostovtsev (RETIRED)
Details
skype-compatible ebuild (libv4l-0.5.1.ebuild,2.04 KB, text/plain)
2008-10-18 18:43 UTC, Alexandre Rostovtsev (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description George Wu 2008-10-05 19:22:53 UTC
libv4l provides a thin abstraction layer that does 2 things,
1. converts v4l1 applications to work with v4l2 devices,
2. for v4l2 devices with strange (proprietary) formats, converts them into something useable (i.e. Bayer -> RGB)

Reproducible: Always

Steps to Reproduce:




http://fedoraproject.org/wiki/Features/BetterWebcamSupport
http://linuxtv.org/v4lwiki/index.php/Libv4l_Progress
Comment 1 George Wu 2008-10-05 19:24:44 UTC
Created attachment 167365 [details, diff]
libv4l-0.5.0 ebuild

I've placed this in media-libs/libv4l
Comment 2 George Wu 2008-10-05 19:32:49 UTC
Created attachment 167366 [details]
libv4l-0.5.0 ebuild

whacked eutils, not necessary
Comment 3 Patrizio Bassi 2008-10-14 07:35:47 UTC
without this and all application patches we're losing webcam support for all users with gspca driver need.

Please prioritize and include in the tree. Fedora already support most of it, 32 and 64 bit too.

http://fedoraproject.org/wiki/Features/BetterWebcamSupport
Comment 4 Alexandre Rostovtsev (RETIRED) gentoo-dev 2008-10-15 05:45:24 UTC
Created attachment 168510 [details]
libv4l-0.5.1.ebuild

Updated ebuild. Supports amd64 and multilib, and respects user CFLAGS.

Also: this package *needs* to be added to the tree soon. This library is required for webcams that use the 2.6.27 kernel's gspca driver (i.e. most USB webcams in existence).
Comment 5 George Wu 2008-10-15 14:49:46 UTC
Comment on attachment 167366 [details]
libv4l-0.5.0 ebuild

obsoleted by 0.5.1 ebuild
Comment 6 Alexandre Rostovtsev (RETIRED) gentoo-dev 2008-10-17 22:29:00 UTC
Created attachment 168854 [details]
improved ebuild

Ebuild improved with the advice of people in #gentoo-sunrise
Comment 7 Alexis Ballier gentoo-dev 2008-10-18 14:53:46 UTC
now in the tree, thanks everyone!
Comment 8 Patrizio Bassi 2008-10-18 17:26:15 UTC
how to use it with skype in a 64bit environment?

seems not working...
LD_PRELOAD=/usr/lib64/libv4l/v4l1compat.so skype
ERROR: ld.so: object '/usr/lib64/libv4l/v4l1compat.so' from LD_PRELOAD cannot be preloaded: ignored.

file /usr/lib64/libv4l/v4l1compat.so
/usr/lib64/libv4l/v4l1compat.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, stripped

LD_PRELOAD=/usr/lib64/libv4l/v4l2compat.so skype
ERROR: ld.so: object '/usr/lib64/libv4l/v4l2compat.so' from LD_PRELOAD cannot be preloaded: ignored.
ERROR: ld.so: object '/usr/lib64/libv4l/v4l2compat.so' from LD_PRELOAD cannot be preloaded: ignored.
Comment 9 Renato Caldas 2008-10-18 17:34:46 UTC
It will not work because you're using a 32 bit precompiled binary, and libv4l libraries are built for 64 bit. You'd need 32 bit compatibility libraries.

You can however persuade the skype people to either release a 64 bit binary or to upgrade the program for newer kernels (adding support for libv4l).

In either case, it's not gentoo's fault.
Comment 10 Patrizio Bassi 2008-10-18 18:33:44 UTC
i suspected it :)

what if we add th emul package too?
Comment 11 Alexandre Rostovtsev (RETIRED) gentoo-dev 2008-10-18 18:43:35 UTC
Created attachment 169004 [details]
skype-compatible ebuild

Patrizio: good point, I forgot about 32-bit binary apps like flash and skype. Here is an ebuild that will build both 32-bit and 64-bit compatibility libraries on amd64. To use the 32-bit library with skype, you will need to edit the /usr/bin/skype file and add
export LD_PRELOAD=/usr/lib32/libv4l/v4l1compat.so
before the "exec" line.
Comment 12 Patrizio Bassi 2008-10-18 19:59:16 UTC
doesn't work...

LD_PRELOAD=/usr/lib32/libv4l/v4l1compat.so skype
ERROR: ld.so: object '/usr/lib32/libv4l/v4l1compat.so' from LD_PRELOAD cannot be preloaded: ignored.

file /usr/lib32/libv4l/v4l1compat.so
/usr/lib32/libv4l/v4l1compat.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, stripped
Comment 13 Alexandre Rostovtsev (RETIRED) gentoo-dev 2008-10-18 20:26:05 UTC
(In reply to comment #12)
Read what I said again. You must edit /usr/bin/skype with a text editor and add the line
export LD_PRELOAD=/usr/lib32/libv4l/v4l1compat.so
somewhere before the "exec" line.

If you simply try to run 'LD_PRELOAD=/usr/lib32/libv4l/v4l1compat.so skype', of course it will not work, because /usr/bin/skype is actually a bash script, and your bash is 64-bit, so it won't accept 32-bit preloads.
Comment 14 Patrizio Bassi 2008-10-18 20:42:58 UTC
you're right :)

but i notice quality is so low, compared to old driver....even tweaking colors...lots of noise...
Comment 15 pierre 2008-10-30 14:18:53 UTC
doing the 63->32 bit trick with libv4l-0.5.3, I have a 'floating point execption' when starting skype.
dmesg says :
m5602-s5k83a/m5602_v4l2.c: BisonCam on /dev/video0 opened
compat_ioctl32: v4l2 ioctl VIDIOC_ENUM_FRAMESIZES, dir=rw (0xc02c564a)
ioctl32(skype:11264): Unknown cmd fd(9) cmd(c02c564a){t:'V';sz:44} arg(f69f1b88) on /dev/v4l/video0
compat_ioctl32: v4l2 ioctl VIDIOC_ENUM_FRAMESIZES, dir=rw (0xc02c564a)
ioctl32(skype:11264): Unknown cmd fd(9) cmd(c02c564a){t:'V';sz:44} arg(f69f1b88) on /dev/v4l/video0
compat_ioctl32: v4l2 ioctl VIDIOC_ENUM_FRAMESIZES, dir=rw (0xc02c564a)
ioctl32(skype:11264): Unknown cmd fd(9) cmd(c02c564a){t:'V';sz:44} arg(f69f1b88) on /dev/v4l/video0
skype[11264] trap divide error ip:f79cf454 sp:f69f1dc0 error:0 in libv4l1.so.0[f79cd000+4000]

does the trick only work for libv4l-5.1?
Comment 16 pierre 2008-10-30 14:25:51 UTC
well, I have tried with 0.5.1 version and it does exactly the same error.
I will be happy to provide more infos..
Comment 17 pierre 2008-10-30 15:17:43 UTC
maybe it's because I'm using kernel 2.6.25-r7...
Comment 18 Renato Caldas 2008-10-30 15:47:36 UTC
(In reply to comment #17)
> maybe it's because I'm using kernel 2.6.25-r7...

Obviously! This library is only useful for the in-kernel drivers, which were only released with 2.6.27.

With previous versions you should use the gspcav1 module (it's in portage).
Comment 19 Kamen Dokov 2009-01-13 16:37:29 UTC
Rostovtsev`s skype trick works great, thank you.
I just renamed the ebuild to libv4l-0.5.8 digested it and voila it builds libv4l-0.5.8 :D
Comment 20 fow 2009-03-09 08:44:27 UTC
Why hasn't this multilib ebuild been merged into the main Portage tree? I have libv4l-0.5.3 but no related files in /usr/lib32.
Comment 21 coran.fisher@gmail.com 2009-03-11 04:19:51 UTC
I am in the same situation fow.  The Skype tricks mentioned here do not work as we do not have the option for lib32 even in a multilib install.  Should we open a new bug?  
Comment 22 coran.fisher@gmail.com 2009-03-11 04:24:35 UTC
As we want Alexandre's above ebuild to go into portage perhaps opening a new bug is not a good idea and instead we should reopen this bug.  What do you think is the best way to proceed?  I feel an ebuild like Alexandre's should replace the one in portage. 
Comment 23 Andrew Mao 2009-07-21 00:49:39 UTC
I think we need to change the ebuilds for this for libv4l-0.6.0 and any future releases that come out so that we don't have to manually digest our ebuilds or make a custom overlay just for the 32-bit libraries. This doesn't break any existing functionality, so it doesn't hurt.
Comment 24 Joe 2009-09-19 19:54:10 UTC
Regarding libv4l-0.6.1 and Skype 2.1.0.47

My machine: amd64 - 2.6.29r5
Using UVC webcam
Skype needs this multilib ebuild overlay for libv4l-0.6.1
Additionally requires edits to /usr/bin/skype:

# Added for amd64
export LD_PRELOAD=/usr/lib32/libv4l/v4l1compat.so

Comment 25 James Broadhead 2009-12-07 23:45:04 UTC
(In reply to comment #24)
> export LD_PRELOAD=/usr/lib32/libv4l/v4l1compat.so

This doesn't work for me; I have this in /usr/bin/skype (amd64, uvc webcam)
 
export LD_PRELOAD=/usr/lib32/libv4l/v4l2convert.so

Otherwise, I renamed the ebuild to 0.6.1, and it works fine. 

+1 for replacing the in-portage version with this. 
Comment 26 Alex Rodionov 2010-02-22 15:36:05 UTC
I don't get it. Is current version of libv4l - media-libs/libv4l-0.6.1 - in portage has multilib support? Because none of the tricks worked for me in Skype 2.1.0.81 ? I had problem with camera vertically flipped and it should have been resolved with LD_PRELOAD, but it didn't worked for me.
Comment 27 Alexandre Rostovtsev (RETIRED) gentoo-dev 2010-02-22 19:41:24 UTC
(In reply to comment #26)
Currently, 32-bit libv4l binaries are included in >=emul-linux-x86-medialibs-20091231. The 20091231 version uses the thoroughly obsolete libv4l-0.5.3; I believe that 20100220 also uses version 0.5.*.

Naturally, those old versions of libv4l fail to correctly support many webcams.

I have filed bug #306419 to mark libv4l-0.6.1 stable and to add it to emul-linux-x86-medialibs.