Bug 1311545 - cheese picture upside down with chicony asus webcam
Summary: cheese picture upside down with chicony asus webcam
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: v4l-utils
Version: 23
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Hans de Goede
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-02-24 12:45 UTC by istaff
Modified: 2016-03-03 20:23 UTC (History)
5 users (show)

Fixed In Version: v4l-utils-1.10.0-2.fc23
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-03-03 20:23:50 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
cheese capture (793.13 KB, image/png)
2016-02-24 12:45 UTC, istaff
no flags Details

Description istaff 2016-02-24 12:45:23 UTC
Created attachment 1130208 [details]
cheese capture

Description of problem:
every time I launche cheese I have the image upside down

Version-Release number of selected component (if applicable):


How reproducible:

every time I use the webcam

Steps to Reproduce:
1.launche cheese or any software use that use webcam
2.watch the image on cheese upside down
3.

Actual results:


Expected results:


Additional info:

[fmust@localhost ~]$ rpm -qa "*v4l*"
libv4l-1.8.1-1.fc23.x86_64
v4l2ucp-2.0.1-14.fc23.x86_64
v4l-utils-1.8.1-1.fc23.x86_64

[fmust@localhost ~]$ lsmod | grep v4l
v4l2_common            16384  1 videobuf2_core
videodev              163840  3 uvcvideo,v4l2_common,videobuf2_core

[fmust@localhost ~]$ lsusb
Bus 001 Device 003: ID 04f2:b012 Chicony Electronics Co., Ltd 1.3 MPixel UVC Webcam
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 002: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 002: ID 03f0:a407 Hewlett-Packard 
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Comment 1 istaff 2016-02-24 12:56:40 UTC
I've installed v4l2ucp but it hasn't any option for "flipdown".
The web cam work properly under vista and ubuntu.

Comment 2 Hans de Goede 2016-02-24 14:30:28 UTC
Hi,

This is likely a problem with the upside-down devices table in v4l-utils. 

I've just build a new version, with an updated upside-down table, perhaps that fixes things ?

Please download v4l-utils-1.10.0-1.fc23.x86_64.rpm and libv4l-1.10.0-1.fc23.x86_64.rpm from here:
http://koji.fedoraproject.org/koji/taskinfo?taskID=13114599

And then install them by running the following command in a dir with these 2 files:

sudo rpm -Uvh *.rpm

Then try running cheese again.

If that does not help, please do:

cat /sys/class/dmi/id/board_name /sys/class/dmi/id/product_name

And copy and paste the output of that command here.

Regards,

Hans

Comment 3 istaff 2016-02-25 12:43:28 UTC
hi,
Done but didn't work cheese displays upside down yet.

[fmust@localhost ~]$ cat /sys/class/dmi/id/board_name /sys/class/dmi/id/product_name
X71SL     
X71SL               


thank you, istaff.

Comment 4 Hans de Goede 2016-02-25 13:40:10 UTC
Hmm,

Not sure what is going on here (specifically not sure why it does work on Ubuntu), can you try running
cheese like this:

LIBV4LCONTROL_FLAGS=3 cheese

and like this:

LIBV4LCONTROL_FLAGS=0 cheese

One of those 2 should fix things for you, I expect / hope it is the second one.

Regards,

Hans

Comment 5 istaff 2016-02-25 14:19:39 UTC
When I run cheese with:
LIBV4LCONTROL_FLAGS=3 cheese
so good to see the webcam works so fine ;)

And when I launche with:
LIBV4LCONTROL_FLAGS=0 cheese
doesn't work picture upside down :|
THe first fix is the right fix. You think I'll always have to type this to have the picture right? Thank you very much for your help Hans.

Comment 6 Hans de Goede 2016-02-25 15:22:55 UTC
Hi,

(In reply to istaff from comment #5)
> When I run cheese with:
> LIBV4LCONTROL_FLAGS=3 cheese
> so good to see the webcam works so fine ;)

Ok, so that is both good and bad news, good in that it works, and bad in that for some reason libv4l is not automatically applying those flags on your system.

So now we need to find out why. libv4l has a table of laptops which have their webcams mounted upside down (yes vendors do this) and it has special handling for Asus since Asus does not just do this, they do this a lot!

So inside http://git.linuxtv.org/v4l-utils.git/tree/lib/libv4lconvert/control/libv4lcontrol.c we've:

static const char *asus_board_name[] = { "...", "X71[A-Z]*", "...", NULL };

Which should match with the X71SL your board has in /sys/class/dmi/id/board_name

It also has:

static const char *asus_board_vendor[] = {
	"ASUSTeK Computer Inc.",
	"ASUSTeK Computer INC.",
	"ASUS CORPORATION",
	NULL };

Can you do:

cat /sys/class/dmi/id/board_vendor

And copy and paste the output here, maybe asus put something weird in your board?

Last it has:

