Bug 844999 - Image upside-down on Asus F7S
Image upside-down on Asus F7S
Status: CLOSED INSUFFICIENT_DATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libv4l (Show other bugs)
7.1
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Hans de Goede
Desktop QE
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-01 08:41 EDT by Vasiliy Sharapov
Modified: 2014-06-23 07:02 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-06-16 08:03:50 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
lsusb output for the webcam (28.30 KB, text/plain)
2012-08-01 08:43 EDT, Vasiliy Sharapov
no flags Details
screenshot of the issue (392.60 KB, image/png)
2012-08-01 08:43 EDT, Vasiliy Sharapov
no flags Details
lsusb (525 bytes, text/x-log)
2014-02-10 20:58 EST, Vasiliy Sharapov
no flags Details
dmidecode (10.53 KB, text/x-log)
2014-02-10 20:58 EST, Vasiliy Sharapov
no flags Details
Patch to add false positive table (6.45 KB, application/mbox)
2014-03-02 06:06 EST, Gregor Jasny
no flags Details
PATCH 1/2: libv4lcontrol: Check control_flags before doing wildcard maching on upside_down (2.38 KB, patch)
2014-03-02 09:01 EST, Hans de Goede
no flags Details | Diff
Patch 2/2: libv4lcontrol: Add Asus F3Sc with 04f2:b012 cam as upside down false positive (1.28 KB, patch)
2014-03-02 09:03 EST, Hans de Goede
no flags Details | Diff

  None (edit)
Description Vasiliy Sharapov 2012-08-01 08:41:18 EDT
Description of problem:
The captured image is flipped vertically in cheese on an Asus F7S Laptop.

Version-Release number of selected component (if applicable):
2:3.4.2-1.el7

How reproducible:
100%

Steps to Reproduce:
1.Open cheese
  
Actual results:
Image flipped vertically

Expected results:
Image not flipped vertically
Comment 1 Vasiliy Sharapov 2012-08-01 08:43:26 EDT
Created attachment 601738 [details]
lsusb output for the webcam
Comment 2 Vasiliy Sharapov 2012-08-01 08:43:50 EDT
Created attachment 601739 [details]
screenshot of the issue
Comment 3 Vasiliy Sharapov 2012-08-01 09:33:55 EDT
This seems like it's probably libv4l component... but I'm not 100% sure.
Comment 4 Debarshi Ray 2012-10-15 11:51:47 EDT
Could you please try:
$ gst-launch-1.0 v4l2src device=/dev/video1 ! videoconvert ! videoscale !
autovideosink

