Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1422005 > unrolled thread

Re: [RFC 0/4] Intel Integrated Sensor Hub Support (ISH)

Started byBastien Nocera <hadess@hadess.net>
First post2016-06-14 17:20 +0200
Last post2016-06-14 23:40 +0200
Articles 4 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [RFC 0/4] Intel Integrated Sensor Hub Support (ISH) Bastien Nocera <hadess@hadess.net> - 2016-06-14 17:20 +0200
    Re: [RFC 0/4] Intel Integrated Sensor Hub Support (ISH) Grant Likely <grant.likely@secretlab.ca> - 2016-06-14 18:10 +0200
      Re: [RFC 0/4] Intel Integrated Sensor Hub Support (ISH) Bastien Nocera <hadess@hadess.net> - 2016-06-14 19:10 +0200
        Re: [RFC 0/4] Intel Integrated Sensor Hub Support (ISH) Grant Likely <grant.likely@secretlab.ca> - 2016-06-14 23:40 +0200

#1422005 — Re: [RFC 0/4] Intel Integrated Sensor Hub Support (ISH)

FromBastien Nocera <hadess@hadess.net>
Date2016-06-14 17:20 +0200
SubjectRe: [RFC 0/4] Intel Integrated Sensor Hub Support (ISH)
Message-ID<rJYid-6wL-3@gated-at.bofh.it>
On Tue, 2016-06-14 at 14:44 +0100, Grant Likely wrote:
> On Fri, Jun 10, 2016 at 4:27 PM, Bastien Nocera <hadess@hadess.net>
> wrote:
> > On Fri, 2016-06-10 at 08:23 -0700, Srinivas Pandruvada wrote:
> > > On Fri, 2016-06-10 at 17:04 +0200, Bastien Nocera wrote:
> > > > > 
> > > 
> > > [...]
> > > 
> > > > Are there any errors when setting the triggers?
> > > > 
> > > Is there any debug option in this service to give more verbose
> > > output?
> > 
> > Add:
> > Environment="G_MESSAGES_DEBUG=all"
> > 
> > To the service file. You should see the debug in systemctl:
> > systemctl status iio-sensor-proxy.service
> > 
> > Or in journalctl if there's too much data:
> > journalctl --reverse -u iio-sensor-proxy.service
> 
> Still no joy on the sensors. The proxy starts up and detects the
> sensors, but I don't see any sensor events occurring:

Could you try again with the current master of iio-sensor-proxy? Make
sure to install the file in the same location as in your distro
provided package.

I've added more debug/warnings to a few cases where it would have
silently failed in the past.

In particular, I don't see any messages that would be coming out of:
https://github.com/hadess/iio-sensor-proxy/blob/master/src/iio-buffer-utils.c#L512

Could it be that the sub-directory is populated after the device is
created in the kernel, causing a race?

Either that, or the contents of the scan_elements/ directory is not the
one expected by this code.

The output of this command should us that:
ls /sys/devices/pci0000:00/0000:00:13.0/{33AECD58-B679-4E54-9BD9-A04D34F0C226}/001E:8086:22D8.0001/HID-SENSOR-200073.8.auto/iio:device1/scan_elements

Cheers

[toc] | [next] | [standalone]


#1422053

FromGrant Likely <grant.likely@secretlab.ca>
Date2016-06-14 18:10 +0200
Message-ID<rJZ4C-79l-23@gated-at.bofh.it>
In reply to#1422005
On Tue, Jun 14, 2016 at 4:12 PM, Bastien Nocera <hadess@hadess.net> wrote:
> On Tue, 2016-06-14 at 14:44 +0100, Grant Likely wrote:
>> On Fri, Jun 10, 2016 at 4:27 PM, Bastien Nocera <hadess@hadess.net>
>> wrote:
>> > On Fri, 2016-06-10 at 08:23 -0700, Srinivas Pandruvada wrote:
>> > > On Fri, 2016-06-10 at 17:04 +0200, Bastien Nocera wrote:
>> > > > >
>> > >
>> > > [...]
>> > >
>> > > > Are there any errors when setting the triggers?
>> > > >
>> > > Is there any debug option in this service to give more verbose
>> > > output?
>> >
>> > Add:
>> > Environment="G_MESSAGES_DEBUG=all"
>> >
>> > To the service file. You should see the debug in systemctl:
>> > systemctl status iio-sensor-proxy.service
>> >
>> > Or in journalctl if there's too much data:
>> > journalctl --reverse -u iio-sensor-proxy.service
>>
>> Still no joy on the sensors. The proxy starts up and detects the
>> sensors, but I don't see any sensor events occurring:
>
> Could you try again with the current master of iio-sensor-proxy? Make
> sure to install the file in the same location as in your distro
> provided package.
>
> I've added more debug/warnings to a few cases where it would have
> silently failed in the past.
>
> In particular, I don't see any messages that would be coming out of:
> https://github.com/hadess/iio-sensor-proxy/blob/master/src/iio-buffer-utils.c#L512
>
> Could it be that the sub-directory is populated after the device is
> created in the kernel, causing a race?
>
> Either that, or the contents of the scan_elements/ directory is not the
> one expected by this code.
>
> The output of this command should us that:
> ls /sys/devices/pci0000:00/0000:00:13.0/{33AECD58-B679-4E54-9BD9-A04D34F0C226}/001E:8086:22D8.0001/HID-SENSOR-200073.8.auto/iio:device1/scan_elements

