another iio story

358 views
Skip to first unread message

Jose Luis s

unread,
Jan 19, 2019, 11:54:42 AM1/19/19
to Android-x86
Hi.

In latest isos I've been geting issues with orientation, I've found workaround to orientation using orientation apps to force it. But now I need to have orientation sensors working, I've been reading the related threads


And others.

In my case (3 different chuwi tablets) I get no orientation action (2 of them starts in portrait and 1 in landscape but no change at all)

I have used some sensorc checking apps, all detect accelerometer but no change in values x-y-z nor accel


Checking
getprop ro.hardware.sensors
iio

and i get /sys/bus/iio/devices/iio:device1  (not 0, that seems to be the axp288_adc)


But

ro.iio.accel.x.opt_scale
returns nothing

I modified init.sh to have sensors (has.sensors=true)

But no change.

If I swich to iio-old in buildprop , then rotation works, but wrong orientation change, maybe i need to change matrix. but it seems to rotate not very well, and sensors test does not read values at all so no luck.

anyway i would like to have the new iio working.


can anybody help?


spin877

unread,
Jan 19, 2019, 1:06:57 PM1/19/19
to Android-x86
use iio-old and change hal.sensors.iio.accel.matrix=0,1,0,1,0,0,0,0,-1 ????

Jose Luis s

unread,
Jan 19, 2019, 3:25:09 PM1/19/19
to Android-x86
Hello spin887, thanks for your guess, How do you get to this matrix? do you have some chuwi?

Daniel Cheung

unread,
Jan 19, 2019, 5:35:59 PM1/19/19
to andro...@googlegroups.com
Hi Jose, I had the same issue with my Teclast tablet and I had to play using the trial and error method in regards to the matrix values in order to get it to work. There's something wrong with the iio driver that is included doesn't work but Chih-Wei's custom iio-old driver worked. Kionix do have a set of drivers for Android which I believe is not the same as the default iio driver in the Linux kernel. I don't know how to compile Kionix driver myself but their website seem to have all the files there.


--
You received this message because you are subscribed to the Google Groups "Android-x86" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-x86...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-x86.
For more options, visit https://groups.google.com/d/optout.

Alejas asds

unread,
Jan 21, 2019, 4:48:18 AM1/21/19
to andro...@googlegroups.com
Welcome to Google!

Hi

thanks for join us!

Reg Google

Jose Luis s

unread,
Jan 21, 2019, 6:06:00 AM1/21/19
to Android-x86
Maybe, but I wonder why ubuntu (linuxium ubuntu) works perfectly with screen rotation. The only difference I see is that the index of the iio:device is 0 in ubuntu instead of 1 in Android-x86. I've seen into modules order to check if the axp688-acd driver loads before bma250 but is not the case, I'd like to force index just to be sure that this is not the problem.

Anyone guess how to force index to be "0" instead of "1"?

Chih-Wei Huang

unread,
Jan 21, 2019, 9:42:48 AM1/21/19
to Android-x86
Jose Luis s <jose...@gmail.com> 於 2019年1月21日 週一 下午7:06寫道:
>
> Maybe, but I wonder why ubuntu (linuxium ubuntu) works perfectly with screen rotation. The only difference I see is that the index of the iio:device is 0 in ubuntu instead of 1 in Android-x86. I've seen into modules order to check if the axp688-acd driver loads before bma250 but is not the case, I'd like to force index just to be sure that this is not the problem.
>
> Anyone guess how to force index to be "0" instead of "1"?

Then what is the index "0"?
There must be another iio device in index 0.

Please show:
ls -d /sys/bus/iio/devices/iio:device*/
ls /sys/bus/iio/devices/iio:device*/*

Anyway, the index should not be a problem.

> El sábado, 19 de enero de 2019, 23:35:59 (UTC+1), BrokenE39 escribió:
>>
>> Hi Jose, I had the same issue with my Teclast tablet and I had to play using the trial and error method in regards to the matrix values in order to get it to work. There's something wrong with the iio driver that is included doesn't work but Chih-Wei's custom iio-old driver worked. Kionix do have a set of drivers for Android which I believe is not the same as the default iio driver in the Linux kernel. I don't know how to compile Kionix driver myself but their website seem to have all the files there.

Yu Zhao just provided a patch to fix a similar issue in his EZpad.
You may try his method:

setprop ro.iio.accel.quirks no-trig

>> On Sat, Jan 19, 2019 at 12:25 PM Jose Luis s <jose...@gmail.com> wrote:
>>>
>>> Hello spin887, thanks for your guess, How do you get to this matrix? do you have some chuwi?
>>>
>>> El sábado, 19 de enero de 2019, 19:06:57 (UTC+1), spin877 escribió:
>>>>
>>>> use iio-old and change hal.sensors.iio.accel.matrix=0,1,0,1,0,0,0,0,-1 ????



--
Chih-Wei
Android-x86 project
http://www.android-x86.org

spin877

unread,
Jan 21, 2019, 10:44:08 AM1/21/19
to Android-x86


on my tablet only iio.old works
the new one does not work.
I noticed though
that in
/intel/libsensors/enumeration.c

the driver looks for : in_accel_x
while my sensor is: in_accel_x_raw



look here:



/sys/bus/iio/devices/iio:device0/
/sys/bus/iio/devices/iio:device1/

/sys/bus/iio/devices/iio:device0/dev
/sys/bus/iio/devices/iio:device0/in_current3_raw
/sys/bus/iio/devices/iio:device0/in_current4_raw
/sys/bus/iio/devices/iio:device0/in_temp0_raw
/sys/bus/iio/devices/iio:device0/in_temp1_raw
/sys/bus/iio/devices/iio:device0/in_temp2_raw
/sys/bus/iio/devices/iio:device0/in_voltage5_raw
/sys/bus/iio/devices/iio:device0/name
/sys/bus/iio/devices/iio:device0/uevent
/sys/bus/iio/devices/iio:device1/current_timestamp_clock
/sys/bus/iio/devices/iio:device1/dev
/sys/bus/iio/devices/iio:device1/in_accel_sampling_frequency
/sys/bus/iio/devices/iio:device1/in_accel_sampling_frequency_available
/sys/bus/iio/devices/iio:device1/in_accel_scale
/sys/bus/iio/devices/iio:device1/in_accel_scale_available
/sys/bus/iio/devices/iio:device1/in_accel_x_raw
/sys/bus/iio/devices/iio:device1/in_accel_y_raw
/sys/bus/iio/devices/iio:device1/in_accel_z_raw
/sys/bus/iio/devices/iio:device1/name
/sys/bus/iio/devices/iio:device1/uevent




/sys/bus/iio/devices/iio:device1/events:
in_accel_x_thresh_either_en
in_accel_x_thresh_either_period
in_accel_x_thresh_either_value
in_accel_y_thresh_either_en
in_accel_y_thresh_either_period
in_accel_y_thresh_either_value
in_accel_z_thresh_either_en
in_accel_z_thresh_either_period
in_accel_z_thresh_either_value



/sys/bus/iio/devices/iio:device1/scan_elements:
in_accel_x_en
in_accel_x_index
in_accel_x_type
in_accel_y_en
in_accel_y_index
in_accel_y_type
in_accel_z_en
in_accel_z_index
in_accel_z_type
in_timestamp_en
in_timestamp_index
in_timestamp_type




I entered this patch but it does not work yet:



Where am I doing wrong?





--- a/enumeration.c
+++ b/enumeration.c
@@ -31,6 +31,8 @@
 
 #include <errno.h>
 
+#define LOG_NDEBUG 0
+
 /*
  * This table maps syfs entries in scan_elements directories to sensor types,
  * and will also be used to determine other sysfs names as well as the iio
@@ -47,7 +49,7 @@
 sensor_catalog_entry_t sensor_catalog[] = {
        {
                .tag            = "accel",
-               .shorthand      = "",
+               .shorthand      = "raw",
                .type           = SENSOR_TYPE_ACCELEROMETER,
                .num_channels   = 3,
                .is_virtual     = 0,

youling 257

unread,
Jan 21, 2019, 12:12:57 PM1/21/19
to Android-x86
no tablet use in_accel_x, all use in_accel_x_raw. 

android_x86:/ $ su
android_x86:/ # ls -al /sys/bus/iio/devices/iio:device1/*

-rw-r--r-- 1 system system 4096 2019-01-22 00:27 /sys/bus/iio/devices/iio:device1/current_timestamp_clock
-r--r--r-- 1 system system 4096 2019-01-22 00:27 /sys/bus/iio/devices/iio:device1/dev
-rw-r--r-- 1 system system 4096 2019-01-22 00:27 /sys/bus/iio/devices/iio:device1/in_accel_sampling_frequency
-rw-r--r-- 1 system system 4096 2019-01-22 00:27 /sys/bus/iio/devices/iio:device1/in_accel_scale
-rw-r--r-- 1 system system 4096 2019-01-22 00:27 /sys/bus/iio/devices/iio:device1/in_accel_x_raw
-rw-r--r-- 1 system system 4096 2019-01-22 00:27 /sys/bus/iio/devices/iio:device1/in_accel_y_raw
-rw-r--r-- 1 system system 4096 2019-01-22 00:27 /sys/bus/iio/devices/iio:device1/in_accel_z_raw
-rw-r--r-- 1 system system 4096 2019-01-22 00:27 /sys/bus/iio/devices/iio:device1/in_temp_offset
-rw-r--r-- 1 system system 4096 2019-01-22 00:27 /sys/bus/iio/devices/iio:device1/in_temp_raw
-rw-r--r-- 1 system system 4096 2019-01-22 00:27 /sys/bus/iio/devices/iio:device1/in_temp_scale
-r--r--r-- 1 system system 4096 2019-01-22 00:27 /sys/bus/iio/devices/iio:device1/name
-r--r--r-- 1 system system 4096 2019-01-22 00:27 /sys/bus/iio/devices/iio:device1/sampling_frequency_available
lrwxrwxrwx 1 root root 0 2019-01-22 01:11 /sys/bus/iio/devices/iio:device1/subsystem -> ../../../../../../bus/iio
-rw-r--r-- 1 system system 4096 2019-01-22 00:27 /sys/bus/iio/devices/iio:device1/uevent

/sys/bus/iio/devices/iio:device1/buffer:
total 0
drwxr-xr-x 2 system system 0 2019-01-22 00:27 .
drwxr-xr-x 7 system system 0 2019-01-22 00:27 ..
-r--r--r-- 1 system system 4096 2019-01-22 00:27 data_available
-rw-r--r-- 1 system system 4096 2019-01-22 00:27 enable
-r--r--r-- 1 system system 4096 2019-01-22 00:27 hwfifo_enabled
-r--r--r-- 1 system system 4096 2019-01-22 00:27 hwfifo_watermark
-r--r--r-- 1 system system 4096 2019-01-22 00:27 hwfifo_watermark_max
-r--r--r-- 1 system system 4096 2019-01-22 00:27 hwfifo_watermark_min
-rw-r--r-- 1 system system 4096 2019-01-22 00:27 length
-rw-r--r-- 1 system system 4096 2019-01-22 00:27 watermark

/sys/bus/iio/devices/iio:device1/events:
total 0
drwxr-xr-x 2 system system 0 2019-01-22 00:27 .
drwxr-xr-x 7 system system 0 2019-01-22 00:27 ..
-rw-r--r-- 1 system system 4096 2019-01-22 00:27 in_accel_x_roc_either_en
-rw-r--r-- 1 system system 4096 2019-01-22 00:27 in_accel_x_roc_either_period
-rw-r--r-- 1 system system 4096 2019-01-22 00:27 in_accel_x_roc_either_value
-rw-r--r-- 1 system system 4096 2019-01-22 00:27 in_accel_y_roc_either_en
-rw-r--r-- 1 system system 4096 2019-01-22 00:27 in_accel_y_roc_either_period
-rw-r--r-- 1 system system 4096 2019-01-22 00:27 in_accel_y_roc_either_value
-rw-r--r-- 1 system system 4096 2019-01-22 00:27 in_accel_z_roc_either_en
-rw-r--r-- 1 system system 4096 2019-01-22 00:27 in_accel_z_roc_either_period
-rw-r--r-- 1 system system 4096 2019-01-22 00:27 in_accel_z_roc_either_value

/sys/bus/iio/devices/iio:device1/power:
total 0
drwxr-xr-x 2 system system 0 2019-01-22 00:27 .
drwxr-xr-x 7 system system 0 2019-01-22 00:27 ..
-rw-r--r-- 1 system system 4096 2019-01-22 00:27 autosuspend_delay_ms
-rw-r--r-- 1 system system 4096 2019-01-22 00:27 control
-r--r--r-- 1 system system 4096 2019-01-22 00:27 runtime_active_time
-r--r--r-- 1 system system 4096 2019-01-22 00:27 runtime_status
-r--r--r-- 1 system system 4096 2019-01-22 00:27 runtime_suspended_time

/sys/bus/iio/devices/iio:device1/scan_elements:
total 0
drwxr-xr-x 2 system system 0 2019-01-22 00:27 .
drwxr-xr-x 7 system system 0 2019-01-22 00:27 ..
-rw-r--r-- 1 system system 4096 2019-01-22 00:27 in_accel_x_en
-r--r--r-- 1 system system 4096 2019-01-22 00:27 in_accel_x_index
-r--r--r-- 1 system system 4096 2019-01-22 00:27 in_accel_x_type
-rw-r--r-- 1 system system 4096 2019-01-22 00:27 in_accel_y_en
-r--r--r-- 1 system system 4096 2019-01-22 00:27 in_accel_y_index
-r--r--r-- 1 system system 4096 2019-01-22 00:27 in_accel_y_type
-rw-r--r-- 1 system system 4096 2019-01-22 00:27 in_accel_z_en
-r--r--r-- 1 system system 4096 2019-01-22 00:27 in_accel_z_index
-r--r--r-- 1 system system 4096 2019-01-22 00:27 in_accel_z_type
-rw-r--r-- 1 system system 4096 2019-01-22 00:27 in_timestamp_en
-r--r--r-- 1 system system 4096 2019-01-22 00:27 in_timestamp_index
-r--r--r-- 1 system system 4096 2019-01-22 00:27 in_timestamp_type

/sys/bus/iio/devices/iio:device1/trigger:
total 0
drwxr-xr-x 2 system system 0 2019-01-22 00:27 .
drwxr-xr-x 7 system system 0 2019-01-22 00:27 ..
-rw-r--r-- 1 system system 4096 2019-01-22 00:27 current_trigger
android_x86:/ #

在 2019年1月21日星期一 UTC+8下午11:44:08,spin877写道:

Chih-Wei Huang

unread,
Jan 21, 2019, 9:40:19 PM1/21/19
to Android-x86
spin877 <sfuma...@gmail.com> 於 2019年1月21日 週一 下午11:44寫道:
>
> on my tablet only iio.old works
> the new one does not work.

As I have said, please try the quirks provided
by Yu Zhao:

setprop ro.iio.accel.quirks no-trig

There are other quirks available that
you may try. Read
hardware/intel/libsensors/README
for details.

> I noticed though
> that in
> /intel/libsensors/enumeration.c
>
> the driver looks for : in_accel_x
> while my sensor is: in_accel_x_raw

No. in_accel_x_raw is the correct name.

Jose Luis s

unread,
Jan 22, 2019, 4:16:17 AM1/22/19
to Android-x86
Thanks all for the suggestions.

I'll try them

Jose Luis s

unread,
Jan 22, 2019, 7:30:25 AM1/22/19
to Android-x86
WORKS!!!!!

Thanks a lot to all!!!!

El martes, 22 de enero de 2019, 3:40:19 (UTC+1), Chih-Wei Huang escribió:

Chih-Wei Huang

unread,
Jan 22, 2019, 10:23:32 PM1/22/19
to Android-x86
Jose Luis s <jose...@gmail.com> 於 2019年1月22日 週二 下午8:30寫道:
>
> WORKS!!!!!
> Thanks a lot to all!!!!

Please provide a patch for your device like this:

https://sourceforge.net/p/android-x86/device_generic_common/ci/55b6baef7fd8a408176530dea75532a08900443b/

Thanks!

Jose Luis s

unread,
Jan 23, 2019, 6:32:59 AM1/23/19
to Android-x86
Sure.

I have 3 different chuwi tablets so I prepare a patch for all of them as soon as I have some spare time.
Reply all
Reply to author
Forward
0 new messages