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/jack,pulseaudio: fix pulse connection to jackd service #93431
Conversation
Quick workaround for current setups: systemd.services.jack.serviceConfig.SupplementaryGroups = [ "users" ];
systemd.user.services.pulseaudio.environment.JACK_PROMISCUOUS_SERVER = "jackaudio";
# sample jackd config
services.jack = {
jackd = {
enable = true;
# to force another sound card
# extraOptions = [ "-dalsa" "-dhw:Solo" "-r44100" "-p1024" "-n2" ];
};
}; Rebuild + re-login and manually issue
|
I have these errors in
|
@gnidorah do you have |
Like |
Good catch! Like this: hardware.pulseaudio = {
package = pkgs.pulseaudioFull;
}; Now I wonder if the package should default to |
I've managed to get this working with 20.03 VM with user and groups like so users.users.jane = {
isNormalUser = true;
extraGroups = [ "wheel" "audio" "jackaudio" ];
}; Most of the VM config: environment.systemPackages = with pkgs; [
wget vim
jack2Full
qjackctl
(mpv.override { jackaudioSupport = true; })
pavucontrol
];
sound.enable = true;
hardware.pulseaudio = {
enable = true;
package = pkgs.pulseaudioFull;
};
services.jack.jackd = {
enable = true;
# extraOptions = [ "-dalsa" "-dhw:S3" "-r44100" "-p1024" "-n2" ];
};
services.xserver.enable = true;
services.xserver.displayManager.sddm.enable = true;
services.xserver.desktopManager.plasma5.enable = true;
# Define a user account. Don't forget to set a password with ‘passwd’.
users.users.jane = {
isNormalUser = true;
extraGroups = [ "wheel" "audio" "jackaudio" ]; # Enable ‘sudo’ for the user.
}; Env vars might cause trouble if you don't reboot or log-out and log-in again. |
Ok, I've added the following configuration rebooted and sound works for me without this PR services.jack.jackd.enable = true;
users.extraUsers.gnidorah.extraGroups = [ "jackaudio" ];
hardware.pulseaudio.enable = true;
hardware.pulseaudio.systemWide = false; Could you please provide a case when this PR is needed? Which programs to use for test etc? |
Use case for this is running Good program for testing both servers is Also check that the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for use cases, makes sense for me 😃
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.
6b0b017
to
f546122
Compare
Fixed the issues with default package: The default |
@sorki This PR is waiting for a long time. Perhaps we should ask someone to merge it? |
@worldofpeace do you think you can take a look? I think this was tested by few people and I'm using it with no issues for months now. The change is quite unobtrusive and only makes setup easier for |
Yeah, I've thought that it should do this for a while anyways. |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/nixos-and-linux-pro-audio/1788/15 |
This fixes the case when Jack Audio Daemon is running
as a service via
services.jack.jackd
and Pulseaudiorunning as a user service.
Two issues prevented connecting
pulse
withjackd
:JACK_PROMISCUOUS_SERVER
environment variable forpulse
user service,resulting in
pulse
trying to accessjackd
as if it was running as part ofthe users session.
jackd
not being able to access socket created bypulse
due to socketcreated using user ID and
users
group. Change allowsjackd
to accessthe socket created by
pulse
correctly.pulse
now also autoloadsmodule-jack-sink
andmodule-jack-source
if
services.jack.jackd.enable
is set.cc @asheshambasta @dustinlacewell @cole-h @gnidorah
TODOs:
Motivation for this change
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)