Hmmm, this is interesting. I fetched, built and ran the latest
iio-sensor-proxy. It quit with the following error. However,
immediately afterwards, I ran the Debian packaged version (1.1-1), and
the sensors started to work. Something in the latest master activates
the sensors enough for the older version to work.

To make sure it wasn't fixed by a kernel upgrade, I also rebooted and
tried again:
1) Booted system - iio-sensor-proxy.service running  --- No rotation sensing
2) # systemctl stop iio-sensor-proxy-service   --- Turn off the agent
3) # G_MESSAGES_DEBUG=all /usr/bin/iio-sensor-proxy.orig     ----
original version, still not working
4) # G_MESSAGES_DEBUG=all /usr/bin/iio-sensor-proxy.new     ----
latest master, failed with error messages
5) # G_MESSAGES_DEBUG=all /usr/bin/iio-sensor-proxy.orig     ----
original version, suddenly working

All of this was tested on Linus' latest master branch (4.7-rc3+)

Output from latest git master:

root@gladys:~# G_MESSAGES_DEBUG=all /usr/sbin/iio-sensor-proxy
** (process:9214): DEBUG: Found accel_3d at
/sys/devices/pci0000:00/0000:00:13.0/{33AECD58-B679-4E54-9BD9-A04D34F0C226}/001E:8086:22D8.0001/HID-SENSOR-200073.8.auto/iio:device1
** (process:9214): DEBUG: Found device
/sys/devices/pci0000:00/0000:00:13.0/{33AECD58-B679-4E54-9BD9-A04D34F0C226}/001E:8086:22D8.0001/HID-SENSOR-200073.8.auto/iio:device1
of type accelerometer at IIO Buffer accelerometer
** (process:9214): DEBUG: Found magn_3d at
/sys/devices/pci0000:00/0000:00:13.0/{33AECD58-B679-4E54-9BD9-A04D34F0C226}/001E:8086:22D8.0003/HID-SENSOR-200083.27.auto/iio:device6
** (process:9214): DEBUG: Found device
/sys/devices/pci0000:00/0000:00:13.0/{33AECD58-B679-4E54-9BD9-A04D34F0C226}/001E:8086:22D8.0003/HID-SENSOR-200083.27.auto/iio:device6
of type compass at IIO Buffer Compass
** (process:9214): DEBUG: Found associated trigger at
/sys/devices/pci0000:00/0000:00:13.0/{33AECD58-B679-4E54-9BD9-A04D34F0C226}/001E:8086:22D8.0001/HID-SENSOR-200073.8.auto/trigger1

** (process:9214): WARNING **: Failed to enable any sensors for device
'/sys/devices/pci0000:00/0000:00:13.0/{33AECD58-B679-4E54-9BD9-A04D34F0C226}/001E:8086:22D8.0001/HID-SENSOR-200073.8.auto/iio:device1'

** (process:9214): WARNING **: Failed to enable any sensors for device
'/sys/devices/pci0000:00/0000:00:13.0/{33AECD58-B679-4E54-9BD9-A04D34F0C226}/001E:8086:22D8.0001/HID-SENSOR-200073.8.auto/iio:device1'
** (process:9214): DEBUG: Found associated trigger at
/sys/devices/pci0000:00/0000:00:13.0/{33AECD58-B679-4E54-9BD9-A04D34F0C226}/001E:8086:22D8.0003/HID-SENSOR-200083.27.auto/trigger6

** (process:9214): WARNING **: Failed to enable any sensors for device
'/sys/devices/pci0000:00/0000:00:13.0/{33AECD58-B679-4E54-9BD9-A04D34F0C226}/001E:8086:22D8.0003/HID-SENSOR-200083.27.auto/iio:device6'

** (process:9214): WARNING **: Failed to enable any sensors for device
'/sys/devices/pci0000:00/0000:00:13.0/{33AECD58-B679-4E54-9BD9-A04D34F0C226}/001E:8086:22D8.0003/HID-SENSOR-200083.27.auto/iio:device6'




Full output running old, then new, then old:

