Automatic screen rotation
#13
Screen rotation stopped working after recent upgrade. Running Arch Wayland:
Code:
$ uname -a

Linux pinetab2 6.6.13-danctnix1-1-pinetab2 #1 SMP PREEMPT_DYNAMIC Mon, 22 Jan 2024 11:53:08 +0000 aarch64 GNU/Linux

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

    Waiting for iio-sensor-proxy to appear
+++ iio-sensor-proxy appeared
=== Has accelerometer (orientation: right-up)

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

P: /devices/platform/fe5e0000.i2c/i2c-5/5-0018/iio:device1
M: iio:device1
R: 1
U: iio
T: iio_device
D: c 252:1
N: iio:device1
L: 0
E: DEVPATH=/devices/platform/fe5e0000.i2c/i2c-5/5-0018/iio:device1
E: DEVNAME=/dev/iio:device1
E: DEVTYPE=iio_device
E: OF_NAME=accelerometer
E: OF_FULLNAME=/i2c@fe5e0000/accelerometer@18
E: OF_COMPATIBLE_0=silan,sc7a20
E: OF_COMPATIBLE_N=1
E: MAJOR=252
E: MINOR=1
E: SUBSYSTEM=iio
E: USEC_INITIALIZED=9020319
E: IIO_SENSOR_PROXY_TYPE=iio-poll-accel iio-buffer-accel
E: SYSTEMD_WANTS=iio-sensor-proxy.service
E: TAGS=:systemd:
E: CURRENT_TAGS=:systemd:

8) Get current mount matrix:
Code:
$ cat /sys/devices/platform/fe5e0000.i2c/i2c-5/5-0018/iio:device1/mount_matrix

1, 0, 0; 0, 0, 1; 0, 1, 0

9) Add custom mount matrix:
Code:
$ sudo nano /etc/udev/hwdb.d/61-sensor-local.hwdb

# /etc/udev/hwdb.d/61-sensor-local.hwdb
sensor:modalias:*sc7a20:*
  ACCEL_MOUNT_MATRIX=0, 1, 0; 1, 0, 0; 0, 0, 1
# above matrix might not be correct rotation matrix: just testing

10) Update hwdb:
Code:
$ sudo systemd-hwdb update

11) Register trigger:
Code:
$ sudo udevadm trigger -v -p DEVNAME=/dev/iio:device1

/sys/devices/platform/fe5e0000.i2c/i2c-5/5-0018/iio:device1

12) Get device info (note: shows new mount matrix):
Code:
$ udevadm info -n /dev/iio:device1

P: /devices/platform/fe5e0000.i2c/i2c-5/5-0018/iio:device1
M: iio:device1
R: 1
U: iio
T: iio_device
D: c 252:1
N: iio:device1
L: 0
E: DEVPATH=/devices/platform/fe5e0000.i2c/i2c-5/5-0018/iio:device1
E: DEVNAME=/dev/iio:device1
E: DEVTYPE=iio_device
E: OF_NAME=accelerometer
E: OF_FULLNAME=/i2c@fe5e0000/accelerometer@18
E: OF_COMPATIBLE_0=silan,sc7a20
E: OF_COMPATIBLE_N=1
E: MAJOR=252
E: MINOR=1
E: SUBSYSTEM=iio
E: USEC_INITIALIZED=9020319
E: ACCEL_MOUNT_MATRIX=0, 1, 0; 1, 0, 0; 0, 0, 1
E: IIO_SENSOR_PROXY_TYPE=iio-poll-accel iio-buffer-accel
E: SYSTEMD_WANTS=iio-sensor-proxy.service
E: TAGS=:systemd:
E: CURRENT_TAGS=:systemd:

13) Repeat sensor test above:
Code:
$ monitor-sensor --accel

[Same result]

14) Repeat get current mount matrix:
Code:
$ cat /sys/devices/platform/fe5e0000.i2c/i2c-5/5-0018/iio:device1/mount_matrix

[Same result]

15) Journal shows nothing unless reboot with new settings:
Code:
$ journalctl --since=today | grep iio

pinetab2 kernel: iio iio:device1: interrupts on the falling edge or active low level
pinetab2 iio-sensor-prox[3129]: Could not find trigger name associated with /sys/devices/platform/fe5e0000.i2c/i2c-5/5-0018/iio:device1

I wasn't able to find any relevant leads by searching for terms from these journal entries.

Any suggestions?
  Reply


Messages In This Thread
Automatic screen rotation - by frtodd - 06-06-2023, 07:05 PM
RE: Automatic screen rotation - by zoward - 06-07-2023, 08:26 AM
RE: Automatic screen rotation - by frtodd - 06-07-2023, 11:12 AM
RE: Automatic screen rotation - by exu - 06-07-2023, 12:22 PM
RE: Automatic screen rotation - by zoward - 06-08-2023, 04:07 AM
RE: Automatic screen rotation - by zoward - 06-07-2023, 04:57 PM
RE: Automatic screen rotation - by frtodd - 06-07-2023, 05:26 PM
RE: Automatic screen rotation - by Corconegre - 06-13-2023, 01:57 AM
RE: Automatic screen rotation - by KelsonV - 06-13-2023, 11:20 AM
RE: Automatic screen rotation - by chzbacon - 06-19-2023, 06:54 PM
RE: Automatic screen rotation - by rqkeating - 06-20-2023, 10:21 AM
RE: Automatic screen rotation - by mtomaschett - 03-17-2024, 01:53 PM
RE: Automatic screen rotation - by hansen - 04-07-2024, 06:58 AM
RE: Automatic screen rotation - by frtodd - 04-10-2024, 06:37 AM
RE: Automatic screen rotation - by hansen - 04-28-2024, 07:53 AM
RE: Automatic screen rotation - by frtodd - 04-28-2024, 03:08 PM
RE: Automatic screen rotation - by Kevin Kofler - 04-28-2024, 05:58 PM
RE: Automatic screen rotation - by hansen - 04-29-2024, 10:33 AM
RE: Automatic screen rotation - by Kevin Kofler - 04-29-2024, 02:34 PM

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

Forum Jump:


Users browsing this thread: 1 Guest(s)