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

nixos/pulseaudio: remove broken support for 32bit on 64bit systems #157352

Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 4 additions & 21 deletions nixos/modules/config/pulseaudio.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ let
binary = "${getBin overriddenPackage}/bin/pulseaudio";
binaryNoDaemon = "${binary} --daemonize=no";

# Forces 32bit pulseaudio and alsa-plugins to be built/supported for apps
# using 32bit alsa on 64bit linux.
enable32BitAlsaPlugins = cfg.support32Bit && stdenv.isx86_64 && (pkgs.pkgsi686Linux.alsa-lib != null && pkgs.pkgsi686Linux.libpulseaudio != null);


myConfigFile =
let
Expand Down Expand Up @@ -60,26 +56,22 @@ let
# Write an /etc/asound.conf that causes all ALSA applications to
# be re-routed to the PulseAudio server through ALSA's Pulse
# plugin.
alsaConf = writeText "asound.conf" (''
alsaConf = writeText "asound.conf" ''
pcm_type.pulse {
libs.native = ${pkgs.alsa-plugins}/lib/alsa-lib/libasound_module_pcm_pulse.so ;
${lib.optionalString enable32BitAlsaPlugins
"libs.32Bit = ${pkgs.pkgsi686Linux.alsa-plugins}/lib/alsa-lib/libasound_module_pcm_pulse.so ;"}
lib ${pkgs.alsa-plugins}/lib/alsa-lib/libasound_module_pcm_pulse.so ;
}
pcm.!default {
type pulse
hint.description "Default Audio Device (via PulseAudio)"
}
ctl_type.pulse {
libs.native = ${pkgs.alsa-plugins}/lib/alsa-lib/libasound_module_ctl_pulse.so ;
${lib.optionalString enable32BitAlsaPlugins
"libs.32Bit = ${pkgs.pkgsi686Linux.alsa-plugins}/lib/alsa-lib/libasound_module_ctl_pulse.so ;"}
lib ${pkgs.alsa-plugins}/lib/alsa-lib/libasound_module_ctl_pulse.so ;
}
ctl.!default {
type pulse
}
${alsaCfg.extraConfig}
'');
'';

in {

Expand Down Expand Up @@ -109,15 +101,6 @@ in {
'';
};

support32Bit = mkOption {
type = types.bool;
default = false;
description = ''
Whether to include the 32-bit pulseaudio libraries in the system or not.
This is only useful on 64-bit systems and currently limited to x86_64-linux.
'';
};

configFile = mkOption {
type = types.nullOr types.path;
description = ''
Expand Down
3 changes: 0 additions & 3 deletions nixos/modules/programs/steam.nix
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ in {
driSupport32Bit = true;
};

# optionally enable 32bit pulseaudio support if pulseaudio is enabled
hardware.pulseaudio.support32Bit = config.hardware.pulseaudio.enable;

hardware.steam-hardware.enable = true;

environment.systemPackages = [ steam steam.run ];
Expand Down
14 changes: 1 addition & 13 deletions nixos/modules/services/audio/jack.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ let
pcmPlugin = cfg.jackd.enable && cfg.alsa.enable;
loopback = cfg.jackd.enable && cfg.loopback.enable;

enable32BitAlsaPlugins = cfg.alsa.support32Bit && pkgs.stdenv.isx86_64 && pkgs.pkgsi686Linux.alsa-lib != null;

umaskNeeded = versionOlder cfg.jackd.package.version "1.9.12";
bridgeNeeded = versionAtLeast cfg.jackd.package.version "1.9.12";
in {
Expand Down Expand Up @@ -62,14 +60,6 @@ in {
Route audio to/from generic ALSA-using applications using ALSA JACK PCM plugin.
'';
};

support32Bit = mkOption {
type = types.bool;
default = false;
description = ''
Whether to support sound for 32-bit ALSA applications on 64-bit system.
'';
};
};

loopback = {
Expand Down Expand Up @@ -129,9 +119,7 @@ in {
(mkIf pcmPlugin {
sound.extraConfig = ''
pcm_type.jack {
libs.native = ${pkgs.alsa-plugins}/lib/alsa-lib/libasound_module_pcm_jack.so ;
${lib.optionalString enable32BitAlsaPlugins
"libs.32Bit = ${pkgs.pkgsi686Linux.alsa-plugins}/lib/alsa-lib/libasound_module_pcm_jack.so ;"}
lib ${pkgs.alsa-plugins}/lib/alsa-lib/libasound_module_pcm_jack.so ;
}
pcm.!default {
@func getenv
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ with lib;
let
json = pkgs.formats.json {};
cfg = config.services.pipewire.media-session;
enable32BitAlsaPlugins = cfg.alsa.support32Bit
&& pkgs.stdenv.isx86_64
&& pkgs.pkgsi686Linux.pipewire != null;

# Use upstream config files passed through spa-json-dump as the base
# Patched here as necessary for them to work with this module
Expand Down
12 changes: 2 additions & 10 deletions nixos/modules/services/desktops/pipewire/pipewire.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ with lib;
let
json = pkgs.formats.json {};
cfg = config.services.pipewire;
enable32BitAlsaPlugins = cfg.alsa.support32Bit
&& pkgs.stdenv.isx86_64
&& pkgs.pkgsi686Linux.pipewire != null;

# The package doesn't output to $out/lib/pipewire directly so that the
# overlays can use the outputs to replace the originals in FHS environments.
Expand Down Expand Up @@ -115,7 +112,6 @@ in {

alsa = {
enable = mkEnableOption "ALSA support";
support32Bit = mkEnableOption "32-bit ALSA support on 64-bit systems";
};

jack = {
Expand Down Expand Up @@ -186,14 +182,10 @@ in {
environment.etc."alsa/conf.d/49-pipewire-modules.conf" = mkIf cfg.alsa.enable {
text = ''
pcm_type.pipewire {
libs.native = ${cfg.package.lib}/lib/alsa-lib/libasound_module_pcm_pipewire.so ;
${optionalString enable32BitAlsaPlugins
"libs.32Bit = ${pkgs.pkgsi686Linux.pipewire.lib}/lib/alsa-lib/libasound_module_pcm_pipewire.so ;"}
lib ${cfg.package.lib}/lib/alsa-lib/libasound_module_pcm_pipewire.so ;
}
ctl_type.pipewire {
libs.native = ${cfg.package.lib}/lib/alsa-lib/libasound_module_ctl_pipewire.so ;
${optionalString enable32BitAlsaPlugins
"libs.32Bit = ${pkgs.pkgsi686Linux.pipewire.lib}/lib/alsa-lib/libasound_module_ctl_pipewire.so ;"}
lib ${cfg.package.lib}/lib/alsa-lib/libasound_module_ctl_pipewire.so ;
}
'';
};
Expand Down
1 change: 0 additions & 1 deletion nixos/tests/installed-tests/pipewire.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ makeInstalledTest {
pulse.enable = true;
jack.enable = true;
alsa.enable = true;
alsa.support32Bit = true;
};
};
}
1 change: 0 additions & 1 deletion nixos/tests/pulseaudio.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ let
imports = [ ./common/wayland-cage.nix ];
hardware.pulseaudio = {
enable = true;
support32Bit = true;
inherit systemWide;
};

Expand Down
1 change: 0 additions & 1 deletion pkgs/games/steam/fhsenv.nix
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,6 @@ in buildFHSUserEnv rec {
and then run \`sudo nixos-rebuild switch\`:
{
hardware.opengl.driSupport32Bit = true;
hardware.pulseaudio.support32Bit = true;
}
**
EOF
Expand Down