Script started on Tue 14 Jun 2016 16:47:16 BST
root@gladys:/usr/sbin# G_MESSAGES_DEBUG=all /usr/sbin/iio-sensor-proxy.orig
** (process:2369): DEBUG: Found accel_3d at
/sys/devices/pci0000:00/0000:00:13.0/{33AECD58-B679-4E54-9BD9-A04D34F0C226}/001E:8086:22D8.0001/HID-SENSOR-200073.8.auto/iio:device1
** (process:2369): DEBUG: Found device
/sys/devices/pci0000:00/0000:00:13.0/{33AECD58-B679-4E54-9BD9-A04D34F0C226}/001E:8086:22D8.0001/HID-SENSOR-200073.8.auto/iio:device1
of type accelerometer at IIO Buffer accelerometer
** (process:2369): DEBUG: Found magn_3d at
/sys/devices/pci0000:00/0000:00:13.0/{33AECD58-B679-4E54-9BD9-A04D34F0C226}/001E:8086:22D8.0003/HID-SENSOR-200083.27.auto/iio:device6
** (process:2369): DEBUG: Found device
/sys/devices/pci0000:00/0000:00:13.0/{33AECD58-B679-4E54-9BD9-A04D34F0C226}/001E:8086:22D8.0003/HID-SENSOR-200083.27.auto/iio:device6
of type compass at IIO Buffer Compass
** (process:2369): DEBUG: Found associated trigger at
/sys/devices/pci0000:00/0000:00:13.0/{33AECD58-B679-4E54-9BD9-A04D34F0C226}/001E:8086:22D8.0001/HID-SENSOR-200073.8.auto/trigger1
** (process:2369): DEBUG: Got type for in_accel_x: is signed: 1,
bytes: 4, bits_used: 32, shift: 0, mask: 0x0, be: 0
** (process:2369): DEBUG: Got type for in_accel_y: is signed: 1,
bytes: 4, bits_used: 32, shift: 0, mask: 0x0, be: 0
** (process:2369): DEBUG: Got type for in_accel_z: is signed: 1,
bytes: 4, bits_used: 32, shift: 0, mask: 0x0, be: 0
** (process:2369): DEBUG: Built channel array for in_accel_x: is
signed: 1, bytes: 4, bits_used: 32, shift: 0, mask: 0x0, be: 0
** (process:2369): DEBUG: Built channel array for in_accel_y: is
signed: 1, bytes: 4, bits_used: 32, shift: 0, mask: 0x0, be: 0
** (process:2369): DEBUG: Built channel array for in_accel_z: is
signed: 1, bytes: 4, bits_used: 32, shift: 0, mask: 0x0, be: 0
** (process:2369): DEBUG: Found associated trigger at
/sys/devices/pci0000:00/0000:00:13.0/{33AECD58-B679-4E54-9BD9-A04D34F0C226}/001E:8086:22D8.0003/HID-SENSOR-200083.27.auto/trigger6
** (process:2369): DEBUG: Got type for in_magn_x: is signed: 1, bytes:
4, bits_used: 32, shift: 0, mask: 0x0, be: 0
** (process:2369): DEBUG: Got type for in_magn_y: is signed: 1, bytes:
4, bits_used: 32, shift: 0, mask: 0x0, be: 0
** (process:2369): DEBUG: Got type for in_magn_z: is signed: 1, bytes:
4, bits_used: 32, shift: 0, mask: 0x0, be: 0
** (process:2369): DEBUG: Got type for
in_rot_from_north_magnetic_tilt_comp: is signed: 1, bytes: 4,
bits_used: 32, shift: 0, mask: 0x0, be: 0
** (process:2369): DEBUG: Built channel array for in_magn_x: is
signed: 1, bytes: 4, bits_used: 32, shift: 0, mask: 0x0, be: 0
** (process:2369): DEBUG: Built channel array for in_magn_y: is
signed: 1, bytes: 4, bits_used: 32, shift: 0, mask: 0x0, be: 0
** (process:2369): DEBUG: Built channel array for in_magn_z: is
signed: 1, bytes: 4, bits_used: 32, shift: 0, mask: 0x0, be: 0
** (process:2369): DEBUG: Built channel array for
in_rot_from_north_magnetic_tilt_comp: is signed: 1, bytes: 4,
bits_used: 32, shift: 0, mask: 0x0, be: 0
** (process:2369): DEBUG: Handling driver refcounting method
'ClaimLight' for ambient light sensor device
** (process:2369): DEBUG: Handling driver refcounting method
'ClaimAccelerometer' for accelerometer device
** (process:2369): DEBUG: Handling driver refcounting method
'ClaimAccelerometer' for accelerometer device
** (process:2369): DEBUG: No new data available
** (process:2369): DEBUG: No new data available
** (process:2369): DEBUG: No new data available
^C



