Image on webcam is upside-down

Bug #224559 reported by Bazilio
112
This bug affects 15 people
Affects Status Importance Assigned to Milestone
Baltix
Confirmed
Medium
Mantas Kriaučiūnas
libv4l (Ubuntu)
Triaged
Wishlist
Unassigned
linux (Ubuntu)
Won't Fix
Medium
Unassigned
linux-ubuntu-modules-2.6.24 (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

I am russian, so sorry for my english.

My system is Kubuntu 7.10
bazilio@ASUSG1S:~$ lsb_release -rd
Description: Ubuntu 7.10
Release: 7.10

I use Asus G1S laptop and i have a problem with my webcam.
It works out of box, but image is upside-down.
In kopete settings it works, but upside-down
In skype it works, but upside-down.

I know that it old bug, but nobody can solve it.

Some info:
bazilio@ASUSG1S:~$ lsmod | grep video
video 18060 0
uvcvideo 57480 0
compat_ioctl32 2304 1 uvcvideo
videodev 29312 1 uvcvideo
v4l1_compat 15364 2 uvcvideo,videodev
v4l2_common 18432 2 uvcvideo,videodev
usbcore 138632 7 xpad,uvcvideo,hci_usb,usbhid,ehci_hcd,uhci_hcd

String with "syntek" about my webcam:
bazilio@ASUSG1S:~$ lsusb
Bus 007 Device 001: ID 0000:0000
Bus 006 Device 003: ID 0b05:1726 ASUSTek Computer, Inc. Laptop OLED Display
Bus 006 Device 002: ID 174f:5a35 Syntek
Bus 006 Device 001: ID 0000:0000
Bus 003 Device 002: ID 046d:c01e Logitech, Inc. MX518 Optical Mouse
Bus 003 Device 001: ID 0000:0000
Bus 001 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
Bus 005 Device 002: ID 0b05:1712 ASUSTek Computer, Inc. BT-183 Bluetooth 2.0+EDR adapter
Bus 005 Device 001: ID 0000:0000
Bus 004 Device 001: ID 0000:0000

In windows system it works perfect, webcam detects as D-Max_GD-5A35, device PID code: USB\VID_174F&PID_5A35

In linux it detects as Sonix Technoogy Co., Ltd USB 2.0 Camera

Revision history for this message
Bazilio (bazilio-recast1) wrote :
Revision history for this message
gedas (gediminas-techsonas) wrote :

Image is flipped also with another syntek webcam, shipped with ASUS S96S:
as@baltix-linux:~$ lsusb
Bus 007 Device 005: ID 174f:6a51

Revision history for this message
Leann Ogasawara (leannogasawara) wrote :

Hi Guys,

Bazilio, since you are the original bug reporter and have commented this is resolved for you I'm going to close this report.

Gedas, if you are still experiencing issues with the most recent Hardy Heron 8.04 release, please test if this is still an issue with the latest Alpha for the upcoming Intrepid Ibex 8.10. You should be able to test via a LiveCD - http://www.ubuntu.com/testing. If the issue still exists, please open a new bug report which should include the following debugging information as outlined at https://wiki.ubuntu.com/KernelTeamBugPolicies . Thanks.

Changed in linux-ubuntu-modules-2.6.24:
status: New → Fix Released
Revision history for this message
Andres Mujica (andres.mujica) wrote :

the ones from dupes if are having this same issue, before reopening again please be sure to test with Intrepid fully updated.

Thanks a lot for your help and comments

regards,

Revision history for this message
Bazilio (bazilio-recast1) wrote :

In Kubuntu 8.10 with all updates bug stil present. And now it's imposible to use fix from here http://ubuntuforums.org/showthread.php?t=838210 , because of new uvcvideo.

Changed in linux-ubuntu-modules-2.6.24:
status: Fix Released → New
Revision history for this message
Andres Mujica (andres.mujica) wrote :

Bazilio, would you be so kind to test with latest kernel available in proposed repos?

thanks, it's highly possible that is solved there

Changed in linux-ubuntu-modules-2.6.24:
status: New → Invalid
status: New → Invalid
Changed in linux:
status: New → Incomplete
Revision history for this message
Bazilio (bazilio-recast1) wrote :

I updated to latest kernel available for my system (Kubuntu 8.10 KDE 4.2 beta2)
bazilio@bazilio-laptop:~$ uname -a
Linux bazilio-laptop 2.6.27-11-generic #1 SMP Thu Jan 8 08:38:33 UTC 2009 i686 GNU/Linux

Bug still present.
Are you sure, that it's kernel bug?
I think that my webcam use uvcvideo driver, that have not vflip param.
There is stkwebcam driver, that have vflip param. Is there a way to use stkwebcam module instead of uvcvideo?

Maybe I should open bug in other place?

Revision history for this message
Andres Mujica (andres.mujica) wrote :

marking as confirmed

Changed in linux:
status: Incomplete → Confirmed
Revision history for this message
Irfan Adilovic (irfy) wrote :

The same symptoms are present even in 2.6.29-rc8-git5. I have a weird feeling we're gonna wait for a long time for this, Bazilio :-(

This is a very well known issue with UVC. Have a look at (the very arrogant) footnote #3 here: http://linux-uvc.berlios.de/#footnote-3

You see, flipping the frames in the uvc driver source is a rather simple thing as demonstrated here: http://ubuntuforums.org/showthread.php?t=838210, and there is no such thing in the kernel uvc driver. It adds a little bit of a processing overhead because flipping is in software, but what the heck - it works at least.

Hopefully, in two releases from now, we will have the then-available uvc drivers in the kernel, which seem to be promising (according to hg log | grep vflip)

Revision history for this message
Dmitriy Geels (dmig) wrote :

I'll try to push published patch as quirk into uvcvideo driver

Changed in linux (Ubuntu):
importance: Undecided → Low
Revision history for this message
Dmitriy Geels (dmig) wrote :

Here is modified version of patch from http://ubuntuforums.org/showthread.php?t=838210
The one posted there has one flaw: it will rotate image for all devices, it work with.

Usecase:
User has laptop with webcam mounted upside-down. He applies patch from forum, he is happy -- webcam image is ok. Then he connects external UVC webcam -- image from it is upside down, because driver just do rotation.

My modification adds quirk for webcam models, known to be mounted upside-down. Driver will not rotate image for others.

Also my patch is made against latest UVC source, so applying it to uvc from ubuntu kernel will reject one hunk (patch will fail to find surrounding lines). Don't be afraid of this, just manually edit uvcvideo.h and following add line there:
#define UVC_QUIRK_ROTATE_IMAGE 0x00000100

My patch won't be accepted to uvc, because: "Linus said, that all image processing must be done in userspace". Even if this is a fix of hardware flaw.
But may be it will be included in Ubuntu?

Also, I consider that existing uvcvideo source should be updated. It is 1-2 years old already and has at least one problem, which was already fixed in upstream: webcam wont work after resume from hibernate.

Changed in linux (Ubuntu):
importance: Low → High
importance: High → Medium
status: Confirmed → Triaged
Revision history for this message
Amit Kucheria (amitk) wrote :

Since upstream has rejected any image processing inside the kernel, this should be correctly handled in userspace using a combination of HAL, udev and libv4l. Adding libv4l to this bug, since that is where the real quirks must be added (I guess)

Changed in libv4l (Ubuntu):
importance: Undecided → Wishlist
status: New → Triaged
Revision history for this message
Amit Kucheria (amitk) wrote :

Unfortunately, carrying such patches for Hardy, Intrepid, Jaunty and Karmic (if we add it today) and support it for the life of these releases is just not possible.

Changed in linux (Ubuntu):
status: Triaged → Won't Fix
Revision history for this message
Dmitriy Geels (dmig) wrote :

Amit, can you describe, why is it impossible?

Best solution I see for the moment is:
1) get uvcvideo sources
2) apply rotating patch
3) use dkms for managing patched uvcvideo
But correct makefile needed to build uvcvideo standalone.

