Dolphin, the GameCube and Wii emulator - Forums

Full Version: REQUEST - Use X1nput instead of Xinput
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

SaladCesar

Hi,

I would like to make a suggestion for Dolphin.

I began to search how I could use Dolphin to use the trigger rumble of my Xbox Controller (Xbox Controllers have 4 rumble motors. 2 in each handle, 2 in each triggers). I searched a lot and even asked on reddit : https://www.reddit.com/r/DolphinEmulator...ors_of_my/

But I didn't find how to do that. Finally, I found this information :
https://www.pcgamingwiki.com/wiki/Contro..._Vibration

" The impulse triggers of the controller are two independent rumble motors located within each of the triggers, allowing developers to selectively vibrate the trigger when the player is performing an action that warrants such a feedback, such as firing a gun or charging an attack.
The XInput API does not expose this functionality. Games making use of the rumble motors uses the Windows.Gaming.Input API instead.
The third-party DLL injection-based tool X1nput can be used to convert the normal vibrations of a game to impulse trigger vibration in many single player games."

OK, so I went to try X1nput : https://github.com/araghon007/X1nput

I followed the instructions on the website, and after using Process Explorer I am sure that Dolphin uses XInput1_4.dll x64. By default, it uses the one in System32. I wanted to try replacing it by X1nput.

But when trying to put it in Dolphin's folder, this happens :
[Image: kkSFptX.png]

It looks like the controller appears as disconnected when using X1nput instead of Xinput.
I think that Dolphin is simply not compatible with X1nput.

My request is :
Could it be possible for Dolphin to use X1nput instead of Xinput in the future builds ? It looks like I can't do that by myself and it would be better for everyone to use X1nput. Better control for Xbox controllers.

Thanks in advance for any answer, have a good day
We are currently looking into Windows XInput replacement, Windows.Gaming.Input (yes, really, it's called that). That exposes the dual motors, as well as a lot more functionality like 8 simultaneous controllers.

SaladCesar

(03-09-2021, 07:47 PM)MayImilae Wrote: [ -> ]We are currently looking into Windows XInput replacement, Windows.Gaming.Input (yes, really, it's called that). That exposes the dual motors, as well as a lot more functionality like 8 simultaneous controllers.

That's wonderful ! Is there a way I could try that, if a nightly build had been released with windows.gaming.input ?
I would be happy to help with testing if needed.
It's a bit outdated, but you can download an experimental build with that feature here. Scroll down to the bottom, then, on the box where it says "all checks passed", click on the "details" link from pr-win-x64, that will direct you to our buildbot where you can download the build...

SaladCesar

(03-10-2021, 08:37 AM)mbc07 Wrote: [ -> ]It's a bit outdated, but you can download an experimental build with that feature here. Scroll down to the bottom, then, on the box where it says "all checks passed", click on the "details" link from pr-win-x64, that will direct you to our buildbot where you can download the build...

Thanks, I just downloaded the dev build.

But in the Vibration settings, I only have the motors R and L appearing like on the master release :
[Image: SUyJ784.png]

Is there a way I could add the trigger motors ? Maybe they don't appear in the choice but can be used in the form below. But I don't know how they are called. Motor TR and Motor TL ? Do you have infos on that ?

Thanks in advance for any answer and have a great day

EDIT : I found how to use the trigger rumble, I just had to select WGInput in the drop down menu. So it works ! I have access to the trigger rumble ! Thanks a lot for your help.

But I would have a little question :

Is there a way I could use sin() and cos() functions to modulate rumbles in amplitude ? Is there a time variable that can be used ?


[Image: 0kSPW9O.png]



My dream would be to be able to modulate the rumbles, using functions with a time variable. Is that possible ?

filoppi

(03-10-2021, 08:17 PM)SaladCesar Wrote: [ -> ]Thanks, I just downloaded the dev build.

But in the Vibration settings, I only have the motors R and L appearing like on the master release :
[Image: SUyJ784.png]

Is there a way I could add the trigger motors ? Maybe they don't appear in the choice but can be used in the form below. But I don't know how they are called. Motor TR and Motor TL ? Do you have infos on that ?

Thanks in advance for any answer and have a great day

EDIT : I found how to use the trigger rumble, I just had to select WGInput in the drop down menu. So it works ! I have access to the trigger rumble ! Thanks a lot for your help.

But I would have a little question :

Is there a way I could use sin() and cos() functions to modulate rumbles in amplitude ? Is there a time variable that can be used ?


[Image: 0kSPW9O.png]



My dream would be to be able to modulate the rumbles, using functions with a time variable. Is that possible ?

No you can not dynamically modify the output (rumble) value, you can only linearly scale it with the range setting. You cannot use functions in outputs as of now.
Also the syntax would have to be "sin(`Motor R`)", not the one you wrote.
That said, that wouldn't be hard to implement, but it's such a specific thing to ask, that no one probably event thought about it.

Edit: if you actually want the sin to be driven by time, that is not possibly and probably will never be, as time based functions aren't available in outputs.

SaladCesar

(03-10-2021, 10:37 PM)filoppi Wrote: [ -> ]No you can not dynamically modify the output (rumble) value, you can only linearly scale it with the range setting. You cannot use functions in outputs as of now.
Also the syntax would have to be "sin(`Motor R`)", not the one you wrote.
That said, that wouldn't be hard to implement, but it's such a specific thing to ask, that no one probably event thought about it.

Edit: if you actually want the sin to be driven by time, that is not possibly and probably will never be, as time based functions aren't available in outputs.

Ok I understand. Thanks. I think I should give up on sin and cos functions then.
What do you mean by "the range setting" ? How could I use that ?

filoppi

(03-11-2021, 01:51 AM)SaladCesar Wrote: [ -> ]Ok I understand. Thanks. I think I should give up on sin and cos functions then.
What do you mean by "the range setting" ? How could I use that ?

It's the slider on top top of the window, it's defaulted to 100.
You can reference outputs within other input expressions.
This is currently the only way to make use of functions to set your rumble strength.

First reference a variable within your "Motor" output mapping to acquire the value set by the game:
[Image: csU25ga.png]
Then you can hijack any input mapping to make use of that variable:
[Image: iexib9D.png]

Note the entire expression must be on one line for it to save properly.
Note the use of the comma operator. `Click 1` is my normal mapping for this input.

I am aware of how hacky this is, but it's as good as you get currently.
There are some plans to make this better in the future.