If you get the same inverted image then this is indeed a v4l2 problem. I must also point out that cheese-3.4.x is too old. You should try with cheese-3.6.x and/or gstreamer 1.0.x.
Comment 5 Vasiliy Sharapov 2012-11-04 18:57:05 EST
(In reply to comment #4)
> Could you please try:
> $ gst-launch-1.0 v4l2src device=/dev/video1 ! videoconvert ! videoscale !
> autovideosink
> 
> If you get the same inverted image then this is indeed a v4l2 problem. I
> must also point out that cheese-3.4.x is too old. You should try with
> cheese-3.6.x and/or gstreamer 1.0.x.

Re-tested on F18 via gst-launch-0.10:
(Cheese 3.6.1; gst-launch-0.10 version 0.10.36)
Had to take videoconvert out of the pipe bacause: `WARNING: erroneous pipeline: no element "videoconvert"`
Bug was still present, so I guess you can change component to gstreamer.
Comment 6 Debarshi Ray 2012-11-05 08:36:55 EST
(In reply to comment #5)
> Re-tested on F18 via gst-launch-0.10:
> (Cheese 3.6.1; gst-launch-0.10 version 0.10.36)

RHEL7 will be using GStreamer 1.0.x, not 0.10.x. F18's cheese is built against 1.0: rpm --requires -q cheese | grep libgstreamer

> Had to take videoconvert out of the pipe bacause: `WARNING: erroneous
> pipeline: no element "videoconvert"`

That is because the videoconvert element does not exist in 0.10.x. As far as I know, its counterpart in 0.10.x is ffmpegcolorspace.
Comment 7 Debarshi Ray 2012-11-05 08:38:30 EST
Reassigning to gstreamer1-plugins-good because that is where the v4l2src is.
Comment 10 Wim Taymans 2013-12-17 13:23:21 EST
Could you please try with GStreamer 1.0:

$ GST_DEBUG=*v4l*:8 gst-launch-1.0 v4l2src ! videoconvert ! videoscale ! autovideosink 2>debug.log 

Then compress and attach debug.log here?
Comment 12 Wim Taymans 2014-02-07 09:18:20 EST
I'm pretty sure this is something that needs a tweak in libv4l2.
Comment 13 Hans de Goede 2014-02-07 09:29:25 EST
Yep this probably needs a libv4l2 upside-down webcam table entry (a table which is mostly filled with Asus models). 

Vasiliy,

Can you please do:

lsusb > lsusb.log
sudo dmidecode > dmi.log

And attach both logfiles here ?

Thanks,

Hans
Comment 14 Vasiliy Sharapov 2014-02-10 20:58:11 EST
Created attachment 861644 [details]
lsusb
Comment 15 Vasiliy Sharapov 2014-02-10 20:58:31 EST
Created attachment 861645 [details]
dmidecode
Comment 16 Hans de Goede 2014-02-17 08:39:57 EST
Vasiliy,

When is the last time you tried this ? This should just work with recent RHEL-7 snapshots and / or a recent Fedora. Can you give this another try?

Thanks & Regards,

Hans
Comment 17 Vasiliy Sharapov 2014-02-18 20:48:15 EST
This bug is still present in RHEL-7.0-20140210.0
Comment 18 Hans de Goede 2014-02-19 02:43:09 EST
Hi,

(In reply to Vasiliy Sharapov from comment #17)
> This bug is still present in RHEL-7.0-20140210.0

Hmm, perhaps your laptop is a false positive, and is getting flipped while it should not be flipped.

Can you try doing the following from a terminal:

LIBV4LCONTROL_FLAGS=0 cheese

And while at it, if the above does not help, can you also also try:

LIBV4LCONTROL_FLAGS=3 cheese

Thanks,

Hans
Comment 19 Hans de Goede 2014-02-19 10:43:41 EST
Ok, so Vasiliy gave me remote access to the machine and this is indeed a false positive of the upside-down cam detection in libv4l.

I need to think a bit about how to best fix this, moving to assigned.
Comment 21 Gregor Jasny 2014-02-28 12:36:56 EST
Hi Vasiliy,

just to double check: This webcam is built into the laptop itself, correct?

(If yes, this bug answers my question if ASUS managed to built in a single webcam in the correct orientation :)

Thanks,
Gregor
Comment 22 Gregor Jasny 2014-03-02 06:04:43 EST
I downloaded some webcam drivers for the F3Sc model from the ASUS website. I hoped that they use some DMI or ACPI bits to flag models with upside down webcams. But instead they copy the webcam driver(s) for every model and alter the flip and mirror bits in the driver inf file. What a mess!

The driver for the webcam owned by Vasiliy had the flip and mirror bits set to 0 in the .inf file. Some other cameras for the same model had both set to 1. Some other models with the same camera had the bits turned on.

Thus excluding the F3Sc from the upside-down table wouldn't be enough. So I decided to include a false-positive (aka. correctly orientated table) that is consulted, too.

Attached you'll find a proposal for a false-positive table. Hans, could you please review it? I'll try to come up with a unit test for the upside down table later.

Thanks,
Gregor
Comment 23 Gregor Jasny 2014-03-02 06:06:24 EST
Created attachment 869598 [details]
Patch to add false positive table
Comment 24 Hans de Goede 2014-03-02 08:50:17 EST
Hi Gregor,

Thanks for working on this. I was planning on writing a fix for this myself, but I don't mind you beating me to it :)

I was thinking along the same lines as you are (add a list of known false-positives), only I was planning to re-use the existing v4lcontrol_flags table. Have you considered that?

My idea is to have a line for false positives inside the v4lcontrol_flags table with flags == 0, and to
modify v4lcontrol_get_flags_from_db to do the more specific (no wildcards) v4lcontrol_flags check first, and if that matches return from v4lcontrol_get_flags_from_db (instead of the current break.

Looking at this now, I think this should be really easy. I'll attach a quick and dirty (and untested) version of what I've in mind.

Regards,

Hans
Comment 25 Hans de Goede 2014-03-02 09:01:32 EST
Created attachment 869625 [details]
PATCH 1/2: libv4lcontrol: Check control_flags before doing wildcard  maching on upside_down
Comment 26 Hans de Goede 2014-03-02 09:03:06 EST
Created attachment 869626 [details]
Patch 2/2: libv4lcontrol: Add Asus F3Sc with 04f2:b012 cam as upside  down false positive
Comment 27 Gregor Jasny 2014-03-02 12:53:39 EST
Hi,

I considered using the v4lcontrol_flags, too. The downside I saw is that no globbing is possible and the DMI values need to be whitespace correct.

But your patch looks much more sane than my one. I will test it, push it into the git repo, and will release a new stable v4l-utils version. This will happen during the next week.

Thanks,
Gregor
Comment 28 Hans de Goede 2014-03-11 07:52:35 EDT
Vasiliy,

I've just done a brew scratch build with the patches we plan to merge upstream to get this fixed:
http://brewweb.devel.redhat.com/brew/taskinfo?taskID=7186372

Can you please install the libv4l packages from that build on the laptop, and see if they resolve the upside down issue ?

Thanks,

Hans
Comment 29 Hans de Goede 2014-06-16 08:03:50 EDT
No response to need-info for 3 months, closing (the fix original developed here is upstream now).

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