Search Issue Tracker
Fixed in 2018.2.X
Fixed in 2017.2.X, 2017.3.X, 2018.1.X
Votes
53
Found in
5.6.1f1
Issue ID
912848
Regression
No
[Android] Input.gyro is extremely laggy on specific device with Android 7.0
Steps to reproduce:
1) Download attached project 'AndroidAttitudeBug.zip' and open in Unity
2) Build and Run 'Main' scene on a device
3) Rotate device
You will see that Input.gyro.attitude and Input.gyro.userAcceleration appear to be lagging
Expected result: Input.gyro.attitude and Input.gyro.userAcceleration should not be lagging (check attached video 'expected.mp4')
Actual result: Input.gyro.attitude and Input.gyro.userAcceleration appear to be lagging (check attached video 'bug.mp4')
Reproduced with:
5.5.3p4, 5.6.1p1, 2017.1.0b6
Device under test:
Reproduced with:
Samsung SM G925F (Galaxy S6 Edge)*, OS:7.0, CPU:arm64-v8a, GPU:Mali-T760, Build:samsung/zeroltexx/zerolte:6.0.1/MMB29K/G925FXXU5DQA7:user/release-keys
Pixel 2
Not reproduced with:
Samsung SM G928F*, OS:7.0, CPU:arm64-v8a, GPU:Mali-T760, Build:samsung/zenltexx/zenlte:6.0.1/MMB29K/G928FXXS3BPIA:user/release-keys
Xiaomi Mi 4i*, OS:5.0.2, CPU:arm64-v8a, GPU:Adreno (TM) 405, Build:Xiaomi/ferrari/ferrari:5.0.2/LRX22G/V8.1.5.0.LXIMIDI:user/release-keys
Samsung SM G935F*, OS:7.0, CPU:arm64-v8a, GPU:Mali-T880, Build:samsung/hero2ltexx/hero2lte:6.0.1/MMB29K/G935FXXU1BPLB:user/release-keys
iPad Air (iOS8.1.1)
Not reproduced when Galaxy S6 Edge was with Android 6.0.1
This issue has been reported to google: https://issuetracker.google.com/u/1/issues/69360770
------------------------------------
Fixed in:2017.2.2p2, 2018.1.0b10, 2018.2.0a1
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Inspector's custom tooltip is displayed incorrectly when the name is truncated in UI toolkit
- Crash on ScriptableRenderLoopDraw when rendering a specific VFX in Play Mode
- The script is not renamed in the Project window when renaming and a compilation Error is present
- Average FPS in Play Mode degradation on a newly created BiRP project when it's upgraded from 2020.3.48f1 to a newer Editor version
- DecoratorDrawer indentation is incorrect when it is called with EditorGUI
roppi2
Oct 16, 2017 11:15
Note @NODRAP's comment: despite the slow updating, I also had wrong (super tiny) gyroscope values on my Galaxy S6 Edge. I did a reboot as described by NODRAP and after that the gyroscope values were correct, even though the slow updating persisted.
roppi2
Oct 16, 2017 11:05
Getting only about 1-2 gyo.attitude updates per second with Unity 2017.1.1f1,Galaxy S6 Edge and Android 7.0.
makaka-org
Oct 05, 2017 23:02
Still here: 2017.1.1p4
Galaxy S6 Edge
Galaxy S8
James-DeCarlo
Sep 11, 2017 17:18
Ok after playing around with the gyro input for unity i have figured out the bottle neck for android the problem is that the gyroscope on android devices is based on radians per second not an angle like on IOS so if you are using Inupt.gyro.attitude for your rotation within your update method it gets real laggy because at that point the unity engine must do matrix math to account for this i believe which in most cases is a complexity of O(n^3). This will slow the game down considerably if you still want to use the gyroscope like me you need to use Input.gyro.rotationRate in your update methods and then apply that Vector3 to your transform.Rotate() method. Lag is gone doing this. in the start method you can call transform.localRotaion = Input.gyro.attitude * new Quaternion(0f,0f,1f,0f); after waiting for 2 seconds after setting the gyro.enabled to true. To calibrate the transform to the gyros position. Also in your resume method you will need to also need to calibrate the transform with attitude as you will be off when it resumes from a phone call for example. Still playing with it will post code to bitbucket and give you guys the link when i am done. Still playing around with it works for the most part but when i spin in the y axis the horizon in the z axis gets tilted from left to right or vice versa depending on if you are spinning clockwise or counter clockwise. Good luck all hope this helps some one else drove me crazy for a little while since it was working on IOS.
James-DeCarlo
Sep 11, 2017 07:53
Problem still exists in Unity 2017.1 and android Samsung Galaxy S6 works perfectly on IPhone. Any solutions to get the gyroscope working properly on Android. Is there a native plugin that will work properly for android devices that unity can release for free that works on all android devices this would be a good way to ease the suffering until the fix is made to the engine.
MFKJ
Aug 16, 2017 12:05
I have also very leggy movement of gyroscope in
Mobile: Samsung Galaxy S6
OS: Andriod 7.0
Unity: 5.2.1
Please let me know when will you resolve this issue.?
_mdbnet_
Jul 20, 2017 23:30
I am seeing this issue as well, on Galaxy S6 phones, and on Unity 5.6.2f1.
Alexander-Seeck
Jul 17, 2017 08:33
This is also reproducible on Unity 5.6.2f1
Nodrap
Jun 29, 2017 15:43
Hit this exact issue on an upgrade to 7 too. The gyro values can slow to really tiny changes but this was corrected with a reboot of the S6. It then returned to the slow updating but the values were at least correct orientation values. The rate is only 2-3 updates per second. Also the Input.gyro.updateInterval value returned is 2e+10 when set to 0.02f. I tried forcing it every frame but this still didn't fix anything. The oddly large reporting update interval was also present on an LG G3 where the gyro tracking works fine so doesn't seem related to the S6 specific issue. An external tester has also said their S5 refused to track the phones motion too but I don't have such a device with which to track.
andyz
Jun 19, 2017 16:08
This badly affects both S6 & S6 Edge it seems (popular phones!).
Also the gyro input is far from good on other phones (S7) compared to what you can get from Google's VR (GVR plugin) code with native plugin for gyro tracking