Пользовательский акселерометр для вращения экрана

lsmod | grep acc
hp_accel               28672  0
lis3lv02d              20480  1 hp_accel

Как я вытаскиваю вывод из этой вещи?

и существует xrandr --output eDP1 --rotate normal или inverted или left или right. Я хочу использовать вывод датчика для инициирования, они управляют и действительно экранируют вращение.

править:

После обновления ядра теперь я получаю это, когда я работаю lsmod | grep acc

hid_sensor_accel_3d    16384  1
hid_sensor_trigger     16384  15 hid_sensor_incl_3d,hid_sensor_accel_3d,hid_sensor_magn_3d,hid_sensor_gyro_3d,hid_sensor_rotation
industrialio_triggered_buffer    16384  5 hid_sensor_incl_3d,hid_sensor_accel_3d,hid_sensor_magn_3d,hid_sensor_gyro_3d,hid_sensor_rotation
hid_sensor_iio_common    16384  6 hid_sensor_incl_3d,hid_sensor_accel_3d,hid_sensor_trigger,hid_sensor_magn_3d,hid_sensor_gyro_3d,hid_sensor_rotation
industrialio           69632  10 hid_sensor_incl_3d,hid_sensor_accel_3d,acpi_als,hid_sensor_trigger,hid_sensor_magn_3d,hid_sensor_gyro_3d,hid_sensor_rotation,industrialio_triggered_buffer,kfifo_buf
hp_accel               28672  0
lis3lv02d              20480  1 hp_accel
hid_sensor_hub         20480  8 hid_sensor_incl_3d,hid_sensor_accel_3d,hid_sensor_iio_common,hid_sensor_trigger,hid_sensor_magn_3d,hid_sensor_gyro_3d,hid_sensor_rotation,hid_sensor_custom

edit2:

iio-sensor-proxy не работает. Попытка sudo iio-sensor-proxy дает

** (process:2721): WARNING **: Failed to read float from /sys/devices/pci0000:00/0000:00:13.0/{33AECD58-B679-4E54-9BD9-A04D34F0C226}/001F:8086:22D8.0001/HID-SENSOR-200073.8.auto/iio:device6/in_scale

** (process:2721): WARNING **: Problem reading scan element information: /sys/devices/pci0000:00/0000:00:13.0/{33AECD58-B679-4E54-9BD9-A04D34F0C226}/001F:8086:22D8.0001/HID-SENSOR-200073.8.auto/iio:device6

и терминал остается пробелом пока я ^C.

Попытка sudo systemctl start iio-sensor-proxy ничего не производит до него тайм-ауты

Job for iio-sensor-proxy.service failed because a timeout was exceeded. See "systemctl status iio-sensor-proxy.service" and "journalctl -xe" for details.

systemctl status iio-sensor-proxy.service

● iio-sensor-proxy.service - IIO Sensor Proxy service
   Loaded: loaded (/lib/systemd/system/iio-sensor-proxy.service; static; vendor preset: enabled)
   Active: failed (Result: timeout) since Wed 2017-05-24 16:12:03 EET; 5min ago
  Process: 3335 ExecStart=/usr/sbin/iio-sensor-proxy (code=killed, signal=TERM)
 Main PID: 3335 (code=killed, signal=TERM)

May 24 16:10:33 gas systemd[1]: Starting IIO Sensor Proxy service...
May 24 16:12:03 gas systemd[1]: iio-sensor-proxy.service: Start operation timed out. Terminating.
May 24 16:12:03 gas systemd[1]: Failed to start IIO Sensor Proxy service.
May 24 16:12:03 gas systemd[1]: iio-sensor-proxy.service: Unit entered failed state.
May 24 16:12:03 gas systemd[1]: iio-sensor-proxy.service: Failed with result 'timeout'.

journalctl -xe (вероятно, не очень полезный)

