Camera image is rotated by 90° on M10 because Qt says the screen's native orientation is portrait

Bug #1601887 reported by Pat McGowan on 2016-07-11
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Canonical System Image
High
Michał Sawicz
Oxide
High
Santosh
1.16
High
Santosh
1.17
High
Santosh
frieza
High
Unassigned
qtubuntu (Ubuntu)
High
Gerry Boland

Bug Description

M10 proposed 138

Open a google hangout preview

The image is flipped horizontally and rotated 90 deg right

Pat McGowan (pat-mcgowan) wrote :
description: updated
David Barth (dbarth) on 2016-07-11
summary: - camera is inverted and rotated
+ camera is inverted and rotated on M10
affects: webbrowser-app (Ubuntu) → oxide
Changed in oxide:
importance: Undecided → High
status: New → Triaged
assignee: nobody → Chris Coulson (chrisccoulson)

I think the inversion was already there, and is something done by the hangouts app itself, on purpose. The rotation clearly is a recent regression though.

Chris Coulson (chrisccoulson) wrote :

Yes, the hangouts app mirrors the camera preview - the actual image sent to other parties is not mirrored.

Changed in oxide:
status: Triaged → In Progress
Chris Coulson (chrisccoulson) wrote :

This isn't a bug in Oxide - QScreen::nativeOrientation says the native orientation is portrait, when it should be landscape. This needs to be correct because the camera orientation is referenced to this

Changed in oxide:
status: In Progress → Triaged
Changed in canonical-devices-system-image:
status: New → Confirmed
importance: Undecided → High
milestone: none → 13
summary: - camera is inverted and rotated on M10
+ camera is defaulting to portrait on M10
summary: - camera is defaulting to portrait on M10
+ Camera image is rotated by 90° on M10 because Qt says the screen's
+ native orientation is portrait
Chris Coulson (chrisccoulson) wrote :

This probably isn't clear to anyone else looking at this bug, but Oxide rotates the camera image based on the current device rotation and the native camera orientation, which we get from the Android camera service via libhybris, using this API:

https://developer.android.com/reference/android/hardware/Camera.html#getCameraInfo(int, android.hardware.Camera.CameraInfo)

The returned native orientation is described in the documentation as (see https://developer.android.com/reference/android/hardware/Camera.CameraInfo.html#orientation):

"The orientation of the camera image. The value is the angle that the camera image needs to be rotated clockwise so it shows correctly on the display in its natural orientation"

In order to do this, we need to know the rotation of the device, which we calculate using the current device orientation referenced to its native orientation.

In this case, the native orientation is incorrect - QScreen::nativeOrientation returns portrait. It should be landscape for the M10 (and other tablets).

Oxide is doing exactly the same thing as Chrome/Android, except that Chrome uses Android's Display.getRotation() API ( https://developer.android.com/reference/android/view/Display.html#getRotation() )

Changed in canonical-devices-system-image:
assignee: nobody → Michał Sawicz (saviq)
Changed in qtubuntu:
assignee: nobody → Gerry Boland (gerboland)
Pat McGowan (pat-mcgowan) wrote :

Not sure if its a directly related issue but the E5 image is upside down, which also used to work correctly. Obviously something regressed. If that doesn't sound related I can open a new bug.

Changed in frieza:
status: New → Confirmed
importance: Undecided → High
Chris Coulson (chrisccoulson) wrote :

vegetahd probably has the same issue as krillin (bug 1567542), which is actually a device bug. I haven't got one of those though.

Pat McGowan (pat-mcgowan) wrote :

@chris right, the devices are essentially the same so we can't special case one without the other

no longer affects: vegetahd
Gerry Boland (gerboland) wrote :

The M10's lcd panel is actually a portrait lcd mounted 90degrees:

phablet@frieza:~$ MIR_SOCKET=/run/mir_socket mirout
Connected to server: <default>
Card 0: Max 3 simultaneous outputs
Output 1: Card 0, LVDS, connected, 1200x1920+0+0, used, on, 135mm x 216mm (10.0"), normal
    1200x1920 56.91*+
Output 2: Card 0, DisplayPort, disconnected
Output 3: Card 0, Virtual, disconnected
    1920x1080 60.00*+

See how the LVDS output (to the lcd) has width 1200 and height 1920.

QtUbuntu relies on these values to guess the native orientation of the display. But it has no idea the panel is actually mounted 90degrees. I believe the graphics driver rotates the actual display too, further confusing things.

Unless we've a way to determine the rotation of the lcd in the housing, I suspect we'll need a per-device quirk to make sure qtubuntu or mir returns the display dimensions we actually want.

Changed in qtubuntu:
status: New → Confirmed
importance: Undecided → High
Olivier Tilloy (osomon) wrote :
Changed in oxide:
assignee: Chris Coulson (chrisccoulson) → Santosh (santoshbit2007)
status: Triaged → Fix Released
Olivier Tilloy (osomon) on 2016-08-17
Changed in oxide:
milestone: none → branch-1.18
David Barth (dbarth) wrote :

Confirmed fixed on 'cooler' by release 1.16.8 of oxide

Changed in canonical-devices-system-image:
status: Confirmed → Fix Committed
Changed in canonical-devices-system-image:
status: Fix Committed → Fix Released
Michał Sawicz (saviq) on 2017-03-13
affects: qtubuntu → qtubuntu (Ubuntu)
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers