Blueprinting/Axis Mapping Rotation Rate: Android/Samsung S8 issue?

Greetings everyone!

I’ve run across an odd issue when using Rotation Rate Event node in blueprints(BP) or setting an axis mapping to Rotation Rate, in a deployed android app, on a Samsung S8. I do not remember this occurring on an IPhone 6s with engine version 4.8-10, but it has been about a year since.

The issue seems to be that the rotation rate regularly returns all 0’s every third of a second or so. The 0’ed rotation rate makes a rather noticeable hitching/stutter effect when the phone is rotated.

The first method I used to capture rotation rate was through axis mapping Turn to Rotation Rate in Project Settings -> Engine -> Input -> Axis Mappings.

The second method I used to capture rotation rate was through BPs. I made a simple BP addition to the FPS BP template. The BP flow follows like this:

[Event Rotation Rate:Axis Value] -> [Break Vector(Axis Value):X] -> [Add Controller Yaw Input(X)]

In both cases, the stutter in rotation rate was present. The stutter only occurred when the app was played on the S8. It did not occur when using a remote control app (Mustafa’s Remote Control) to relay motion data in an editor play window.

I noticed the issue might stem from motion data returning 0’s. After making a BP that captured the rotation rate data, split the vector, made checks to see if all three (x,y,and z) floats were equal to 0, and then printing the values out in different colors, an oddity appeared. I noticed that every third of a second or so, and for a period of about a third of a second, rotation rate would be all 0’s for all axes. Even when greatly moving the phone, all 0 vectors would occur very frequently when the app was played on my phone. In contrast, when having motion data relayed from my phone to an editor play window, the phone had to be placed on a table to yield only a few all 0 vectors.

Am I going about this wrong, or is this an engine/phone issue? I have not tried this in C++ yet or an older engine version.

Any help on the issue would be greatly appreciated, thank you!

With some further testing it seems this issue persists even when c++ is used. I’ve gone and started a bug on this (Blueprints/C++: RotationRate as Input on Android Stuttering - Blueprint - Epic Developer Community Forums).

Hello ,

I got your bug submission, replying here for visibility.

I was unable to reproduce this on a Nexus 5. (Smooth motion, I recreated the BP to check for 0, 0, 0 data and very rarely saw that to evaluate as true)

Is rotation rate the only Motion input you have active in your test project? (I saw a bit of weirdness when trying to use “Tilt”)

Anyone with an S8 seeing this as well?

Hey there! Thank you for taking the time to reply here.

My plan was to have HMD style input, this provides the rapid response I am looking for in an FPS, and it is most similar to mouse movement. I have tried tilt, but it doesn’t have the feel I am looking for. Aside from the feel, it also will take a little bit of trig magic to fix the tilt so that it stays with the orientation of the device rather than the absolute orientation to the earth. I think I explained that right… Hah.

I’ve tried acceleration, gravity, and tilt also. None of these reproduce the issue. It only occurs with rotationrate. This does seem odd, as I believe rotation rate is derived from gravity and acceleration and some basic trig functions, though I could be wrong.

Interestingly, back when 4.10 was around, I made an even more developed version of this basic gameplay concept for an IPhone 6s. Initially, it too had a strange hitch/stutter, but it seemed to have resolved itself over time. I believe it was related to shaders being compiled(?). This was over a year ago, so I could be partially wrong. Unfortunately, I did not save the project. :frowning: (This is why you should use version control kids.)

Another striking thing I noticed is that when this was done on my IPhone, there was a significant amount of jitter. This required a little bit of elaborate float point math, called every frame for smoothing, but this didn’t seem to affect the performance of the game play. I bring this particular point up because I wondered if the 0 vectors come from a computational issue. In contrast to the IPhone’s jitter, there is none-whatsoever in the S8. I’m not sure if this is because there is a motion pre-processor, if the engine got “smarter”, or if it simply is a more accurate sensor that removes noise.

I’ve use the show engine and other various console commands and nothing seemed to get anywhere close to unreasonable. I believe the video I provided also showed frame rate with some added movement to try and distinguish the stutter not being connected to a graphical issue.

On the code side of things, I did do some digging into the engine source. Though I understand a bit of C++, I never really found how/where it calls the API’s to gather the motion data, or the math it probably performs to produce the processed motion data in the engine. I did notice that there seems to be a rather simple for loop that runs through what seems to be an array of motion input structs, which seems to have it’s members initialized to the four motion values, gravity, acceleration, rotationrate, and tilt. Perhaps the API can’t pull data fast enough to initialize the motion input struct, or maybe it’s a threading issue for event queues (if they’re used?).

