Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Issue with device rotation commands

Author
Message
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 12th Jan 2016 15:31 Edited at: 12th Jan 2016 16:49
Hello. I'm having issues with my VR game again.

The below code works fine on my Samsung Galaxy S3 mini (Android 4.1.2), but when I run it on my Nexus 5 (Android 6.0.1 CyanogenMod 13.0.20160102), the rotation commands all return 0.
Does anyone else have this issue or is it just me? (I know the rotation sensors work, as I can play Google Cardboard apps from the app store just fine.)

Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 12th Jan 2016 17:34 Edited at: 12th Jan 2016 17:34
I have a Nexus 5 running Android 6.0.1 stock, and the above code works for me. Does GetRotationVectorSensorExists return 0 as well? I'm not sure what could be happening there.
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 12th Jan 2016 22:30
On my phone, GetRotationVectorSensorExists () returns 1.
The various GetRawRotationVector_2 commands all return 0.0

Works on my S3, not on my nexus5, but it works fine on my wifes nexus 5... She isn't running CyanogenMod however.
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 13th Jan 2016 02:33
Strange, do the other sensors work, gyro, accelerometer, magnetic?
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 13th Jan 2016 09:13
I've not tried them. It's weird as other VR apps work fine.
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 13th Jan 2016 17:11
It might be that they are using Java instead of the NDK
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 13th Jan 2016 18:49
Then what could the issue be? It it my phone? CyanogenMod? AppGameKit? NDK?
There does seem to be an issue somewhere and it would be good to get to the bottom of it so that I know the feature will work across all devices.
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 14th Jan 2016 08:59
My guess would be the Cyanogen firmware is at fault. Looks like they patched some sensor issues in December (from XDA forums), but if you're using a non-semi-official version then you might not have those updates in your build.
V2 T1 (Mostly)
Phone Tap!
Uzmadesign
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 14th Jan 2016 10:07
I appear to be using a nightly build which was on the phone when I got it. I might remove CM and put stock android back on.
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 14th Jan 2016 17:47
If you wanted to debug the issue my first step would be to determine whether the other sensor commands work, accelerometer, gyro, and magnetic. If they don't work then it suggests a deeper issue with the interface between NDK and the CyanogenMod sensor manager. If they do work then it suggests a lack of support for the rotation vector sensor, which is a fusion of all the other sensors and is not specifically defined in the NDK sensor header files. We use a hard coded value that gets passed to the Android OS and hope that it responds correctly. The next step would be to start experimenting and researching a way of getting CynogenMod to respond to the NDK sensor commands in general, or the rotation vector in particular, depending on what was discovered. Unfortunately that's not an easy task and isn't guaranteed to find a solution.
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 14th Jan 2016 19:28


Using the above code, the following sensors return values: ( No Values = 0.000000, Negative No Values = -0.000000 )

GetRawAccelX: Values
GetRawAccelY: Values
GetRawAccelZ: Values
GetRawGPSAltitude: No Values
GetRawGPSLatitude: No Values
GetRawGPSLongitude: No Values
GetRawGyroVelocityX: Values
GetRawGyroVelocityY: Values
GetRawGyroVelocityZ: Values
GetRawLightLevel: Values
GetRawMagneticX: No Values
GetRawMagneticY: No Values
GetRawMagneticZ: No Values
GetRawProximityDistance: Always shows 5
GetRawRotationVectorW: No Values
GetRawRotationVectorW2:No Values
GetRawRotationVectorX: Negative No Values
GetRawRotationVectorX2: No Values
GetRawRotationVectorY: Negative No Values
GetRawRotationVectorY2: Negative No Values
GetRawRotationVectorZ: No Values
GetRawRotationVectorZ2: No Values


I think I'll just put stock Android on it and save the hassle, but at least we know that this version of CM doesn't work with most of the sensor commands.
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 16th Jan 2016 14:38
Stock android works fine on my phone, so it was definitely CyanogenMod that was causing the issue, at least on this device it was.

Login to post a reply

Server time is: 2024-11-17 03:03:12
Your offset time is: 2024-11-17 03:03:12