May 24 16:11:26 gas kernel: intel-vbtn INT33D6:01: unknown event index 0xcd
May 24 16:12:03 gas systemd[1]: iio-sensor-proxy.service: Start operation timed out. Terminating.
May 24 16:12:03 gas systemd[1]: Failed to start IIO Sensor Proxy service.
-- Subject: Unit iio-sensor-proxy.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit iio-sensor-proxy.service has failed.
-- 
-- The result is failed.
May 24 16:12:03 gas systemd[1]: iio-sensor-proxy.service: Unit entered failed state.
May 24 16:12:03 gas systemd[1]: iio-sensor-proxy.service: Failed with result 'timeout'.
May 24 16:12:03 gas sudo[3855]: pam_unix(sudo:session): session closed for user root
May 24 16:12:17 gas gnome-session[2010]: (nm-applet:2383): nm-applet-WARNING **: ModemManager is not avai
May 24 16:12:17 gas gnome-session[2010]: (nm-applet:2383): nm-applet-WARNING **: ModemManager is not avai
May 24 16:12:17 gas gnome-session[2010]: (nm-applet:2383): nm-applet-WARNING **: ModemManager is not avai
May 24 16:12:17 gas gnome-session[2010]: (nm-applet:2383): nm-applet-WARNING **: ModemManager is not avai
May 24 16:12:17 gas gnome-session[2010]: (nm-applet:2383): nm-applet-WARNING **: ModemManager is not avai
May 24 16:12:17 gas gnome-session[2010]: (nm-applet:2383): nm-applet-WARNING **: ModemManager is not avai
May 24 16:12:17 gas gnome-session[2010]: (nm-applet:2383): nm-applet-WARNING **: ModemManager is not avai
May 24 16:12:17 gas gnome-session[2010]: (nm-applet:2383): nm-applet-WARNING **: ModemManager is not avai
May 24 16:12:17 gas gnome-session[2010]: (nm-applet:2383): nm-applet-WARNING **: ModemManager is not avai
May 24 16:13:40 gas anacron[775]: Job `cron.daily' terminated
May 24 16:13:40 gas anacron[775]: Normal exit (1 job run)
May 24 16:13:50 gas org.gnome.zeitgeist.SimpleIndexer[1779]: ** (zeitgeist-fts:2514): WARNING **: Unable 
May 24 16:14:14 gas gnome-session[2010]: (nm-applet:2383): nm-applet-WARNING **: ModemManager is not avai
May 24 16:14:14 gas gnome-session[2010]: (nm-applet:2383): nm-applet-WARNING **: ModemManager is not avai
May 24 16:14:14 gas gnome-session[2010]: (nm-applet:2383): nm-applet-WARNING **: ModemManager is not avai
May 24 16:14:14 gas gnome-session[2010]: (nm-applet:2383): nm-applet-WARNING **: ModemManager is not avai
May 24 16:14:14 gas gnome-session[2010]: (nm-applet:2383): nm-applet-WARNING **: ModemManager is not avai
May 24 16:14:14 gas gnome-session[2010]: (nm-applet:2383): nm-applet-WARNING **: ModemManager is not avai
May 24 16:14:14 gas gnome-session[2010]: (nm-applet:2383): nm-applet-WARNING **: ModemManager is not avai
May 24 16:14:14 gas gnome-session[2010]: (nm-applet:2383): nm-applet-WARNING **: ModemManager is not avai
May 24 16:14:14 gas gnome-session[2010]: (nm-applet:2383): nm-applet-WARNING **: ModemManager is not avai
May 24 16:14:43 gas org.gnome.zeitgeist.SimpleIndexer[1779]: ** (zeitgeist-fts:2514): WARNING **: Unable 
May 24 16:15:01 gas CRON[4519]: pam_unix(cron:session): session opened for user root by (uid=0)
May 24 16:15:01 gas CRON[4520]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
May 24 16:15:01 gas CRON[4519]: pam_unix(cron:session): session closed for user root
May 24 16:15:02 gas org.gnome.zeitgeist.SimpleIndexer[1779]: ** (zeitgeist-fts:2514): WARNING **: Unable 
May 24 16:15:15 gas org.gnome.zeitgeist.SimpleIndexer[1779]: ** (zeitgeist-fts:2514): WARNING **: Unable 
May 24 16:15:26 gas org.gnome.zeitgeist.SimpleIndexer[1779]: ** (zeitgeist-fts:2514): WARNING **: Unable 
May 24 16:15:49 gas /usr/lib/snapd/snapd[790]: snapmgr.go:450: No snaps to auto-refresh found
May 24 16:15:49 gas snapd[790]: 2017/05/24 16:15:49.321528 snapmgr.go:450: No snaps to auto-refresh found
May 24 16:15:51 gas org.gnome.zeitgeist.SimpleIndexer[1779]: ** (zeitgeist-fts:2514): WARNING **: Unable 
May 24 16:16:13 gas gnome-session[2010]: (nm-applet:2383): nm-applet-WARNING **: ModemManager is not avai
May 24 16:16:13 gas gnome-session[2010]: (nm-applet:2383): nm-applet-WARNING **: ModemManager is not avai
May 24 16:16:13 gas gnome-session[2010]: (nm-applet:2383): nm-applet-WARNING **: ModemManager is not avai
May 24 16:16:13 gas gnome-session[2010]: (nm-applet:2383): nm-applet-WARNING **: ModemManager is not avai
May 24 16:16:13 gas gnome-session[2010]: (nm-applet:2383): nm-applet-WARNING **: ModemManager is not avai
May 24 16:16:13 gas gnome-session[2010]: (nm-applet:2383): nm-applet-WARNING **: ModemManager is not avai
May 24 16:16:13 gas gnome-session[2010]: (nm-applet:2383): nm-applet-WARNING **: ModemManager is not avai
May 24 16:16:13 gas gnome-session[2010]: (nm-applet:2383): nm-applet-WARNING **: ModemManager is not avai
May 24 16:16:13 gas gnome-session[2010]: (nm-applet:2383): nm-applet-WARNING **: ModemManager is not avai
May 24 16:16:58 gas org.gnome.zeitgeist.SimpleIndexer[1779]: ** (zeitgeist-fts:2514): WARNING **: Unable 
May 24 16:17:01 gas CRON[4669]: pam_unix(cron:session): session opened for user root by (uid=0)
May 24 16:17:01 gas CRON[4670]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
May 24 16:17:01 gas CRON[4669]: pam_unix(cron:session): session closed for user root
May 24 16:17:46 gas org.gnome.zeitgeist.SimpleIndexer[1779]: ** (zeitgeist-fts:2514): WARNING **: Unable 
May 24 16:18:00 gas org.gnome.zeitgeist.SimpleIndexer[1779]: ** (zeitgeist-fts:2514): WARNING **: Unable

... и да названием моего компьютера является газовый X'D

Я надеюсь, что мы можем починить эту вещь датчика. Я отчаянно пытаюсь заставлять это работать. Кажется, что мы добираемся там :)

4
задан 24 May 2017 в 17:20

1 ответ

Это не решение, а указатель в правильном направлении. Я также искал, чтобы метод сделал это. Я столкнулся с iio-sensor-proxy https://github.com/hadess/iio-sensor-proxy, и я нахожусь в процессе записи маленького демона, который уладит это.

Это - то, что я получаю, когда я выполняю контрольный датчик и поворачиваю экран 90 градусов направо.

> monitor-sensor 
    Waiting for iio-sensor-proxy to appear
+++ iio-sensor-proxy appeared
=== Has accelerometer (orientation: undefined)
=== Has ambient light sensor (value: 0.000000, unit: lux)
    Accelerometer orientation changed: normal
    Light changed: 6.098000 (lux)
    Light changed: 168.823008 (lux)
    Light changed: 167.266008 (lux)
    Light changed: 161.816008 (lux)
    Light changed: 183.098009 (lux)
    Accelerometer orientation changed: left-up
    Light changed: 204.379010 (lux)
    Light changed: 214.241010 (lux)
    Light changed: 214.371010 (lux)
    Accelerometer orientation changed: normal
    Light changed: 179.724009 (lux)
    Light changed: 170.121008 (lux)
    Light changed: 170.900008 (lux)
3
ответ дан 1 December 2019 в 10:01

Другие вопросы по тегам:

Похожие вопросы: