carleewang / cm9-msm8960

Automatically exported from code.google.com/p/cm9-msm8960
0 stars 0 forks source link

Gyroscope non-functional #147

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1.Using an app such as Smart Tools, which requires the gyroscope for leveling. 
2. Attempting to use the Photosphere function of the new Android 4.2 camera
3. Using an app such as Phone Tester, which reports on the status of various 
sensors

What is the expected output? What do you see instead?

I expect to be able to take Photosphere pictures, using the 4.2 camera, and I 
expect more precise control in games and apps. Instead,Photosphere does not 
work, and apps have to rely on the accelerometer alone. 

What version of the product are you using? On what operating system?

I am using the November 3 Nightly of CyanogenMod 10, for Evita.  The operating 
system is Android 4.1.2

Please provide any additional information below.

Original issue reported on code.google.com by TAndrews...@gmail.com on 4 Nov 2012 at 7:06

Attachments:

GoogleCodeExporter commented 9 years ago
Thats weird, I just fired up Phone Tester and its showing G-Scope data for me. 
See attached photos.

Original comment by h8r...@gmail.com on 4 Nov 2012 at 10:08

Attachments:

GoogleCodeExporter commented 9 years ago
(its all zeroed out bc i had it laying flat)

Original comment by h8r...@gmail.com on 4 Nov 2012 at 10:08

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Mine isn't working.  I'm on the latest stable cm10 with the 4.2 gapps.  Could 
the gapps have broken this?

Original comment by tommyarn...@gmail.com on 14 Nov 2012 at 1:56

Attachments:

GoogleCodeExporter commented 9 years ago
Factory reset and installed the jb gapps same problem.

Original comment by tommyarn...@gmail.com on 14 Nov 2012 at 4:44

Attachments:

GoogleCodeExporter commented 9 years ago
Phone tester shows my gyroscope to be working fine with cm10 stable and 4.2 
gapps.  Photosphere at least sort of works but has a lot of lag.

My properties pop-up looks like h8's.  NAME is MPL Gyro, and VENDOR is 
Invensense.  tommy's NAME is R3GD20 Gyroscope, and his VENDOR is ST.  Is it 
possible there is different hardware in some One Xs?

Original comment by laut...@gmail.com on 15 Nov 2012 at 9:54

GoogleCodeExporter commented 9 years ago
Just realized tommy might not be using an evita at all. </sheepish>

Original comment by laut...@gmail.com on 15 Nov 2012 at 10:20

GoogleCodeExporter commented 9 years ago
I have exactly the same problem and my gyro is also displayed as R3GD20 (and 
yes, I am using an evita).

As the gyro works fine on Sense roms maybe there's a missing driver/firmware 
somewhere?

Original comment by i.am.the...@gmail.com on 16 Nov 2012 at 10:18

Attachments:

GoogleCodeExporter commented 9 years ago
I'm also having the issue. I am on a one xl. My bootloader says Evita. I have 
the R3GD20 in mine as well. Maybe there are multiple versions of the hardware 
out there. 

Original comment by nayt...@gmail.com on 16 Nov 2012 at 10:39

GoogleCodeExporter commented 9 years ago
Yeah, definitely more than one type of gyroscope in these phones. I can confirm 
that I've got R3GD20 in my evita as well. Looks like that's why half of us 
don't have working gyro.

Original comment by ajer...@gmail.com on 16 Nov 2012 at 3:50

GoogleCodeExporter commented 9 years ago
All the other sensors work except for the gyro
According to Phone Tester app form the market;
Gyroscope: Wating for data.... No data appears 
Properties: 
NAME: R3GD20 GYROSCOPE SENSOR
 VENDOR: ST
 VERSION: 1
 POWER: 6.1 mA
 RANGE: 34.906586
 RESOLUTION: 6.1

This is on AT&T Evtia OneX, HBoot 1.14, Software 2.20.

Any Jelly Bean rom breaks the sensor.
Sense based roms do not break the sensor.
Android 4.2 camera, photosphere does not communicate with the sensor.
Anything from Android 4.1 and higher breaks the gyro.

Original comment by davidali...@gmail.com on 19 Nov 2012 at 10:10

GoogleCodeExporter commented 9 years ago
Are we concluding that the evitas seem to have different gyroscopes and the 
drivers don't support them?

Original comment by efrainor...@gmail.com on 21 Nov 2012 at 2:22

GoogleCodeExporter commented 9 years ago
I am having the same problem mentioned above

Sensor: r3gd20 
Waiting for data 

Original comment by naveenmu...@gmail.com on 21 Nov 2012 at 5:59

GoogleCodeExporter commented 9 years ago
I have the same problem. Confirmed with Phone Tester app. No data from Gyro. 
Photo Sphere does not work. I have CM10 + Gapps4.1 + Camera4.2 flashed.

Gyroscope
  Waiting for Data...
Properties
 NAME: R3GD20 GYROSCOPE SENSOR
 VENDOR: ST
 VERSION: 1
 POWER: 6.1 mA
 RANGE: 34.906586
 RESOLUTION: 6.1

Original comment by knvi...@gmail.com on 21 Nov 2012 at 7:08

GoogleCodeExporter commented 9 years ago
i'm having the same issue. seems to work on non-jb roms and confirmed with 
phone tester.

Gyroscope
  Waiting for Data...
Properties
 NAME: R3GD20 GYROSCOPE SENSOR

Original comment by finandes...@gmail.com on 26 Nov 2012 at 6:19

GoogleCodeExporter commented 9 years ago
Confirmed on evita runing King Kang M1.  Phone Tester shows waiting for data on 
R3GD20 GYROSCOPE SENSOR as reported above.

Original comment by Matthew....@gmail.com on 27 Nov 2012 at 1:40

GoogleCodeExporter commented 9 years ago
Can someone with a RG3D20 gyroscope look and see if they have a 
/sys/class/htc_gyro/ directory?  It's possible that it's only there when using 
a sense ROM too.  I don't really have much idea how the stuff in /sys gets 
there.

I found http://pastebin.com/cByvuyJu which appears to be an init.rc type for a 
device very similar to ours.  It contains the following section:

on init
    # for Invense MPU3050
    chmod 0664 /dev/mpu
    chmod 0664 /dev/mpuirq
    chmod 0664 /dev/timerirq
    chmod 0664 /sys/class/gyro_sensors/gyro/mpu_lpm_flag
    chown system system /dev/mpu
    chown system system /dev/mpuirq
    chown system system /dev/timerirq
    chown system system /sys/class/gyro_sensors/gyro/mpu_lpm_flag

    # for ST R3GD20
    chown system system /sys/class/htc_gyro/gyro/enable_device
    chown system system /sys/class/htc_gyro/gyro/pollrate_ms
    chown system system /sys/class/htc_gyro/gyro/range
    chown system system /sys/class/htc_gyro/gyro/enable_polling
    chown system system /sys/class/htc_gyro/gyro/fifo_samples
    chown system system /sys/class/htc_gyro/gyro/fifo_mode
    chown system system /sys/class/htc_gyro/gyro/reg_value
    chown system system /sys/class/htc_gyro/gyro/reg_addr
    chmod 0664 /sys/class/htc_gyro/gyro/enable_device
    chmod 0664 /sys/class/htc_gyro/gyro/pollrate_ms
    chmod 0664 /sys/class/htc_gyro/gyro/range
    chmod 0664 /sys/class/htc_gyro/gyro/enable_polling
    chmod 0664 /sys/class/htc_gyro/gyro/fifo_samples
    chmod 0664 /sys/class/htc_gyro/gyro/fifo_mode
    chmod 0664 /sys/class/htc_gyro/gyro/reg_value
    chmod 0664 /sys/class/htc_gyro/gyro/reg_addr

Original comment by laut...@gmail.com on 27 Nov 2012 at 10:24

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I can confirm that I have a /sys/class/htc_gyro/ directory.

Original comment by davidali...@gmail.com on 27 Nov 2012 at 10:40

GoogleCodeExporter commented 9 years ago
Yes, an empty htc_gyro folder. On CM10, R3GD20 gyro.

Original comment by ajer...@gmail.com on 27 Nov 2012 at 10:45

GoogleCodeExporter commented 9 years ago
I just checked. 
/sys/class/htc_gyro/ exists, but is empty on CM10.

Original comment by knvi...@gmail.com on 27 Nov 2012 at 10:48

GoogleCodeExporter commented 9 years ago
So what if we just copy the folder and contents and past it to the empty folder?

Original comment by davidali...@gmail.com on 27 Nov 2012 at 10:48

GoogleCodeExporter commented 9 years ago
If we can get a copy of the contents, presumably from a sense based install, 
that's worth a shot.  I would try it, but I'm one of the lucky ones with a 
working MPL gyroscope.