I tried to build patched uvcvideo from kernel source, but there is some problem with this new module insmod fails. Haven't find solution for this yet. Only whole kernel rebuild helps.

Revision history for this message
Sarah (sarahelj) wrote : RE: [Bug 224559] Re: Image on webcam is upside-down

Hello, how to have this program ?
I have to download it on internet or i get it from the synaptic programs.
Help me

Cordialy Sarah

> Date: Wed, 29 Apr 2009 07:40:18 +0000
> From: <email address hidden>
> To: <email address hidden>
> Subject: [Bug 224559] Re: Image on webcam is upside-down
>
> Amit, can you describe, why is it impossible?
>
> Best solution I see for the moment is:
> 1) get uvcvideo sources
> 2) apply rotating patch
> 3) use dkms for managing patched uvcvideo
> But correct makefile needed to build uvcvideo standalone.
>
> I tried to build patched uvcvideo from kernel source, but there is some
> problem with this new module insmod fails. Haven't find solution for
> this yet. Only whole kernel rebuild helps.
>
> --
> Image on webcam is upside-down
> https://bugs.launchpad.net/bugs/224559
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in “libv4l” source package in Ubuntu: Triaged
> Status in “linux” source package in Ubuntu: Won't Fix
> Status in “linux-ubuntu-modules-2.6.24” source package in Ubuntu: Invalid
> Status in “linux-ubuntu-modules-2.6.24” source package in Baltix: Invalid
>
> Bug description:
> I am russian, so sorry for my english.
>
> My system is Kubuntu 7.10
> bazilio@ASUSG1S:~$ lsb_release -rd
> Description: Ubuntu 7.10
> Release: 7.10
>
> I use Asus G1S laptop and i have a problem with my webcam.
> It works out of box, but image is upside-down.
> In kopete settings it works, but upside-down
> In skype it works, but upside-down.
>
> I know that it old bug, but nobody can solve it.
>
> Some info:
> bazilio@ASUSG1S:~$ lsmod | grep video
> video 18060 0
> uvcvideo 57480 0
> compat_ioctl32 2304 1 uvcvideo
> videodev 29312 1 uvcvideo
> v4l1_compat 15364 2 uvcvideo,videodev
> v4l2_common 18432 2 uvcvideo,videodev
> usbcore 138632 7 xpad,uvcvideo,hci_usb,usbhid,ehci_hcd,uhci_hcd
>
> String with "syntek" about my webcam:
> bazilio@ASUSG1S:~$ lsusb
> Bus 007 Device 001: ID 0000:0000
> Bus 006 Device 003: ID 0b05:1726 ASUSTek Computer, Inc. Laptop OLED Display
> Bus 006 Device 002: ID 174f:5a35 Syntek
> Bus 006 Device 001: ID 0000:0000
> Bus 003 Device 002: ID 046d:c01e Logitech, Inc. MX518 Optical Mouse
> Bus 003 Device 001: ID 0000:0000
> Bus 001 Device 001: ID 0000:0000
> Bus 002 Device 001: ID 0000:0000
> Bus 005 Device 002: ID 0b05:1712 ASUSTek Computer, Inc. BT-183 Bluetooth 2.0+EDR adapter
> Bus 005 Device 001: ID 0000:0000
> Bus 004 Device 001: ID 0000:0000
>
> In windows system it works perfect, webcam detects as D-Max_GD-5A35, device PID code: USB\VID_174F&PID_5A35
>
> In linux it detects as Sonix Technoogy Co., Ltd USB 2.0 Camera

