Skip to content

Acer Switch 3 SW312-31 Incorrect Screen Rotation #13732

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
RoadrunnerWMC opened this issue Oct 5, 2019 · 4 comments · Fixed by #13779
Closed

Acer Switch 3 SW312-31 Incorrect Screen Rotation #13732

RoadrunnerWMC opened this issue Oct 5, 2019 · 4 comments · Fixed by #13779

Comments

@RoadrunnerWMC
Copy link
Contributor

systemd version the issue has been seen with
240 (Ubuntu), 243-1.fc31 (Fedora)

Used distribution
I tested with two distros:

  • Ubuntu 19.04
  • Fedora 31 Beta 1.1

Expected behaviour you didn't see
The screen graphics (in my case, the entire GNOME desktop environment) are oriented correctly, and when you rotate the device, the screen graphics correctly rotate to match.

Unexpected behaviour you saw
The screen graphics are always rotated incorrectly. The graphics are 90 degrees counterclockwise if the device is right-side up or upside down, and 90 degrees clockwise if the device is sideways.

Steps to reproduce the problem

  • Have an Acer Switch 3 SW312-31
  • Boot it into Ubuntu or Fedora from a live USB
  • When the desktop appears, the screen orientation is incorrectly detected as described above.

More information
I believe this is a hwdb issue, since I was able to make the graphics rotate completely upside-down by messing with 60-sensor.hwdb. Copying the latest Acer rules from GitHub does not help in my case, though.

Using the instructions from https://unix.stackexchange.com/a/411241, here are the identification parameters for my device:

Driver name: BOSC0200
Vendor: Acer
Product name: Switch SW312-31

Output of cat /sys/`udevadm info -q path -n /dev/iio:device0`/../modalias:

acpi:BOSC0200:BOSC0200:

Output of cat /sys/class/dmi/id/modalias:

dmi:bvnInsydeCorp.:bvrV1.14:bd11/08/2018:svnAcer:pnSwitchSW312-31:pvrV1.14:rvnAPL:rnTahiti_S:rvrV1.14:cvnAcer:ct32:cvrChassisVersion:

Based on all of the above, I think the rule name for this device would be sensor:modalias:acpi:BOSC0200*:dmi:*:svnAcer*:pnSwitchSW312-31:*? I'm not sure exactly where to place the glob asterisks, though (they seem to be pretty inconsistent among the existing rules for Acer products).

I'm happy to open a PR for this once I know what the correct rotation matrix is, but despite some searching, I couldn't figure out how you're supposed to determine it. I could probably swap and negate rows of the identity matrix more or less at random until it seems to work, but is that actually how it's done, or is there a more systematic way?

Thank you for any help you can provide!

@poettering
Copy link
Member

/cc @hadess

@hadess
Copy link
Contributor

hadess commented Oct 8, 2019

I could probably swap and negate rows of the identity matrix more or less at random until it seems to work, but is that actually how it's done, or is there a more systematic way?

That's how it's done, as there's only one correct way.

We use the same orientation as Windows:
https://docs.microsoft.com/en-gb/previous-versions/windows/apps/dn440593(v=win.10)

I'll try to get this documented and added to iio-sensor-proxy at some point.

@hadess
Copy link
Contributor

hadess commented Oct 8, 2019

Documentation issues will be tracked in: hadess/iio-sensor-proxy#285

@RoadrunnerWMC
Copy link
Contributor Author

I figured it would make the most sense to try existing rotation matrices for other Acer products instead of guessing randomly, and the first one I tried worked perfectly. The pull request above uses that.

poettering pushed a commit that referenced this issue Oct 16, 2019
mikhailnov pushed a commit to mikhailnov/systemd that referenced this issue Nov 15, 2019
mikhailnov pushed a commit to mikhailnov/systemd that referenced this issue Aug 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants