Re: Debugging 3D sensor on Lenovo YOGA 700-11ISK

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 20/03/2019 07:46, Pandruvada, Srinivas wrote:
> On Tue, 2019-03-19 at 12:14 +1100, Alexey Kardashevskiy wrote:
>>
> 
> [...]
> 
>> Refer to iio buffer interface for how to read from buffers by
>>> enabling
>>> channels. tools/iio/iio_generic_buffer.c is an example how to use.
>>
>>
>> No, my question was about the kernel side of the device, not the
>> userspace, it is late to look there - the data seems to be broken. I
>> am
>> interested to see how these buffers are filled with data and compare
>> to
>> what linux exposes via in_accel_x_raw sysops properties. Oh well, it
>> is
>> debugging time them.
> kernel processing is done in multiple layers, from transport->hid-
> sensor-hub.c->hid-sensor-accel-3d.c
> The kernel is just sending what FW is sending in buffer mode.
> FW is sending 0,0,0 for x,y,z. This is the way FW is telling that it
> completed a batch. Basically the user space could have gone to sleep by
> informing that don't bother it for x amount of time or samples. It
> seems that this platform is enabling batch mode, whether user space
> wants it or not.
> 
> Try this change iio-sensor-proxy. From raw data 
> 
> diff --git a/src/drv-iio-buffer-accel.c b/src/drv-iio-buffer-accel.c
> index ebf94de..84a83a3 100644
> --- a/src/drv-iio-buffer-accel.c
> +++ b/src/drv-iio-buffer-accel.c
> @@ -65,6 +65,11 @@ process_scan (IIOSensorData data, DrvData *or_data)
>         tmp.y = accel_y;
>         tmp.z = accel_z;
>  
> +       if (tmp.x == 0 && tmp.y == 0 && tmp.z == 0) {
> +               g_debug("batch complete\n");
> +               return 0;
> +       }
> +

I tried, it did not help - worked for a little bit - turned laptop 3
times - and then started rotating it endlessly. The problem is not with
zero samples (or not just with them) but with wrong samples too.


>         if (!apply_mount_matrix (or_data->mount_matrix, &tmp))
>                 g_warning ("Could not apply mount matrix");
>  
> 
> Thanks,
> Srinivas
> 
> 
>>
>>
>>

-- 
Alexey



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux