Simultaneous Physical and Network input

Need help? Ask here and someone will help
Post Reply
sourander
Posts: 6
Joined: Mon Feb 03, 2020 7:44 am

Simultaneous Physical and Network input

Post by sourander »

Hello,

I've been practicing with GIMX + Ubuntu 18.04 + Dualshock 4 v2 + Playstation 4 Pro. I've had some fun time logging button presses and such - just for learning new stuff (by piping the stdout of gimx to Python subprocess)

I'd also love to be able to send controls to the controller using Python. I've managed to do this following the gimx network client (client.py) example, but more question is:

Can I somehow launch gimx so that it will take input from BOTH physical device (the Dualshock 4 itself) AND from network?

I've tried launching it with either the GUI or with CLI using command such as: gimx -c DualShock4.xml -nograb -t DS4 --src 127.0.0.1:51914. But so far I have only managed to get either physical input or network input working. Never both.
User avatar
Matlo
Posts: 5768
Joined: Wed Jul 06, 2011 7:01 am
Location: France
Contact:

Re: Simultaneous Physical and Network input

Post by Matlo »

Hello,

Please explain the use case.
GIMX creator
sourander
Posts: 6
Joined: Mon Feb 03, 2020 7:44 am

Re: Simultaneous Physical and Network input

Post by sourander »

Use case?

So, if I launch it from the Gimx-launcher (GUI), there is an option to choose input as "Network". It asks me to press "PS" button on my controller. If I create a script that presses the PS button, it works just fine, but the physical controller doesn't get passed through. So I can use that no more.

On the other hand, if I launch it with cli with: "gimx -c Dualshock4.xml -p /dev/ttyUSB0 --status --nograb --force-updates --subpos -t DS4 --src 127.0.0.1:51914", it outputs everything to console but nothing goes to the controller.

I'd like to mix these worlds. Use controller. And also do input using Python programming.
User avatar
Matlo
Posts: 5768
Joined: Wed Jul 06, 2011 7:01 am
Location: France
Contact:

Re: Simultaneous Physical and Network input

Post by Matlo »

Describing a use case is more like "I want to have device and network inputs at the same time to have the possibility to [do somehing in Python] while [doing another thing with the Dualshock 4]".
GIMX creator
sourander
Posts: 6
Joined: Mon Feb 03, 2020 7:44 am

Re: Simultaneous Physical and Network input

Post by sourander »

Oh, sorry, I misunderstood.

The only useful idea so far is "AFK loop" that could be started and stopped by pushing a keyboard key, so that one does not get logged out of the game while being e.g. in kitchen. Currently, people use rubberband over L3 or just run back to Dualshock controller every 5 minutes or so.

Another semi-useful script would be "go over menus and switch settings [X,Y,Z...] to values [x,y,z...]"

If I'd be also to fetch data from physical controller and use that for generating output, then I can imagine a lot of cool stuff. One idea would be rapid fire function for games that try to kill your hand muscles. Another would be teaching a tensorflow model using reinforcement learning to play some simple game (using capture card data.)

To summarize, I don't have any specific ideas. I'm just curious if GIMX allows me to do this so that I could practice on my Python skills.
User avatar
Matlo
Posts: 5768
Joined: Wed Jul 06, 2011 7:01 am
Location: France
Contact:

Re: Simultaneous Physical and Network input

Post by Matlo »

Scripting is currently supported by the macro feature (which has some limitations).

I'll see if I can make it work, but it won't be a priority if it turns out to be complex.
GIMX creator
sourander
Posts: 6
Joined: Mon Feb 03, 2020 7:44 am

Re: Simultaneous Physical and Network input

Post by sourander »

Awesome, thank you!
User avatar
Matlo
Posts: 5768
Joined: Wed Jul 06, 2011 7:01 am
Location: France
Contact:

Re: Simultaneous Physical and Network input

Post by Matlo »

I realized that it actually works, the --src argument has to be placed before the -p one:

Code: Select all

gimx -c Dualshock4.xml --src 127.0.0.1:51914 -p /dev/ttyUSB0 --status --nograb --force-updates --subpos
GIMX creator
Post Reply