_________________________________________________________________
Découvrez toutes les possibilités de communication avec vos proches
http://www.microsoft.com/windows/windowslive/default.aspx

Revision history for this message
Irfan Adilovic (irfy) wrote :

In Ubuntu 9.04 (at least), under System -> Preferences -> Multimedia Systems Selector, under the Video tab, then under Default Input, one can perform certain selections for the Default Input. Here the default in my case is v4l2src from video4linux2, but i can imagine that one can write one's own filter or just modify the v4l2src to rotate the image.

Now, how do I tell applications to use this anyway? I tried setting test input there, but Skype and Cheese never bothered using that - they still connected to the camera.

Is there any merit in trying to do something here? Any further hints or ideas?

Revision history for this message
Dmitriy Geels (dmig) wrote :

Here is temporary solution as kernel patch: http://forum.ubuntu.ru/index.php?topic=59385.msg438527#msg438527 (sorry, only russian).
Patch applies perfectly on 2.6.30 kernel (may be get from http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.30/) or with one manual edit of uvcvideo.h for earlier kernels.

Revision history for this message
Vladimir Espinosa (vladimir.e) wrote :

I'm having the same issue on an Asus UL30A running Karmic Koala.

This patch (backported from libv4l-0.6.4) solves the issue on my hardware.

