06-19-2023, 06:54 PM
Thanks for posting this. Works great!
Automatic screen rotation
|
06-19-2023, 06:54 PM
Thanks for posting this. Works great!
06-20-2023, 10:21 AM
The command given previously, `sudo pacman -S iio-sensor-proxy` worked for me too. I did have to go into settings, display configuration and uncheck "only in tablet mode". If I kept that option checked, the screen was stuck in vertical mode but now it follows its orientation. Nice!
03-17-2024, 01:53 PM
(This post was last modified: 03-31-2024, 09:58 AM by mtomaschett.
Edit Reason: clarification
)
Screen rotation stopped working after recent upgrade. Running Arch Wayland:
Code: $ uname -a I tried to add a custom mount matrix to fix the problem, but I am not able to get any matrix to be applied. Here's what I did: 1) Install: Code: $ sudo pacman -S iio-sensor-proxy 2) Settings -> Display & Monitor: Orientation: "automatic" and "only when in tablet mode" selected (if these settings don't appear immediately, click to another settings panel, then back to "Display & Monitor") 3) Ensure that PineTab2 is attached to keyboard case 4) This command sometimes causes touchpad on case to become unresponsive; restart required: Code: $ monitor-sensor --accel 5) remove PinTab2 from case, rotate 90 counter-clockwise (screen top switches from device's right edge to device's left edge) Code: Accelerometer orientation changed: bottom-up 6) rotate 90 clockwise (screen top switches from device's left edge to device's bottom edge) Code: Accelerometer orientation changed: right-up [or "normal"] 7) Ctrl-C to quit. Return PineTab2 to case (screen top switches back to device's right edge). Get device info (note lack of mount matrix entry): Code: $ udevadm info -n /dev/iio:device1 8) Get current mount matrix: Code: $ cat /sys/devices/platform/fe5e0000.i2c/i2c-5/5-0018/iio:device1/mount_matrix 9) Add custom mount matrix: Code: $ sudo nano /etc/udev/hwdb.d/61-sensor-local.hwdb 10) Update hwdb: Code: $ sudo systemd-hwdb update 11) Register trigger: Code: $ sudo udevadm trigger -v -p DEVNAME=/dev/iio:device1 12) Get device info (note: shows new mount matrix): Code: $ udevadm info -n /dev/iio:device1 13) Repeat sensor test above: Code: $ monitor-sensor --accel 14) Repeat get current mount matrix: Code: $ cat /sys/devices/platform/fe5e0000.i2c/i2c-5/5-0018/iio:device1/mount_matrix 15) Journal shows nothing unless reboot with new settings: Code: $ journalctl --since=today | grep iio I wasn't able to find any relevant leads by searching for terms from these journal entries. Any suggestions?
04-07-2024, 06:58 AM
I re-raise the question: Any suggestions?
04-10-2024, 06:37 AM
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.
04-28-2024, 07:53 AM
(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.This is interesting, it changed nothing at my side. The display is always rotated 90 degrees clockwise (but rotation itself works).
So I am definitely no expert.
But if rotation is working, just off by some value, that seems like a great sign. My assumption is those matrix numbers are used to modify how the screen should be drawn relative to the rotation sensor. I wonder if it's possible if the rotation sensor could be oriented differently in different device and require different values in that matrix. If rotation is working, I'd be tempted to move those 1's around in the matrix (assuming one "1" per three digit set) to see if it changes things. Good luck! (ed: grammar)
04-28-2024, 05:58 PM
(This post was last modified: 04-28-2024, 06:00 PM by Kevin Kofler.)
This matrix is a permutation matrix. Like an identity matrix, but with some rows/columns permuted. Every row and every column should contain exactly one 1, all other entries should be 0. You can try all possible permutations, for a 3×3 matrix, there are 3!=1*2*3=6 possible permutations.
I believe that the mount matrix, in addition to such a permutation, can also apply mirroring, where you replace one or more of the 1 entries by -1. (04-28-2024, 05:58 PM)Kevin Kofler Wrote: This matrix is a permutation matrix. Like an identity matrix, but with some rows/columns permuted. Every row and every column should contain exactly one 1, all other entries should be 0. You can try all possible permutations, for a 3×3 matrix, there are 3!=1*2*3=6 possible permutations.Ok, I try to fiddle around with matrix and let you know the outcome! Maybe this is a stupid question, but: must the matrix be formatted like this 0, 1, 0; 1, 0, 0; 0, 0, 1 or is it ok to have everything in one line, as in the example?
04-29-2024, 02:34 PM
I think you must have everything in one line.
|
Possibly Related Threads… | |||||
Thread | Author | Replies | Views | Last Post | |
PineTab 2 login screen rotation fix | chzbacon | 11 | 6,313 |
03-17-2024, 04:53 PM Last Post: mtomaschett |
|
Ubuntu touch rotation | GloriousCoffee | 3 | 2,318 |
01-09-2024, 06:01 AM Last Post: polrus |
|
Low-level persistent display rotation | diodelass | 8 | 11,486 |
10-06-2020, 07:17 AM Last Post: tophneal |