pfps / yoga-laptop

Systems and information to make Lenovo Yoga laptops work better
GNU General Public License v3.0
156 stars 30 forks source link

Not working after suspend #49

Open stekman opened 8 years ago

stekman commented 8 years ago

The orientation functionality stops working after suspend. I use this crude script as a workaround on Ubuntu 15.10:

/etc/pm/sleep.d/restart_orientation

#!/bin/bash 
case "$1" in
    hibernate|suspend)
         killall orientation &
         ;;
    thaw|resume)
         sleep 30
         nohup /usr/bin/orientation > /dev/null &
         ;;
esac
pfps commented 8 years ago

Hmm, I'm not seeing that.

However, maybe suspend/resume does interfere with something in the program. Has anyone else seen this behaviour?

chhtz commented 8 years ago

I sometimes had this issue (after suspending) -- however not always. I haven't investigated yet what is/was causing it. Before my change in pull request #47 I also sometimes got this after pressing the rotation-lock button multiple times (this was probably because the wrong thread still had some kind of file-lock on the sensor readings) Addendum: I'm also on Ubuntu 15.10, and I'm using XFCE (if that helps investigating)

dehuszar commented 7 years ago

I'm seeing this. On Ubuntu 16.10 (and 16.04) suspend/wake actually works now. But I find that the orientation script only works when run after boot with sudo priveleges. Doing a suspend and wake causes the script to become unresponsive. Killing the orientation processes and running the script again returns iio device number being used is 2 iio trigger number being used is 2 and no new sensor data is output as the laptop is reoriented.

A fresh boot gets it working again.