Revision history for this message
Frej (frecon) wrote :

@Vladimir Espinosa how do I install your patch? I'm using 10.04 with asus ul30vt.

Revision history for this message
Gregor Jasny (gjasny) wrote :

I'd suggest to just use the newest version. You can either compile it yourself or use the Debian package:

sudo -i
wget http://ftp.us.debian.org/debian/pool/main/libv/libv4l/libv4l-0_0.6.4-1_i386.deb
dpkg -i libv4l-0_0.6.4-1_i386.deb

If you need another architecture, check: http://packages.debian.org/unstable/libv4l-0

The symbols in libv4l-0 are versioned, so this newer version should just work.

Revision history for this message
Gregor Jasny (gjasny) wrote :

@Frej: According to packages.ubuntu.com Lucid contains already libv4l 0.6.4.

can you please post the output of the following commands?
dpkg -l libv4l-0
cat /sys/class/dmi/id/board_vendor
cat /sys/class/dmi/id/board_name
lsusb -v

Thanks,
Gregor

Revision history for this message
Guilherme Blanco (guilhermeblanco) wrote :

@Gregor

Here is the output of what you requested:
http://pastie.org/904948
http://pastie.org/904950

I am currently running Kubuntu 9.10. My camera is still upside down even after installing the .deb package.

Cheers,

Revision history for this message
Oleg Shmelev (oshmelyov) wrote :

I have Asus F7z and I've been using Ubuntu since 9.04 and my webcam image has always been upside down.

Revision history for this message
WolverinePL (podusowski) wrote :

ASUS K50IN

Bus 001 Device 003: ID 04f2:b071 Chicony Electronics Co., Ltd 2.0M UVC Webcam / CNF7129

The same problem here.

Revision history for this message
André Ventura (afv) wrote :

Same problem on ASUS N82JV.

libv4l-0 -> 0.6.4-1ubuntu1

lsusb -> ID 04f2:b1bb Chicony Electronics Co., Ltd

sudo lsusb -v -d 04f2:b1bb -> http://paste.ubuntu.com/519365/

Revision history for this message
ptha (peter-hannon) wrote :

I am seeing the webcam image upside down on both Skype and Google chat. I have an Asus N61JQ. I am running Ubuntu 10.10 64 bit.

Bus 001 Device 003: ID 13d3:5122 IMC Networks
Sonix Technology Co., Ltd.
USB 2.0 Camera

Revision history for this message
Guilherme Blanco (guilhermeblanco) wrote :

Hi,

I would like to mention that webcam image is correct now on ubuntu 10.10 on my Asus G1S.
I was one of the original reporters of 7.04 on another *very* old bug report.

Cheers,

Guilherme Blanco

Revision history for this message
ptha (peter-hannon) wrote :

To update my setup:

libv4l-0 -> 0.6.4-1ubuntu1

board_vendor -> ASUSTeK Computer Inc.

board_name -> N61Jq

lsusb -> Bus 001 Device 003: ID 13d3:5122 IMC Networks

I am having the upside down webcam image on Ubuntu 10.10 64 bit.

Revision history for this message
Antonio Barbuzzi (antoniob82) wrote :

