2

I have an HP pavilion G6 Laptop which I've been running Debian on for roughly 2-3 years now, with the Cinnamon DE.

I've updated it to Debian testing as I was having a couple of issue with the graphics driver for my AMD A8 APU. I've only just discovered (after 4 months) that the screen will change it's orientation based on the laptops orientation.

I've already gone to this question, which has described what is happening, and why it happens. All of that is great, except for the fact that the orientation is all wrong. I'ts out by 90 degrees. When I lilt the laptop from bottom to the sky, it orientates the screen 90 degrees anti-clockwise, when I would expect a full 180 degrees.

I like this feature, and I want to get it working properly, but I just don't have a good enough knowledge on IIO and udev/dbus to do that.

This is the output of udevadm containing this particular device:

   P: /devices/platform/lis3lv02d/input/input8
   E: ABS=7
   E: DEVPATH=/devices/platform/lis3lv02d/input/input8
   E: EV=9
   E: ID_FOR_SEAT=input-platform-lis3lv02d
   E: ID_INPUT=1
   E: ID_INPUT_ACCELEROMETER=1
   E: ID_PATH=platform-lis3lv02d
   E: ID_PATH_TAG=platform-lis3lv02d
   E: IIO_SENSOR_PROXY_TYPE=input-accel
   E: MODALIAS=input:b0019v0000p0000e0000-e0,3,kra0,1,2,mlsfw
   E: NAME="ST LIS3LV02DL Accelerometer"
   E: PHYS="lis3lv02d/input0"
   E: PRODUCT=19/0/0/0
   E: PROP=0
   E: SUBSYSTEM=input
   E: SYSTEMD_WANTS=iio-sensor-proxy.service

Any help regarding this would be much appreciated.

EDIT: Thought I'd add these values from looking at iio-sensor-proxy for laptop in different 90 degree orientations:

 Y  X  Z
 0  0  1 -- Home position
 0  1  0 -- Right-up
 0 -1  0 -- Left-up
 1  0  0 -- Bottom-up
 -1 0  0 -- Top-up

Where 1 = max (roughly a value of 1200) and -1 = minimum (roughly a value of -1200)

EDIT: to clarify as per first comment, orientation is not being detected correctly by iio-sensor-proxy. When I observe the output of monitor-sensor this is what is observed:

Expected              -- Reality
Bottom-up = Bottom-up -- Bottom-up = Right-up
Right-up  = Right-up  -- Right-up  = Bottom-up
Top-up    = Top-up    -- Top-up    = Left-up
Left-up   = Left-up   -- Left-up   = Top-up

Top-up == Neutral position
humroben
  • 41
  • 6
  • As explained in other question, you need to run `monitor-sensor` on a root terminal and observe the messages in your terminal to identify if the orientation is detected correctly by iio-sensor-proxy when you flip your screen. If iio-sensor-proxy detects orientation ok, then it is a cinnamon bug and you need to apply the solution given in other question: http://unix.stackexchange.com/questions/335260/accelerometer-screen-rotation-on-non-touchscreen-laptop – George Vasiliou Jan 12 '17 at 14:37
  • iio-sensor-proxy does not detect orientation correctly, I've updated the question to reflect what is observed – humroben Jan 12 '17 at 14:44

1 Answers1

1

Since monitor-sensor is not correctly identyfying your screen real orientation , it seems that the best would be to file a bug to iio-sensor-proxy programmer https://github.com/hadess/iio-sensor-proxy to have this fixed.

As a very UGLY workaround you could disable the auto-screen rotation feature of Cinnamon by settings set org.cinnamon.settings-daemon.plugins.orientation active false and then modify this script to feet your upsidedown needs like this:

case "$ORIENTATION" in
normal)
xrandr --output eDP1 --rotate left;; #instead of --rotate normal
bottom-up)
xrandr --output eDP1 --rotate right;; #instead of --rotate inverted
right-up)
xrandr --output eDP1 --rotate inverted;; #instead of --rotate right
left-up)
xrandr --output eDP1 --rotate normal;; #instead of --rotate left
esac
done

Again, i point out that this is a very ugly solution that you might need to apply until iio-sensor-proxy programmer help you out to fix the bug.

George Vasiliou
  • 7,803
  • 3
  • 18
  • 42
  • I've tried this: https://github.com/systemd/systemd/blob/master/hwdb/60-sensor.hwdb but the problem is, I can't get udevadm to trigger the device – humroben Jan 12 '17 at 15:12
  • @humbroben What are the error messages you get when you try to apply the systemd workaround in the github link above? – George Vasiliou Jan 13 '17 at 08:52