Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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
24 changes: 10 additions & 14 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 @@ -113,8 +105,7 @@ in {
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.
This option is no longer supported, and will eventually be removed.
'';
};

Expand Down Expand Up @@ -227,6 +218,11 @@ in {
}

(mkIf cfg.enable {
assertions = [{
assertion = !cfg.support32Bit;
message = "`hardware.pulseaudio.support32Bit` is no longer supported.";
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The alsa 32bit options have been pretty widely recommended in the past due to steam so I'd like to see a proper deprecation error instead of just silently removing the options.

@jansol That makes sense. This commit adds a clearer message, but did you mean an actual deprecation process, where we fix the currently broken 32bit support and provide a deprecation warning about its eventual removal? That would require reintroducing the patch that was removed in #154276, but I'm not opposed to doing that if it's warranted (and it sounds like it is).

I'd also like to provide a more informative message than I've done in this commit, something like,

In order to support 32bit audio on a 64bit system, please use ??? instead.

But I don't know enough about this domain to do so. Is there a pipewire-related suggestion that would be appropriate in place of ??? above?
cc @L-as

}];

environment.systemPackages = [ overriddenPackage ];

sound.enable = true;
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
12 changes: 6 additions & 6 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 @@ -67,7 +65,7 @@ in {
type = types.bool;
default = false;
description = ''
Whether to support sound for 32-bit ALSA applications on 64-bit system.
This option is no longer supported, and will eventually be removed.
'';
};
};
Expand Down Expand Up @@ -129,9 +127,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 Expand Up @@ -217,6 +213,10 @@ in {
assertion = !(cfg.alsa.enable && cfg.loopback.enable);
message = "For JACK both alsa and loopback options shouldn't be used at the same time.";
}
{
assertion = !cfg.alsa.support32Bit;
message = "`services.jack.alsa.support32Bit` is no longer supported.";
}
];

users.users.jackaudio = {
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
17 changes: 7 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,7 @@ in {

alsa = {
enable = mkEnableOption "ALSA support";
support32Bit = mkEnableOption "32-bit ALSA support on 64-bit systems";
support32Bit = mkEnableOption "This option is no longer supported, and will eventually be removed";
};

jack = {
Expand Down Expand Up @@ -156,6 +153,10 @@ in {
assertion = cfg.jack.enable -> !config.services.jack.jackd.enable;
message = "PipeWire based JACK emulation doesn't use the JACK service. This option requires `services.jack.jackd.enable` to be set to false";
}
{
assertion = !cfg.alsa.support32Bit;
message = "`services.pipewire.alsa.support32Bit` is no longer supported.";
}
];

environment.systemPackages = [ cfg.package ]
Expand Down Expand Up @@ -186,14 +187,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