sc-controller icon indicating copy to clipboard operation
sc-controller copied to clipboard

sc-controller not passing gyro info to yuzu emulator

Open octoshrimpy opened this issue 4 years ago • 12 comments

All mappings work correctly, the menu is fantastic (no longer need to bring up steam for these things!), however no gyro is being passed from the steam controller to yuzu. The hardware works since I can use it for mouse control, and yuzu does detect the UDP server and receives data correctly. however when attaching a device to motion, it requires a shake and that data isn't getting passed, I guess?

image the button labeled as "shake!" sits at "[not set]", clicking it brings up the shake text that lasts a few seconds, and after that it goes back, regardless of motion on the controller.

I know that https://github.com/FrogTheFrog/steam-gyro-for-cemuhook exists, but it is no longer under development as the owner no longer has a steam controller. see here.

frogthefrog did add a PR into yuzu for fixing the fact the shake values are higher than shat steam controller outputs, but with his cemuhook app, it never sent any input to the emu, rendering the controller useless until the daemon was stopped, and so I'm unsure if that will be helpful or not, since I don't know much about the topics.

octoshrimpy avatar Jul 25 '21 07:07 octoshrimpy

Set the log filters to *:Debug and perform a few motion mapping tries. Upload the log file afterwards. I would like to see if data is sended

german77 avatar Jul 25 '21 19:07 german77

How do I set log filters? do I have to run it from terminal? where is the log file? there is no reference to this in the readme or wiki that I've found. I've enabled Input Test Mode in settings, but it doesn't show gyro when the controller is moved, although it does display every other input. for reference I've installed it from AUR, 0.4.8.5-1

octoshrimpy avatar Jul 25 '21 21:07 octoshrimpy

Are you on discord? I'm able to explain better there

german77 avatar Jul 25 '21 23:07 german77

I'm having the same issue using an old DS4 controller

Edit: v1993/evdevhook works, maybe taking a look at how they do things could help

Tachi107 avatar Jul 28 '21 21:07 Tachi107

Looking at the Yuzu logs here, it seems like sc-controller is providing some very wrong readings:

[ 103.945265] Input <Debug> input_common/udp/client.cpp:UpdateYuzuSettings:337: UDP Controller 0: gyro=(0.39711976, 0.07159893, -0.23690248), accel=(0, -0, 0)
[ 103.957269] Input <Debug> input_common/udp/client.cpp:UpdateYuzuSettings:337: UDP Controller 0: gyro=(0.39711976, 0.07159893, -0.23690248), accel=(0, -0, 0)
[ 103.965261] Input <Debug> input_common/udp/client.cpp:UpdateYuzuSettings:337: UDP Controller 0: gyro=(0.23181622, 0.18584423, -0.28130946), accel=(0, -0, 0)
[ 103.973261] Input <Debug> input_common/udp/client.cpp:UpdateYuzuSettings:337: UDP Controller 0: gyro=(0.23181622, 0.18584423, -0.28130946), accel=(0, -0, 0)
[ 103.981305] Input <Debug> input_common/udp/client.cpp:UpdateYuzuSettings:337: UDP Controller 0: gyro=(0.23181622, 0.18584423, -0.28130946), accel=(0, -0, 0)
[ 103.993307] Input <Debug> input_common/udp/client.cpp:UpdateYuzuSettings:337: UDP Controller 0: gyro=(0.12754783, 0.15865228, 0.044406988), accel=(0, -0, 0)
[ 104.001281] Input <Debug> input_common/udp/client.cpp:UpdateYuzuSettings:337: UDP Controller 0: gyro=(0.12754783, 0.15865228, 0.044406988), accel=(0, -0, 0)

According to the spec, gyro should be in degrees per second, which this absolutely does not look like (the readings are from me shaking the controller violently).

K900 avatar Aug 02 '21 18:08 K900

Actually, looks like these values are somehow scaled by Yuzu already before being logged: https://github.com/yuzu-emu/yuzu/blob/5edc96f4a47bff64cfd97f0c91e42b56ab58b2d7/src/input_common/udp/client.cpp#L285

K900 avatar Aug 02 '21 21:08 K900

I think this is related to sc-controller not handling accelerometer data. Yuzu might be requiring acceleration info for selecting the active gyro provider. See attached screenshots

sc-controller: sc-controller

steam-gyro-for-cemuhook (working): steam-gyro

athdesk avatar Aug 14 '21 14:08 athdesk

Yuzu can work with just one sensor. The giro might not trigger the minimum threshold of 5.0 in any direction. If this is true let me know to lower the trigger value.

german77 avatar Aug 15 '21 13:08 german77

I've noticed that I am not using this codebase, but instead a fork. https://aur.archlinux.org/packages/sc-controller/

https://github.com/Ryochan7/sc-controller/

octoshrimpy avatar Aug 16 '21 18:08 octoshrimpy

@german77 how would you have me check those values? I'd like to get this working for me and everyone else, and am willing to be guinea pig for code and testing builds for both scc and yuzu forks.

octoshrimpy avatar Aug 16 '21 19:08 octoshrimpy

Modify the source and find the correct value. Right now it's at 5. Try with 3 or 2. From the logs posted above the data is fine is just a mapping issue

https://github.com/yuzu-emu/yuzu/blob/5edc96f4a47bff64cfd97f0c91e42b56ab58b2d7/src/input_common/udp/client.cpp#L346

german77 avatar Aug 20 '21 00:08 german77

Got a test branch up with some changes for CemuHook. SC Controller was not grabbing the accel data from the input report. Just to note, the BT driver was not changed so a Bluetooth connection with the Steam Controller still does not pull the accel data. Make sure to use a USB or SC Dongle connection.

https://github.com/Ryochan7/sc-controller/tree/cemuhook_test_changes

Ryochan7 avatar Aug 20 '21 05:08 Ryochan7