Download

[Gear VR] Bluetooth Controller Issues (for Mobile VR Jam)

Heya VR Peeps.

I’ve been working away on my Mobile VR Jam entry Circumpaint and I’ve run into an issue with using bluetooth controllers and the Gear VR. It looks like there are a number of controls that are not mapped in UE4. To test this out, I’ve created a new UE4 game that allows me to try out each of the controls and show which ones work. Here is the game working under Windows with a Xbox controller (the baseline):

b39e1fdb49da8e72c163b43c92fc83b09e0e7c3d.png

Everything in green means that I was able to trigger it using the controller. Items in red means that I was not able to trigger it. For the Xbox controller, everything is working as expected.

Now here is the Samsung EI-GP20 controller:

bad8f3c84ed82b4cd5c088ec01c856730943c72e.png

As you may see, the Sumsung EI-GP20 controller is missing the D-Pad and the Right Thumbstick. This controller doesn’t have trigger buttons so them not showing up is expected. I’m also surprised that the thumbstick actions (left, right, etc.) are not mapped.

I also have a Red Samurai controller that I tested:

be0f6a05812703a6d5c77bcc41a8fd1cb6f4e01b.png

The Red Samurai controller has a working Right Thumbstick, but the D-Pad is also missing. Please note that both of these controllers work fine in Android games from the store.

Not having the D-Pad and Right Thumbstick working on the Samsung controller, and the D-Pad on a generic controller, is unfortunately crippling to my own Mobile VR Jam entry. I would expect that these would be required for anyone else that is also working on a Jam entry and making use of a controller.

Is there a patch available to fix these issues? I would gladly place it in my public 4.7.x branch so that everyone may have access to it.

Thanks!

  • Dave

The X/Y axis of both the left and right thumbsticks work (at least for my Moga Pro) so you can get that traditional first person control of Forward/Right on left stick and Turn on the right but I absolutely feel your pain in the control area. Currently I have my attack and block compensated to my “Shoulder” buttons but I would rather put them on my trigger axis. The D-Pad as well can function as 4 more buttons in case you have alot of actions (similar to what you are seeing alot nowadays with modern console games) but with the system not picking up all these buttons I find myself compensating rather then innovating which feels like a step back in terms of my development. As of right now my Face Button Left is the only “key” I have left for binding which I plan to use for some sort of inventory management and then that’s a wrap on my player input. Thankfully I currently have no idea how to put in mic support because even if I did I don’t have any buttons left for it.

@MrScratch:
The biggest issue from my OP is that the Samsung controller does not currently have a working Right Thumbstick, so even your control scheme would not work with it. I can only assume that the Mobile VR Jam judges will have access to the Samsung controller. I might be able to live without the D-Pad for the Jam, but the Right Thumbstick is a must.

  • Dave

I didn’t even realize the EI-GP20 you posted is the unofficial “official” controller for the unit since my headset didn’t come with one. I absolutely agree that this is an issue that needs to looked into relativity soon as it could have a significant impact on not only the Jam Judges but our playerbase as well.

Global signing’s already been enabled on the Jam now and I’m in the process of having early alpha multiplayer running relatively soon but with this news I am a bit worried that word of mouth is going to cause harm to my product if people using Samsung’s controller run into issues or getting dizzy (possibly increase simulation sickness) or losing balance and falling from being forced to physically turn their body.

Hey!

In looking through the Epic’s low priority on GearVR and VR in general makes me sad post I see that JJ Hoesing posted this comment in the beginning of March:

@JJ:
Would it be possible for you to release your controller patch for 4.7.x so that we may make use of it for the Jam?

Thanks!

  • Dave

Not having much success with the controller here either. It kinda works, yet the X axis is super choppy even when the frame rate is up and the head turning is smooth.

I used to have this issue as well and it stemmed from having a clash going on between my player’s “Use Controller Rotation Yaw” and “Orient Rotation To Movement” as my player toggles these guys on and off based on what he is doing. This is easily noticeable if you walk backwards or in random directions in the room that has your highest number of draw calls.

I don’t have any special toggling going on with the player controller, just default settings. What was the fix, in your case?

It depends on what type of player you have. If you have a setup just like the first person template then you want to make sure that your “Use Controller Rotation Yaw” is enabled and “Orient Rotation To Movement” is disabled. If you have a player that is like the third person template then you want to make sure its the opposite. You never want to have both of those options enabled at the same time so it wouldn’t hurt to double check it.

Hey All!

We’re now a week away from the end of the Mobile VRJam. Any chance of getting JJ’s patch for bluetooth controllers before the week is out?

Thanks!

  • Dave

Heya!