root@gladys:/usr/sbin# G_MESSAGES_DEBUG=all /usr/sbin/iio-sensor-proxy.new
** (process:2468): DEBUG: Found accel_3d at
/sys/devices/pci0000:00/0000:00:13.0/{33AECD58-B679-4E54-9BD9-A04D34F0C226}/001E:8086:22D8.0001/HID-SENSOR-200073.8.auto/iio:device1
** (process:2468): DEBUG: Found device
/sys/devices/pci0000:00/0000:00:13.0/{33AECD58-B679-4E54-9BD9-A04D34F0C226}/001E:8086:22D8.0001/HID-SENSOR-200073.8.auto/iio:device1
of type accelerometer at IIO Buffer accelerometer
** (process:2468): DEBUG: Found magn_3d at
/sys/devices/pci0000:00/0000:00:13.0/{33AECD58-B679-4E54-9BD9-A04D34F0C226}/001E:8086:22D8.0003/HID-SENSOR-200083.27.auto/iio:device6
** (process:2468): DEBUG: Found device
/sys/devices/pci0000:00/0000:00:13.0/{33AECD58-B679-4E54-9BD9-A04D34F0C226}/001E:8086:22D8.0003/HID-SENSOR-200083.27.auto/iio:device6
of type compass at IIO Buffer Compass
** (process:2468): DEBUG: Found associated trigger at
/sys/devices/pci0000:00/0000:00:13.0/{33AECD58-B679-4E54-9BD9-A04D34F0C226}/001E:8086:22D8.0001/HID-SENSOR-200073.8.auto/trigger1

** (process:2468): WARNING **: Failed to enable any sensors for device
'/sys/devices/pci0000:00/0000:00:13.0/{33AECD58-B679-4E54-9BD9-A04D34F0C226}/001E:8086:22D8.0001/HID-SENSOR-200073.8.auto/iio:device1'

** (process:2468): WARNING **: Failed to enable any sensors for device
'/sys/devices/pci0000:00/0000:00:13.0/{33AECD58-B679-4E54-9BD9-A04D34F0C226}/001E:8086:22D8.0001/HID-SENSOR-200073.8.auto/iio:device1'
** (process:2468): DEBUG: Found associated trigger at
/sys/devices/pci0000:00/0000:00:13.0/{33AECD58-B679-4E54-9BD9-A04D34F0C226}/001E:8086:22D8.0003/HID-SENSOR-200083.27.auto/trigger6

** (process:2468): WARNING **: Failed to enable any sensors for device
'/sys/devices/pci0000:00/0000:00:13.0/{33AECD58-B679-4E54-9BD9-A04D34F0C226}/001E:8086:22D8.0003/HID-SENSOR-200083.27.auto/iio:device6'

** (process:2468): WARNING **: Failed to enable any sensors for device
'/sys/devices/pci0000:00/0000:00:13.0/{33AECD58-B679-4E54-9BD9-A04D34F0C226}/001E:8086:22D8.0003/HID-SENSOR-200083.27.auto/iio:device6'



root@gladys:/usr/sbin# G_MESSAGES_DEBUG=all /usr/sbin/iio-sensor-proxy.orig
** (process:2533): DEBUG: Found accel_3d at
/sys/devices/pci0000:00/0000:00:13.0/{33AECD58-B679-4E54-9BD9-A04D34F0C226}/001E:8086:22D8.0001/HID-SENSOR-200073.8.auto/iio:device1
** (process:2533): DEBUG: Found device
/sys/devices/pci0000:00/0000:00:13.0/{33AECD58-B679-4E54-9BD9-A04D34F0C226}/001E:8086:22D8.0001/HID-SENSOR-200073.8.auto/iio:device1
of type accelerometer at IIO Buffer accelerometer
** (process:2533): DEBUG: Found magn_3d at
/sys/devices/pci0000:00/0000:00:13.0/{33AECD58-B679-4E54-9BD9-A04D34F0C226}/001E:8086:22D8.0003/HID-SENSOR-200083.27.auto/iio:device6
** (process:2533): DEBUG: Found device
/sys/devices/pci0000:00/0000:00:13.0/{33AECD58-B679-4E54-9BD9-A04D34F0C226}/001E:8086:22D8.0003/HID-SENSOR-200083.27.auto/iio:device6
of type compass at IIO Buffer Compass
** (process:2533): DEBUG: Found associated trigger at
/sys/devices/pci0000:00/0000:00:13.0/{33AECD58-B679-4E54-9BD9-A04D34F0C226}/001E:8086:22D8.0001/HID-SENSOR-200073.8.auto/trigger1
** (process:2533): DEBUG: Got type for in_accel_x: is signed: 1,
bytes: 4, bits_used: 32, shift: 0, mask: 0x0, be: 0
** (process:2533): DEBUG: Got type for in_accel_y: is signed: 1,
bytes: 4, bits_used: 32, shift: 0, mask: 0x0, be: 0
** (process:2533): DEBUG: Got type for in_accel_z: is signed: 1,
bytes: 4, bits_used: 32, shift: 0, mask: 0x0, be: 0
** (process:2533): DEBUG: Built channel array for in_accel_x: is
signed: 1, bytes: 4, bits_used: 32, shift: 0, mask: 0x0, be: 0
** (process:2533): DEBUG: Built channel array for in_accel_y: is
signed: 1, bytes: 4, bits_used: 32, shift: 0, mask: 0x0, be: 0
** (process:2533): DEBUG: Built channel array for in_accel_z: is
signed: 1, bytes: 4, bits_used: 32, shift: 0, mask: 0x0, be: 0
** (process:2533): DEBUG: Found associated trigger at
/sys/devices/pci0000:00/0000:00:13.0/{33AECD58-B679-4E54-9BD9-A04D34F0C226}/001E:8086:22D8.0003/HID-SENSOR-200083.27.auto/trigger6
** (process:2533): DEBUG: Got type for in_magn_x: is signed: 1, bytes:
4, bits_used: 32, shift: 0, mask: 0x0, be: 0
** (process:2533): DEBUG: Got type for in_magn_y: is signed: 1, bytes:
4, bits_used: 32, shift: 0, mask: 0x0, be: 0
** (process:2533): DEBUG: Got type for in_magn_z: is signed: 1, bytes:
4, bits_used: 32, shift: 0, mask: 0x0, be: 0
** (process:2533): DEBUG: Got type for
in_rot_from_north_magnetic_tilt_comp: is signed: 1, bytes: 4,
bits_used: 32, shift: 0, mask: 0x0, be: 0
** (process:2533): DEBUG: Built channel array for in_magn_x: is
signed: 1, bytes: 4, bits_used: 32, shift: 0, mask: 0x0, be: 0
** (process:2533): DEBUG: Built channel array for in_magn_y: is
signed: 1, bytes: 4, bits_used: 32, shift: 0, mask: 0x0, be: 0
** (process:2533): DEBUG: Built channel array for in_magn_z: is
signed: 1, bytes: 4, bits_used: 32, shift: 0, mask: 0x0, be: 0
** (process:2533): DEBUG: Built channel array for
in_rot_from_north_magnetic_tilt_comp: is signed: 1, bytes: 4,
bits_used: 32, shift: 0, mask: 0x0, be: 0
** (process:2533): DEBUG: Handling driver refcounting method
'ClaimLight' for ambient light sensor device
** (process:2533): DEBUG: Handling driver refcounting method
'ClaimAccelerometer' for accelerometer device
** (process:2533): DEBUG: Handling driver refcounting method
'ClaimAccelerometer' for accelerometer device
** (process:2533): DEBUG: Read from IIO: 4449, -1007689, 15468
** (process:2533): DEBUG: Accel sent by driver (quirk applied): 0, 9, 0
** (process:2533): DEBUG: Emitted orientation changed: from undefined to normal
** (process:2533): DEBUG: Read from IIO: 3729, -1007724, 12494
** (process:2533): DEBUG: Accel sent by driver (quirk applied): 0, 9, 0
** (process:2533): DEBUG: Read from IIO: -12800, -1056421, -2211
** (process:2533): DEBUG: Accel sent by driver (quirk applied): 0, 9, 0
** (process:2533): DEBUG: Read from IIO: -642273, -671193, -106330
** (process:2533): DEBUG: Accel sent by driver (quirk applied): 5, 6, 0
** (process:2533): DEBUG: Emitted orientation changed: from normal to right-up
** (process:2533): DEBUG: Read from IIO: -968979, -66939, 45709
** (process:2533): DEBUG: Accel sent by driver (quirk applied): 8, 0, 0
** (process:2533): DEBUG: Read from IIO: -973822, -54006, 38730
** (process:2533): DEBUG: Accel sent by driver (quirk applied): 8, 0, 0
** (process:2533): DEBUG: Read from IIO: -436204, -868488, -94847
** (process:2533): DEBUG: Accel sent by driver (quirk applied): 3, 7, 0
** (process:2533): DEBUG: Emitted orientation changed: from right-up to normal
** (process:2533): DEBUG: Read from IIO: -32008, -988339, -7532
** (process:2533): DEBUG: Accel sent by driver (quirk applied): 0, 8, 0
** (process:2533): DEBUG: Read from IIO: 22296, -1010201, 9358
** (process:2533): DEBUG: Accel sent by driver (quirk applied): 0, 9, 0
^C
root@gladys:/usr/sbin# exit

Script done on Tue 14 Jun 2016 16:47:49 BST

[toc] | [prev] | [next] | [standalone]


#1422105

