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: Fix ExecStop #95374

Closed
wants to merge 1 commit into from

Conversation

jonringer
Copy link
Contributor

@jonringer jonringer commented Aug 13, 2020

Motivation for this change

Not sure the root cause, but I will have many pulseaudio daemons running, and unable to get audio.

Current fix was to do pulseaudio --kill; pulseaudio --start, obviously, this isn't ideal. However, altering the ExecStop to use the --kill command seems to clean up all the zombie daemons.

prior behavior

Aug 13 14:54:57 jon-desktop systemd[9664]: Starting Sound Service...
Aug 13 14:54:57 jon-desktop pulseaudio[903]: E: [pulseaudio] pid.c: Daemon already running.
Aug 13 14:54:57 jon-desktop pulseaudio[903]: E: [pulseaudio] main.c: pa_pid_file_create() failed.
Aug 13 14:54:57 jon-desktop systemd[9664]: pulseaudio.service: Main process exited, code=exited, status=1/FAILURE
Aug 13 14:54:57 jon-desktop systemd[9664]: pulseaudio.service: Failed with result 'exit-code'.
Aug 13 14:54:57 jon-desktop systemd[9664]: Failed to start Sound Service.
Aug 13 14:54:58 jon-desktop systemd[9664]: pulseaudio.service: Scheduled restart job, restart counter is at 4.
Aug 13 14:54:58 jon-desktop systemd[9664]: Stopped Sound Service.
Aug 13 14:54:58 jon-desktop systemd[9664]: Starting Sound Service...
Aug 13 14:54:58 jon-desktop pulseaudio[919]: E: [pulseaudio] pid.c: Daemon already running.
Aug 13 14:54:58 jon-desktop pulseaudio[919]: E: [pulseaudio] main.c: pa_pid_file_create() failed.
Aug 13 14:54:58 jon-desktop systemd[9664]: pulseaudio.service: Main process exited, code=exited, status=1/FAILURE
Aug 13 14:54:58 jon-desktop systemd[9664]: pulseaudio.service: Failed with result 'exit-code'.
Aug 13 14:54:58 jon-desktop systemd[9664]: Failed to start Sound Service.
Aug 13 14:54:58 jon-desktop systemd[9664]: pulseaudio.service: Scheduled restart job, restart counter is at 5.

current behavior:

# systemctl --user restart pulseaudio
Aug 13 15:21:25 jon-desktop systemd[9664]: Starting Sound Service...
Aug 13 15:21:26 jon-desktop systemd[9664]: Started Sound Service.
Aug 13 15:21:26 jon-desktop pulseaudio[25942]: E: [pulseaudio] bluez5-util.c: GetManagedObjects() failed: org.freedesktop.D>
# another `systemctl --user restart pulseaudio` to verify it works
Aug 13 15:22:21 jon-desktop systemd[9664]: Stopping Sound Service...
Aug 13 15:22:21 jon-desktop systemd[9664]: pulseaudio.service: Succeeded.
Aug 13 15:22:21 jon-desktop systemd[9664]: Stopped Sound Service.
Aug 13 15:22:21 jon-desktop systemd[9664]: Starting Sound Service...
Aug 13 15:22:21 jon-desktop systemd[9664]: Started Sound Service.
Aug 13 15:22:21 jon-desktop pulseaudio[26290]: E: [pulseaudio] bluez5-util.c: GetManagedObjects() failed: org.freedesktop.D
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@jonringer
Copy link
Contributor Author

just listing previous authors of file:

cc @rnhmjoj @adisbladis @worldofpeace @fpletz @Mic92

@jonringer
Copy link
Contributor Author

note that I tested this on NixOS, but I'm the only user on my computers. So I don't know if this will break multi-user computers.

@@ -312,6 +312,7 @@ in {
serviceConfig = {
Type = "notify";
ExecStart = "${binaryNoDaemon} --log-level=${cfg.daemon.logLevel} --system -n --file=${myConfigFile}";
ExecStop = "${binaryNoDaemon} --kill";
Copy link
Contributor

Choose a reason for hiding this comment

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

are you using systemWide pulseaudio? Because that isn't the default in nixos and is greatly discouraged in use
(this is in the mkIf systemWide block)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no, I am not:

  hardware.pulseaudio = {
    support32Bit = true;
    enable = true;
  };

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll have to do some more investigating.. maybe these changes just coincided with something else

@jonringer jonringer closed this Aug 13, 2020
@jonringer jonringer deleted the pulseaudio-fix branch August 13, 2020 23:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants