Automatic screen rotation
#21
(04-29-2024, 02:34 PM)Kevin Kofler Wrote: I think you must have everything in one line.

I tried all the 6 permutations and found no difference. While executing

Code:
sudo systemd-hwdb update
it complains

Code:
/etc/udev/hwdb.d/60-sensor.hwdb:2: Property expected, ignoring record with no properties.
So of course there can be no difference...

Did I miss anything?
  Reply
#22
(05-19-2024, 09:28 AM)hansen Wrote:
(04-29-2024, 02:34 PM)Kevin Kofler Wrote: I think you must have everything in one line.

I tried all the 6 permutations and found no difference. While executing

Code:
sudo systemd-hwdb update
it complains

Code:
/etc/udev/hwdb.d/60-sensor.hwdb:2: Property expected, ignoring record with no properties.
So of course there can be no difference...

Did I miss anything?


Sorry for the delay: busy weekend! 

Can you post your 60-sensor.hwdb into a code block? It sounds to me like there's something it doesn't like about how your configuration is formatted.
  Reply
#23
Sorry, didn't had much time the last weeks...after all these tries I deleted the 60-sensor.hwdb file. I'll set it up again and let you know.
  Reply
#24
(04-10-2024, 06:37 AM)frtodd Wrote: I finally did an OS update today. After the last update rotation quit working for me. After this update, it was still broken.

(Unrelated: with the current update, I can shutdown the device with wifi on! Still seems to hang when it tries to sleep with wifi on, though.)

I went through the motions of the original fix:

1. sudo pacman -S iio-sensor-proxy #[was already installed]
2. create /etc/udev/hwdb.d/60-sensor.hwdb

sensor:modalias:*
  ACCEL_MOUNT_MATRIX=0, 1, 0; 1, 0, 0; 0, 0, 1

3. Setting -> Display Configuration: Orientation = Automatic; Uncheck "Only when in tablet mode"

After a reboot, rotation seems to be mostly working.

"Mostly" because I can have it in a horizontal orientation, but if I lay the screen back too far (e.g., resting it against a pillow on the couch), it will change back to vertical orientation. I don't know if more tweaking of the matrix would help with this. But I can deal with it for now.

Hi guys,
I am quiete new to the Pinetab2 and hope I do not ask stupid questions. My problem is that the Auto Screen Rotation works, but not as it is supposed to. 
I installed the iio-sensor and when i take it out ot the case the taskbar always urns to the left hand side, so the rotation is wrong for 90 degrees.
The mentioned solution here is to create the file, maybe this is a dumb question, but how can I create this file:60-sensor.hwdb and what is the content. Could you post this file?
Thank in advance

Sumisu
  Reply
#25
(08-01-2024, 08:09 AM)Sumisu Wrote: how can I create this file:60-sensor.hwdb and what is the content. Could you post this file?
Thank in advance

Sumisu

Sumisu,

Welcome to the party! I'm glad it's almost working for you!

The contents of the file /etc/udev/hwdb.d/60-sensor.hwdb are simple:
Code:
sensor:modalias:*
  ACCEL_MOUNT_MATRIX=0, 1, 0; 1, 0, 0; 0, 0, 1

Those nine numbers should be able to fix your issue. They are labeled a matrix meaning they represent:

Code:
0 1 0
1 0 0
0 0 1


Note there is only a single "1" in each column or row. I believe this matrix accounts for the fact that the rotation sensor may be oriented differently or respond differently on each device. If your device is always 90 degrees off, then hopefully all you have to do is change the matrix to find the orientation that works for you. So, for example, I might try each of the following to see if one of them works:

  ACCEL_MOUNT_MATRIX=1, 0, 0; 0, 1, 0; 0, 0, 1
  ACCEL_MOUNT_MATRIX=1, 0, 0; 0, 0, 1; 0, 1, 0
  ACCEL_MOUNT_MATRIX=0, 1, 0; 1, 0, 0; 0, 0, 1
  ACCEL_MOUNT_MATRIX=0, 1, 0; 0, 0, 1; 1, 0, 0
  ACCEL_MOUNT_MATRIX=0, 0, 1; 1, 0, 0; 0, 1, 0
  ACCEL_MOUNT_MATRIX=0, 0, 1; 0, 1, 0; 1, 0, 0

Good luck!
  Reply
#26
My screen was 90 degrees off clockwise, the following worked for me

1. # pacman -S iio-sensor-proxy

2. # nano /etc/udev/hwdb.d/61-sensor-local.hwdb

3. Put the following in and save
#
sensor:modalias:*sc7a20:*
  ACCEL_MOUNT_MATRIX=0, 0, -1; 1, 0, 0; 0, -1, 0
#

4. # systemd-hwdb update
5. # udevadm trigger -v -p DEVNAME=/dev/iio:device1
6.  Settings -> Display & Monitor -> check "Automatic"
7. Maybe reboot, not sure


I figured the correct accel_mount_matrix by drawing 2 cubes and assigning X,Y and Z axis, one cube for Pinetab rotation and one for screen rotation and then correcting the accel_mount_matrix based on the differences. Also the numbers can be -1,0,1.

Credits to mtomaschett with this post https://forum.pine64.org/showthread.php?...#pid121865
and iio-sensor-proxy documentation https://github.com/IMbackK/iio-sensor-proxy
  Reply
#27
perfect, that's it! ?
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  PineTab 2 login screen rotation fix chzbacon 11 6,271 03-17-2024, 04:53 PM
Last Post: mtomaschett
  Ubuntu touch rotation GloriousCoffee 3 2,262 01-09-2024, 06:01 AM
Last Post: polrus
  Low-level persistent display rotation diodelass 8 11,474 10-06-2020, 07:17 AM
Last Post: tophneal

Forum Jump:


Users browsing this thread: 1 Guest(s)