If you have the files, see if you can attach them here for others.

Original comment by laut...@gmail.com on 27 Nov 2012 at 10:52

GoogleCodeExporter commented 9 years ago
But all the htc_* directories are empty. 
For example, htc_accelerometer is also empty and the acc. still works just fine 
with CM10. I am guessing CM10 uses equivalent files in another location and 
just does not need these htc_* ones. We would need to find the CM10 location 
and point it to this htc_gyro after copying over the files? Just speculating 
here...

Original comment by knvi...@gmail.com on 27 Nov 2012 at 10:54

GoogleCodeExporter commented 9 years ago
Apparently jewel uses the same gyroscope.  In 
https://github.com/CyanogenMod/android_device_htc_jewel/blob/jellybean/ramdisk/i
nit.jet.rc there are the following lines:

# for ST R3GD20
    chown system system /sys/class/htc_gyro/gyro/enable_device
    chown system system /sys/class/htc_gyro/gyro/pollrate_ms
    chown system system /sys/class/htc_gyro/gyro/range
    chown system system /sys/class/htc_gyro/gyro/enable_polling
    chown system system /sys/class/htc_gyro/gyro/fifo_samples
    chown system system /sys/class/htc_gyro/gyro/fifo_mode
    chown system system /sys/class/htc_gyro/gyro/reg_value
    chown system system /sys/class/htc_gyro/gyro/reg_addr

Original comment by laut...@gmail.com on 27 Nov 2012 at 10:57

GoogleCodeExporter commented 9 years ago
I have stuff in the htc_* directories.  There are files in 
/sys/class/htc_accessory.  For example, I have sub-directories with files for 
debug, fm, headset, and tty.

Original comment by laut...@gmail.com on 27 Nov 2012 at 11:01

GoogleCodeExporter commented 9 years ago
Hmmm... my /sys/class/htc_accessory is also empty.

Mine is a 11/20/12 Nightly of CM10.

Original comment by knvi...@gmail.com on 27 Nov 2012 at 11:04

GoogleCodeExporter commented 9 years ago
What are you using to view these directories? Maybe the files are there but 
just hidden for me? I am using the CM10 File Manager in Root Access Mode.

Original comment by knvi...@gmail.com on 27 Nov 2012 at 11:06

GoogleCodeExporter commented 9 years ago
From your earlier comments... are you on a Sense ROM? 
The others with empty htc_ dirs might all be CM10. 
Your HTC Jewel note with CyanogenMod files for that same gyro being present is 
promising!

Original comment by knvi...@gmail.com on 27 Nov 2012 at 11:11

GoogleCodeExporter commented 9 years ago
Cm10 stable

I'm not sure what the difference is.  I have the working gyroscope hardware and 
hboot 1.09.

Original comment by laut...@gmail.com on 27 Nov 2012 at 11:49

GoogleCodeExporter commented 9 years ago
That is strange. You are also on CM10 and have the directories. Maybe they were 
removed from the Nightly updates at some point (although I wonder why). Could 
anyone else with CM10 take a look and see if they have files under the 
/sys/class/htc_* directories? Mine are all empty. 11/20/12 CM10 Nightly.

Original comment by knvi...@gmail.com on 28 Nov 2012 at 12:01

GoogleCodeExporter commented 9 years ago
I upgraded to the 11/26 nightly, and I still have all the folders except 
htc_gyros.  Maybe it was a specific update, or maybe it relates to something 
else.

Original comment by laut...@gmail.com on 28 Nov 2012 at 1:06

GoogleCodeExporter commented 9 years ago
i checked my /sys/class/htc_gyro/ directory and it seems like there is a 
symlink in there. i am unable to look into further until i get home and see 
where it might be directing too.  

Original comment by finandes...@gmail.com on 28 Nov 2012 at 11:57

GoogleCodeExporter commented 9 years ago
looks like it's point to /sys/devices/virtual/htc_gyro/gyro. i used terminal to 
look at /sys/class/htc_gyro which is how i noticed the symlink. 

Original comment by finandes...@gmail.com on 29 Nov 2012 at 12:23

GoogleCodeExporter commented 9 years ago
I see the same thing. I just flashed to 11/26 Nightly.
Using CM10 File Manager, the /sys/class/htc_gyro looks empty.
But using Terminal I see it contains gyro which is a link:
gyro -> ../../devices/virtual/htc_gyro/gyro 

Original comment by knvi...@gmail.com on 29 Nov 2012 at 1:05

GoogleCodeExporter commented 9 years ago
Hmmm... since I updated to CM10 11/26 Nightly, my JB4.2 Camera force closes on 
clicking on photosphere. On my earlier CM10 11/20 nightly, at least I got the 
un-responsive blue dot (busted gyro).

Original comment by knvi...@gmail.com on 29 Nov 2012 at 1:14

GoogleCodeExporter commented 9 years ago
Under /sys/devices/virtual/htc_gyro/gyro, there is a file (enable_device) which 
just contains a 0. I tried su to root in terminal and changing this to 1 but 
ran into some editor issues that prevented me from updating the file. Can 
someone try setting this to 1 and seeing if the Phone Tester detects it? 

It can't be this simple right??

Original comment by knvi...@gmail.com on 29 Nov 2012 at 1:32

GoogleCodeExporter commented 9 years ago
matt, do you mind going into that directory /sys/devices/virtual/htc_gyro/gyro 
and see if enable_device is set to 1? 

thanks.

Original comment by finandes...@gmail.com on 29 Nov 2012 at 1:48

GoogleCodeExporter commented 9 years ago
Well now I know why I could see the directories.  I used Root Explorer.  It 
shows simlinks.

Original comment by laut...@gmail.com on 29 Nov 2012 at 1:58

GoogleCodeExporter commented 9 years ago
Progress!
I was able to edit the enable_device file to replace the 0 with 1. 
Now Phone Tester is showing Gyro data!

Unfortunately, PhotoSphere is still not working. I will post the commands I 
used.

Original comment by knvi...@gmail.com on 29 Nov 2012 at 2:05

GoogleCodeExporter commented 9 years ago
I don't have that file, because I have the other hardware.  I would guess to 
try to create the missing simlinks.  Then maybe the system could set that flag 
on its own to enable gyroscope as needed.

Original comment by laut...@gmail.com on 29 Nov 2012 at 2:05

GoogleCodeExporter commented 9 years ago
This is all in Terminal Emulator.

$ su root
# mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
# cd /sys/devices/virtual/htc_gyro/gyro
# vim enable_device
    When cursor is over the first character-
        r 1
       (this replaces 0 with 1)
    Then to save and exit-
        :wq!
       (there is a warning message, ignore and hit enter)
# cat enable_device 
    (this is to confirm that the write worked)
# exit
$ exit

That's it. Then run Phone Tester. You will see Gyro Data coming through!

(BTW, my FC on reflash of nightly was due to not re-flashing Gaps4.2 and the 
4.2camera. I fixed that before running the above steps to get the gyro working).

Unfortunately, although the gyro now sends data to Phone Tester, PhotoSphere is 
still not happy.

Original comment by knvi...@gmail.com on 29 Nov 2012 at 2:10

GoogleCodeExporter commented 9 years ago
Strike my last comment.  You already said the simlinks are there.  Try setting 
enable_polling as well if it isn't already.

Original comment by laut...@gmail.com on 29 Nov 2012 at 2:10

GoogleCodeExporter commented 9 years ago
Enable polling is already 1

Original comment by knvi...@gmail.com on 29 Nov 2012 at 2:15

GoogleCodeExporter commented 9 years ago
Here are my Phone tester screenshots after updating 
/sys/devices/virtual/htc_gyro/gyro/enable_device file.

Original comment by knvi...@gmail.com on 29 Nov 2012 at 2:18

Attachments:

GoogleCodeExporter commented 9 years ago
Another thought, see if the owner and permissions on the simlinks are set like 
init.rc above would set them.

Can you get out to read 0 for X, Y, and Z if you lay it on a flat surface?

Original comment by laut...@gmail.com on 29 Nov 2012 at 2:20

GoogleCodeExporter commented 9 years ago
Let me try the flat surface one. 

Slight problem - reboot restores the enable_device to 0.
So clearly, there is an init file that must be updated and not this file 
directly.

Original comment by knvi...@gmail.com on 29 Nov 2012 at 2:22

GoogleCodeExporter commented 9 years ago
Calibration seems off. I tried moving the phone around from flat to vertical. 
The X, Y, Z values stay very close the the screen shot values above. Just minor 
(random?) fluctuations in the fractions. That explains why photosphere did not 
get better with it enabled. The data out of the gyro is just noise.

Seems like we need an init file to set the enable_device and to setup the 
correct calibration parameters. Arrrg.

Original comment by knvi...@gmail.com on 29 Nov 2012 at 2:32