# Touchpad Gyroscope



## Fat Albert (Dec 4, 2011)

Hello, I went to download the GyroSpace 3d wallpaper, and the 3d effect created by the gyroscope didn't work. So I investigated by downloading a gyroscope detecting app, and no matter which app I tried, there was no response from the gyroscope. The only other forum I could find about it was an XDA forum that hadn't had a new post since April. I know the touchpad has a gyroscope, but it doesn't seem to be working. Can anyone tell me whats going on with this? And remember, its your accelerometer that has been responsible for turning in racing racing games, and doesn't prove your gyroscope works. Thanks for helping.

And Happy New Year BTW!!!!!


----------



## nevertells (Oct 29, 2011)

Have you tried any other apps or games that use the gyroscope? I found the thread on XDA and the guy tried the apps to test the gyroscope and said they did not work. Maybe it's the wallpaper that is the problem.


----------



## jcsullins (Sep 27, 2011)

Fat Albert said:


> Hello, I went to download the GyroSpace 3d wallpaper, and the 3d effect created by the gyroscope didn't work. So I investigated by downloading a gyroscope detecting app, and no matter which app I tried, there was no response from the gyroscope. The only other forum I could find about it was an XDA forum that hadn't had a new post since April. I know the touchpad has a gyroscope, but it doesn't seem to be working. Can anyone tell me whats going on with this? And remember, its your accelerometer that has been responsible for turning in racing racing games, and doesn't prove your gyroscope works. Thanks for helping.
> 
> And Happy New Year BTW!!!!!


Sorry, gyroscope does not work.


----------



## nevertells (Oct 29, 2011)

[quote name=accelerometerimestamp='1357097156' post='1071066']

Sorry, gyroscope does not work.
[/quote]

So it's the accelorameter that takes care of the multi-axis movements in these games and apps?


----------



## jcsullins (Sep 27, 2011)

nevertells said:


> So it's the accelorameter that takes care of the multi-axis movements in these games and apps?


If they work, then it would seem so.


----------



## fuhrermike (Jan 30, 2012)

Does the MPU-3050 just not have a driver yet? I've noticed this for a while on some of the augmented reality and shooting gallery type apps.


----------



## ricez (Oct 14, 2011)

Is this useful?
https://github.com/sonyxperiadev/DASH/tree/master/libs/mpu3050/libsensors

https://github.com/sonyxperiadev/DASH


----------



## jcsullins (Sep 27, 2011)

fuhrermike said:


> Does the MPU-3050 just not have a driver yet? I've noticed this for a while on some of the augmented reality and shooting gallery type apps.


Right, no userspace driver/HAL for it.


----------



## jcsullins (Sep 27, 2011)

ricez said:


> Is this useful?
> https://github.com/s...3050/libsensors
> 
> https://github.com/sonyxperiadev/DASH


Well, that's just a "dummy" driver for it without any real code, so not much.


----------



## Fat Albert (Dec 4, 2011)

jcsullins said:


> Sorry, gyroscope does not work.


So since the touchpad is this far into development, is it safe to say that gyroscope for this device won't happen? Or is it a matter of getting a driver or lines of code from HP?

Thanks for responding btw


----------



## Dorregaray (Jan 26, 2012)

what about: https://android.googlesource.com/platform/hardware/invensense/+/android-4.0.4_r2.1/libsensors/MPLSensor.cpp ?


----------



## Hunter X (Nov 22, 2012)

That looks like it can work. I might try to incorporate it in my cm9 source and see what happens.


----------



## Dorregaray (Jan 26, 2012)

Hunter X said:


> That looks like it can work. I might try to incorporate it in my cm9 source and see what happens.


Try: http://review.cyanog....org/#/c/29597/
I haven't tested it but at least compiles


----------



## DroidTouchpad_22 (Dec 6, 2012)

Nice! Is incredible if we have also the gyroscope!


----------



## Fat Albert (Dec 4, 2011)

Just a thought, but maybe the broken gyroscope is responsible for the few FC'ing apps in JB, like Asphalt 7, MC4, and NOVA 3.

And for the devs that are responding to this thread, thanks. I'm SO happy you guys are at least looking at this


----------



## Hunter X (Nov 22, 2012)

EDIT: nvm, i'm a moron.


----------



## Hunter X (Nov 22, 2012)

Dorregaray said:


> Try: http://review.cyanog....org/#/c/29597/
> I haven't tested it but at least compiles


http://review.cyanog....org/#/c/29597/ Patch Set 2 does not compile. Errors out with ALOG* not declared.
Manually added the declarations and recompiling


----------



## Dorregaray (Jan 26, 2012)

Hunter X said:


> http://review.cyanog....org/#/c/29597/ Patch Set 2 does not compile. Errors out with ALOG* not declared.
> Manually added the declarations and recompiling


I might have misses ALOGs in the code. The kernel changes are needed to make it works - the libs are made for newer kernel I think.
I'll let you know if I have figured out anything.


----------



## Hunter X (Nov 22, 2012)

Mentlegen, we have working gyroscope.
















This is on a TP 4G. TP 4G ROM coming soon.
Beta ROM download: http://dl.dropbox.co...-tenderloin.zip
Includes MBM, Cam and now Gyro support. For testing purposes only.
It should go without saying that I am not responsible for any bricks that may arise from installing this beta OS.
EDIT: Was playing around with it some more and it doesn't appear to actually be functioning outside of Zdevicetest or if it's even using the gyro and not the accelerometer.


----------



## pgzerwer2 (Oct 13, 2011)

So, is this only going to work on 4G models, of which there are very few, or is the fix applicable to all TPs?


----------



## Hunter X (Nov 22, 2012)

It will work with all TouchPads, I just happen to own a TP 4G which I installed Android on.


----------



## Fat Albert (Dec 4, 2011)

Would you mind releasing what you have? I would love to test it out as is and I'm sure others would too


----------



## Hunter X (Nov 22, 2012)

It's nonfunctional yet. I believe it was using the accelerometer all along in the gyroscope test. I tested other apps that are gyroscope specific and they were nonfunctioning. I initially declared the missing variables so my logcat wasn't helpful but i later redefined them to proper variables which gave helpful debug info. Turns out the gyroscope was not initializing but was erroring out the whole time.
EDIT: Also, the accelerometer and magnetometer would crash so you can't change the device orientation at all (a reboot fixes it though, until the drivers crash again).


----------



## Dorregaray (Jan 26, 2012)

I have uploaded the kernel changes for gyroscope to gerrit and updated sensors patch. However the gyroscope is not functional yet.


----------



## nevertells (Oct 29, 2011)

Hunter X said:


> It's nonfunctional yet. I believe it was using the accelerometer all along in the gyroscope test. I tested other apps that are gyroscope specific and they were nonfunctioning. I initially declared the missing variables so my logcat wasn't helpful but i later redefined them to proper variables which gave helpful debug info. Turns out the gyroscope was not initializing but was erroring out the whole time.
> EDIT: Also, the accelerometer and magnetometer would crash so you can't change the device orientation at all (a reboot fixes it though, until the drivers crash again).


Wonder if this is the reason Smart Compass only works when the Touchpad is held perpendicular to the ground?


----------



## Gradular (Feb 1, 2012)

nevertells said:


> Wonder if this is the reason Smart Compass only works when the Touchpad is held perpendicular to the ground?


That would seem the case.


----------



## Dorregaray (Jan 26, 2012)

Gyroscope patch for CM9 (official nightly):
http://goo.im/devs/D...yroscope-v2.zip

Gyroscope patch for CM10 (jcsullins preview):
http://goo.im/devs/Dorregaray/testing/update-cm10-gyroscope-v3.zip

patches as always in gerrit:
http://review.cyanogenmod.org/29597
http://review.cyanogenmod.org/29838
http://review.cyanogenmod.org/29733


----------



## nevertells (Oct 29, 2011)

Dorregaray said:


> Gyroscope patch for CM9 (official nightly):
> http://goo.im/devs/D...9-gyroscope.zip
> 
> Gyroscope patch for CM10 (jcsullins preview):
> ...


Thanks Tomasz. Would you be so kind to explain what this patch does. What should we be looking for? What should we use to test? What apps are you aware of that use the gyro?


----------



## Dorregaray (Jan 26, 2012)

nevertells said:


> Thanks Tomasz. Would you be so kind to explain what this patch does. What should we be looking for? What should we use to test? What apps are you aware of that use the gyro?


I've been using Gyroscope rotate and Smart sensors from the play store to see if it's working. Without the patch the smart sensors will show no gyroscope and after the patch will plot the gyroscope axis values.


----------



## nevertells (Oct 29, 2011)

Dorregaray said:


> I've been using Gyroscope rotate and Smart sensors from the play store to see if it's working. Without the patch the smart sensors will show no gyroscope and after the patch will plot the gyroscope axis values.


Thank you! I'll be testing soon. Do you know if it has any affect on how the compass will work? I have only been able to get one compass app to work in a limited fashion, by holding the TouchPad perpendicular to the ground. It works horizontal to the ground in WebOS.


----------



## pgzerwer2 (Oct 13, 2011)

Dorregaray said:


> Gyroscope patch for CM9 (official nightly):
> http://goo.im/devs/D...9-gyroscope.zip
> 
> Gyroscope patch for CM10 (jcsullins preview):
> ...


Well, after flashing my TP crashes (instant reboot) every time I try to start a compass program. Restoring backup as I type.
Is there something special about the way this needs to be installed?


----------



## Dorregaray (Jan 26, 2012)

pgzerwer2 said:


> Well, after flashing my TP crashes (instant reboot) every time I try to start a compass program. Restoring backup as I type.
> Is there something special about the way this needs to be installed?


what build are you using? I've been testing the CM10 patch only. the CM9 version should also work.


----------



## pgzerwer2 (Oct 13, 2011)

Dorregaray said:


> what build are you using? I've been testing the CM10 patch only. the CM9 version should also work.


CM9 from 12/16

Sent from my cm_tenderloin using Tapatalk HD


----------



## chicle (Aug 29, 2011)

pgzerwer2 said:


> Well, after flashing my TP crashes (instant reboot) every time I try to start a compass program. Restoring backup as I type.
> Is there something special about the way this needs to be installed?


Same with me.

I'm using the 01/06/13 official cm9 nightly.

I'm also restoring.


----------



## Hunter X (Nov 22, 2012)

It's true, although I didn't use the zips provided, but rather on my own custom build for the TP 4G. Although my TP 4G doesn't outright crash when I launch the compass, the compass app has a very low response time, even in zdevicetest. In zdevicetest, the accelerometer, compass and gyroscope have very slow response times, keeping the app open long enough caused my TP 4G to crash and reboot.


----------



## Fat Albert (Dec 4, 2011)

Hunter X said:


> It's true, although I didn't use the zips provided, but rather on my own custom build for the TP 4G. Although my TP 4G doesn't outright crash when I launch the compass, the compass app has a very low response time, even in zdevicetest. In zdevicetest, the accelerometer, compass and gyroscope have very slow response times, keeping the app open long enough caused my TP 4G to crash and reboot.


+1

I don't know how to use the gyroscope apps on the play store, so i just downloaded and tested the app I mentioned in the OP. I'm getting the results that Hunter X got; it seems the gyroscope is responding in a very clunky fashion, refreshing the planets to where they should be according to the gyroscope instead of showing the movement from one spot to another. The patch however does not crash my Touchpad. Nightly 12/16/12 CM9


----------



## giorgi3 (Jan 6, 2013)

I tried the patch and AndroSensor now shows the gyroscope (it didn't list it at all prior to the patch). I got the reboot issue shortly after starting app . I am running cm 9-20121230-NIGHTLY-tenderloin.


----------



## giorgi3 (Jan 6, 2013)

I did a novacom install of cm10 and included the gyroscope patch in the cminstall directory. The androsensor now shows the gyroscope AND the Orientation both reporting data. I've tried a couple of compass programs and they appear to be working correctly. No crashes so far !!! yeah!.

UPDATE:

i've tried a number of gyroscope driven apps and they all seem to work ok. I just put GryoSpace 3D wallpaper on and it looks to be working as well!!


----------



## Hunter X (Nov 22, 2012)

In CM9, ZDevice Test reports additional sensors available: Rotation Vector, Gravity and Linear Acceleration sensors. Anyone else can confirm on either CM9 or CM10?


----------



## Dorregaray (Jan 26, 2012)

I haven't tested the CM9 version - I'm on CM10 - so there may be some issue with that. I'll check when I'll have some time to backup CM10 and load CM9.


----------



## Dorregaray (Jan 26, 2012)

The new patch for CM9: http://goo.im/devs/Dorregaray/testing/update-cm9-gyroscope-v2.zip - fixes broken responsiveness of sensors.
I've also created another one: http://goo.im/devs/Dorregaray/testing/update-cm9-gyroscope-v2b.zip - it's v2 with changed gyroscope parameters. Please let me know if you can see any difference between v2 and v2b and which one is more accurate.

HunterX: the Rotation Vector, Gravity and Linear Acceleration sensors are software based (see the vendor in Z-Device Tester). Don't test this sensors.


----------



## Hunter X (Nov 22, 2012)

I tried looking into inverting the axis for the TP 4G, but unfortunately I dont understand the syntax of the parameters for orientation (is it axis related?).
EDIT: Tried out both v2 and v2b and I personally haven't noticed any difference, sensors still have low responsiveness.


----------



## giorgi3 (Jan 6, 2013)

Finally got another chance to look at CM10 with Gyro patch. I thought the GyroSpace wallpaper was responding well but I really don't have anything to compare it to as I've never seen any of these apps before. I'm a total noob to Android.

All the compasses seemed slow and inaccurate. They did seem to match the 'orientation' values in AndroSensor, so I'm guessing that is where they get their values. AndoSensor says orientation is a calculated value based on accelerometer and magnetic field sensors.


----------



## db_white (Nov 26, 2011)

Tested it on CM10 using AndoSensor. The accelerometer X value bobbles between -1 and -0.9; Y bobbles between 0.2 and 0.3; Z between 10.2 and 10.3; all while lying flat on the table.

I'm guessing the non-zero X and Y values are confusing SkEye, as the star map is constantly rolling, even when the TouchPad is stationary on a table. Google Sky Map must use a different filtering algorithm, as the star map doesn't roll, but it does jiggle even when the TouchPad is stationary.

Also, as an FYI, the battery went from fully charged to 15%, in just 2 hours after applying the patch. Normally, I see about 18% loss per hour of heavy Internet surfing, so it feels like this guzzles juice like crazy. Many thanks though for all your efforts in enabling functionality to the TouchPad's camera and sensors.


----------



## Dorregaray (Jan 26, 2012)

the v2 patch for CM10: http://goo.im/devs/Dorregaray/testing/update-cm10-gyroscope-v2.zip
I have added missed in the first release jcsullins accelerator responsiveness patch


----------



## fuhrermike (Jan 30, 2012)

Dorregaray said:


> the v2 patch for CM10: http://goo.im/devs/D...yroscope-v2.zip
> I have added missed in the first release jcsullins accelerator responsiveness patch


Works perfectly well for me. The first would randomly snap to other sides of the axis but this one seems to have fixed that. Thanks again!


----------



## giorgi3 (Jan 6, 2013)

Has anyone had success in getting true compass readings from CM9 or CM10 and the gyro patches?

The Compass does not appear to work correctly for me with any of the patches provided for cm9 or cm10. The crashes are gone, and the compass needles move now, but I get some very strange readings. For example lining the touchpad up flat to a corner of the room and then rotating it 90 degrees at a time, I do not get anything that looks close to 90 degrees azimuth readings. In fact the readings never get above 170 degrees? In addition they seem to drift very slowly and never settle anywhere near a true reading.

I would love to see the compass values working. I bought a AR Drone 2.0 and have tried the AR Freeflight and AR Fight Pro applications to fly it. Both have a really great feature called absolute control, but the need a working compass on the tablet for it to work properly. And so far, I cannot get anything related to the compass applications to work correctly..


----------



## Dorregaray (Jan 26, 2012)

CM10 patch v3: http://goo.im/devs/D...yroscope-v3.zip
- added temperature sensor (does not work on apps using old android api, like smart sensors)
- fixed some not closed file handlers in magnetometer and accelerator
- setting default magnetometer delay at initialization to 50ms (the apps changes this value)
- removed debug messages floating around in kernel log

please let me know if I haven't broken anything and how's the battery life


----------



## RolandDeschain79 (Feb 1, 2012)

Dorregaray said:


> CM10 patch v3: http://goo.im/devs/D...yroscope-v3.zip
> - added temperature sensor (does not work on apps using old android api, like smart sensors)
> - fixed some not closed file handlers in magnetometer and accelerator
> - setting default magnetometer delay at initialization to 50ms (the apps changes this value)
> ...


Thank you Dorregaray! Great work as always, much appreciated


----------



## Hunter X (Nov 22, 2012)

RolandDeschain79 said:


> Thank you Dorregaray! Great work as always, much appreciated


Is that a report of smooth functionality?


----------



## Dorregaray (Jan 26, 2012)

CM9: http://goo.im/devs/Dorregaray/testing/update-cm9-gyroscope-v3.zip


----------



## Net-burst (Dec 31, 2012)

Tried on CM9 01/06. Jerky and inaccurate sensors. Sensor data is not correct and updates roughly once per 1,5-2 seconds.


----------



## fuhrermike (Jan 30, 2012)

The output is accurate, but very choppy in all the tester apps I've tried with V3. Magnetometer is outputting well, not sure which apps support the new temperature function though.


----------



## Fat Albert (Dec 4, 2011)

I got the same behavior with V3. Accurate, but very choppy. And it seems that games are opting to use the gyroscope now instead of the accelerometer. In games like A7 and NFS, turning is sudden and jagged instead of smooth, like its compensating for every tilt instead of flowing with it in real time


----------



## db_white (Nov 26, 2011)

I tested v3 with AndroSensor on CM10 on the TouchPad, and compared the results to that obtained with a Galaxy Note 2.

In the vertical position (resting on a wall), in portrait mode, for the accelerometer readings, GN reports X, Y, Z values of 0, 9.8 and 1.9 while the TP reports -9.8, -0.3 and 0.7; in landscape mode, the GN readings were 10.2, 0, and 1.3 while the TP readings were 0.8, 10.2 and 0.0 - i.e. the coordinate systems are rotated. In the horizontal position (on the floor), the readings were in agreement for both portrait and landscape. i.e. both said Z was 10.x

The orientation was a different story - all of my test cases were mismatched. Vertical portrait on the GN reported 134, -87 and 1.9 while the TP reported 189, 1.1 and 94. In vertical landscape GN reported 55, 3.6 and -82 while TP reported 127, -81 and -15. In horizontal portrait, GN reported 160, 0.3 and 0.1 while TP reported 233, -0.4 and -0.5. In horizontal landscape, GN reported 16.4, -1.6 and -1.4 while TP reported 160.3, 1.5 and -0.3.

For grins, I started Google Sky in horizontal portrait on both devices. A constellation which appeared semi-vertically on the GN was mostly horizontal on the TP, agreeing with the 70 degree rotation reported by the orientation results above.

Current drain is a big improvement over v1. I saw about 10% / hr during heavy surfing, which is down from the 18% which was my CM10 typical.

Saw two other quirky things - 

1) each time after reboot, there seems to be some heavy duty background stuff going on. When I click on the 6 squares in the upper right main screen to display my apps, there is an extended wait (black background with spinning circle) before the apps appear. Don't know if it's lost the app cache (I've got 200+ installed) or initializing the sensors. Didn't see this with the v2 drop.

2) After testing and a couple of snooze cycles, the rotation sensor went offline and my TP was stuck in landscape mode. Tried disabling / re-enabling the display rotation without any effect. Will report back if I can recreate the event.

Thanks for your time and effort!


----------



## giorgi3 (Jan 6, 2013)

I tested the webos compass and various compass applications on CM10 with the V3 sensors patch. I used a interior corner of my house as a reference point. I placed the touchpad flat (horizontal) and rotated it 360 degrees (4 readings at approximately 90 degree angles) based on two sides always touching the wall corner. All rotations were clockwise.

The WebOS Compass seemed to get close to actual readings but was not exactly 90 degrees per turn.The CM10 v3 apps were all over the board, the azimuth in some cases drifted slowly and took up to a minute to settle in to a consistent number.

Data for the tests are in the following order, Rotational position number; Initial Reading; State (steady or drifting values); Highest reading observed; Final reading.

WebOS
====================
Compass Application
---------------------------------
#1 220 steady 220 200
#2 330 steady 330 330
#3 55 steady 55 55
#4 136 steady 136 136
====================

CM10 with gyro patch v3
====================
Smart Compass
-------------------------------
#1 168 steady 168 168
#2 139 steady 139 139
#3 95 drifting 95 82
#4 70 drifting 144 144

Compass Pro
--------------------------------
#1 259 Steady 259 259
#2 226 Steady 226 226
#3 190 Drifting 190 172
#4 160 Drifting 235 235

MyAndroid Sensor (orientation sensor - azimuth)
--------------------------------
#1 257 steady 257 157
#2 222 Drifting 222 124
#3 142 drifting 182 175
#4 167 drifting 240 223
======================


----------



## Dorregaray (Jan 26, 2012)

Another test release: http://goo.im/devs/Dorregaray/testing/update-cm10-gyroscope-v3h.zip
I have changed x & z axis orientation to the correct one (I believe) and have also changed the sensors polling a bit. Please let me know if I haven't broken anything especially compass and accelerometer and how the gyroscope now works (especially in games). Please let me also know if there's any impact on the battery drain.


----------



## Hunter X (Nov 22, 2012)

Any changes at all in the kernel that isn't in this commit http://review.cyanogenmod.org/#/c/29733/ ? I'm looking to just swap the sensor libs and maintain my MBM enabled kernel.


----------



## Dorregaray (Jan 26, 2012)

No, anymore changes. However if you'll take a look at the http://downloads.help.palm.com/opensource/other/linux-kernel-tenderloin-android.tar.bz2 (in arch/arm/mach-msm/board-msm8660.c) you'll see that there are different axis mappings between touchpad and touchpad 3g so you probably need to port that stuff.


----------



## Hunter X (Nov 22, 2012)

Dorregaray said:


> No, anymore changes. However if you'll take a look at the http://downloads.hel...android.tar.bz2 (in arch/arm/mach-msm/board-msm8660.c) you'll see that there are different axis mappings between touchpad and touchpad 3g so you probably need to port that stuff.


thanks mate


----------



## Dorregaray (Jan 26, 2012)

v4 release: http://goo.im/devs/Dorregaray/testing/update-cm10-gyroscope-v4.zip
- axis mapping changed,
- gyro kernel poll support from v2 reintroduced


----------



## Fat Albert (Dec 4, 2011)

Dorregaray said:


> v4 release: http://goo.im/devs/D...yroscope-v4.zip
> - axis mapping changed,
> - gyro kernel poll support from v2 reintroduced


Do you have a v4 release for CM9? A lot of my favorite games that use gyroscope only works for CM9. And if we've already flashed one of the past gyroscope patches, would flashing the newer one over it cause any problems? Thanks for your hard work man


----------



## Hunter X (Nov 22, 2012)

By the way, I'm not so sure we have a temperature sensor since it doesnt appear to report anything and remains at awaiting input in every test app I try.
Got it to work now.


----------



## nevertells (Oct 29, 2011)

Hunter X said:


> By the way, I'm not so sure we have a temperature sensor since it doesnt appear to report anything and remains at awaiting input in every test app I try.
> Got it to work now.


So is this patch a keeper?


----------



## Hunter X (Nov 22, 2012)

Idk, I did some mods in my test builds, but the crashing still exists... I've mostly been backporting Dorregaray's Jellybean commits to ICS and some minor mods to the tenderloin kernel & defconfig. just by changing sensor configs for the mpu3050 in the tenderloin defconfig from the bma150 and ak8975 to LSM303DLHA and LSM303DLHM for the accelerometer and magnetometer respectively, only then did the "temperature" sensor start to respond for me.


----------



## Dorregaray (Jan 26, 2012)

v5:
- z axis orientation changed

CM10: http://goo.im/devs/Dorregaray/testing/update-cm10-gyroscope-v5.zip

CM9: http://goo.im/devs/Dorregaray/testing/update-cm9-gyroscope-v5.zip


----------



## Dorregaray (Jan 26, 2012)

Fat Albert said:


> Idk, I did some mods in my test builds, but the crashing still exists... I've mostly been backporting Dorregaray's Jellybean commits to ICS and some minor mods to the tenderloin kernel & defconfig. just by changing sensor configs for the mpu3050 in the tenderloin defconfig from the bma150 and ak8975 to LSM303DLHA and LSM303DLHM for the accelerometer and magnetometer respectively, only then did the "temperature" sensor start to respond for me.


I have updated patch for CM9. Don't need to port it on your own. 
Don't change the bma150 and ak8975 to LSM303DLHA and LSM303DLHM in kernel config or you'll have not working accelerometer and magnetometer. I'm not sure why is that but it might have been a reason to do that.

Regarding the crashes - how to reproduce them, what's in logcat when the crash occurs?


----------



## Hunter X (Nov 22, 2012)

One crash I can reproduce easily is opening Google Maps and clicking the location button to go into compass mode, that leads to a crash. As far as nonworking accelerometer and magnetometer, they seem to work when i've changed the kernel config.


----------



## giorgi3 (Jan 6, 2013)

I tried cm9 version 5 with various compass applications. The good.. .It appears to show a full 360 degree roatation. The app I really care about (ArDrone Flight Pro), now sees full rotation as well when I move the touchpad!.The bad... compass readings not accurate relative to WebOS,,, they all still drift slowly after most 90 degree rotations.

I've got an android phone coming next week. Once i get it I'll compare apps on it to apps on the touchpad and post what I see. I may buy a real compass as well just so i can get a better frame of reference to true north.


----------



## Hunter X (Nov 22, 2012)

OH SNAP!! Tried latest patchsets on Gerrit and everything is smooth now. Compass readings aren't accurate and lots of drifting in Google Maps street view. left/right axis are inverted.


----------



## Dorregaray (Jan 26, 2012)

I'm not sure if the x and y axis needs to be swapped. please let me know how the games works with v5 and if works bad try v5b:
http://goo.im/devs/Dorregaray/testing/update-cm10-gyroscope-v5b.zip
http://goo.im/devs/Dorregaray/testing/update-cm9-gyroscope-v5b.zip


----------



## Hunter X (Nov 22, 2012)

v5b messed up everything, in streetview, moving device up/down causes view to move left/right respectively and moving left/right causes view to go down/up. This is on a TP 4G so can't tell if it works as it should on a regular TP.


----------



## db_white (Nov 26, 2011)

Tested v5 on CM10 (32GB, US TouchPad). Accelerometer axes still out of sync with Galaxy Note 2. On the Note, I get a *Y *reading of positive 9.8 m/s[sup]2[/sup] when the front camera is above the home button, whereas on the TouchPad (when the camera is above the home button), the *X* reads *negative *9.9 m/s[sup]2[/sup].

On the Note 2, I get an *X* reading of positive 10.2 m/s[sup]2[/sup] when I'm looking at the display and the front camera is to the left of the home button, whereas the TouchPad reports that as a *Y* value of positive 10.2 m/s[sup]2[/sup].

Is the magnetometer under your control too? It looks like the axes are mismatched there too. I put both units side by side on my desk. I don't know what magnetic field they saw (nearby speakers? power supply in my desktop box?) but with camera above home button, TouchPad read *positive X* while Note 2 sees it as a *negative Y*. When looking at display and camera to left of home button, TouchPad read negative *Y* while the Note 2 sees it as negative *X*. The Orientation "Help" information indicates the accelerometer and magnetic field readouts are both used as inputs to the Orientation calculation. I don't know if it's possible to get an accurate orientation without correct accelerometer AND magnetic values. [I also don't know how much of CM has been tweaked to work with the mis-aligned sensor values, so the blast zone may wind up being bigger than just the sensors...]

For what it's worth, we had a clear night last and I was able to confirm that Google Sky matches the actual sky on the Galaxy Note 2, so I'm confident that the Note 2 is returning the proper orientation.

Also, I'm still seeing a 17 second lag between trying to open my apps "folder" and when the apps actually start appearing.

Thanks for all your hard work.


----------



## db_white (Nov 26, 2011)

Tested v5b on CM10 and didn't see any difference in accelerometer / magnetometer data from v5 (above). Should I have? If so, is there somewhere I can check for the version identifier? Thanks.

With v5b loaded, sat in chair and spun counterclockwise (from my right towards my left) to test the gyroscope. In vertical portrait mode (camera above home button), GN2 reports positive Y rotation while TP reports *negative* Y rotation. The readings matched for the other orientations (vertical landscape, camera to left of home, both gave positive X; horizontal, both gave positive Z).

With v5 loaded, vertical portrait TP reports *negative X* rotation, while vertical landscape reports *positive Y*. v5b is closer to GN2, but not a complete match.


----------



## Hunter X (Nov 22, 2012)

There is no version identifier, only thing you're supposed to notice is whether it behaves differently, like for me it completely changed all axis compared to my build using the gerrit commits which only had left/right inverted. And as everyone mentioned, other sensors aren't positioned correctly.
Actually, the the magnetometer does seem to move to its correct destination but very very slowly which I guess is what some are calling drifting. Watching the below video made me think that perhaps the data isn't being combined properly for sensor fusion since in the video, the sensors are very smooth with the fusion, but slow and inaccurate without it.


----------



## Dorregaray (Jan 26, 2012)

I don't have any other device with the gyroscope (still waiting for htc sensation xe I've ordered) so I don't have any device to compare. Could you take a look on v2 patch and compare to other devices? (in v4 I started messing with axes orientation).
while comparing to other devices please take a look on:
http://developer.android.com/guide/topics/sensors/sensors_motion.html#sensors-motion-gyro
http://developer.android.com/guide/topics/sensors/sensors_overview.html#sensors-coords


----------



## twosheds (Oct 2, 2011)

Using the V2 patch with AndroSensor, comparing the TP results( in landscape i.e. with the camera at the west end of the device) against a Nexus 7 ( in portrait with it's camera at the north end) the accelerometer x & y co-ords for both devices are more or less the same whereas the z reading is 9.86 to 9.87 on the Nexus and between 10.00 and 10.04 on the TP. For orientation, the x value is 0 or 360 on the Nexus and between 40 and 70 on the TP, the y and z values being very nearly the same on both devices.

Edit :- Forgot to mention that the two devices were aligned edge to edge.

HTH


----------



## Dorregaray (Jan 26, 2012)

twosheds said:


> Using the V2 patch with AndroSensor, comparing the TP results( in landscape i.e. with the camera at the west end of the device) against a Nexus 7 ( in portrait with it's camera at the north end) the accelerometer x & y co-ords for both devices are more or less the same whereas the z reading is 9.86 to 9.87 on the Nexus and between 10.00 and 10.04 on the TP. For orientation, the x value is 0 or 360 on the Nexus and between 40 and 70 on the TP, the y and z values being very nearly the same on both devices.
> 
> Edit :- Forgot to mention that the two devices were aligned edge to edge.
> 
> HTH


the question is should touchpad be hold in landscape or portrait?


----------



## twosheds (Oct 2, 2011)

Dorregaray said:


> the question is should touchpad be hold in landscape or portrait?


Following the links that you posted, I came across this article http://android-devel...es-another.html and in it the author indicates that 'down' on the device corresponds to down in the 'world' when the accelerometer y co-ord is approx = -9.81 (-G) which occurs when the TP is in portrait mode with the camera on the RHS. I'm pretty sure that you know all this already.

Writing this makes me realize that I have posted my results with the TP pointing in the wrong direction'







i.e. with it's 'top' pointing south instead of north.

EDIT
After turning the TP round, for the accelerometer the TP reads between 0.04 and 0.08 for x, between *-*0.03 ans *-*0.08 for y and between 10.01 and 10.04 for z whereas the Nexus reads arounf 0.17 for x, *+*0.15 to *+*0.17 and between 9.86 and 9.87 for z. The orientation readings on the nexus are the same as befor whereas the x value on the TP hovering between 177 and 186, the y and z values being similar to my previous values.

EDIT No. 2 Ignore this post - I think I've misunderstood the article that I referred to.


----------



## Dorregaray (Jan 26, 2012)

The problem is that I'm not sure if portrait is the right 'native' orientation. On the page http://developer.android.com/guide/topics/sensors/sensors_overview.html#sensors-coords its mentioned that the native orientation of tablets may be landscape


----------



## colt223 (Apr 19, 2012)

Dorregaray said:


> The problem is that I'm not sure if portrait is the right 'native' orientation. On the page http://developer.and...#sensors-coords its mentioned that the native orientation of tablets may be landscape


I prefer to hold mine in portrait mode, maybe because I read on it a lot, but honestly most games and apps for larger tablets seem to default to landscape mode.
So for development, I would guess landscape would be the TP's 'native' orientation?


----------



## giorgi3 (Jan 6, 2013)

Still playing with v5 on cm9 and compass values. After watching the video provide by Hunter X, I started looking for apps that could graph sensor data. I found a free app that graphs sensor data called Sensor Kinetics and ran a few tests.

What I find interesting is that the derived 3d rotational sensor (orientation)when graphed seems to take a two full rotations of the TP to get 360 degrees of rotational reading (+180 to - 180) but it is very smooth and quick. Could it be that something in the orientation sensor code is halving everything, I.E. if we rotate 180 degrees it only effectively give us 90 degrees rotatation, then we 'slowly' adjust the rest of the way via the magetic field sensor?

Just a thought.

Here is the graph where I rotated the TP ~90 degrees at a time with short pause after each.Notice it seems to be sensing 45 degree rotations, not 90 and it took two full rotations of the TP to get 360 degrees on the sense data.


----------



## db_white (Nov 26, 2011)

Thank you for the pointer to the developer docs. If I hadn't read it with my own eyeballs, I would have thought you were making that part about "natural" orientation up. I've reverted to v2 and can confirm that if I assume that the "natural" orientation for the TouchPad is vertical with camera to left, home button to right, then the accelerometer axes match that of the Note 2. I guess if you're optimizing for gaming use, then landscape orientation would be "natural", as it more closely matches a television in wide screen mode or computer monitor.

The sensor docs indicate that accelerometer, gyroscope and magnetic field sensor all use the "natural" orientation. With both GN2 and TP in natural orientation, CCW rotation on the GN2 is positive Y on the gyroscope, whereas the TP reports it as a *negative X*. Magnetic field values are different between the two devices (TP approximately 20% larger than GN2) but roughly in same proportions. i.e. Y is largest component when both are side by side in "natural" orientation.

The Orientation calculation is still off though. Both in "natural", side by side. Similar readings on accelerometer, near zero gyroscope on both, bigger magnetic field on TP. GN2 reads X, Y, Z of 68, -83, 0 degrees where TP reads 10, -80,-7. The Google Sky chart is totally different between the two devices. TP thinks it's looking North, while GN2 thinks it's looking North-East. There's no overlap in the constellations at all. I **suspect** that it's due to the difference in the magnetic field. As I moved the TP closer to my computer, Google Sky shifted from North to West in response to shifting the TP twelve inches in the -Z direction with no rotation involved.

Hope this helps!

Edit: corrected typo on Google Sky orientation for GN2


----------



## giorgi3 (Jan 6, 2013)

More 'playing around' this time on cm10 gyro v5.

I drew a line on paper aligned to what what Sensor Kenetic software has for what I think represents north (+180/-180) in the rotation vector graph. I then booted WebOS and found that line to be +52 degrees - 23 degrees off of WebOS north. I also found that clockwise rotation on WebOS increased the azimuth degrees on both. while clockwise rotation on android v5 decreased the azimuth degrees.

CORRECTION # 1
After reading the landscape vs portrait discussion, I realigned using lanscape for android and found that the CM10 Landscape North (+180/-180) reads as 337 degrees on Webos Portrait North or a variation of about -23 degrees.

CORRECTION # 2:
I think the Rotational direction is fine. I was misreading the data.

So I think there are three two problems with what I am seeing. 

1) magnetic compass reading off somewere around +50 -20 degrees 
2) Rotation direction sensing reversed (ie clockwise rotation should be positive degree increase).
3) Rotation vector calculations 1/2 degree per 1 degree real rotation (ie. a real 90 degree rotation is sensed as 45 degree change).