I am seeing the webcam image upside down too with a Asus UL50Vg, so I made this tiny patch that solves the problem.

Revision history for this message
Hans de Goede (j-w-r-degoede) wrote :

Hi all,

Short self intro: I'm a v4l kernel subsystem developer and the author and maintainer of libv4l. So when it comes to upside down mounted webcams in laptops there are 3 important points to keep in mind:

1) Video processing in the kernel is wrong, and the kernel patch which some here have referred to is doubly wrong because it will flip the image of all uvc devices not just those mounted upside down in some webcams. Please stop mucking around with kernel patches, they are not the solution to this problem!

2) The proper solution for this is flipping the image in userspace which is being handled by libv4l. libv4l has a large list of known to have a mounted upside down webcam laptop models which is constantly updated. There is a ppa available which is tracking upstream libv4l (now part of v4l-utils) pretty closely, follow the instructions here to install libv4l from this ppa:
http://radu.cotescu.com/2009/11/05/flipped-images-ubuntu-webcam/

3) Unfortunately not all programs are using libv4l, some try to talk to the /dev/video node directly, please test with "cheese" and if the image is not upside down there, the problem you are seeing is not in libv4l, but an app which does not use libv4l, see below for a workaround for this.

If the image is still upside down in cheese *after* installing the latest libv4l / v4l-utils from the above link, then your laptop model is not in the list of libv4l, please do (as root):
lsusb > lsusb.log
dmidecode > dmi.log

And send me <email address hidden>, a mail with the 2 generated files attached. Do *NOT* copy and paste them I need them 100% unmodified.

I'll then add your laptop to libv4l's upside down table and get back to you with testing instructions.

4) Programs which are not using libv4l, notorious examples of which are skype and the google chat firefox plugin, can be made to use libv4l by pre-loading a libc wrapper, launch the program in question from a cmdline like this to use this wrapper:
LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so application_name

For example for skype:
LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so skype

Note that when running 32 bit apps such as skype (even the so called 64 bit download of skype is 32 bits!!) and the google chat firefox plugin on a 64 bit install, you must use the following line to get the 32 bit version if the wrapper:
LD_PRELOAD=/usr/lib32/libv4l/v4l1compat.so skype

Note that for the google chat plugin, firefox must be started with this wrapper, first close *all* firefox windows and then do:
LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so firefox
Or on 64 bit installs:
LD_PRELOAD=/usr/lib32/libv4l/v4l1compat.so firefox

Regards,

Hans

Revision history for this message
Bill St. Clair (billstclair) wrote :

Yay! Thank you, Hans. Starting Skype with the LD_PRELOAD environment setting fixed my upside down skype video.

Revision history for this message
Kapil Soni (kapilsoni2006) wrote :

Hi

I am Kapil Soni. I have installed ubuntu 11.4 version, which is going great but I am facing the same problem. When I use the webcam it shows me upside down. And I am really very upset with this. Can you please solve this bug.

Regards
Kapil Soni

Revision history for this message
Mantas Kriaučiūnas (mantas) wrote :

It seems I should include newer libv4l and gtk-v4l packages in Baltix GNU/Linux 2010 (Lucid) repository. It's important to test how Empathy and Cheese works with libv4l 0.8.3 from Ubuntu 11.04

affects: linux-ubuntu-modules-2.6.24 (Baltix) → baltix
Changed in baltix:
assignee: nobody → Mantas Kriaučiūnas (mantas)
importance: Undecided → Medium
status: Invalid → New
Revision history for this message
Mantas Kriaučiūnas (mantas) wrote :

It seems libv4l packages are too old even in latest stable Ubuntu version - 11.04 (Natty). I got upside-down image and video from webcam in Asus K53E until I've updated libv4l-0 package from ppa:libv4l
It seems I should include newer (at least 0.8.5) libv4l and gtk-v4l packages in Baltix GNU/Linux 2011 (Natty) repository too. It's important to test how Empathy and Cheese in Ubuntu 10.04 works with libv4l 0.8.5 from Ubuntu 11.10

Changed in baltix:
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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