Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 844999

Summary: Image upside-down on Asus F7S
Product: Red Hat Enterprise Linux 7 Reporter: Vasiliy Sharapov <vsharapo>
Component: libv4lAssignee: Hans de Goede <hdegoede>
Status: CLOSED INSUFFICIENT_DATA QA Contact: Desktop QE <desktop-qa-list>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.1CC: debarshir, gjasny, hdegoede, mclasen, vsharapo, wtaymans
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-16 12:03:50 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
lsusb output for the webcam
none
screenshot of the issue
none
lsusb
none
dmidecode
none
Patch to add false positive table
none
PATCH 1/2: libv4lcontrol: Check control_flags before doing wildcard maching on upside_down
none
Patch 2/2: libv4lcontrol: Add Asus F3Sc with 04f2:b012 cam as upside down false positive none

Description Vasiliy Sharapov 2012-08-01 12:41:18 UTC
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 12:43:26 UTC
Created attachment 601738 [details]
lsusb output for the webcam

Comment 2 Vasiliy Sharapov 2012-08-01 12:43:50 UTC
Created attachment 601739 [details]
screenshot of the issue

Comment 3 Vasiliy Sharapov 2012-08-01 13:33:55 UTC
This seems like it's probably libv4l component... but I'm not 100% sure.

Comment 4 Debarshi Ray 2012-10-15 15:51:47 UTC
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 23:57:05 UTC
(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 13:36:55 UTC
(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 13:38:30 UTC
Reassigning to gstreamer1-plugins-good because that is where the v4l2src is.

Comment 10 Wim Taymans 2013-12-17 18:23:21 UTC
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 14:18:20 UTC
I'm pretty sure this is something that needs a tweak in libv4l2.

Comment 13 Hans de Goede 2014-02-07 14:29:25 UTC
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-11 01:58:11 UTC
Created attachment 861644 [details]
lsusb

Comment 15 Vasiliy Sharapov 2014-02-11 01:58:31 UTC
Created attachment 861645 [details]
dmidecode

Comment 16 Hans de Goede 2014-02-17 13:39:57 UTC
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-19 01:48:15 UTC
This bug is still present in RHEL-7.0-20140210.0

Comment 18 Hans de Goede 2014-02-19 07:43:09 UTC
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 15:43:41 UTC
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 17:36:56 UTC
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 11:04:43 UTC
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 11:06:24 UTC
Created attachment 869598 [details]
Patch to add false positive table

Comment 24 Hans de Goede 2014-03-02 13:50:17 UTC
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 14:01:32 UTC
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 14:03:06 UTC
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 17:53:39 UTC
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 11:52:35 UTC
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 12:03:50 UTC
No response to need-info for 3 months, closing (the fix original developed here is upstream now).