----------



## giorgi3 (Jan 6, 2013)

I got my android phone today and loaded the [background=rgb(245, 245, 245)]Sensor Kenetic software on it. I can confirm that on the android phone, 4 rotations of a physical 90 degrees gives you a complete 360 degree reading on the rotational vector graph. On the touchpad it takes 8 physical rotations of 90 degrees to achieve a 360 degree reading.[/background]


----------



## Dorregaray (Jan 26, 2012)

The default (natural) positon is landscape (to match the accelerometer orientation) so please perform accelerometer tests in that orientation.
I have finally get the htc sensation xe so I have been able to verify the readings and it seems for me that the v5 is ok.

I'd like to keep gyroscope separate from compass and rotation vector - I want to have gyroscope tested and merged first and then think about the rest of the sensors.
So please let me know if v5 works ok with the gyroscope enabled games - this is the most important test at this point.


----------



## giorgi3 (Jan 6, 2013)

Sorry, I didn't realize you were focused on the gyroscope only. As I posted quite awhile ago, the gyrospace 3d wallpaper works fine. I just tested it against my Samsung Galaxy III and it looks to function the same. I'm not aware of what games are gyroscope enabled but I'll poke around and see what I can figure out.


----------



## Hunter X (Nov 22, 2012)

I think all Gameloft racing games use the gyroscope.
Also report that the gyro responds fine on my WiFi TouchPad


----------



## lepa71 (Oct 19, 2011)

Is it the version v5 or v5b?


Dorregaray said:


> The default (natural) positon is landscape (to match the accelerometer orientation) so please perform accelerometer tests in that orientation.
> I have finally get the htc sensation xe so I have been able to verify the readings and it seems for me that the v5 is ok.
> 
> I'd like to keep gyroscope separate from compass and rotation vector - I want to have gyroscope tested and merged first and then think about the rest of the sensors.
> So please let me know if v5 works ok with the gyroscope enabled games - this is the most important test at this point.


----------



## Hunter X (Nov 22, 2012)

Played some Asphalt 7 on my WiFi TP both stock nightly and stock nightly with gyro update
Stock: Accelerometer responds fine in-game and steering is somewhat smooth.
Stock + Gyro: Accelerometer is CRAZY!! Steering is very hard and sometimes you just can't steer at all. When it does steer, it is a very sharp steer and sends me flying into walls and blowing up the car.


----------



## giorgi3 (Jan 6, 2013)

I tried helidroid 3d as it says it uses the gyro. It seemed to work fine on cm10 gyro v5.


----------



## Hunter X (Nov 22, 2012)

Can something like the following commit be applied to the gyroscope so it can properly invert its axes on TP 4G models?
http://review.cyanogenmod.org/#/c/24149/


----------



## Fat Albert (Dec 4, 2011)

Hunter X said:


> Played some Asphalt 7 on my WiFi TP both stock nightly and stock nightly with gyro update
> Stock: Accelerometer responds fine in-game and steering is somewhat smooth.
> Stock + Gyro: Accelerometer is CRAZY!! Steering is very hard and sometimes you just can't steer at all. When it does steer, it is a very sharp steer and sends me flying into walls and blowing up the car.


+1 in the case of Asphalt 7 and all gameloft games using gyroscope (Asphalt 6, Modern Combat 4 tested). But it also seems that turning with the gyroscope in Riptide GP works just fine, and the gyrospace 3d app has started working with v5 and v5b as well. I do notice the turning in Riptide GP is slightly clunkier with the patch compared to having no patch, and the gyrospace 3d isn't as smooth as other devices, but these two apps are still very usable with the gyroscope patch flashed


----------



## Dorregaray (Jan 26, 2012)

Hunter X said:


> Can something like the following commit be applied to the gyroscope so it can properly invert its axes on TP 4G models?
> http://review.cyanog....org/#/c/24149/


I don't have much time recently but you can create a patch and upload to gerrit and I will include it in my gyro builds.
I'm thinking on trying to access accelerometer and magnetometer through mpu3050 and invensense lib as I do for gyroscope... I'm curious if it work ;-)


----------



## Dorregaray (Jan 26, 2012)

v6: 
I have changed the gyro's max range and resolution to a lower values. Let me know if it has impact on asphalt and other games

CM10: http://goo.im/devs/Dorregaray/testing/update-cm10-gyroscope-v6.zip


----------



## nevertells (Oct 29, 2011)

Dorregaray said:


> v6:
> I have changed the gyro's max range and resolution to a lower values. Let me know if it has impact on asphalt and other games
> 
> CM10: http://goo.im/devs/Dorregaray/testing/update-cm10-gyroscope-v6.zip


Don't know if it would be possible or even worth looking at the source code that HP open sourced a while back for any useful settings for the gyroscope. HD Compass in WebOS works very smoothly and in any position. I'm guessing the gyro might have something to do with that. Haven't found any apps that test the gyro yet. Hopefully the compass and gyro code aren't proprietary like Qualcomm's camera code.


----------



## Fat Albert (Dec 4, 2011)

Dorregaray said:


> v6:
> I have changed the gyro's max range and resolution to a lower values. Let me know if it has impact on asphalt and other games
> 
> CM10: http://goo.im/devs/D...yroscope-v6.zip


Love to test a CM9 version if you have one. Most gameloft games don't work on CM10


----------



## Hunter X (Nov 22, 2012)

Dorregaray said:


> Don't know if it would be possible or even worth looking at the source code that HP open sourced a while back for any useful settings for the gyroscope. HD Compass in WebOS works very smoothly and in any position. I'm guessing the gyro might have something to do with that. Haven't found any apps that test the gyro yet. Hopefully the compass and gyro code aren't proprietary like Qualcomm's camera code.


If I'm interpreting it correctly, he plans on getting the gyroscope working accurately before thinking about the addon sensors for smoothness.


----------



## nevertells (Oct 29, 2011)

Hunter X said:


> If I'm interpreting it correctly, he plans on getting the gyroscope working accurately before thinking about the addon sensors for smoothness.


I'm interpreting it the same way Hunter. I'm just suggesting that the WebOS source code might offer some useful settings for the gyro in Android. I thought my post was clear on that. Just suggesting in case someone might not have thouht of that.


----------



## Dorregaray (Jan 26, 2012)

v6 for CM9:
http://goo.im/devs/D...yroscope-v6.zip

v6b for CM9 with inverted gyroscope axis for tenderloin 3g:
http://goo.im/devs/D...roscope-v6b.zip

@Hunter X: let me know if v6b works for you - I'll post the change to gerrit then



Carey4782 said:


> My thanks as well. Would it be possible to post a revert gyro to CM10 20121215 without reverting everthing. I'm trying to trouble shoot battery drain. (-60mA on PC USB, + 900 on Touchstone and +1,770 on supplied adapter).


I believe the v6 should work on CM10 20121215 too


----------



## nevertells (Oct 29, 2011)

Dorregaray said:


> v6 for CM9:
> http://goo.im/devs/D...yroscope-v6.zip
> 
> v6b for CM9 with inverted gyroscope axis for tenderloin 3g:
> ...


I'm curious if my suggestion in post #96 has any validity.


----------



## Hunter X (Nov 22, 2012)

@Dorregaray: Did you change the .orientation values in board-tenderloin.c and if so, to what values were they changed to. I have been experimenting by setting it to {1,0,0,0,1,0,0,0,1}

Both TPs react the same now.
WiFi TP on latest CM10 preview with Gyro v6
TP 4G on custom built CM9 with Gyro v6b

Only thing is they are slightly pointing in different direction when viewing in Z-Device Test (small angle difference), but they move the same in response to turns, etc.

EDIT: As far as Asphalt goes with v6, it's slightly better, but the game is still unplayable (can't steer properly, not a fault in me having bad driving skills). Same goes for Asphalt on my TP 4G with the v6b Gyro patch. Maybe it has to do with the accelerometer now?


----------



## Dorregaray (Jan 26, 2012)

Hunter X said:


> I'm curious if my suggestion in post #96 has any validity.


The situation with gyro is better that we have invensense libs in android source tree plus a froyo kernel from hp.
The only problem was that the ics/jb libs requires newer kernel API than froyo but I have mostly fixed that basing on Sony's 3.0 kernel


----------



## Gradular (Feb 1, 2012)

Dorregaray said:


> The values for accelerometer, gyro and magnetometer are messed up in board-tenderloin.c.
> The proper ones should be {1,0,0,0,1,0,0,0,1} for WiFi and {-1,0,0,0,1,0,0,0,-1} for 3g.
> Those values are negated in userspace so {1,0,0,0,1,0,0,0,1} works for you. Need to fix that at some point.
> 
> ...


I love that last line. There is hope...

Sent from my cm_tenderloin using RootzWiki


----------



## Dorregaray (Jan 26, 2012)

v7:
- v6b + kernel configuration changes

http://goo.im/devs/Dorregaray/testing/update-cm10-gyroscope-v7.zip
http://goo.im/devs/Dorregaray/testing/update-cm9-gyroscope-v7.zip


----------



## ZeroZorro (Mar 3, 2012)

Dorregaray said:


> v7:
> - v6b + kernel configuration changes
> 
> http://goo.im/devs/D...yroscope-v7.zip
> http://goo.im/devs/D...yroscope-v7.zip


Working OK on my Touchpad CM10 so far, only in Asphalt 7 1.0.4 the steering is completely messed up!
BTW: NFS Most Wanted works fine (like before), so does NFS Hot Pursuit, although not as smooth as Most Wanted.


----------



## Fat Albert (Dec 4, 2011)

ZeroZorro said:


> Working OK on my Touchpad CM10 so far, only in Asphalt 7 1.0.4 the steering is completely messed up!
> BTW: NFS Most Wanted works fine (like before), so does NFS Hot Pursuit, although not as smooth as Most Wanted.


v6 patch on the latest cm9 nightly fixed my issues with Asphalt 7 1.0.4. In fact, every game that I've tested except one has worked with the v6 patch. The only game misbehaving is MC4, with the same sudden juttering seen in earlier patches. Something that I've also noticed is the patch makes turning a lot more sensitive than turning w/o patch. A normal tilt could send you careening into a wall. I haven't tested v7 yet


----------



## Gradular (Feb 1, 2012)

Dorregaray said:


> v7:
> - v6b + kernel configuration changes
> 
> http://goo.im/devs/Dorregaray/testing/update-cm10-gyroscope-v7.zip
> http://goo.im/devs/Dorregaray/testing/update-cm9-gyroscope-v7.zip


With cm10-v7, auto-rotate screen stops working after any apps force an orientation.

Sent from my cm_tenderloin using RootzWiki


----------



## Hunter X (Nov 22, 2012)

Gradular said:


> With cm10-v7, auto-rotate screen stops working after any apps force an orientation.
> 
> Sent from my cm_tenderloin using RootzWiki


Can you be a bit more specific? For example which app causes the issue? Do you have your device auto-rotation locked? I've tried some apps and after they force orientation, my TP 4G can still rotate.


----------



## fuhrermike (Jan 30, 2012)

Dorregaray said:


> v7:
> - v6b + kernel configuration changes
> 
> http://goo.im/devs/D...yroscope-v7.zip
> http://goo.im/devs/D...yroscope-v7.zip


These do well for my purposes, thanks so much for the work! Most Wanted steers much better than ever before.


----------



## Hunter X (Nov 22, 2012)

@Dorregaray: might want to add arch/arm/configs/tenderloin4g_android_defconfig to the commit with the same changes you made to arch/arm/configs/tenderloin_android_defconfig.


----------



## Gradular (Feb 1, 2012)

Hunter X said:


> Can you be a bit more specific? For example which app causes the issue? Do you have your device auto-rotation locked? I've tried some apps and after they force orientation, my TP 4G can still rotate.


Pretty much any app that forces a orientation. Like the Rootzwiki app in the title screen, a lot of games that force portrait. After they run, its stuck in portrait no matter which way my TP is at the time. And I double checked that that my auto rotate was unlocked. I reflashed v6 and the issue goes away. I'm running the cm10 latest build, btw.

Sent from my GT-P3110 using RootzWiki


----------



## Hunter X (Nov 22, 2012)

Perhaps it's a CM10 bug. I am not seeing such behavior on my CM9 TP 4G. I shall test on my CM10 WiFi TP.
EDIT: I can also confirm that auto-rotate is broken with v7 on CM10. All I had to do was reboot and my screen orientation was locked in landscape (auto-rotate was enabled). CM9 is fine though.


----------



## Dorregaray (Jan 26, 2012)

Hunter X said:


> EDIT: I can also confirm that auto-rotate is broken with v7 on CM10. All I had to do was reboot and my screen orientation was locked in landscape (auto-rotate was enabled).


ok, so it seems that the v7 needs some more kernel work to be done for proper enabling/disabling accelerometer.
the question is if v6 is good enough for games or v7 is better and I need to fix the auto-rotate issue? how's the compass on v7?


----------



## giorgi3 (Jan 6, 2013)

The compass is still non functional. Degree heading is inaccurate.Rotational Vector still shows 90 degree physical rotations read as 45 degrees.


----------



## Dorregaray (Jan 26, 2012)

v8:
- kernel work for enabling/disabling accelerometer/magnetometer on gyro request

CM9: http://goo.im/devs/D...yroscope-v8.zip
CM10: http://goo.im/devs/Dorregaray/testing/update-cm10-gyroscope-v8.zip


----------



## Hunter X (Nov 22, 2012)

v7 works fine on my CM9 and doesn't cause issues with auto-rotate there, but it only appears to happen in CM10. Compass works fine in my case in CM9, untested in CM10.
@giorgi3: Are you sure it doesn't work? Perhaps it "doesn't work" if you're indoors and have lots of magnetic interference around you. I was going to claim the same thing, but I just moved away from my workbench and went closer to the window (less metal around) and the compass points correctly and moves correctly.


----------



## Fat Albert (Dec 4, 2011)

Hunter X said:


> v7 works fine on my CM9 and doesn't cause issues with auto-rotate there, but it only appears to happen in CM10. Compass works fine in my case in CM9, untested in CM10.
> @giorgi3: Are you sure it doesn't work? Perhaps it "doesn't work" if you're indoors and have lots of magnetic interference around you. I was going to claim the same thing, but I just moved away from my workbench and went closer to the window (less metal around) and the compass points correctly and moves correctly.


+1. v7 fills almost all the needs so far. The video of NFS in the High End Games Compatibility thread uses the v7 gyroscope patch. Amazing how far this has come in 2 weeks. Going to test v8


----------



## giorgi3 (Jan 6, 2013)

@hunterX I'm pretty sure. I've tried it in several locations without any success at getting a good heading. I've got the wifi TP and am currently testing on CM9 with V7 gyro patch. What application are you using to test the compass? I'll try the same and see if I get better results.

#1 @hunterX: I noticed you mention having both the TP 4G and the TP wifi. Do you get identical results from both?


----------



## giorgi3 (Jan 6, 2013)

I just upgraded to cm9 v8. Same results. Just to make sure I wasn't mis-reading something, I put my touchpad and my samsung s3 on a mat, so that rotating the mat rotated both. I then started the 'Compass Pro' app on both and rotated the pad approximately 90 degrees clockwise and recorded both. Then repeated this until I got back to the starting point. Here are the results 

Test # 1
----------------------
S3	TP
310 . 126
046 169
115 223
212 272
308 323...360...159...125

The last 90 degree rotation again exhibited the 'drift' I had mentioned in previous posts. When I first looked the TP showed 323, then slowly started to gain degrees, the speed of gain increased at around 330 and continued until it got up to 159, then slowly it started back, and ended up on 125. Very strange behavior.

This is way out of my field of expertise, but I still wonder if the rotation vector (90 vs 45 degrees) that I mentioned on previous posts is causing some of this issue. Notice the TP recorded a rotation difference of 43, 54, 49 and 51 where the Samsung s3 recorded rotational differences of 96,69,97,96. And based on the 'strange behavior' on the final rotation, it looks like the compass uses the rotational vector to react quickly to the changes in orientation, and then use the magnetic field to fine tune the reading.


----------



## Dorregaray (Jan 26, 2012)

CM10 patch: http://goo.im/devs/Dorregaray/testing/update-cm10-gyroscope-v8.zip


----------



## Gradular (Feb 1, 2012)

Dorregaray said:


> CM10 patch: http://goo.im/devs/Dorregaray/testing/update-cm10-gyroscope-v8.zip


Auto rotate still stops when forced.

Sent from my cm_tenderloin using RootzWiki


----------



## ZeroZorro (Mar 3, 2012)

Dorregaray said:


> CM10 patch: http://goo.im/devs/Dorregaray/testing/update-cm10-gyroscope-v8.zip


Didn't work on Asphalt7 and also impossible now in NFS most wanted to steer.
The same for v7 for cm10 I earlier tried. With v6 NFS works fine.

Let me know if you need more info/data....

Sent from my cm_tenderloin using Tapatalk 2


----------



## levite805 (Jan 21, 2012)

The auto rotation stopped working with v8. Reinstalled v6 and it works great. FYI


----------



## Fat Albert (Dec 4, 2011)

v8 works just as well as v7 on latest CM9 weekly. All racing games involving turning works, gyrospace works, horrible jerking in Modern Combat 4 as seen in all past versions, but unlike the racing games gyro is not a necessity. So as far as functionality, life's good


----------



## Dorregaray (Jan 26, 2012)

v9:
changed magnetometer's sensitivity to match the value from hp's froyo kernel

CM10: http://goo.im/devs/Dorregaray/testing/update-cm10-gyroscope-v9.zip
CM9: will be available later

let me know if there's any change in compass behaviour


----------



## Gradular (Feb 1, 2012)

Dorregaray said:


> v9:
> changed magnetometer's sensitivity to match the value from hp's froyo kernel
> 
> CM10: http://goo.im/devs/Dorregaray/testing/update-cm10-gyroscope-v9.zip
> ...


Auto rotate now works, but compass is off. Its about 45 degrees off. Sometimes its slow in rotating to its final directional.

Sent from my cm_tenderloin using RootzWiki


----------



## ZeroZorro (Mar 3, 2012)

Dorregaray said:


> v9:
> changed magnetometer's sensitivity to match the value from hp's froyo kernel
> 
> CM10: http://goo.im/devs/Dorregaray/testing/update-cm10-gyroscope-v9.zip
> ...


V9 makes NFS MostWanted work again, smooth. Asphalt7 still responding hysterical on movements









Sent from my cm_tenderloin using Tapatalk 2


----------



## ZeroZorro (Mar 3, 2012)

Dorregaray said:


> v9:
> 
> let me know if there's any change in compass behaviour


Sent from my cm_tenderloin using Tapatalk 2

Are there any particular tests you want us to do or logs you need to make things easier?
I'll be happy to test and help!


----------



## giorgi3 (Jan 6, 2013)

v9 did change, but results are still inconsistent. One thing noticed using compass pro app is that both my Galaxy S3 and my Touchpad (wifi) agree on the 270 degree heading. Also the touchpad seems to more consistent with it's headings (even though they are off considerably with the S3). I 'think both of these behaviors are new with V9. 

Clockwise rotation
S3 TP
000 0154
090 210
180 244
270 270 (yes! something agrees).
000 159 then drifted back to 125
090 211
180 244
270 270 
000 159 then drifted back to 125
Now rotating counter clockwise
270 240 then slowly to 270
180 245
090 210
000 121 then slowly to 125
270 240 then slowly to 270


----------



## Dorregaray (Jan 26, 2012)

v9b: v9 + gyro max range change

CM10: http://goo.im/devs/Dorregaray/testing/update-cm10-gyroscope-v9b.zip
CM9: http://goo.im/devs/Dorregaray/testing/update-cm9-gyroscope-v9b.zip

let me know how's the steering in asphalt now.

the compass seemed to point to the right direction when my tp was lying on the table in portrait orientation in z device test. in the same position the the direction in smart compass was totaly wrong


----------



## Hunter X (Nov 22, 2012)

Steering is still abysmal in Asphalt, although not as abysmal as before. I'll try to make a video to show the problem with steering unless someone beats me to it.


----------



## Dorregaray (Jan 26, 2012)

Hunter X said:


> Steering is still abysmal in Asphalt, although not as abysmal as before. I'll try to make a video to show the problem with steering unless someone beats me to it.


please make a video. I'd buy asphalt 7 but it's huge and I don't have enough space on my tp to test by myself.


----------



## Fat Albert (Dec 4, 2011)

Haven't played Asphalt in a while, just tried it with v9 patch on CM9, and yes its pretty bad, which is very odd because NFS steers like a dream. Video below






No, this is not me flailing my Touchpad around, I was legitimately trying to make the correct turns. The very first turn I gestured for the car to go left, but it went right. Overall turning was very erratic and inconsistent. I'd tilt left, it might go right, it might go left, the turn would be way to hard, or not be recognized, or if it was recognized, stay on the turning path for way longer than intended. Can you confirm Hunter X?

This is NFS just a few seconds after the video above was recorded. Works


----------



## Fat Albert (Dec 4, 2011)

This is Modern Combat 4 with gyroscope enabled. I don't touch the screen until I disable gyroscope. This same behavior is in Nova 3 when gyroscope is enabled






And is there a way to put just a raw video into a post? Uploading to Youtube, then putting the link here is seriously time consuming

Hope the videos help. Thanks Dorregaray


----------



## Dorregaray (Jan 26, 2012)

Thanks for the videos. Now it's time for another test using TP and another gyro enabled device

1. Install AndroSensor on both devices
2. Go to the settings, enable Record button and set Active Sensors to Accelerometer, Gyroscope, Magnetic Field and Orientation
3. Put both devices on some mat on the desk or ground
4. Start recording
5. Rotate the mat as shown on the case a) on the picture
6. Stop recording

7. Start recording
8. Raise the both devices with the same, constant speed by 90 degrees up and down as shown on the







picture
9. Stop recording

10. Repeat the 7-9 steps for the case c)

11. Gather the cvs files from the devices and upload

12. Let me know if the asphalt or other gyro enabled games are working properly on the second device










Sorry for my ugly drawings but I couldn't describe this movements in english


----------



## Hunter X (Nov 22, 2012)

@Dorregaray, if you can't test Asphalt, I think you can try Gyro Island on the Play store. It is pretty small and uses the gyro.


----------



## Dorregaray (Jan 26, 2012)

Hunter X said:


> @Dorregaray, if you can't test Asphalt, I think you can try Gyro Island on the Play store. It is pretty small and uses the gyro.


I tried, but I wasn't been able to see anything in Gyro Island except something that might be a sky no matter in what position I have hold the touchpad so I have assumed that the app may not be working properly and get rid of it.

edit: installed gyro island on htc sensation xe (having almost the same CPU and gyro) and does not work so it looks like it doesn't work well with MPU3050 gyro or snapdragon cpus.


----------



## giorgi3 (Jan 6, 2013)

@Dorregaray