FromBastien Nocera <hadess@hadess.net>
Date2016-06-14 19:10 +0200
Message-ID<rK00F-7Kr-1@gated-at.bofh.it>
In reply to#1422053
On Tue, 2016-06-14 at 17:08 +0100, Grant Likely wrote:
> On Tue, Jun 14, 2016 at 4:12 PM, Bastien Nocera <hadess@hadess.net>
> wrote:
> > On Tue, 2016-06-14 at 14:44 +0100, Grant Likely wrote:
> > > On Fri, Jun 10, 2016 at 4:27 PM, Bastien Nocera <hadess@hadess.ne
> > > t>
> > > wrote:
> > > > On Fri, 2016-06-10 at 08:23 -0700, Srinivas Pandruvada wrote:
> > > > > On Fri, 2016-06-10 at 17:04 +0200, Bastien Nocera wrote:
> > > > > > > 
> > > > > 
> > > > > [...]
> > > > > 
> > > > > > Are there any errors when setting the triggers?
> > > > > > 
> > > > > Is there any debug option in this service to give more
> > > > > verbose
> > > > > output?
> > > > 
> > > > Add:
> > > > Environment="G_MESSAGES_DEBUG=all"
> > > > 
> > > > To the service file. You should see the debug in systemctl:
> > > > systemctl status iio-sensor-proxy.service
> > > > 
> > > > Or in journalctl if there's too much data:
> > > > journalctl --reverse -u iio-sensor-proxy.service
> > > 
> > > Still no joy on the sensors. The proxy starts up and detects the
> > > sensors, but I don't see any sensor events occurring:
> > 
> > Could you try again with the current master of iio-sensor-proxy?
> > Make
> > sure to install the file in the same location as in your distro
> > provided package.
> > 
> > I've added more debug/warnings to a few cases where it would have
> > silently failed in the past.
> > 
> > In particular, I don't see any messages that would be coming out
> > of:
> > https://github.com/hadess/iio-sensor-proxy/blob/master/src/iio-buff
> > er-utils.c#L512
> > 
> > Could it be that the sub-directory is populated after the device is
> > created in the kernel, causing a race?
> > 
> > Either that, or the contents of the scan_elements/ directory is not
> > the
> > one expected by this code.
> > 
> > The output of this command should us that:
> > ls /sys/devices/pci0000:00/0000:00:13.0/{33AECD58-B679-4E54-9BD9-
> > A04D34F0C226}/001E:8086:22D8.0001/HID-SENSOR-
> > 200073.8.auto/iio:device1/scan_elements
> 
> Hmmm, this is interesting. I fetched, built and ran the latest
> iio-sensor-proxy. It quit with the following error. However,
> immediately afterwards, I ran the Debian packaged version (1.1-1),
> and
> the sensors started to work. Something in the latest master activates
> the sensors enough for the older version to work.

There's no changes in that code other than me introducing a bug that'd
make it throw a warning when the sensor was already enabled. Fixed now.

Could you try again, but make sure to replace the existing iio-sensor-
proxy so it's started on boot, when the device appears. If you see the
warning again, please attach the output out from "ls" as requested in
the earlier mail.

If it doesn't warn on startup, and it fails to work, then we're
probably looking at a bug in the kernel...

Cheers

[toc] | [prev] | [next] | [standalone]


#1422359

FromGrant Likely <grant.likely@secretlab.ca>
Date2016-06-14 23:40 +0200
Message-ID<rK4dY-1WX-7@gated-at.bofh.it>
In reply to#1422105
On Tue, Jun 14, 2016 at 6:01 PM, Bastien Nocera <hadess@hadess.net> wrote:
> On Tue, 2016-06-14 at 17:08 +0100, Grant Likely wrote:
>> On Tue, Jun 14, 2016 at 4:12 PM, Bastien Nocera <hadess@hadess.net>
>> wrote:
>> > On Tue, 2016-06-14 at 14:44 +0100, Grant Likely wrote:
>> > > On Fri, Jun 10, 2016 at 4:27 PM, Bastien Nocera <hadess@hadess.ne
>> > > t>
>> > > wrote:
>> > > > On Fri, 2016-06-10 at 08:23 -0700, Srinivas Pandruvada wrote:
>> > > > > On Fri, 2016-06-10 at 17:04 +0200, Bastien Nocera wrote:
>> > > > > > >
>> > > > >
>> > > > > [...]
>> > > > >
>> > > > > > Are there any errors when setting the triggers?
>> > > > > >
>> > > > > Is there any debug option in this service to give more
>> > > > > verbose
>> > > > > output?
>> > > >
>> > > > Add:
>> > > > Environment="G_MESSAGES_DEBUG=all"
>> > > >
>> > > > To the service file. You should see the debug in systemctl:
>> > > > systemctl status iio-sensor-proxy.service
>> > > >
>> > > > Or in journalctl if there's too much data:
>> > > > journalctl --reverse -u iio-sensor-proxy.service
>> > >
>> > > Still no joy on the sensors. The proxy starts up and detects the
>> > > sensors, but I don't see any sensor events occurring:
>> >
>> > Could you try again with the current master of iio-sensor-proxy?
>> > Make
>> > sure to install the file in the same location as in your distro
>> > provided package.
>> >
>> > I've added more debug/warnings to a few cases where it would have
>> > silently failed in the past.
>> >
>> > In particular, I don't see any messages that would be coming out
>> > of:
>> > https://github.com/hadess/iio-sensor-proxy/blob/master/src/iio-buff
>> > er-utils.c#L512
>> >
>> > Could it be that the sub-directory is populated after the device is
>> > created in the kernel, causing a race?
>> >
>> > Either that, or the contents of the scan_elements/ directory is not
>> > the
>> > one expected by this code.
>> >
>> > The output of this command should us that:
>> > ls /sys/devices/pci0000:00/0000:00:13.0/{33AECD58-B679-4E54-9BD9-
>> > A04D34F0C226}/001E:8086:22D8.0001/HID-SENSOR-
>> > 200073.8.auto/iio:device1/scan_elements
>>
>> Hmmm, this is interesting. I fetched, built and ran the latest
>> iio-sensor-proxy. It quit with the following error. However,
>> immediately afterwards, I ran the Debian packaged version (1.1-1),
>> and
>> the sensors started to work. Something in the latest master activates
>> the sensors enough for the older version to work.
>
> There's no changes in that code other than me introducing a bug that'd
> make it throw a warning when the sensor was already enabled. Fixed now.
>
> Could you try again, but make sure to replace the existing iio-sensor-
> proxy so it's started on boot, when the device appears. If you see the
> warning again, please attach the output out from "ls" as requested in
> the earlier mail.