If this helps, the S8 isn’t my primary phone and was purchased solely for unreal development. I don’t have too many limitations on what I can do in regards to testing. I may have access to a pixel 2, though I am not sure.

Thanks for the help so far.

As a side though on the coding avenue, could the priority of input events be low enough so that other events over run it for a few cycles before input is processed again? The colored debug messages do seem to form a semi-consistent pattern. Lot’s of red in a solid block, two or so smaller blocks, then a singlish small block then it repeats. Perhaps the most consistent of the pattern is that there always seems to be a large block followed by separated smaller ones.

Hey everyone, wanted to give quick update.

After starting fresh from source, it seems this issue is still present. I have not had the opportunity to have access to a Pixel 2 yet, unfortunately.

, have you or anyone on the team had a chance to test this on any other devices?

Thank you for the help and work so far!

Wanted to check in and see if anyone has experienced this also. Would be super if anyone could provide some input or assitance.

I’ve tried many of the previous attempts on another computer and still no luck.

Thanks for the help.

Greetings everyone, so far this issue remains unsolved and, I have come to a standstill development wise. This particular part of the proof of concept demo is pretty important to the playstyle and concept of the game.

I, unfortunately, have not had the opportunity to try this on other devices.

Would anyone else be willing to assist in this issue?

Hey , Found a bit more of a solid repro: In a project with GoogleVR enabled, if “stereo off” is called on begin play, stuttering (mostly 0’s returned) begins.

Hummm! This is most interesting. I’ll try and play around with that in particular to see if that causing the issues I’ve been having.

Thank you very, very, much for taking the time to track this down.

Greetings again !

I’ve had some time to sit down and play with this some more. As a side note, a usable Pixel 2 still eludes me.

When I looked through the settings of the project, it seems most, if not all VR related items were already turned off. Checking the BPs of the FPS template project also does not yield too many suspect nodes. I did try a couple things:

  • Removed all references to AR/VR/HMD in the BP’s, though none seemed to have references the one specifically mentioned, unless I missed it
  • Turned off all AR/VR/HMD related settings I could find, even removing the entries for Daydream and Cardboard in the GoogleVR config support section
  • Turned on all AR/VR/HMD related settings, including downloading the drivers and support apps associated (Oculus, etc.)
  • Fully reset phone again, for good measure

In all these cases, the stutter was still present.

Because of the nature of the game I was/am developing, it’s difficult to move forward with the stuttering. As a result of this, the phone, for nearly the entire course of this issue, has remained mostly a fancy desk paper-weight (Used to weigh down a travel HDD a couple times so it wouldn’t fall off desk when plugged in, hah!). In-light of this, I would be perfectly willing to send the device to Epic’s engine support team, if they do not have one available or want to specifically experiment. Seeing as the Samsung S8 is a popular flagship phone, more developers may be experience this issue–though this remains a theory as there seems to be few people posting here–and I would be happy to do this.

I hope this helps and thanks for the effort so far!

Hello again everyone.

I’ve had a chance to try the basic template FPS, with rotation rate as turn input, on a Galaxy S9+ (Unlocked). The issue was very present and much worse. Interestingly, the issue was so bad that at first I thought the motion input was not compatible, was not turned on, or had an error. Only after rotating the phone quite quickly did the screen jump (No smoothness at all). It would seem that practically all vectors returned on a Samsun Galaxy S9+ are zero vectors, and rotation rate is unusable.

I am going to again try and find someone with a Pixel 1/2 to see if the Samsung VR stuff is the issue or if there is an issue with the Galaxy itself.

I am not sure how to go about the issue of Google’s VR services being a possible cause, as these apps can’t normally be uninstalled/disabled. With that said, I don’t suppose many prospective users would have the same patience as gamers 25 years ago, in that getting the game to run or run properly was the first boss fight. :slight_smile:

Thanks for all the help so far.

I’ve had some time to try the previous template game mentioned on various other phones now. Here are the results:

Pixel C (Special Internal Version): I can’t give many details on the specifics of the device. The motion was smooth but the stutter was less of a hitch and more of a very short pause. These pauses were at static intervals. Overall it seemed, anecdotally, that it performed a little better than the S8. I will likely not have access this device again or for a long period of time.

Xiaomi Redmi Note 4: Unlocked, ATT, Android 7.0. Very consistent stutter but more frequent and at very consistent intervals.

Google Pixel 2: Unlocked, ATT, Android 8.1. Almost no stutter at all. Only present when moving quickly. very consistent intervals. This phone seemed to run the game the best in regards to the stutter issue.

Success! It would seem in 4.20, this is no longer an issue! Wo0t!

Thank you so much for all the help and the rest of the engine team for their efforts.

Glad to hear it! Thank you for your persistence! :slight_smile: