flipped webcam image with libv4l on ASUS U31F

Bug #826265 reported by Joseph Chereshnovsky on 2011-08-14
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
v4l-utils (Ubuntu)
Undecided
Gregor Jasny

Bug Description

I have the latest Ubuntu 11.04 32-bit on ASUS U31F

I've followed these instruction to resolve the issue with my web camera
http://radu.cotescu.com/flipped-images-ubuntu-webcam/

but it doesn't works for me as I wasn't able to locale the file
/usr/lib/libv4l/v4l1compat.so after successful installation.

I've found that only people with 64-bit editions have the same issue as this library located under
/usr/lib32/libv4l/v4l1compat.so

But I have Ubuntu 11.04 32-bit and directory /usr/lib/libv4l doesn't exists after successful package installation from this PPA
 https://launchpad.net/~libv4l/+archive/ppa

Anyway I was able to locale the installed files and for some reason they were placed under
/usr/lib/i386-linux-gnu/libv4l

later I've found the following blog post with the hack but not any explanation
http://www.sergioller.com/drupal/en/node/15

anyway finally my webcam DOESN'T works, even after I've tried everything described
I'm ready to participate, test and provide feedback/

possibly will be useful for all others who have the same issue

derkegel (idislikeusernames) wrote :

Same story from beginning to end :(

Webcam not woking on ASUS ul30a fresh install 11.04, 2.6.38-11-generic-pae

Help please!

Changed in v4l-utils (Ubuntu):
status: New → Confirmed
Gregor Jasny (gjasny) wrote :

Hello,

the .so files move was necessary to make add multiarch support to the package:
v4l-utils (0.8.5-1) unstable; urgency=low

  Beginning with this release libv4l-0 will support multiarch on Debian.
  As a result of the new triplet library directory you need to update
  any preload paths. For example on an amd64 system the following line

  LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so

  must be changed into

  LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libv4l/v4l1compat.so

  Additionally libv4l-dev packages will drop the static libraries in a
  future upload. If you have a good use case for static libraries where
  the shared ones are not sufficient, please file a wishlist bug report.

 -- Gregor Jasny <email address hidden> Sat, 09 Jul 2011 19:12:38 +0200

Changed in v4l-utils (Ubuntu):
status: Confirmed → In Progress
assignee: nobody → Gregor Jasny (gjasny)
Gregor Jasny (gjasny) wrote :

Hello,

I'd like to assist with your issues. The ASUS U31F was added recently to the 'unmirror' table of libv4l.

Unfortunately this version is not part of 11.04. You can either get a nightly snapshot package from this PPA:
https://launchpad.net/~libv4l/+archive/development
(experimental code).

Or you can keep your outdated package and set an environment variable as described here:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=639231

Please add a comment here if you have problems with one of these steps.

Thanks,
Gregor

panticz.de (panticz.de) wrote :

Hi, here a quickfix for Skype:

sudo apt-get install libv4l-0
[ -d /usr/lib/libv4l ] || sudo mkdir /usr/lib/libv4l
[ -f /usr/lib/libv4l/v4l1compat.so ] || sudo ln -s /usr/lib/i386-linux-gnu/libv4l/v4l1compat.so /usr/lib/libv4l/v4l1compat.so
sudo sed -i 's|Exec=skype|Exec=env LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so skype|g' /usr/share/applications/skype.desktop

Cheers

Gregor Jasny (gjasny) wrote :

@panticz.de: Why do you create symlinks? Changing the preload line to LD_PRELOAD=/usr/lib/i386-linux-gnu/libv4l/v4l1compat.so should have done the trick.

Gregor Jasny (gjasny) on 2011-11-15
Changed in v4l-utils (Ubuntu):
status: In Progress → New
status: New → Confirmed

Hey,

I've fixed this issue by installing the library from PPA
https://launchpad.net/~libv4l/+archive/development

But now I'm upgraded to Ubuntu 12.04 and error occurs again. I plan to install the version from PPA again, but anyway it would be great to have the latest version shipped with Ubuntu out of the box.

What's the current output of dpkg -l libv4l* ?

I have the latest Ubuntu 12.04 32-bit on ASUS U31F
Installed latest available version from PPA: https://launchpad.net/~libv4l/+archive/development

dpkg -l libv4l* says:
ii libv4l-0 0.9.0~test1+r1269-53~precise1 Collection of video4linux support libraries
ii libv4lconvert1 0.9.0~test1+r1269-53~precise1 Video4linux frame format conversion library

But problem wasn't resolved for some reason :(

I've even tried to create a symbolic link as it was described in comments #3 and #4 - but that doesn't helps

My image from camera is still flipped up side down

Gregor Jasny (gjasny) wrote :

Please remove the development PPA and revert the v4l packages to the plain Ubuntu ones.

Then verify that 'cheese' works properly. If that's woking libv4l is flipping the image properly.
From that point Skype issues are easy to fix.

Reverted library back

ii libv4l-0 0.8.6-1ubuntu1 Collection of video4linux support libraries
ii libv4lconvert0 0.8.6-1ubuntu1 Video4linux frame format conversion library

But my problem not only in Skype. Camera displays flipped image in Google Chrome browser here:
https://apprtc.appspot.com/?r=50397532

and in Skype as well, possibly in other apps as well.

It would be interesting to avoid application specific fix, just want to have camera working for all apps like I had in Ubuntu 11.10 before upgrade.

by the way - In Cheese it works OK right now, with 0.8.6 version of lib

Gregor Jasny (gjasny) wrote :

Now try the following on the command line
LD_PRELOAD=/usr/lib/i386-linux-gnu/libv4l/v4l1compat.so skype

if that does not work paste the output of $(which skype)

It works!
$ LD_PRELOAD=/usr/lib/i386-linux-gnu/libv4l/v4l1compat.so skype

but now it would be great to have it operational out of the box, without a need to run from CLI, and also make webcam to work in Google Chrome.

How can I avoid using "LD_PRELOAD=/usr/lib/i386-linux-gnu/libv4l/v4l1compat.so" to start my application by clicking on icon?
Possibly symlinking this library somewhere to make it available for all apps at one time???

Because creating the start script like "skype.sh" with appropriate command and then replacing the original Skype icon in menu with this script, and repeat that for all uncompatible programms - looks ugly for me.

Still can't resolve this issue and camera in my Google Chrome still flipped upside down.

This doesn't works for some reason aswell:
LD_PRELOAD=/usr/lib/i386-linux-gnu/libv4l/v4l1compat.so google-chrome

So while visiting this URL: https://apprtc.appspot.com/?r=12169946 - the image is still flipped.

How can I remove old/buggy libraries to allown only latest fixed ones?
Possibly create some symlinks to replace them for all applications?

Gregor Jasny (gjasny) wrote :

The problem is Skype and Google Chrome are closed source. So you cannot patch them to use libv4l directly. Preloading the library by changing the .desktop files or replace the binary by a small wrapper script seems to be the sanest approach.

I you want libv4l preloaded to ALL processes on your system you could add it to /etc/ld.so.preload (see man ld.so). Maybe you can restrict it to just i386 ones. But IMHO this solution is worse than the one above.

thanks, I will move with changing the .desktop items

LD_PRELOAD=/usr/lib/i386-linux-gnu/libv4l/v4l1compat.so google-chrome

But for some reason Google Chrome doesn't works for my system. Its strange as:

LD_PRELOAD=/usr/lib/i386-linux-gnu/libv4l/v4l1compat.so skype

works!

Skype works great but I still can't start Google Chrome with webcamera support - so Google Talk video calls are still not functioning properly.

Here is the response I have during running the Google Talk:

$ LD_PRELOAD=/usr/lib/i386-linux-gnu/libv4l/v4l1compat.so /usr/bin/google-chrome
ALSA lib pcm_dmix.c:957:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
ALSA lib pcm_dmix.c:957:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
ALSA lib pcm_dmix.c:957:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
[6:8:1295387528:ERROR:capture_video_decoder.cc(68)] Not implemented reached in virtual void CaptureVideoDecoder::OnStarted(media::VideoCapture*)
[6:8:1295416422:ERROR:capture_video_decoder.cc(84)] Not implemented reached in virtual void CaptureVideoDecoder::OnError(media::VideoCapture*, int)
[6:8:1295416457:ERROR:capture_video_decoder.cc(88)] Not implemented reached in virtual void CaptureVideoDecoder::OnRemoved(media::VideoCapture*)
[6:6:1295416537:ERROR:media_stream_impl.cc(374)] Not implemented reached in virtual void MediaStreamImpl::OnVideoDeviceFailed(const std::string&, int)
ALSA lib pcm_dmix.c:957:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
ALSA lib pcm_dmix.c:957:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
....

Possibly that will help to resolve the issue?

I believe only these lines are important:

[6:8:1295387528:ERROR:capture_video_decoder.cc(68)] Not implemented reached in virtual void CaptureVideoDecoder::OnStarted(media::VideoCapture*)
[6:8:1295416422:ERROR:capture_video_decoder.cc(84)] Not implemented reached in virtual void CaptureVideoDecoder::OnError(media::VideoCapture*, int)
[6:8:1295416457:ERROR:capture_video_decoder.cc(88)] Not implemented reached in virtual void CaptureVideoDecoder::OnRemoved(media::VideoCapture*)
[6:6:1295416537:ERROR:media_stream_impl.cc(374)] Not implemented reached in virtual void MediaStreamImpl::OnVideoDeviceFailed(const std::string&, int)

and the rest can be ignored as they are listed even when I don't use the WebRTC to get video stream from webcam.

Looks like guys from Google Chrome are trying to resolve this issue here:
http://code.google.com/p/webrtc/issues/detail?id=512

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.