Oops, missed that the first time. Here you go:

root@gladys:~# ls
/sys/devices/pci0000:00/0000:00:13.0/{33AECD58-B679-4E54-9BD9-A04D34F0C226}/001E:8086:22D8.0001/HID-SENSOR-200073.8.auto/iio:device1/scan_elements
in_accel_x_en     in_accel_y_en     in_accel_z_en
in_accel_x_index  in_accel_y_index  in_accel_z_index
in_accel_x_type   in_accel_y_type   in_accel_z_type

> If it doesn't warn on startup, and it fails to work, then we're
> probably looking at a bug in the kernel...

Here is the output. The latest master still doesn't work. However, it
has the same behaviour that running the broken version of
iio-sensors-proxy (207b5bbd8) will cause the good one start working
(92fa6ea9e).

-- Logs begin at Tue 2016-06-14 22:19:47 BST, end at Tue 2016-06-14
22:20:52 BST. --
Jun 14 22:19:48 gladys systemd[1]: Starting IIO Sensor Proxy service...
Jun 14 22:19:48 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
Found accel_3d at
/sys/devices/pci0000:00/0000:00:13.0/{33AECD58-B679-4E54-9BD9-A04D34F0C226}/001E:8086:22D8.0001/HID-SENSOR-200073.8.auto/iio:device1
Jun 14 22:19:48 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
Found device /sys/devices/pci0000:00/0000:00:13.0/{33AECD58-B679-4E54-9BD9-A04D34F0C226}/001E:8086:22D8.0001/HID-SENSOR-200073.8.auto/iio:device1
of type accelerometer at IIO Buffer accelerometer
Jun 14 22:19:48 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
Found magn_3d at
/sys/devices/pci0000:00/0000:00:13.0/{33AECD58-B679-4E54-9BD9-A04D34F0C226}/001E:8086:22D8.0003/HID-SENSOR-200083.27.auto/iio:device6
Jun 14 22:19:48 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
Found device /sys/devices/pci0000:00/0000:00:13.0/{33AECD58-B679-4E54-9BD9-A04D34F0C226}/001E:8086:22D8.0003/HID-SENSOR-200083.27.auto/iio:device6
of type compass at IIO Buffer Compass
Jun 14 22:19:48 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
Found associated trigger at
/sys/devices/pci0000:00/0000:00:13.0/{33AECD58-B679-4E54-9BD9-A04D34F0C226}/001E:8086:22D8.0001/HID-SENSOR-200073.8.auto/trigger1
Jun 14 22:19:48 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
Enabled sensor /sys/devices/pci0000:00/0000:00:13.0/{33AECD58-B679-4E54-9BD9-A04D34F0C226}/001E:8086:22D8.0001/HID-SENSOR-200073.8.auto/iio:device1/scan_elements/in_accel_x_en
Jun 14 22:19:48 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
Enabled sensor /sys/devices/pci0000:00/0000:00:13.0/{33AECD58-B679-4E54-9BD9-A04D34F0C226}/001E:8086:22D8.0001/HID-SENSOR-200073.8.auto/iio:device1/scan_elements/in_accel_y_en
Jun 14 22:19:48 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
Enabled sensor /sys/devices/pci0000:00/0000:00:13.0/{33AECD58-B679-4E54-9BD9-A04D34F0C226}/001E:8086:22D8.0001/HID-SENSOR-200073.8.auto/iio:device1/scan_elements/in_accel_z_en
Jun 14 22:19:48 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
Got type for in_accel_x: is signed: 1, bytes: 4, bits_used: 32, shift:
0, mask: 0x0, be: 0
Jun 14 22:19:48 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
Got type for in_accel_y: is signed: 1, bytes: 4, bits_used: 32, shift:
0, mask: 0x0, be: 0
Jun 14 22:19:48 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
Got type for in_accel_z: is signed: 1, bytes: 4, bits_used: 32, shift:
0, mask: 0x0, be: 0
Jun 14 22:19:48 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
Built channel array for in_accel_x: is signed: 1, bytes: 4, bits_used:
32, shift: 0, mask: 0x0, be: 0
Jun 14 22:19:48 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
Built channel array for in_accel_y: is signed: 1, bytes: 4, bits_used:
32, shift: 0, mask: 0x0, be: 0
Jun 14 22:19:48 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
Built channel array for in_accel_z: is signed: 1, bytes: 4, bits_used:
32, shift: 0, mask: 0x0, be: 0
Jun 14 22:19:48 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
Found associated trigger at
/sys/devices/pci0000:00/0000:00:13.0/{33AECD58-B679-4E54-9BD9-A04D34F0C226}/001E:8086:22D8.0003/HID-SENSOR-200083.27.auto/trigger6
Jun 14 22:19:48 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
Enabled sensor /sys/devices/pci0000:00/0000:00:13.0/{33AECD58-B679-4E54-9BD9-A04D34F0C226}/001E:8086:22D8.0003/HID-SENSOR-200083.27.auto/iio:device6/scan_elements/in_magn_x_en
Jun 14 22:19:48 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
Enabled sensor /sys/devices/pci0000:00/0000:00:13.0/{33AECD58-B679-4E54-9BD9-A04D34F0C226}/001E:8086:22D8.0003/HID-SENSOR-200083.27.auto/iio:device6/scan_elements/in_magn_y_en
Jun 14 22:19:48 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
Enabled sensor /sys/devices/pci0000:00/0000:00:13.0/{33AECD58-B679-4E54-9BD9-A04D34F0C226}/001E:8086:22D8.0003/HID-SENSOR-200083.27.auto/iio:device6/scan_elements/in_magn_z_en
Jun 14 22:19:48 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
Enabled sensor /sys/devices/pci0000:00/0000:00:13.0/{33AECD58-B679-4E54-9BD9-A04D34F0C226}/001E:8086:22D8.0003/HID-SENSOR-200083.27.auto/iio:device6/scan_elements/in_rot_from_north_magnetic_tilt_comp_en
Jun 14 22:19:48 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
Got type for in_magn_x: is signed: 1, bytes: 4, bits_used: 32, shift:
0, mask: 0x0, be: 0
Jun 14 22:19:48 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
Got type for in_magn_y: is signed: 1, bytes: 4, bits_used: 32, shift:
0, mask: 0x0, be: 0
Jun 14 22:19:48 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
Got type for in_magn_z: is signed: 1, bytes: 4, bits_used: 32, shift:
0, mask: 0x0, be: 0
Jun 14 22:19:48 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
Got type for in_rot_from_north_magnetic_tilt_comp: is signed: 1,
bytes: 4, bits_used: 32, shift: 0, mask: 0x0, be: 0
Jun 14 22:19:48 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
Built channel array for in_magn_x: is signed: 1, bytes: 4, bits_used:
32, shift: 0, mask: 0x0, be: 0
Jun 14 22:19:48 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
Built channel array for in_magn_y: is signed: 1, bytes: 4, bits_used:
32, shift: 0, mask: 0x0, be: 0
Jun 14 22:19:48 gladys systemd[1]: Started IIO Sensor Proxy service.
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
Built channel array for in_magn_z: is signed: 1, bytes: 4, bits_used:
32, shift: 0, mask: 0x0, be: 0
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
Built channel array for in_rot_from_north_magnetic_tilt_comp: is
signed: 1, bytes: 4, bits_used: 32, shift: 0, mask: 0x0, be: 0
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
Handling driver refcounting method 'ClaimAccelerometer' for
accelerometer device
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
Handling driver refcounting method 'ReleaseLight' for ambient light
sensor device
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
Handling driver refcounting method 'ClaimAccelerometer' for
accelerometer device
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:44 gladys iio-sensor-proxy[577]: ** (process:577): DEBUG:
No new data available
Jun 14 22:20:47 gladys systemd[1]: Stopping IIO Sensor Proxy service...
Jun 14 22:20:47 gladys iio-sensor-proxy[577]: ** (process:577):
Jun 14 22:20:47 gladys systemd[1]: Stopped IIO Sensor Proxy service.



>
> Cheers

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web