On Tuesday Epic is having a Mobile Development Twitch stream: https://forums.unrealengine.com/showthread.php?68202-Support-Stream-%E2%80%93-Mobile-Development-May-5th I’ve posted about these bluetooth controller issues in that thread to hopefully get some eyeballs on it.

Thanks!

  • Dave

+5000%

Help us, Obi-JJ Hoesing. You’re our only hope :slight_smile:

I saw this on reddit: Fixed Unreal Engine 4 GearVR Samsung EI-GP20 gamepad support

I’m reluctant to use it though, would prefer JJ’s solution, as it sounds like the one mentioned on reddit could bork other gamepads and there’s a chance the judges might be using something other than the ei-gp20. Also others failed to get it to work anyway. If anyone tries it and does get it to work then please post back your findings here and what codebase you are running off.

I’m currently running off David’s 4.7 fork (Thanks David!). Is that what everyone else is doing for the Jam? As far as I’m aware this is the best route due to anti-aliasing patch and virtual head model + plus a few other things. Have the patches he made from various sources made it in to master (soon to be 4.8) yet? Are there any benefits to moving to master instead for the final Jam submission? I probably won’t have time but I’m thinking positional audio could be pretty cool and I think master branch would potentially provide that. Anyone tried it successfully with Gear VR yet?

P.S. This is my entry by the way - The Curator’s Mini-Museum of Natural History. Doesn’t look like much in 2D but the 3D scans look pretty great in on the Gear VR. Still lots to do!

One of us, Bino, did try the master branch a couple of weeks ago and you can read his thread about it on the Oculus forum. In that thread, Brian Hook of Oculus stated that the upcoming integration with UE 4.8 will be for Windows and Xaudio2 only, not the GearVR. This was recently confirmed by Epic’s lead audio dev Aaron McLeran, when he explained the reason for it being PC only. At this time, the only way to get Oculus positional audio working on the GearVR in UE4 is by running it within FMOD Studio, the process for which is detailed in that thread on the Oculus forum and in the FMOD Support FAQ.

Hey All.

So we’re down to four days left in the Mobile VR Jam, and only two of those are week days. Having fully functional bluetooth controllers would really help, especially if there was already a patch available that just needed to be cleaned up. Please?

Thanks!

  • Dave

Sorry, I was off fighting fires in another area and missed this :frowning:

The quickest fix for the right stick at least is in AndroidInputInterface.cpp, replace



case AMOTION_EVENT_AXIS_Z:        NewControllerData[deviceId].RXAnalog =  axisValue; break;
case AMOTION_EVENT_AXIS_RZ:       NewControllerData[deviceId].RYAnalog = -axisValue; break;


With AMOTION_EVENT_AXIS_RX and _RY

And in LaunchAndroid.cpp replace:



AMOTION_EVENT_AXIS_Z,
AMOTION_EVENT_AXIS_RZ,


With _RX and _RY.

I haven’t looked into shoulder buttons, but it’s likely something very similar.

Hey JJ.

Thanks so much for getting back to us!

I’ve made those changes here and while it does get the Samsung EI-GP20 going, unfortunately it appears to break the Right Thumbstick of my generic controller (Red Samurai) that worked previously. We’ve swapped one non-functioning controller with the other.

Is there a solution that gets the Right Thumbstick working across all controllers?

Thanks!

  • Dave

Not an easy one, which is why I haven’t checked any of this in :frowning:

We need to go out to the Java layer and figure out the exact name of the controller and then map that to our native code controllers and figure out which mapping to use. It’s doable, but a bit ugly.

See this as a reference for the basics of what needs to happen:

https://chromium.googlesource.com/chromium/src/+/master/content/public/android/java/src/org/chromium/content/browser/input/GamepadMappings.java

Just wanted to say thanks to JJ. Thanks! Tested with Dave’s fork and working, although speed of rotation is pretty turbo!

Anyone know if the Oculus judges will have the default Samsung gamepads? Sounds like this patch might bork other pads and its within the realms of possibility that the judges might have Moga instead of the Samsung EI-GP20.

I’ll post over at Oculus and see if I can get any clarification. if I can’t I think I’m just going o go for it and hope for the best.

Funny really. Having the right stick makes testing much easier (especially when testing without the GearVR headset in developer mode). That said part of me thinks that keeping right thumb stick disabled forces end users to rotate in their chairs/in real space. Using the stick definitely breaks presence a bit - as one would expect.

You should be able to adjust rate of rotation, either on the player or pawn, can’t remember which. One thing we do is we only allow yaw control by default. Pitch doesn’t feel very good for most cases.

Thanks for the tip JJ. I was able to change the Base Turn rate on my player slow things down.