Closed vladimiroltean closed 8 years ago
** (process:7135): WARNING *: Failed to write current_trigger file Permission denied
* (process:7135): WARNING *: Could not open for write '/sys/devices/pci0000:00/0000:00:14.0/usb2/2-6/2-6:1.0/0003:2047:0855.0001/HID-SENSOR-200073.2.auto/iio:device3/buffer/enable'
This is a problem. Is the kernel producing warnings? As which user are you running this helper?
Directly as a login user.
That won't work, the iio-sensor-proxy needs to run as root.
Yes, sorry for the false alarm, running as root produces apparently correct results in the log:
* (process:12301): DEBUG: Found als at /sys/devices/pci0000:00/0000:00:14.0/usb2/2-6/2-6:1.0/0003:2047:0855.0001/HID-SENSOR-200041.9.auto/iio:device0 * (process:12301): DEBUG: Found device /sys/devices/pci0000:00/0000:00:14.0/usb2/2-6/2-6:1.0/0003:2047:0855.0001/HID-SENSOR-200041.9.auto/iio:device0 of type ambient light sensor at IIO Buffer Light sensor * (process:12301): DEBUG: Found accel_3d at /sys/devices/pci0000:00/0000:00:14.0/usb2/2-6/2-6:1.0/0003:2047:0855.0001/HID-SENSOR-200073.2.auto/iio:device3 * (process:12301): DEBUG: Found device /sys/devices/pci0000:00/0000:00:14.0/usb2/2-6/2-6:1.0/0003:2047:0855.0001/HID-SENSOR-200073.2.auto/iio:device3 of type accelerometer at IIO Buffer accelerometer * (process:12301): DEBUG: Found magn_3d at /sys/devices/pci0000:00/0000:00:14.0/usb2/2-6/2-6:1.0/0003:2047:0855.0001/HID-SENSOR-200083.4.auto/iio:device4 * (process:12301): DEBUG: Found device /sys/devices/pci0000:00/0000:00:14.0/usb2/2-6/2-6:1.0/0003:2047:0855.0001/HID-SENSOR-200083.4.auto/iio:device4 of type compass at IIO Buffer Compass * (process:12301): DEBUG: Found associated trigger at /sys/devices/pci0000:00/0000:00:14.0/usb2/2-6/2-6:1.0/0003:2047:0855.0001/HID-SENSOR-200073.2.auto/trigger3 * (process:12301): DEBUG: Got type for in_accel_x: is signed: 1, bytes: 4, bits_used: 16, shift: 0, mask: 0x65535, be: 0 * (process:12301): DEBUG: Got type for in_accel_y: is signed: 1, bytes: 4, bits_used: 16, shift: 0, mask: 0x65535, be: 0 * (process:12301): DEBUG: Got type for in_accel_z: is signed: 1, bytes: 4, bits_used: 16, shift: 0, mask: 0x65535, be: 0 * (process:12301): DEBUG: Built channel array for in_accel_x: is signed: 1, bytes: 4, bits_used: 16, shift: 0, mask: 0x65535, be: 0 * (process:12301): DEBUG: Built channel array for in_accel_y: is signed: 1, bytes: 4, bits_used: 16, shift: 0, mask: 0x65535, be: 0 * (process:12301): DEBUG: Built channel array for in_accel_z: is signed: 1, bytes: 4, bits_used: 16, shift: 0, mask: 0x65535, be: 0 * (process:12301): DEBUG: Found associated trigger at /sys/devices/pci0000:00/0000:00:14.0/usb2/2-6/2-6:1.0/0003:2047:0855.0001/HID-SENSOR-200041.9.auto/trigger0 * (process:12301): DEBUG: Got type for in_intensity_both: is signed: 1, bytes: 4, bits_used: 32, shift: 0, mask: 0x0, be: 0 * (process:12301): DEBUG: Built channel array for in_intensity_both: is signed: 1, bytes: 4, bits_used: 32, shift: 0, mask: 0x0, be: 0 * (process:12301): DEBUG: Found associated trigger at /sys/devices/pci0000:00/0000:00:14.0/usb2/2-6/2-6:1.0/0003:2047:0855.0001/HID-SENSOR-200083.4.auto/trigger4 * (process:12301): DEBUG: Got type for in_magn_x: is signed: 1, bytes: 4, bits_used: 16, shift: 0, mask: 0x65535, be: 0 * (process:12301): DEBUG: Got type for in_magn_y: is signed: 1, bytes: 4, bits_used: 16, shift: 0, mask: 0x65535, be: 0 * (process:12301): DEBUG: Got type for in_magn_z: is signed: 1, bytes: 4, bits_used: 16, shift: 0, mask: 0x65535, be: 0 * (process:12301): DEBUG: Got type for in_rot_from_north_magnetic_tilt_comp: is signed: 1, bytes: 4, bits_used: 16, shift: 0, mask: 0x65535, be: 0 * (process:12301): DEBUG: Built channel array for in_magn_x: is signed: 1, bytes: 4, bits_used: 16, shift: 0, mask: 0x65535, be: 0 * (process:12301): DEBUG: Built channel array for in_magn_y: is signed: 1, bytes: 4, bits_used: 16, shift: 0, mask: 0x65535, be: 0 * (process:12301): DEBUG: Built channel array for in_magn_z: is signed: 1, bytes: 4, bits_used: 16, shift: 0, mask: 0x65535, be: 0 * (process:12301): DEBUG: Built channel array for in_rot_from_north_magnetic_tilt_comp: is signed: 1, bytes: 4, bits_used: 16, shift: 0, mask: 0x65535, be: 0 * (process:12301): DEBUG: Handling driver refcounting method 'ClaimLight' for ambient light sensor device * (process:12301): DEBUG: Handling driver refcounting method 'ClaimLight' for ambient light sensor device * (process:12301): DEBUG: Handling driver refcounting method 'ClaimAccelerometer' for accelerometer device * (process:12301): DEBUG: Handling driver refcounting method 'ClaimAccelerometer' for accelerometer device * (process:12301): DEBUG: No new data available * (process:12301): DEBUG: Read from IIO: 31, -1008, 45 * (process:12301): DEBUG: Accel sent by driver (quirk applied): 0, 9, 0 * (process:12301): DEBUG: Emitted orientation changed: from undefined to normal * (process:12301): DEBUG: No new data available * (process:12301): DEBUG: Read from IIO: 32, -1009, 46 * (process:12301): DEBUG: Accel sent by driver (quirk applied): 0, 9, 0 * (process:12301): DEBUG: No new data available * (process:12301): DEBUG: Read from IIO: 31, -1009, 48 * (process:12301): DEBUG: Accel sent by driver (quirk applied): 0, 9, 0 * (process:12301): DEBUG: No new data available * (process:12301): DEBUG: Read from IIO: 41, -1009, 45 * (process:12301): DEBUG: Accel sent by driver (quirk applied): 0, 9, 0 * (process:12301): DEBUG: No new data available * (process:12301): DEBUG: Read from IIO: 47, -1009, 45 * (process:12301): DEBUG: Accel sent by driver (quirk applied): 0, 9, 0 * (process:12301): DEBUG: No new data available * (process:12301): DEBUG: Read from IIO: 68, -1008, 53 * (process:12301): DEBUG: Accel sent by driver (quirk applied): 0, 9, 0 * (process:12301): DEBUG: Read from IIO: 78.100001 * (process:12301): DEBUG: Light level sent by driver (quirk applied): 78.100001 (unit: lux) * (process:12301): DEBUG: Emitted light changed: from 0.000000 to 78.100001 * (process:12301): DEBUG: Emitted light changed: from 74.200001 to 78.100001 * (process:12301): DEBUG: Read from IIO: 970, 221, 148 * (process:12301): DEBUG: Accel sent by driver (quirk applied): -9, -2, 1 * (process:12301): DEBUG: Read from IIO: 85.900001 * (process:12301): DEBUG: Light level sent by driver (quirk applied): 85.900001 (unit: lux) * (process:12301): DEBUG: Emitted light changed: from 78.100001 to 85.900001 * (process:12301): DEBUG: Read from IIO: 592, -461, 224 * (process:12301): DEBUG: Accel sent by driver (quirk applied): -5, 4, 2 * (process:12301): DEBUG: Read from IIO: 89.800001 * (process:12301): DEBUG: Light level sent by driver (quirk applied): 89.800001 (unit: lux) * (process:12301): DEBUG: Emitted light changed: from 85.900001 to 89.800001 * (process:12301): DEBUG: Read from IIO: -28, -955, 391 * (process:12301): DEBUG: Accel sent by driver (quirk applied): 0, 9, 3 * (process:12301): DEBUG: Emitted orientation changed: from left-up to normal * (process:12301): DEBUG: No new data available * (process:12301): DEBUG: Read from IIO: -59, -958, 358 * (process:12301): DEBUG: Accel sent by driver (quirk applied): 0, 9, 3 * (process:12301): DEBUG: No new data available * (process:12301): DEBUG: Read from IIO: -29, -856, 334 * (process:12301): DEBUG: Accel sent by driver (quirk applied): 0, 8, 3 * (process:12301): DEBUG: Read from IIO: 62.500001 * (process:12301): DEBUG: Light level sent by driver (quirk applied): 62.500001 (unit: lux) * (process:12301): DEBUG: Emitted light changed: from 89.800001 to 62.500001 * (process:12301): DEBUG: Read from IIO: -1012, 81, 64 * (process:12301): DEBUG: Accel sent by driver (quirk applied): 9, 0, 0 \ (process:12301): DEBUG: Emitted orientation changed: from normal to right-up
However, gnome-shell still does not rotate the screen, although it does seem to pick up events from iio-sensor-proxy. Running "/usr/lib/gnome-settings/daemon/gsd-test-orientation" tells me it's picking up orientation info, and at least it's trying to rotate the screen.
The bug seems to be related to the Intel i915 graphics kernel module, because each time I run "xrandr -o left", I get this message in the kernel log:
[ 30.231191] [drm:check_crtc_state [i915]] ERROR mismatch in ips_enabled (expected 1, found 0) [ 30.231196] ------------[ cut here ]------------ [ 30.231209] WARNING: CPU: 0 PID: 684 at drivers/gpu/drm/i915/intel_display.c:12324 check_crtc_state+0x8df/0xf80 [i915]() [ 30.231210] pipe state doesn't match! [ 30.231212] Modules linked in: rfcomm sha256_ssse3 sha256_generic hmac drbg ansi_cprng ctr ccm cmac ecb fuse snd_hda_codec_hdmi hid_sensor_accel_3d hid_sensor_gyro_3d hid_sensor_magn_3d hid_sensor_incl_3d hid_sensor_als hid_s ensor_rotation hid_sensor_trigger hid_sensor_iio_common industrialio_triggered_buffer kfifo_buf industrialio joydev mousedev hid_sensor_hub hid_multitouch bnep uvcvideo videobuf2_vmalloc videobuf2_memops videobuf2_core v4l2_comm on videodev btusb btrtl btbcm btintel media bluetooth usbhid arc4 i915 iTCO_wdt iTCO_vendor_support intel_rapl x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel kvm iwlmvm snd_hda_codec_realtek snd_hda_codec_generic mac80 211 crct10dif_pclmul crc32_pclmul drm_kms_helper nls_iso8859_1 crc32c_intel snd_hda_intel snd_hda_codec ghash_clmulni_intel iwlwifi [ 30.231256] nls_cp437 drm snd_hda_core vfat aesni_intel fat aes_x86_64 snd_hwdep lrw snd_pcm gf128mul cfg80211 glue_helper snd_timer ablk_helper cryptd intel_gtt snd evdev i2c_algo_bit input_leds mei_me soundcore lpc_ich shp chp mei mac_hid psmouse i2c_i801 serio_raw pcspkr thermal ideapad_laptop sparse_keymap rfkill i2c_hid hid fan i2c_designware_platform dw_dmac battery int3403_thermal dw_dmac_core i2c_designware_core gpio_lynxpoint 8250_dw video int3402_thermal spi_pxa2xx_platform processor_thermal_device int340x_thermal_zone intel_soc_dts_iosf iosf_mbi int3400_thermal acpi_thermal_rel ac button processor sch_fq_codel ip_tables x_tables ext4 crc16 mbcache jbd2 sd_mod at kbd libps2 ahci xhci_pci libahci ehci_pci xhci_hcd ehci_hcd libata usbcore scsi_mod usb_common i8042 serio sdhci_acpi sdhci led_class [ 30.231310] mmc_core [ 30.231314] CPU: 0 PID: 684 Comm: Xorg Not tainted 4.2.3-1-ARCH #1 [ 30.231316] Hardware name: LENOVO 20266/Yoga2, BIOS 76CN43WW 03/30/2015 [ 30.231318] 0000000000000000 0000000009031e70 ffff880240207788 ffffffff8156c0ca [ 30.231321] 0000000000000000 ffff8802402077e0 ffff8802402077c8 ffffffff81074886 [ 30.231324] ffff8802402077c8 ffff88024eec1350 ffff8802554f6000 ffff88024eec1000 [ 30.231327] Call Trace: [ 30.231334] [
] dump_stack+0x4c/0x6e [ 30.231338] [ ] warn_slowpath_common+0x86/0xc0 [ 30.231341] [ ] warn_slowpath_fmt+0x55/0x70 [ 30.231353] [ ] check_crtc_state+0x8df/0xf80 [i915] [ 30.231361] [ ] ? drm_calc_vbltimestamp_from_scanoutpos+0x17a/0x330 [drm] [ 30.231376] [ ] intel_modeset_check_state+0x216/0xb50 [i915] [ 30.231388] [ ] ? intel_set_mode+0x92c/0xb60 [i915] [ 30.231399] [ ] intel_crtc_set_config+0x4c7/0x580 [i915] [ 30.231408] [ set_task_blocked+0x41/0xa0 [ 30.231433] [] drm_mode_set_config_internal+0x66/0x100 [drm] [ 30.231417] [ ] drm_mode_setcrtc+0x3e9/0x500 [drm] [ 30.231423] [ ] drm_ioctl+0x125/0x610 [drm] [ 30.231426] [ ] ? ] ? drm_mode_setplane+0x1b0/0x1b0 [drm] [ 30.231437] [ ] do_vfs_ioctl+0x295/0x480 [ 30.231440] [ ] ? __fget+0x77/0xb0 [ 30.231443] [ ] SyS_ioctl+0x79/0x90 [ 30.231446] [ ] ? SyS_rt_sigprocmask+0x8e/0xc0 [ 30.231449] [ ] entry_SYSCALL_64_fastpath+0x12/0x71 [ 30.231451] ---[ end trace 9f06c7cf1835b7b7 ]---
As can be seen, I am running the latest stable kernel, 4.2.3. I will also try the mainline version.
/usr/lib/gnome-settings/daemon/gsd-test-orientation
will only run if you disabled the orientation plugin. Re-enable it and it should pick up the changes. Make sure to use GNOME 3.18, it won't work with older versions.
After more investigation, it seems that this piece of software works correctly, with all debug messages showing what they should. However, auto rotation in GNOME doesn't properly work at startup (after 5-6 successful rotations it stops), until I restart the shell (Alt-F2 + r). It works completely fine after that (including after waking up from sleep). I am trying to run the following immediately after reboot:
gsettings set org.gnome.settings-daemon.plugins.orientation active false /usr/lib/gnome-settings/daemon/gsd-test-orientation
It shows the following sample output:
(gsd-test-orientation:29957): orientation-plugin-DEBUG: Found orientation 'normal' for accelerometer (gsd-test-orientation:29957): orientation-plugin-DEBUG: Orientation changed to 'normal', switching screen rotation (gsd-test-orientation:29957): orientation-plugin-DEBUG: Found orientation 'left-up' for accelerometer (gsd-test-orientation:29957): orientation-plugin-DEBUG: Orientation changed to 'left-up', switching screen rotation (gsd-test-orientation:29957): orientation-plugin-DEBUG: Found orientation 'normal' for accelerometer (gsd-test-orientation:29957): orientation-plugin-DEBUG: Orientation changed to 'normal', switching screen rotation
Unfortunately, after running "gsettings set org.gnome.settings-daemon.plugins.orientation active true" again, the effective screen rotation does not happen. I am moving to the gnome-settings-daemon issues page, since I believe the bug to be there.
As iio-sensor-proxy is reading the sensor correctly, reporting it to the desktop to use, and that gsd-test-orientation can read the data, it looks like a GNOME bug, not one in iio-sensor-proxy. Please file a bug against gnome-settings-daemon at https://bugzilla.gnome.org referencing this bug, and make sure that you're using the newest stable version of gnome-settings-daemon as well.
Hi, I didn't know of a better place to post this. I am using Arch Linux with GNOME 3.18, and this proxy to provide screen auto rotation. After a while however (can't pinpoint what's causing it), auto rotation stops working. I have checked the output of monitor-sensor and it is still running, giving messages such as:
Either reloading GNOME shell (Alt-F2 + r) or running "killall gnome-settings-daemon" help (temporarily) solve the issue, but I'd much rather prefer it not happening. The output of "G_MESSAGES_DEBUG=all /usr/sbin/iio-sensor-proxy" is: