hadess / iio-sensor-proxy

IIO accelerometer sensor to input device proxy
198 stars 64 forks source link

Explain mount matrix quirk #285

Closed SavageAUS closed 4 years ago

SavageAUS commented 4 years ago

Which 0 or 1 does what?

sensor:modalias:acpi:SMO8500:dmi::svnASUSTeK:pnTP500LNG: ACCEL_MOUNT_MATRIX=0, 1, 0; 1, 0, 0; 0, 0, 1

Like what does the first 1 do? the second? normal, left, inverted, right?

I cannot find anything online to tell me which "switch" does what?

The reason for asking is my screen is rotated 90 degrees to the right when i log into Arch Linux (Plasma) and i want to correct this and then make sure all other rotates function as they should.

When i have it set as above the screen rotation on login if normal but not all rotations work.

Ok i got all correct rotations working with this: sensor:modalias:acpi:SMO8500:dmi::svnASUSTeK:pnTP500LNG: ACCEL_MOUNT_MATRIX=0, 1, 0; 1, 0, 0; 0, 0, 1

but my touchscreen and touchpad are inverted so they are pretty mush unusable. Do any of the ACCEL_MOUNT_MATRIX=0, 1, 0; 1, 0, 0; 0, 0, 1 control these items?

hadess commented 4 years ago

Pointing you to this is the best I can do right now: https://docs.microsoft.com/en-gb/previous-versions/windows/apps/dn440593(v=win.10)

The matrix is a "3x3 matrix" which the accelerometer readings are multiplied by so for example: accel reading: x = 0, y = -256, z = 0 matrix: 1, 0, 0; 0, 0, 1; 0, 1, 0 corrected reading: x = 0, y = 0, -256

I couldn't find better example on how to do this right now, sorry.

hadess commented 4 years ago

Some notes for myself:

KaTex syntax for rotation matrix:

  \left[ {\begin{array}{ccc}
   x & y & z\\
  \end{array} } \right]
*
  \left[ {\begin{array}{ccc}
   x & y & z\\
   x & y & z\\
   x & y & z\\
  \end{array} } \right]

Gitlab KaTeX support: https://gitlab.com/gitlab-org/gitlab/blob/master/doc/user/markdown.md#math

Some PDFs with explanations: https://cache.freescale.com/files/sensors/doc/app_note/AN3461.pdf https://www.degruyter.com/downloadpdf/j/acsc.2016.26.issue-2/acsc-2016-0013/acsc-2016-0013.pdf http://www.irrd.ca/cag/smartphone/MEMEA2013-Smartphone-axis.pdf

hadess commented 4 years ago

Moved to https://gitlab.freedesktop.org/hadess/iio-sensor-proxy/issues/285