Dolphin, the GameCube and Wii emulator - Forums

Full Version: GC Controller Inputs via named pipes
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I recently saw that as of dolphin revision 4.0-8065, dolphin supports receiving gamecube controller inputs via named pipes. I looked around but could not find any documentation for how one would achieve this.

I then browsed through the code which was helpful and tried this
1) created a dir in /usr/share/dolphin-emu/sys/ with the name "Pipes"
2) created a named pipe called "pipe' in this directory.

then, to test whether the pipe had worked, I started up dolphin, set the controller settings to "Standard Controller" for both port 1 and 2 (the others were at "none") and plugged my controller into the adapter in slot 1. I started up the game (In this case super smash brothers melee for the nintendo gamecube) and did:
Code:
sudo su
echo 'a' > pipe

nothing happened. the a button was not pressed.


If anyone has any knowlodge on named pipes for controlling dolphin, that would be helpful.

tl:dr How do I send GC controller inputs to Dolphin via named pipes?
also, if anyone could contact spxtr, the creator of this feature, that would be great. i don't know if he has an account on the forums. thanks all.
Not a developer here, but…

You don't have to (and imo, you simply shouldn't) create the Pipes directory in the global system directory; you could just create it in your local, user-specific .dolphin-emu (located at ~/.dolphin-emu normally).

So to create the pipe:
Code:
mkdir ~/.dolphin-emu/Pipes
cd ~/.dolphin-emu/Pipes
mkfifo pipe

According to comments left in the code by spxtr, valid commands are as follows:

Code:
// To create a piped controller input, create a named pipe in the
// Pipes directory and write commands out to it. Commands are separated
// by a newline character, with spaces separating command tokens.
// Command syntax is as follows, where curly brackets are one-of and square
// brackets are inclusive numeric ranges. Cases are sensitive. Numeric inputs
// are clamped to [0, 1] and otherwise invalid commands are discarded.
// {PRESS, RELEASE} {A, B, X, Y, Z, START, L, R, D_UP, D_DOWN, D_LEFT, D_RIGHT}
// SET {L, R} [0, 1]
// SET {MAIN, C} [0, 1] [0, 1]

So for example, you would do echo "PRESS X" > pipe to press the X button, "RELEASE X" to release it. Your syntax was incorrect, which is why Dolphin ignored your commands.

Also, merely creating the pipe is not enough: you have to go in the Controllers settings, and configure them to use the Pipe device as the controller device. Make sure to check Background Input or Dolphin won't take input from the pipe unless it is focused.
By the way, the pipe can be named anything you like, not just pipe.
thanks for all your help. this looks promising.
alright, it's almost working. I found the pipe, selected it, and tried to send commands to it. Unfortunantly dolphin does not recieve inputs. Background input is true, and I have tried various deviations from echo "PRESS START" > pipe but to no avail. I tried cat pipe then entered my command in a different terminal and cat displayed it properly, so it should be working??
That's weird. Did you also configure the button mappings?
(12-05-2015, 09:31 AM)IR_ Wrote: [ -> ]also, if anyone could contact spxtr, the creator of this feature, that would be great. i don't know if he has an account on the forums. thanks all.

He is on IRC very often: #dolphin-dev @freenode
(12-08-2015, 06:41 PM)leolam Wrote: [ -> ]That's weird. Did you also configure the button mappings?

no, i didn't configure them. I pressed 'clear' before setting device to Pipe/0/pipe

spxtr

You need to configure them like a regular controller, by sending "PRESS A" after pressing the A button button, and so on. It's a pain, I know, but you only have to do it once. Might be worth making a default config for these.
Pages: 1 2