static const struct v4lcontrol_usb_id asus_camera_id[] = {
	{ 0x04f2, 0xb012 },
	{ 0x04f2, 0xb034 },
	{ 0x04f2, 0xb036 },
	{ 0x04f2, 0xb071 },
...
};

Which matches with your lsusb output, and if all 3 arrays contain any match, then libv4l should do the 
LIBV4LCONTROL_FLAGS=3 automatically ...

> And when I launche with:
> LIBV4LCONTROL_FLAGS=0 cheese
> doesn't work picture upside down :|

Ok, so you've an upside-down mounted webcam, which is quite normal on Asus laptops (for other Vendors we've a different table where all 3 items we check must be an exact match for that exact laptop, for Asus we simply want any entry from all 3 arrays to match and then we will assume the cam is upside down as it is that common on Asus).

> The first fix is the right fix. You think I'll always have to type this to
> have the picture right?

Nope, we need to figure out why the special Asus handling code is not triggering on your laptop.

> Thank you very much for your help Hans.

You're welcome, I actually wrote the upside-down handling code in libv4l, so I'm quite familiar with the problem :)

Regards,

Hans

Comment 7 istaff 2016-02-25 19:21:37 UTC
Hi
Ok, thanks for the explanation  now I understand why I have this problem,(like other asus users with webcam).
Here's the return for the command:

[fmust@localhost ~]$ cat /sys/class/dmi/id/board_vendor
PEGATRON CORPORATION         
[fmust@localhost ~]$ 

Thank you for your patience Hans.

Comment 8 istaff 2016-02-26 20:10:23 UTC
Hi,
I've found some informations about the webcam, don't know if this could help but...

Chicony_CNF7050_CNF6131 Camera
USB\VID_04F2&PID_B012&REV_0346&MI_00
USB\VID_04F2&PID_B012&MI_00
Sonix

Comment 9 Hans de Goede 2016-02-27 13:25:50 UTC
Hi,

(In reply to istaff from comment #8)
> Hi,
> I've found some informations about the webcam, don't know if this could help
> but...
> 
> Chicony_CNF7050_CNF6131 Camera
> USB\VID_04F2&PID_B012&REV_0346&MI_00
> USB\VID_04F2&PID_B012&MI_00
> Sonix

Thanks, but the problem is already clear:

[fmust@localhost ~]$ cat /sys/class/dmi/id/board_vendor
PEGATRON CORPORATION         

That string is not in the asus_board_vendor array, which explains why the LIBV4LCONTROL_FLAGS=3 is not being done automatically. Now the question becomes how to fix this. I will discuss this with the other v4l-util devs. I'll put you in the Cc of the mails.

Comment 10 Hans de Goede 2016-02-27 13:45:55 UTC
Hi,

I've just started a scratch-build of v4l-utils for F23 with a patch added which should fix your issue in what I believe is the best way to fix it:

http://koji.fedoraproject.org/koji/taskinfo?taskID=13149562

Can you please download v4l-utils-1.10.0-2.fc23.x86_64.rpm and libv4l-1.10.0-2.fc23.x86_64.rpm from there (when it is done bulding) and then install them by running the following command in a dir with these 2 files:

sudo rpm -Uvh *.rpm

Then try running cheese again (without setting LIBV4LCONTROL_FLAGS), it should now do the right thing automatically.

Regards,

Hans

Comment 11 istaff 2016-02-27 18:48:17 UTC
Hi
I'had problems for the install but now it's done and it works, you're the best!!!
Happy to have a normal webcam now, if you come in France one day, you'll be welcomed, billion thanks Hans.Merci mille fois encore, THANK YOU !!!!VERY VERY MUCH!!!!

Comment 12 istaff 2016-02-27 18:53:08 UTC
Sorry I come back just to ask how can I do to mark this bug as resolved? I mark it as closed or...? Thanks Hans...you're genius!

Comment 13 Hans de Goede 2016-02-27 20:22:41 UTC
Hi,

(In reply to istaff from comment #12)
> Sorry I come back just to ask how can I do to mark this bug as resolved? I
> mark it as closed or...? Thanks Hans...you're genius!

The build which I gave you is not an official build, as I'm waiting to see if upstream is ok with the patch, once that is resolved I'll do an official bugfix release and close the bug.

Regards,

Hans

Comment 14 istaff 2016-02-28 09:55:16 UTC
hi,

Ok, good luck

Comment 15 Fedora Update System 2016-03-01 12:06:25 UTC
v4l-utils-1.10.0-2.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-68253fbd78

Comment 16 Fedora Update System 2016-03-02 12:52:46 UTC
v4l-utils-1.10.0-2.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-68253fbd78

Comment 17 istaff 2016-03-03 12:34:57 UTC
Hi
Ok it's done, thanks

Comment 18 Fedora Update System 2016-03-03 20:23:47 UTC
v4l-utils-1.10.0-2.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.


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