From 7699ee43269822c3844370b760507c4017bac7e1 Mon Sep 17 00:00:00 2001 From: Martino Fontana Date: Sat, 7 May 2022 16:27:23 +0200 Subject: [PATCH 1/2] citra: fix Cubeb under SDL interface https://github.com/NixOS/nixpkgs/issues/171173 --- pkgs/applications/emulators/citra/default.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/emulators/citra/default.nix b/pkgs/applications/emulators/citra/default.nix index 92d0f5b1d36..31f5ebc3038 100644 --- a/pkgs/applications/emulators/citra/default.nix +++ b/pkgs/applications/emulators/citra/default.nix @@ -77,9 +77,11 @@ stdenv.mkDerivation { chmod -R a+w externals/zstd ''; - # Todo: cubeb audio backend (the default one) doesn't work on the SDL interface. - # This seems to be a problem with libpulseaudio, other applications have similar problems (e.g Duckstation). - # Note that the two interfaces have two separate configuration files. + # Fixes https://github.com/NixOS/nixpkgs/issues/171173 + postInstall = lib.optionalString (enableCubeb && enableSdl2) '' + wrapProgram "$out/bin/citra" \ + --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ libpulseaudio ]} + ''; meta = with lib; { homepage = "https://citra-emu.org"; From a62444153e7589ab3cf9d3575aa4e889d0be8da4 Mon Sep 17 00:00:00 2001 From: Martino Fontana Date: Sat, 7 May 2022 16:27:51 +0200 Subject: [PATCH 2/2] duckstation: fix Cubeb under SDL interface https://github.com/NixOS/nixpkgs/issues/171173 --- pkgs/applications/emulators/duckstation/default.nix | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/emulators/duckstation/default.nix b/pkgs/applications/emulators/duckstation/default.nix index 8e4d909a724..45bb9ed74f9 100644 --- a/pkgs/applications/emulators/duckstation/default.nix +++ b/pkgs/applications/emulators/duckstation/default.nix @@ -90,8 +90,9 @@ mkDerivation rec { runHook postCheck ''; + # Libpulseaudio fixes https://github.com/NixOS/nixpkgs/issues/171173 qtWrapperArgs = [ - "--prefix LD_LIBRARY_PATH : ${vulkan-loader}/lib" + "--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ libpulseaudio vulkan-loader ]}" ]; meta = with lib; { @@ -102,5 +103,3 @@ mkDerivation rec { platforms = platforms.linux; }; } -# TODO: default sound backend (cubeb) does not work, but SDL does. Strangely, -# switching to cubeb while a game is running makes it work.