Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing on Yoga 2 11'' #37

Open
Aradan opened this issue May 2, 2015 · 11 comments
Open

Testing on Yoga 2 11'' #37

Aradan opened this issue May 2, 2015 · 11 comments

Comments

@Aradan
Copy link

Aradan commented May 2, 2015

Hi, I was trying to test this in a Yoga 2 device with the 3.19 kernel (I'm using Manjaro). How does the orientation script is supposed to work? When I execute it (after running make) I get this

$ sudo ./orientation 
iio device number being used is 0
iio trigger number being used is 0
Orientation 1, x:    7, y: -992, z:    7
Orientation 1, x:    7, y: -992, z:    7
Orientation at 0.0 is normal
Orientation 1, x:    7, y: -992, z:    7
Orientation 1, x:    7, y: -992, z:    7
Orientation at 1.0 is normal
ROTATE to normal
unable to find device ELAN Touchscreen
Second child (xinput) returned 256 
Orientation 1, x:    7, y: -992, z:    7
Orientation 1, x:    7, y: -992, z:    7
Orientation at 2.0 is normal
Orientation 1, x:    7, y: -992, z:    7
Orientation 1, x:    7, y: -992, z:    7
Orientation at 3.0 is normal
...

But nothing changes if I rotate my screen. I didn't install the drivers since I'm using a new kernel, or should I?

Regards

@pfps
Copy link
Owner

pfps commented May 2, 2015

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

It does look as if you are close to getting the sensing to work. Try moving
the laptop around to see if the orientation numbers change. If they don't,
then it is likely that the sensor is not being initialized somehow. This is
likely to be because your sensor requires a quirk (something out of the
ordinary) to be correctly initialized and that quirk has not been added to
your distribution or to Linux as a whole. The sensor in the Yoga 2 Pro
needs such a quirk. You will have to find out which sensor you have and how
to get the right quirk set up. This is not easy.

You should also try out the generic_buffer program.
sudo ./generic_buffer -n accel_3d -c 100
should spit out a bunch of sensor values for whatever is thought to be the
accelerometer in your system. Move your laptop around to see if the values
change.

You also do not appear to have an ELAN Touchscreen. You will have to figure
out which touchscreen you have, if any.

The sensor can probably be found via lsusb. On the Yoga 2 Pro it is
ID 2047:0855 Texas Instruments Invensense Embedded MotionApp HID Sensor

To find out your touchscreen name use xinput and look for something named
a touchscreen.

Let me know how your investigations progress.

peter

On 05/02/2015 04:16 AM, Aradan wrote:

Hi, I was trying to test this in a Yoga 2 device with the 3.19 kernel
(I'm using Manjaro). How does the orientation script is supposed to work?
When I execute it (after running make) I get this

|$ sudo ./orientation iio device number being used is 0 iio trigger
number being used is 0 Orientation 1, x: 7, y: -992, z: 7
Orientation 1, x: 7, y: -992, z: 7 Orientation at 0.0 is normal
Orientation 1, x: 7, y: -992, z: 7 Orientation 1, x: 7, y: -992,
z: 7 Orientation at 1.0 is normal ROTATE to normal unable to find
device ELAN Touchscreen Second child (xinput) returned 256 Orientation 1,
x: 7, y: -992, z: 7 Orientation 1, x: 7, y: -992, z: 7
Orientation at 2.0 is normal Orientation 1, x: 7, y: -992, z: 7
Orientation 1, x: 7, y: -992, z: 7 Orientation at 3.0 is normal
... |

But nothing changes if I rotate my screen. I didn't install the drivers
since I'm using a new kernel, or should I?

Regards

— Reply to this email directly or view it on GitHub
#37.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCAAGBQJVRNK/AAoJECjN6+QThfjz+rEH/3BLce/XInwO1kz5mjgjmrEd
KuUZxA5gqcHN0471UylFqrUA9HMgKqnOKcMsJ1RxUdEL4kmXH+r1cngKr+Lcnx9c
bH3lcoEKhL2xMU/YopELelY6/T5dFZuGRvKxXjE2+Lnuwk1H5VdqxNr2/6IRlV88
yTbNGkPlqiuZ84PPUW8ERZwUbH2DF2d+7t4VsNhbzCzDlYxMp3Mg3X88UWkfr1a+
UJAD7BuXYLd/4A+O5BciYf2VvdBGWNOc06w1ltfZ0HHUMPAN4WV9Q2yk6zRkGtN8
/Sh5qiVgmqpFZP3UDMoWRcz9dtGmBDSMvCWwl2RBoPHuFwhMX3dQyAZ1v+Fmrf8=
=G3+O
-----END PGP SIGNATURE-----

@pfps
Copy link
Owner

pfps commented May 2, 2015 via email

@Aradan
Copy link
Author

Aradan commented May 3, 2015

Thanks for the help :)
Using the generic buffer does not show any improvement

$ sudo ./generic_buffer -n accel_3d -c 100
iio device number being used is 3
iio trigger number being used is 3
DEV_DIR_NAME /sys/bus/iio/devices/iio:device3  TRIGGER_NAME accel_3d-dev3
SCAN_SIZE 12
N000: in_accel_x    7    7.0  in_accel_y -992 -992.0  in_accel_z    7    7.0  
N000: in_accel_x    7    7.0  in_accel_y -992 -992.0  in_accel_z    7    7.0  

Also, it seems the sensors are not present when I use lsusb (I cannot see anything from Texas )
However, the touchscreen device works normally, xinput shows me this:

Virtual core pointer                        id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ Atmel Atmel maXTouch Digitizer            id=11   [slave  pointer  (2)]
⎜   ↳ ETPS/2 Elantech Touchpad                  id=14   [slave  pointer  (2)]

The maXTouch stuff is the one. I thought that the newest kernels were going to have everything already implemented, which seems not to be the case.

What I don't know is how to detect the accelerometer or sensors for the light. But according to your reply, it is a difficult task.
If I do lsmod, I can get some sensor outputs:

hid_sensor_incl_3d     12667  0 
hid_sensor_rotation    12667  0 
hid_sensor_accel_3d    12674  1 
hid_sensor_gyro_3d     12667  0 
hid_sensor_als         12639  0 
hid_sensor_magn_3d     12667  0 
hid_sensor_trigger     12521  12 hid_sensor_gyro_3d,hid_sensor_incl_3d,hid_sensor_accel_3d,hid_sensor_rotation,hid_sensor_als,hid_sensor_magn_3d
uvcvideo               84822  0 
hid_sensor_iio_common    12737  6 hid_sensor_gyro_3d,hid_sensor_incl_3d,hid_sensor_accel_3d,hid_sensor_rotation,hid_sensor_als,hid_sensor_magn_3d
industrialio_triggered_buffer    12417  6 hid_sensor_gyro_3d,hid_sensor_incl_3d,hid_sensor_accel_3d,hid_sensor_rotation,hid_sensor_als,hid_sensor_magn_3d
kfifo_buf              12834  1 industrialio_triggered_buffer
industrialio           42744  10 hid_sensor_trigger,hid_sensor_gyro_3d,industrialio_triggered_buffer,hid_sensor_incl_3d,hid_sensor_accel_3d,hid_sensor_rotation,hid_sensor_als,kfifo_buf,hid_sensor_magn_3d
hid_sensor_incl_3d     12667  0 
hid_sensor_rotation    12667  0 
hid_sensor_accel_3d    12674  1 
hid_sensor_gyro_3d     12667  0 
hid_sensor_als         12639  0 
hid_sensor_magn_3d     12667  0 
hid_sensor_trigger     12521  12 hid_sensor_gyro_3d,hid_sensor_incl_3d,hid_sensor_accel_3d,hid_sensor_rotation,hid_sensor_als,hid_sensor_magn_3d
uvcvideo               84822  0 
hid_sensor_iio_common    12737  6 hid_sensor_gyro_3d,hid_sensor_incl_3d,hid_sensor_accel_3d,hid_sensor_rotation,hid_sensor_als,hid_sensor_magn_3d
industrialio_triggered_buffer    12417  6 hid_sensor_gyro_3d,hid_sensor_incl_3d,hid_sensor_accel_3d,hid_sensor_rotation,hid_sensor_als,hid_sensor_magn_3d
kfifo_buf              12834  1 industrialio_triggered_buffer
industrialio           42744  10 hid_sensor_trigger,hid_sensor_gyro_3d,industrialio_triggered_buffer,hid_sensor_incl_3d,hid_sensor_accel_3d,hid_sensor_rotation,hid_sensor_als,kfifo_buf,hid_sensor_magn_3d

I will try to search a little more about this, but does not look easy

Cheers

@guilhem
Copy link

guilhem commented Jun 27, 2015

Hi @pfps ,
I just change my Yoga 2 11 for a Yoga 3 14 and it seems to have same sensor controller.
I was quite lazy before... but as it's my second laptop with this chip I want to make it working ;)

And... I'm not quite far from make it working:
I use your commit: torvalds/linux@825747b and change value for my laptop
And it's working!
When I cat values in /sys/bus/iio/devices/iio:deviceX values are moving according to environment (for als, gyro and magn).
Now my problem is about buffer... it's working only when I "cat" values.... :/
I don't know where to look...

@guilhem
Copy link

guilhem commented Jul 9, 2015

@Aradan @pfps my uptream patch have been validated for inclusion in 4.3.

Let's test it when first RC goes out ;)

@davidcortesortuno
Copy link

Cool, will it work on the small Yoga 2? Because the sensors are not from Texas. BTW, I was using Arch, I hope it works when the new kernel goes out

@guilhem
Copy link

guilhem commented Jul 9, 2015

@davidcortesortuno I had support for sensors made by ITE used in yoga 2 11 and yoga 3 14 (and maybe other ;))

@davidcortesortuno
Copy link

Hi, how can I test your patch? Since the gyroscope is not working on my Windows partition and I think it is a software rather than a hardware related stuff. I would like to check if it at least working.

@guilhem
Copy link

guilhem commented Sep 17, 2015

Hi all,

4.3 rc1 have been released and I tested my yoga 3 14 with success \o/

I don't know for yoga 2 11 but I think it should work :)

@davidcortesortuno
Copy link

I installed kernel 4.3 rc1 in Arch Linux and it is working! Thanks for submitting the patch. I hope I can use the light sensor in the future :) and also that the new kernel comes up soon

@davidcortesortuno
Copy link

Hi, just to let you know, after this kernel patch it is possible to use screen rotation and ambient light sensors with iio-sensor-proxy https://github.com/hadess/iio-sensor-proxy in Gnome 3.18 or newer, which works nicely

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants