Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: fdca20391ce3
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: fcef646736e2
Choose a head ref
  • 2 commits
  • 2 files changed
  • 2 contributors

Commits on Sep 8, 2020

  1. nixos/jack,pulseaudio: fix pulse connection to jackd service

    This fixes the case when Jack Audio Daemon is running
    as a service via `services.jack.jackd` and Pulseaudio
    running as a *user* service.
    
    Two issues prevented connecting `pulse` with `jackd`:
    * Missing `JACK_PROMISCUOUS_SERVER` environment variable for `pulse` user service,
      resulting in `pulse` trying to access `jackd` as if it was running as part of
      the users session.
    * `jackd` not being able to access socket created by `pulse` due to socket
      created using user ID and `users` group. Change allows `jackd` to access
      the socket created by `pulse` correctly.
    
    `pulse` now also autoloads `module-jack-sink` and `module-jack-source`
    if `services.jack.jackd.enable` is set.
    
    The default `pulse` package is now set to `pulseaudioFull` automatically
    if `services.jack.jackd.enable` is set.
    sorki committed Sep 8, 2020

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    NeQuissimus Tim Steinbach
    Copy the full SHA
    f546122 View commit details

Commits on Nov 10, 2020

  1. Merge pull request #93431 from sorki/audio/pulseJack

    nixos/jack,pulseaudio: fix pulse connection to jackd service
    worldofpeace authored Nov 10, 2020

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    NeQuissimus Tim Steinbach
    Copy the full SHA
    fcef646 View commit details
Showing with 10 additions and 1 deletion.
  1. +7 −1 nixos/modules/config/pulseaudio.nix
  2. +3 −0 nixos/modules/services/audio/jack.nix
8 changes: 7 additions & 1 deletion nixos/modules/config/pulseaudio.nix
Original file line number Diff line number Diff line change
@@ -36,6 +36,8 @@ let
${addModuleIf cfg.zeroconf.discovery.enable "module-zeroconf-discover"}
${addModuleIf cfg.tcp.enable (concatStringsSep " "
([ "module-native-protocol-tcp" ] ++ allAnon ++ ipAnon))}
${addModuleIf config.services.jack.jackd.enable "module-jack-sink"}
${addModuleIf config.services.jack.jackd.enable "module-jack-source"}
${cfg.extraConfig}
'';
};
@@ -144,7 +146,9 @@ in {

package = mkOption {
type = types.package;
default = pkgs.pulseaudio;
default = if config.services.jack.jackd.enable
then pkgs.pulseaudioFull
else pkgs.pulseaudio;
defaultText = "pkgs.pulseaudio";
example = literalExample "pkgs.pulseaudioFull";
description = ''
@@ -284,6 +288,8 @@ in {
RestartSec = "500ms";
PassEnvironment = "DISPLAY";
};
} // optionalAttrs config.services.jack.jackd.enable {
environment.JACK_PROMISCUOUS_SERVER = "jackaudio";
};
sockets.pulseaudio = {
wantedBy = [ "sockets.target" ];
3 changes: 3 additions & 0 deletions nixos/modules/services/audio/jack.nix
Original file line number Diff line number Diff line change
@@ -246,6 +246,9 @@ in {
description = "JACK Audio Connection Kit";
serviceConfig = {
User = "jackaudio";
SupplementaryGroups = lib.optional
(config.hardware.pulseaudio.enable
&& !config.hardware.pulseaudio.systemWide) "users";
ExecStart = "${cfg.jackd.package}/bin/jackd ${lib.escapeShellArgs cfg.jackd.extraOptions}";
LimitRTPRIO = 99;
LimitMEMLOCK = "infinity";