I hope I got this right. I tried to do the Androsensor csv file collection you requested. The S3 data is from a galaxy s3 and the TP data is from the touchpad.

Both devices were on the same mat, and recording simultaneously as I moved the mat. I couldn't place them side by side as you pictured due to the size of the mat I had available. The Touchpad was at the top of the mat and positioned landscape. The S3 was directly below the TP and positioned in the portrait position.

The first file in each of these zip files should be the simultaneous 360 degree rotation clockwise pf the mat.
the second file in each should be a simultaneous 90 degree rotation up of the mat.
the third file in each is a 90 degree rotation to the right of the mat.

There may be some 'bobbling' around in the second and third, as I had to raise the mat up off the table first, then do the rotation.

Let me know if this works ok for you.

George


----------



## Dorregaray (Jan 26, 2012)

giorgi3 said:


> @Dorregaray
> 
> The first file in each of these zip files should be the simultaneous 360 degree rotation clockwise pf the mat.
> the second file in each should be a simultaneous 90 degree rotation up of the mat.
> the third file in each is a 90 degree rotation to the right of the mat.


Thanks for the data. I have compared the gyro values and I don't see any huge difference. The S3's gyro seems to be a bit more sensitive but all the values are at the same level.

@giorgi3: could you tell me what's the gyro max range and resolution of S3 (it's reported by z device test)?


----------



## giorgi3 (Jan 6, 2013)

z-device test says thegyroscope maximum range is

s3 = 10240.0000 m/s2
tp = 34.9066 m/s2


----------



## Dorregaray (Jan 26, 2012)

giorgi3 said:


> z-device test says thegyroscope maximum range is
> 
> s3 = 10240.0000 m/s2
> tp = 34.9066 m/s2


htc sensation also has 10240.0000 m/s2. maybe I should use this value


----------



## twosheds (Oct 2, 2011)

Dorregaray said:


> htc sensation also has 10240.0000 m/s2. maybe I should use this value


The Nexus 7 reports 34.9066 m/s2


----------



## Hunter X (Nov 22, 2012)

CM9 v9b appears to use 10240.0000 m/s^2 resolution.


----------



## Dorregaray (Jan 26, 2012)

Hunter X said:


> CM9 v9b appears to use 10240.0000 m/s^2 resolution.


yes, I set 10240 in 9b, but it seems that it didn't magicaly solved all the issues.
I've tried froyo build (from http://forum.xda-developers.com/showthread.php?t=2058150) and it's set to 10240. so I'm gonna use this as default in the next release.


----------



## Hunter X (Nov 22, 2012)

I checked my Kindle Fire HD 7" and Z-Device Test shows it has an "MPL Gyro" by InvenSense. Its maximum range is 10240.0000 m/s^2 with a resolution of 1.0000 m/s^2. Also has MPL Accel, MPL Gravity, MPL Linear Accel, MPL Rotation vector all with the same max range and resolution (not same units, but same # value). No compass/magnetometer detected by Z-Device Test.
EDIT: KFHD 7" uses MPU6050 which probably explains why it has gyro + accel only and no compass.

@Dorregaray: I've been looking at sensor-params.h from the invensense source and saw that the resolution and range for the compass and accelerometer sensors don't match what is reported by Z-Device Test and thought that maybe adjusting it might get the sensors to play nice.


----------



## Dorregaray (Jan 26, 2012)

I've managed to get the froyo ROM working with the original hp sensors implementation for reference. If anyone is brave enough to give it a try here it is:
http://goo.im/devs/Dorregaray/testing/Froyo-2.2.1-Qcom-Kang-Touchpad-a0.3-incl-gapps-sensors.zip
make sure to backup first, then install from recovery and perform factory reset. wifi is not working (enabling wifi reboots the device).

I'm gonna use this build as a reference to compare the returned values and see what's the difference and what can I do about it.


----------



## Hunter X (Nov 22, 2012)

Are there any apps for testing the sensors that work on Froyo? I've tried Z-Device Test, but it just reboots the TP.


----------



## Dorregaray (Jan 26, 2012)

Hunter X said:


> Are there any apps for testing the sensors that work on Froyo? I've tried Z-Device Test, but it just reboots the TP.


AndroSensor works ok, for compass I've been using SmartCompass


----------



## Dorregaray (Jan 26, 2012)

v10:
- change magnetometer axis orientation/mapping to match froyo settings
- gyro resolution 10240 (as in 9b)

CM10: http://goo.im/devs/D...roscope-v10.zip
CM9: http://goo.im/devs/D...roscope-v10.zip

v10b:
- swapped x and y axis to match froyo settings
CM10: http://goo.im/devs/D...oscope-v10b.zip
CM9: http://goo.im/devs/Dorregaray/testing/update-cm9-gyroscope-v10b.zip

let me know how the compass is on v10 and how's the asphalt on v10 and v10b


----------



## Hunter X (Nov 22, 2012)

patchset 9 on gerrit is equivalent to the v10 update above?
CM9 v10b link is wrong, it points to v9b. Link should be http://goo.im/devs/Dorregaray/testing/update-cm9-gyroscope-v10b.zip


----------



## Dorregaray (Jan 26, 2012)

Hunter X said:


> CM9 v10b link is wrong, it points to v9b. Link should be http://goo.im/devs/D...oscope-v10b.zip


thanks, should be ok now. I don't know why this happens - I've been pasting the correct link. maybe the opera browser messed it up


----------



## Hunter X (Nov 22, 2012)

Is v10 supposed to treat the natural orientation as portrait?


----------



## Dorregaray (Jan 26, 2012)

Hunter X said:


> Is v10 supposed to treat the natural orientation as portrait?


on hp's froyo the natural orientation is portrait.

v10 uses this orientation for magnetometer and v10b also for gyroscope


----------



## captainmorris (Sep 5, 2011)

Dorregaray said:


> on hp's froyo the natural orientation is portrait.
> 
> v10 uses this orientation for magnetometer and v10b also for gyroscope


CM10 v10b allowed for proper control while playing Asphalt. CM10 v10 had reversed controls for me. Control was still not ideal with 10b, but it is now marginally playable. The timing is still slightly off...if I need to correct to the right, I turn the tablet, then a second later, I get my turn, but it is a little late. I can sometimes force a faster turn, by tapping the tablet hard to the direction that I'm turning, but it then turns really hard into the direction that I'm turning...makes for a rough race, but it is playable...if just barely! Thanks Dorregaray!

Sent from my cm_tenderloin using Tapatalk HD


----------



## Dorregaray (Jan 26, 2012)

captainmorris said:


> CM10 v10b allowed for proper control while playing Asphalt. CM10 v10 had reversed controls for me. Control was still not ideal with 10b, but it is now marginally playable. The timing is still slightly off...if I need to correct to the right, I turn the tablet, then a second later, I get my turn, but it is a little late. I can sometimes force a faster turn, by tapping the tablet hard to the direction that I'm turning, but it then turns really hard into the direction that I'm turning...makes for a rough race, but it is playable...if just barely! Thanks Dorregaray!


could you obtain the logcat after starting the game and look for "set fifo rate: " message? it will contain the polling interval the asphalt is setting


----------



## Hunter X (Nov 22, 2012)

D/Sensors ( 243): sensor activation called: handle=4, enabled=1********************************
I/Sensors ( 243): Enabling gyroscope
D/Sensors ( 243): set fifo rate: 39 200000000
D/Sensors ( 243): set fifo rate: 3 20000000
D/Sensors ( 243): sensor activation called: handle=4, enabled=0********************************
I/Sensors ( 243): Disabling gyroscope
D/Sensors ( 243): sensor activation called: handle=4, enabled=1********************************
I/Sensors ( 243): Enabling gyroscope
D/Sensors ( 243): set fifo rate: 39 200000000
D/Sensors ( 243): set fifo rate: 3 20000000

I should probably mention that axes are once again inverted on TP 4G.


----------



## Dorregaray (Jan 26, 2012)

Hunter X said:


> D/Sensors ( 243): sensor activation called: handle=4, enabled=1********************************
> I/Sensors ( 243): Enabling gyroscope
> D/Sensors ( 243): set fifo rate: 39 200000000
> D/Sensors ( 243): set fifo rate: 3 20000000
> ...


please try v10c and let me know if the axis are ok now and if it has any impact on games

v10c:
- min delay for gyro changed to 5ms
- axis change for TP 4G

CM9: http://goo.im/devs/D...oscope-v10c.zip
CM10: http://goo.im/devs/Dorregaray/testing/update-cm10-gyroscope-v10c.zip


----------



## captainmorris (Sep 5, 2011)

Dorregaray said:


> D/Sensors ( 243): sensor activation called: handle=4, enabled=1********************************
> I/Sensors ( 243): Enabling gyroscope
> D/Sensors ( 243): set fifo rate: 39 200000000
> D/Sensors ( 243): set fifo rate: 3 20000000
> ...


My logcat looks similar to HunterX 's, but my axis orientation is correct on CM10 v10b, and I have a normal Touchpad 32GB.

I/ActivityManager( 361): START {cmp=com.gameloft.android.ANMP.GloftA7HM/.SplashScreenActivity (has extras) u=0} from pid 29905
D/Sensors ( 361): sensor activation called: handle=4, enabled=0********************************
I/Sensors ( 361): Disabling gyroscope
D/dalvikvm(29905): GC_EXPLICIT freed 355K, 51% free 4086K/8195K, paused 16ms+6ms, total 65ms
D/Sensors ( 361): sensor activation called: handle=4, enabled=1********************************
I/Sensors ( 361): Enabling gyroscope
D/Sensors ( 361): set fifo rate: 39 200000000
D/Sensors ( 361): set fifo rate: 3 20000000
D/dalvikvm(29905): GC_EXPLICIT freed 353K, 51% free 4096K/8195K, paused 4ms+4ms, total 35ms
D/dalvikvm(29905): GC_EXPLICIT freed 255K, 51% free 4076K/8195K, paused 4ms+3ms, total 30ms

Sent from my cm_tenderloin using Tapatalk HD


----------



## Dorregaray (Jan 26, 2012)

captainmorris said:


> My logcat looks similar to HunterX 's, but my axis orientation is correct on CM10 v10b, and I have a normal Touchpad 32GB.
> 
> I/ActivityManager( 361): START {cmp=com.gameloft.android.ANMP.GloftA7HM/.SplashScreenActivity (has extras) u=0} from pid 29905
> D/Sensors ( 361): sensor activation called: handle=4, enabled=0********************************
> ...


could you check on v10c - just uploaded in the post above.

how's the compass on v10 series?


----------



## Hunter X (Nov 22, 2012)

I think everything should be fixed for the WiFi TP first because now I'm starting to get confused with what the proper orientation should be and it's acting funky.


----------



## captainmorris (Sep 5, 2011)

Dorregaray said:


> could you check on v10c - just uploaded in the post above.
> 
> how's the compass on v10 series?


CM10 v10c at first seemed better, but then things got really twitchy. As the race went on, I lost more control. Towards the end, I had virtually no control, and would even twitch in the opposite direction. When I look at Smart Compass, the compass would point to the correct direction only while flat on the table, in landscape, facing me...if I turn the tablet, or pick it up, the orientation is off. It is slightly better if I turn the accelerometer off, but it is still up to 30 degrees off. I retried v10b, and it behaves very much the same way, just slightly less responsive in the beginning. If I left smart compass on for a while, a toast message comes up, saying "magnetic sensor error!!! No magnetic sensor, or it is out of order."

Sent from my cm_tenderloin using Tapatalk HD


----------



## Dorregaray (Jan 26, 2012)

captainmorris said:


> CM10 v10c at first seemed better, but then things got really twitchy. As the race went on, I lost more control. Towards the end, I had virtually no control, and would even twitch in the opposite direction. When I look at Smart Compass, the compass would point to the correct direction only while flat on the table, in landscape, facing me...if I turn the tablet, or pick it up, the orientation is off. It is slightly better if I turn the accelerometer off, but it is still up to 30 degrees off. I retried v10b, and it behaves very much the same way, just slightly less responsive in the beginning. If I left smart compass on for a while, a toast message comes up, saying "magnetic sensor error!!! No magnetic sensor, or it is out of order."


