Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slippi Desktop #11

Open
ursi opened this issue Apr 21, 2021 · 4 comments
Open

Slippi Desktop #11

ursi opened this issue Apr 21, 2021 · 4 comments

Comments

@ursi
Copy link

ursi commented Apr 21, 2021

I have the following expression for the slippi dekstop app, but I can't get it to actually be able to play a replay. As far as I can tell, It needs to pass some flags to dolphin-emu in the directory you set. I symlinked slippi-playback do dolphin-emu in its own directory but no luck. Any ideas?

{ appimageTools, gsettings-desktop-schemas, gtk3 }:
  let version = "1.6.8"; in
  appimageTools.wrapType2
    { name = "slippi-desktop";

      src =
        builtins.fetchurl
          { url = "https://github.com/project-slippi/slippi-desktop-app/releases/download/v1.6.8/Slippi-Launcher-${version}-x86_64.AppImage";
            sha256 = "0phwiwhl0pzxw3hs4bmi1zfi8vq2agnaba9jfmznycvjvsh73wiy";
          };

      # magic I found at https://discourse.nixos.org/t/failure-appimage-run-with-gsetting/4403/2
      # to get the popups for selecting files to work
      profile =
        ''
        export LC_ALL=C.UTF-8
        export XDG_DATA_DIRS=${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name}:${gtk3}/share/gsettings-schemas/${gtk3.name}:$XDG_DATA_DIRS
        '';
    }
@djanatyn
Copy link
Owner

I'll take a look this afternoon - I haven't touched replays in a bit, but I bet we can get this working.

djanatyn added a commit that referenced this issue Apr 24, 2021
@djanatyn
Copy link
Owner

I have this code on a branch I'm testing, feature/ssbm-nix: 5e5bbeb

It looks like it's loading my configuration from "/home/djanatyn/.config/Slippi Desktop App/Settings":

[pid  5904] openat(AT_FDCWD, "/home/djanatyn/.config/Slippi Desktop App/Settings", O_RDONLY|O_CLOEXEC) = 38

That's JSON:

❯ jq '.' <  "/home/djanatyn/.config/Slippi Desktop App/Settings"
{
  "previousVersion": "1.6.8",
  "isoPath": "/home/djanatyn/melee/game.iso",
  "playbackDolphinPath": "/home/djanatyn/repos/Slippi-FM-installer/Slippi-FM-r18/netplay/dolphin-emu",
  "settings": {
    "isoPath": "/home/djanatyn/melee/game.iso",
    "rootSlpPath": "/home/djanatyn/Slippi/2021-03",
    "playbackDolphinPath": "/nix/store/vdkbcdxykachhmvfnsn9kqvjqmzxkm49-slippi-ishiiruka-2.2.1-playback/"
  }
}

The path is set here. I tried launching a game initially:
old

It didn't work because it was using my old path. I had a recent slippi-playback available:

❯ ls /nix/store/2mayzj8nsn1vx2y50d4xvzmq0d1gzfrb-slippi-ishiiruka-2.2.1-playback/
bin  dolphin-emu  portable.txt  Sys  traversal_server

I updated /home/djanatyn/.config/Slippi Desktop App/Settings to point there:

❯ jq '.settings.playbackDolphinPath' <  "/home/djanatyn/.config/Slippi Desktop App/Settings"
"/nix/store/2mayzj8nsn1vx2y50d4xvzmq0d1gzfrb-slippi-ishiiruka-2.2.1-playback/"

After that, Dolphin successfully launched when I tried to watch a replay! However, nothing played.
I took a look at what dolphin process it was launching to see what arguments were passed:

❯ pgrep -laf dolphin-emu
22850 /nix/store/2mayzj8nsn1vx2y50d4xvzmq0d1gzfrb-slippi-ishiiruka-2.2.1-playback/dolphin-emu -i /tmp/slippi-comm-vod-87890b4cc762e7f9dd748628.txt -b -e /home/djanatyn/melee/game.iso

It's not loading any configuration directories. Just like with slippi-netplay, it'll attempt to persist configuration inside of that read-only /nix/store/.../ directory. We need to pass an argument like -u ~/slippi-playback-config somewhere:

# taken from my command line history
cd ~/repos/ssbm-nix && nix run .#slippi-playback -- -e ~/melee/netplay.iso -i /dev/stdin -u ~/slippi-playback-config -o turnip <<< '{"replay":"/home/djanatyn/good-slippis/simna-turnip.slp"}'

So from my end, this derivation looks fine, but we need to wrap our slippi-playback binary

I tried poking at this by writing a quick shell script named dolphin-emu:

❯ cat /var/tmp/slippi-desktop-test/dolphin-emu
#!/usr/bin/env bash
exec /nix/store/2mayzj8nsn1vx2y50d4xvzmq0d1gzfrb-slippi-ishiiruka-2.2.1-playback/dolphin-emu -u ~/slippi-playback-config "$@"

This didn't end up working with the Slippi Desktop app.

Maybe the next step could be trying writeScriptBin, something like this (a derivation I wrote for quickly launching Crystal Melee):

overlay = final: prev: {
    crystal-melee = final.writeScriptBin "crystal-melee" ''
    #!${final.stdenv.shell}

    exec ${final.slippi-netplay}/bin/slippi-netplay -e ~/melee/diet-melee/DietMeleeLinuxPatcher/CrystalMelee_v1.0.1.iso -u ~/slippi-config
    '';
};

@djanatyn
Copy link
Owner

djanatyn commented Sep 6, 2021

I think there may be some more issues with slippi-playback, I opened a ticket upstream: project-slippi/Ishiiruka#315

@r-burns
Copy link

r-burns commented Dec 7, 2022

I have slippi playback / replays working on my setup, the main issue I encountered was that the default appimage wrapper doesn't pass additional arguments, but slippi needs these to set up the playback emulator. I wrote a wrapper like this:

with import <nixpkgs> {}; 
let
  src = fetchzip {
    url = "https://github.com/project-slippi/Ishiiruka-Playback/releases/download/v2.5.2/playback-2.5.2-Linux.zip";
    sha256 = "sha256-f6frHM9SpTKv6TWn/kiW/Fs4zvUBUSCxp6WQIvyoOzI=";
    stripRoot = false;
  };  

  ldlibpath = lib.makeLibraryPath [
    gmp 
    vulkan-loader
    "/run/opengl-driver"
  ];  
in
  writeShellScript "Slippi_Playback-x86_64.AppImage" ''
    LD_LIBRARY_PATH=${ldlibpath} ${appimage-run}/bin/appimage-run ${src}/Slippi_Playback-x86_64.AppImage "$@"
  ''

After setting the playback executable location to the result of that expression in the launcher settings, I am able to view replays.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants