Valkirie / HandheldCompanion

ControllerService
Other
1.16k stars 90 forks source link

OneXplayer Mini i7 Support (Horizontal Is Vertical, Vertical Is Horizontal) #150

Closed jeongseang closed 2 years ago

jeongseang commented 2 years ago

I am having an issue where the gyroscopic controls are reversed. Rotating the device horizontally will lead to vertical camera movements and rotating the device vertically will lead to horizontal camera movements. The overlay also shows this to be the case. I'm not sure if this is a software issue with Handheld Companion or a hardware issue with my OnexPlayer Mini i7-1260p.

CasperH2O commented 2 years ago

Can you confirm, are you using the internal IMU or the USB IMU?

jeongseang commented 2 years ago

Internal, it's the Bosch Accelerometer according to Device Manager.

CasperH2O commented 2 years ago

Ok. Was it OK with version 0.9.8.0?

jeongseang commented 2 years ago

I tried 0.9.8.0 and the latest version 0.9.9.0 and both of them have this issue for me.

jeongseang commented 2 years ago

Have not tried older versions.

CasperH2O commented 2 years ago

Please try, it will narrow down the search much quicker.

jeongseang commented 2 years ago

Tried on 0.9.5.1, same issue.

CasperH2O commented 2 years ago

Ok. Thank you for double checking, I think I know what the problem is. Can you share a picture of the applications About page?

jeongseang commented 2 years ago

Screenshot (1)

jeongseang commented 2 years ago

Do you think it's a software issue or could it be a case of the unit itself having implemented the accelerometer/gyroscope in a defective way?

CasperH2O commented 2 years ago

Nope, the answer is much simpler, we don't have a configuration yet for this model's IMU mounting. You are the first!

jeongseang commented 2 years ago

Ooh gotcha I see. Well I'd be more than happy to offer any information that could help out on this front. Appreciate the aid and prompt responses. 👍

CasperH2O commented 2 years ago

Great, I have a test build with more logging and a simple movement test will create a logfile from which I can figure out the required changes. Will get back to you.

jeongseang commented 2 years ago

Sounds good, thanks.

CasperH2O commented 2 years ago

Ok @jeongseang , hereby a test build (slightly older, that's intentional).

Download from here: https://github.com/Valkirie/ControllerService/releases/download/bin-rc-0.9.7.0/Handheld.Companion-Release-0.9.7.0-OneXIntelTest.exe

Test steps:

Install the debug .exe Start HC GUI Stop service Delete ControllerService log of today from: C:\Program Files\Handheld Companion\logs Lay device flat on it's back (screen facing upward) Start service Pick up device, screen facing user Rotate left in a steering motion (roll axis) Rotate right in a steering motion (roll axis) Tilt device away, top of device away from user (pitch axis) Tilt device towards, top of device towards user (pitch axis) Rotate device around yaw axis left Rotate device around yaw axis right Place device back on table Stop service make a copy of the log ControllerService log file and share it with your friendly neighborhood HC developer 🙂

In case something goes wrong, no worries, be sure to stop the service, delete the log file, start the service and try again.

Roll pitch yaw visualization:

image

jeongseang commented 2 years ago

ControllerService20220531.log

Hope this worked!

CasperH2O commented 2 years ago

Log looks decent, will investigate later in detail:

image

Also good news, this device is uniquely identifiable:

2022-05-31 14:38:52.951 -07:00 [WRN] ONE XPLAYER from ONE-NETBOOK TECHNOLOGY CO., LTD. is not yet supported. The behavior of the application will be unpredictable.

jeongseang commented 2 years ago

Would you happen to have a rough estimate on when the fix can be implemented and released?

CasperH2O commented 2 years ago

From initial comparison, it seems this sensor is mounted at a 90 degree angle, which means we'd have to swap some axis instead of just inverting them. The current code for automagically detecting and changing the mounting does not support that yet, so that could be a while.

However, it shouldn't be too much work to make this change hardcoded and put an installable on the release page specifically for the OneXPlayer Mini Intel. I can have a look this evening, we might have to iterate once or twice though.

jeongseang commented 2 years ago

Sounds good, much appreciated. Let me know if I can provide any additional information to help with iterations.

CasperH2O commented 2 years ago

The differences from "default" are:

Angular velocity Z should become X Y is the same X should become Z

Acceleration X inverted Z inverted

Default:

image

One X Mini intel

image

jeongseang commented 2 years ago

Ah I see, interesting choice for OnexPlayer to mount the gyro differently for this specific version of the device.

CasperH2O commented 2 years ago

Well, could simply be due to the different motherboard layout, it's a different processor, space constrains etc. The "default" is actually based on the Ayaneo, but there's really no wrong or right. If you really really wanted to you could change your IMU firmware settings with a manufacturer software tool.

I'll prepare that hardcoded version for you now.

jeongseang commented 2 years ago

Yeah I'll look into that option. In the meantime, thr e hardcoded version is much appreciated.

CasperH2O commented 2 years ago

I don't recommend you tweak your sensor that way.

Please try this version: https://github.com/Valkirie/ControllerService/releases/download/bin-rc-0.9.9.0/Handheld.Companion-Release-0.9.9.0-OnexPlayer-Mini-i7-1260p.exe

If it's good, happy gaming, if not, I will prepare another debug version with extra logging.

jeongseang commented 2 years ago

It works! I did have to invert some of the axis and that still interprets vertical as horizontal and vice versa, but with the right boxes ticked, it finally works as it should. Really appreciate it!

CasperH2O commented 2 years ago

@jeongseang with the help from a fellow OneXPlayer Mini Intel Gundam Edition owner we improved the IMU mounting some more. This build is made with thanks to @romracer. Included with the latest release here: https://github.com/Valkirie/ControllerService/releases/tag/bin-rc-0.9.10.4

Valkirie commented 2 years ago

Fixed on next build