could you get the logcat from both cases - I'd like to see if there's some clue there.


----------



## Hunter X (Nov 22, 2012)

Compass appears to work fine on my TP4G, only when held in portrait mode; It's nice and smooth, although as reported before, it works only when held/laid flat.


----------



## nevertells (Oct 29, 2011)

Hunter X said:


> Compass appears to work fine on my TP4G, only when held in portrait mode; It's nice and smooth, although as reported before, it works only when held/laid flat.


My 32gb TP, running CM9, no patches, the compass will only work correctly in portrait with the TP held perpendicular to the ground. Held horizontal to the ground, compass movements are erratic and North and South are reversed. It's totally fubar in landscape.


----------



## Hunter X (Nov 22, 2012)

nevertells said:


> My 32gb TP, running CM9, no patches, the compass will only work correctly in portrait with the TP held perpendicular to the ground. Held horizontal to the ground, compass movements are erratic and North and South are reversed. It's totally fubar in landscape.


Perhaps its another axes issue then...


----------



## Dorregaray (Jan 26, 2012)

v11:
- removed the debugging messages from gyro driver/lib

CM10: http://goo.im/devs/D...roscope-v11.zip
CM9: http://goo.im/devs/Dorregaray/cmtouchpad/cm9-gyro/update-cm9-gyroscope-v11.zip

@captainmorris: let me know if this has improved the steering a bit


----------



## giorgi3 (Jan 6, 2013)

The compass still does not appear to be right for a 32gb TP WiFi version.


----------



## nevertells (Oct 29, 2011)

Dorregaray said:


> v11:
> - removed the debugging messages from gyro driver/lib
> 
> CM10: http://goo.im/devs/D...roscope-v11.zip
> ...


Hey "D", are you soliciting testing and feedback in any other forums or threads? I only see minimal posts here unless folks are PM'ing you their comments. I understand basically what you are trying to do here, but my understanding of Linux, programming and the way these built in instruments work is nil, so I don't know that I could be of much help in that area. I'm not a gamer either. I did post what my TouchPad compass was doing without any of your patches as a point of reference that might help you sort this out. But from what I am seeing/reading, you need a wider base of input to help you make sense of this. Let me know if there is anything I can do in my limited understanding of this.


----------



## captainmorris (Sep 5, 2011)

Dorregaray said:


> v11:
> - removed the debugging messages from gyro driver/lib
> 
> CM10: http://goo.im/devs/Dorregaray/cmtouchpad/cm10-gyro/update-cm10-gyroscope-v11.zip
> ...


I'm sorry that I haven't responded since your last post. I've been super busy with work. I grabbed my TP and loaded up v11. I played one game of Asphalt 7, and actually made it to the end of the race...in last place, but I was able to finally finish a race. It wasn't pretty though. There are times when the steering just stops responding, then exaggerates, turning my view on it's side, like I'm riding on 2 wheels, but I still don't turn, then I may stutter in the direction that I want, or I will slingshot across the screen and crash. With this update, I was able to maintain enough control to finish the race, just not with any quality of control. Looking at the compass, it was mostly inverted, but there is no real consistency with the compass...it wanders a lot, and I get the magnetic sensor warning occasionally. Switching orientation seems to fix that though. If you still want logcats, I may be able to pull some together for you later...back to work now! Thanks Dorregaray!

Sent from my Galaxy Nexus using Tapatalk 2


----------



## Dorregaray (Jan 26, 2012)

captainmorris said:


> If you still want logcats, I may be able to pull some together for you later...


that would be great. it would be good to have a logcat from the asphalt game and taken on the compass issue (especially taken with "-v time" option) . if you could obtain the corresponding dmesg output from the device that would be even better

btw. uploaded v11 for CM9: http://goo.im/devs/Dorregaray/cmtouchpad/cm9-gyro/update-cm9-gyroscope-v11.zip


----------



## ZeroZorro (Mar 3, 2012)

Dorregaray said:


> that would be great. it would be good to have a logcat from the asphalt game and taken on the compass issue (especially taken with "-v time" option) . if you could obtain the corresponding dmesg output from the device that would be even better
> 
> btw. uploaded v11 for CM9: http://goo.im/devs/Dorregaray/cmtouchpad/cm9-gyro/update-cm9-gyroscope-v11.zip


Could you point me to the right direction how to make those logs, I would be happy to provide the data. Or does it require programming skills?

Sent from my cm_tenderloin using Tapatalk 2


----------



## Hunter X (Nov 22, 2012)

connect your TP to the computer and open a terminal shell. You must have the Android SDK installed, well the platform-tools only since it contains the adb command you need. In the terminal shell just run the following

```
adb logcat > logcat.txt
```
That will create the file logcat.txt in the current working directory which is the output of the logcat command on the device.
You can also run logcat from the device itself, but I find that a bit more tedious to work with. You can do the same with dmesg.


----------



## Dorregaray (Jan 26, 2012)

Hunter X said:


> connect your TP to the computer and open a terminal shell. You must have the Android SDK installed, well the platform-tools only since it contains the adb command you need. In the terminal shell just run the following
> 
> ```
> adb logcat > logcat.txt
> ...


you can obtain the dmesg using:

```
adb shell dmesg > dmesg.txt
```
or using a terminal emulator and:

```
dmesg > /sdcard/dmesg.txt
```


----------



## Dorregaray (Jan 26, 2012)

Hunter X said:


> I think everything should be fixed for the WiFi TP first because now I'm starting to get confused with what the proper orientation should be and it's acting funky.


I have messed up the axis config for TP 3G. Uploaded a new kernel patch to gerrit. Will build and upload flashable zips tomorrow.


----------



## Dorregaray (Jan 26, 2012)

The problem with compass is as follows. The TouchPad has been designed for portrait mode by HP so it has camera, magnetometer, gyroscope, accelerometer sensors aligned for portrait mode. While on android the tablet UI is designed for landscape mode.
The magnetometer works properly when have axis configured for portrait mode, the same gyroscope. However the accelerometer has axis configured for landscape mode (otherwise the UI will be reverted). This makes a problem while the compass apps are using accelerometer to increase the compass precision.
I don't have a solution for that at this point so I have removed the magnetometer changes from the gyro patch in gerrit.
If I find a solution I will upload a new patchset for it to the gerrit and provide the flashable update.


----------



## nevertells (Oct 29, 2011)

Dorregaray said:


> The problem with compass is as follows. The TouchPad has been designed for portrait mode by HP so it has camera, magnetometer, gyroscope, accelerometer sensors aligned for portrait mode. While on android the tablet UI is designed for landscape mode.
> The magnetometer works properly when have axis configured for portrait mode, the same gyroscope. However the accelerometer has axis configured for landscape mode (otherwise the UI will be reverted). This makes a problem while the compass apps are using accelerometer to increase the compass precision.
> I don't have a solution for that at this point so I have removed the magnetometer changes from the gyro patch in gerrit.
> If I find a solution I will upload a new patchset for it to the gerrit and provide the flashable update.


So where are we at with this? From what I can deduce from reading the posts here, as of patch v11, things are still very sketchy. What can a general user expect if he installs this patch? CaptainMorris posted above that playing Asphalt was barely doable. I understand basically that it comes down to a design difference of the way WebOS and Android use the sensors on the TouchPad. So is there any reason for one to install this patch at this point? Thanks for your efforts to get it this far.


----------



## Fat Albert (Dec 4, 2011)

nevertells said:


> So where are we at with this? From what I can deduce from reading the posts here, as of patch v11, things are still very sketchy. What can a general user expect if he installs this patch? CaptainMorris posted above that playing Asphalt was barely doable. I understand basically that it comes down to a design difference of the way WebOS and Android use the sensors on the TouchPad. So is there any reason for one to install this patch at this point? Thanks for your efforts to get it this far.


Well, considering that gyroscopes main purpose is for racing and shooting games, wallpapers, and the compass/mapping features, it pretty much depends on what your looking for to be fixed. If you want to play Asphalt 7, don't install patches after #9 (I can't confirm that the ones before it WILL work, but I can confirm the ones after don't) . If you want a fully functional compass, your out of luck for now.

As for me, when I saw the gyrospace wallpaper work for the first time on patch 7, I cried with joy. Many happy tears ran their course that day (not really but still). And its not like all racing games don't work. With patch 11, NFS MW, GTA III, and Riptide GP all work beautifully, plus a lot of other teeter-totter games I can't think of right now.

All in all, it seems the Touchpad is at the stage of if the patch works great. But if you're happy with where you're at, then you should probably stay there, because Touchpad development seems to be slowing. I don't know if this little engine that could has much longer

Many thanks to Dorregaray for making this extraordinary effort to get one of the last missing pieces on the Android Touchpad to work, and to Jcsullins for also developing. I am totally looking forward to the next patch









PS- Nintendo is totally screwed.


----------



## Hunter X (Nov 22, 2012)

Almost every game works beautifully with the latest patchsets, with asphalt being the exception.


----------



## Dorregaray (Jan 26, 2012)

v12:
- reverted magnetometer changes

CM9: http://goo.im/devs/Dorregaray/cmtouchpad/cm9-gyro/update-cm9-gyroscope-v12b.zip
CM10: http://goo.im/devs/Dorregaray/cmtouchpad/cm10-gyro/update-cm10-gyroscope-v12b.zip

let me know how it works. the list of games/apps working correctly/incorrectly would be nice


----------



## Hunter X (Nov 22, 2012)

I dont think v12 has the latest sensors. Temperature sensor identifies itself as BMA 150 still rather than MPL which leads me to believe its an old patchset.


----------



## Dorregaray (Jan 26, 2012)

Hunter X said:


> I dont think v12 has the latest sensors. Temperature sensor identifies itself as BMA 150 still rather than MPL which leads me to believe its an old patchset.


The real change was in kernel. There was one change in libsensors - changing the sensor name, so even if the libsensors didn't build and is from v11 it don't mind - functionally it's v12

I've rebuilt the v12 for CM10 to make sure the libsensors is the latest:
http://goo.im/devs/D...oscope-v12b.zip


----------



## Hunter X (Nov 22, 2012)

I meant for CM9. Apart from changing the name to MPL Temp Sensor in patchset 12, there were changes to MPLSensor.cpp
The sensors libs I compiled from whats on gerrit behave differently from the libs in the v12 update zip.


----------



## Dorregaray (Jan 26, 2012)

Hunter X said:


> I meant for CM9. Apart from changing the name to MPL Temp Sensor in patchset 12, there were changes to MPLSensor.cpp
> The sensors libs I compiled from whats on gerrit behave differently from the libs in the v12 update zip.


the rebuilt version for CM9: http://goo.im/devs/Dorregaray/cmtouchpad/cm9-gyro/update-cm9-gyroscope-v12b.zip


----------



## tqhoang (Nov 19, 2011)

Is the CM9 gyro patch compatible with the CM9 nightly 20121217? I haven't been updating my CM9 TouchPads since I re-installed using ACMEInstaller3 (in prep for CM10+).


----------



## Dorregaray (Jan 26, 2012)

tqhoang said:


> Is the CM9 gyro patch compatible with the CM9 nightly 20121217? I haven't been updating my CM9 TouchPads since I re-installed using ACMEInstaller3 (in prep for CM10+).


should work, but make backup first (or keep the 20121217 on device to be able to reflash) in case it won't work


----------



## Dorregaray (Jan 26, 2012)

The gyro patch is integrated with latest jcsullins cm10 preview:
http://goo.im/devs/jcsullins/cmtouchpad/preview/cm-10-20130304-EXPERIMENTAL-tenderloin-FOR_LIMITED_TESTING_ONLY_CAM.zip


----------



## nevertells (Oct 29, 2011)

Dorregaray said:


> The gyro patch is integrated with latest jcsullins cm10 preview:
> http://goo.im/devs/j...NG_ONLY_CAM.zip


Tomasz, what can you tell us about this latest rom? Since J.C.'s 1216 experimental rom, literally hundreds of changes were added to CM10 by the host of developers around the world in addition to the code that you and J.C. have added. When he compiled this most recent rom, were all the changes included?
the 1216 rom file size is 145.16MB. This newest rom is 145.28MB in size. Any insight you can provide is appreciated.


----------



## Dorregaray (Jan 26, 2012)

nevertells said:


> Tomasz, what can you tell us about this latest rom? Since J.C.'s 1216 experimental rom, literally hundreds of changes were added to CM10 by the host of developers around the world in addition to the code that you and J.C. have added. When he compiled this most recent rom, were all the changes included?
> the 1216 rom file size is 145.16MB. This newest rom is 145.28MB in size. Any insight you can provide is appreciated.


I cannot tell you much. For sure it have:
- gyro patch,
- camera config,
According to the gerrit it should have:
- usb connection reporting change (do not report charging when it's just connected to pc and not charging),
- storage notification in status bar,
- some filemanager changes,
- some translations added,
- some performance improvements,
and probably some other changes.
I'm pretty sure jcsullins has added some of his patches too (http://review.cyanogenmod.org/#/q/owner:jcsullins%2540gmail.com+statuspen+branch:jellybean,n,z)


----------



## nubar (Nov 20, 2012)

Just confirming that Asphalt still doesn't (or barely) works with CM10 03/04.

If I remember correctly (which I might not) it worked fine until one of the November or December updates. Any idea what changed at that point?


----------



## Dorregaray (Jan 26, 2012)

nubar said:


> Just confirming that Asphalt still doesn't (or barely) works with CM10 03/04.
> 
> If I remember correctly (which I might not) it worked fine until one of the November or December updates. Any idea what changed at that point?


are you able to check on which patch it stopped working? then I'll examine the changes


----------



## NewbyJE (Jan 19, 2012)

Dorregaray:

Thank you very much for all your hard work on the sensors.

Dorregaray, jcsullins, Hunter X:

PM'ed you with code changes to test/critique. These changes appear to work correctly for accelerometer and gyroscope on TP WiFi and 4G versions.

Still working on magnetometer (compass).

John


----------



## ShanghaiDroid (Feb 24, 2012)

awesome that so much works. thanks! I can also confirm asphalt7 does not work with the accelerometer and gyroscope. would be willing to test...

FYI: Tried installing the v6 patch and CM10 wouldn't finish loading -- stuck on the boot video. Had to reinstall cm10.


----------



## ShanghaiDroid (Feb 24, 2012)

Is there a way to disable the Gyroscope?


----------



## Dorregaray (Jan 26, 2012)

ShanghaiDroid said:


> Is there a way to disable the Gyroscope?


it's not being used until the game or other app want's to use it. there's no way to disable it.
why to you want to disable it?


----------



## ShanghaiDroid (Feb 24, 2012)

Dorregaray said:


> it's not being used until the game or other app want's to use it. there's no way to disable it.
> why to you want to disable it?


Thanks for the response,

I am under the impression that the gyroscope is the thing that is interfering with Asphalt 7's steering issues... Thought temporarily disabling it might end that issue without need for further development...

I'm on 03/04 CM10 Touchpad, 32 Gb. Wifi.


----------



## Dorregaray (Jan 26, 2012)

ShanghaiDroid said:


> Thanks for the response,
> 
> I am under the impression that the gyroscope is the thing that is interfering with Asphalt 7's steering issues... Thought temporarily disabling it might end that issue without need for further development...
> 
> I'm on 03/04 CM10 Touchpad, 32 Gb. Wifi.


I believe the asphalt has an controls configuration - I believe there should be an option to use gyroscope or not


----------



## ShanghaiDroid (Feb 24, 2012)

Asphalt 7 does not appear to have this option, unless you use an onscreen steering wheel and shut off motion sensors.

thanks


----------



## tqhoang (Nov 19, 2011)

NewbyJE said:


> Dorregaray:
> 
> Thank you very much for all your hard work on the sensors.
> 
> ...


@Dorregaray - Couple questions.
Are these the changes that are in the CM10 gyro v12c, I read through this thread and only saw references up to v12b.
Also I'm still running the CM10 2012-12-16 preview. I assume the v12b is probably still compatible with that, but was the v12c built against that source or against the current upstream at the time?
Has the CM9 gyro patch been accepted? I'm running the CM9 nightly 2013-03-10 and was wondering if the CM9 gyro v12b would be compatible.
Thanks!


----------



## Dorregaray (Jan 26, 2012)

tqhoang said:


> Are these the changes that are in the CM10 gyro v12c, I read through this thread and only saw references up to v12b.
> Also I'm still running the CM10 2012-12-16 preview. I assume the v12b is probably still compatible with that, but was the v12c built against that source or against the current upstream at the time?
> Has the CM9 gyro patch been accepted? I'm running the CM9 nightly 2013-03-10 and was wondering if the CM9 gyro v12b would be compatible.


ad 1. The changes NewbyJE mentioned are not in any patch yet - it's still in progress.
ad 2. The v12b and v12c were built against the current upstream at the time
ad 3. no, it has not yet been accepted


----------



## groo_pcd (Oct 19, 2011)

hi dorregaray, could you make a new patch based on the low bat patches from jcsullins?

your patch breaks the new build savings. so either I have more battery or I have the compass :-[

keep up the good work

Sent from a touchie ice cream sandwich.


----------



## Dorregaray (Jan 26, 2012)

v12c: rebased v12b (includes low battery patches from jcsullins)

http://goo.im/devs/Dorregaray/cmtouchpad/cm9-gyro/update-cm9-gyroscope-v12c.zip


----------



## Hunterdiver (Nov 3, 2011)

The same problem appears to exist on the CM10.1 build .. I foolishly tried to apply this patch against it but it resulted in a boot loop fortunatly as always I had takena back up.

Are there any plans to patch this on 10.1 ??


----------



## Dorregaray (Jan 26, 2012)

v13:
- rebased to the last changes,
- updates to sensor setup by John Newby

CM10: http://goo.im/devs/Dorregaray/cmtouchpad/cm10-gyro/update-cm10-gyroscope-v13.zip
CM10.1: http://goo.im/devs/Dorregaray/cmtouchpad/cm10.1-gyro/update-cm10.1-gyroscope-v13.zip



Hunterdiver said:


> The same problem appears to exist on the CM10.1 build .. I foolishly tried to apply this patch against it but it resulted in a boot loop fortunatly as always I had takena back up.
> 
> Are there any plans to patch this on 10.1 ??


try the v13 for cm10.1 but make a backup first - I haven't tested it


----------



## garux (Dec 26, 2012)

Dorregaray said:


> CM10.1: http://goo.im/devs/D...roscope-v13.zip
> 
> try the v13 for cm10.1 but make a backup first - I haven't tested it


could you please let me know if this needs reflashed every time a rom is flased?

Thanks.


----------



## Dorregaray (Jan 26, 2012)

garux said:


> could you please let me know if this needs reflashed every time a rom is flased?
> 
> Thanks.


yes, it needs to be reflashed


----------



## twosheds (Oct 2, 2011)

I tried V13 with JCSullins CM10.1 Bluetooth_test ROM(080813) but I couldn't access the SDCard. The message given was "the sd card is not currently mounted".

Reflashed my backup and it was accessible again.


----------



## Hunterdiver (Nov 3, 2011)

Using the unofficial Cm10.1 nighties (cm-10.1-20130819-UNOFFICIAL-tenderloin) I also experienced unmounted SD card problem.

Did try Google sky and I still jitters &#8230;


----------



## Dorregaray (Jan 26, 2012)

Hunterdiver said:


> Using the unofficial Cm10.1 nighties (cm-10.1-20130819-UNOFFICIAL-tenderloin) I also experienced unmounted SD card problem.
> 
> Did try Google sky and I still jitters &#8230;


I may lack the sdcard mounting fix in the patch...


----------



## RolandDeschain79 (Feb 1, 2012)

Dorregaray said:


> I may lack the sdcard mounting fix in the patch...


Hey Dorregaray

A very interesting post was just made in the Jcsullins CM10 thread by iMarck90. He has created an updated CM10 build with the master key exploits fixed but has left out the gyroscope. It appears he's found a bug that needs squashing and your expertise here would be very much appreciated. Thank you for all you've done for our Touchpads Camera and Gyroscope, I hope you would be willing to take another look for all us die hard TP fans.

Cheers

http://rootzwiki.com/topic/31548-rom-guide-how-to-install-jcsullins-cm10cm101-unofficial-builds-edited-91113/?p=1471377


----------



## Dorregaray (Jan 26, 2012)

RolandDeschain79 said:


> Hey Dorregaray
> 
> A very interesting post was just made in the Jcsullins CM10 thread by iMarck90. He has created an updated CM10 build with the master key exploits fixed but has left out the gyroscope. It appears he's found a bug that needs squashing and your expertise here would be very much appreciated. Thank you for all you've done for our Touchpads Camera and Gyroscope, I hope you would be willing to take another look for all us die hard TP fans.
> 
> ...


I'll take a look on that when I'll find some free time.


----------



## Dorregaray (Jan 26, 2012)

It looks like this CM10 build by iMarck90 is wrong. I've loaded it and in z-device test the compass, accelerometer and gyroscope are crashing, the light sensor is not working. I've installed v13 gyroscope patch over it and everything works ok.


----------



## RolandDeschain79 (Feb 1, 2012)

Dorregaray said:


> It looks like this CM10 build by iMarck90 is wrong. I've loaded it and in z-device test the compass, accelerometer and gyroscope are crashing, the light sensor is not working. I've installed v13 gyroscope patch over it and everything works ok.


Thank you for taking the time to test this build for us Dorregaray :grin: (thumbs up emoticon needed here).

I will test out installing the V13 gyroscope patch now. I have Tbobs WebOS style app switcher mod installed too, so I hope it all works

CM-10-20131005-UNOFFICIAL-tenderloin.zip

v13 gyroscope patch

*(Optional) *HP TouchPad CM10 WebOS-like Card Switcher Mod for Jcsullins Unofficial CM10 Preview. Watch theVideo Here!

WebCM10 for CM10 03/04 (with battery stats)

Edit: Tested it with Tbobs patch and everything works fine no rebooting with the brightness set to auto and my battery stats show!


----------



## tqhoang (Nov 19, 2011)

@Dorregaray - Is the v13 gyroscope patch included in "cm-10.1-20131210-SNAPSHOT-VPN-tenderloin.zip"? If not, is the v13 patch compatible with it to install?

@Roland - A little off topic, but the ROM I listed above...that's still considered a Milaq 10.1 ROM that requires AcmeInstaller5M right? I used the "5M" and it seems to be installed ok, but just wanted to double check.

@All - Thanks again for all this great work to make the TouchPad a safe platform to keep using.


----------



## Dorregaray (Jan 26, 2012)

I have no idea. you should ask the "cm-10.1-20131210-SNAPSHOT-VPN-tenderloin.zip" build author. I know it's included in latest Kitkat Evervolv builds.

The userspace patch is still laying in CM's gerrit waiting for the merge. The kernel patch disappeared from gerrit so it's hard to say.


----------



## Mossy (Oct 29, 2011)

Just tried Dorregary's V13 gyro patch on JCSullins VPN build
No idea if it even needed it, but I felt like dancin' with the devil for 30 minutes or so
My bad if things went sideways

The two don't seem to play well together
Blew away a few apps and disconnected the mount SDCard (at least that's what TiBkup and Root explorer report)

Nandroid, nandroid - a concept well worth remembering
Back up and running JCS VPN again.
Was on JCS 3.X build (have a nandroid of that one too in case I feel like dancin' again)
, but his VPN has everything working that I'll ever need and -3mA drain during sleep. Sweet.


----------



## Dorregaray (Jan 26, 2012)

The gyro patch includes the patched 2.6.35 kernel that replaces the existing one.This patch has been created a long time ago and is not suitable for 3.x kernels and data/media builds.


----------

