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

pulseaudio service: set DISPLAY #15840

Merged
merged 4 commits into from
Jul 16, 2016
Merged

Conversation

anderspapitto
Copy link
Contributor

@anderspapitto anderspapitto commented May 30, 2016

Motivation for this change

I was seeing

May 28 22:41:49 gurney systemd[935]: Starting PulseAudio Server...
May 28 22:41:49 gurney pulseaudio[941]: E: [pulseaudio] module-jackdbus-detect.c: Unable to contact D-Bus session bus: org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
May 28 22:41:49 gurney pulseaudio[941]: E: [pulseaudio] module.c: Failed to load module "module-jackdbus-detect" (argument: "channels=2"): initialization failed.
May 28 22:41:49 gurney pulseaudio[941]: E: [pulseaudio] main.c: Module load failed.
May 28 22:41:49 gurney pulseaudio[941]: W: [pulseaudio] server-lookup.c: Unable to contact D-Bus: org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
May 28 22:41:49 gurney pulseaudio[941]: W: [pulseaudio] main.c: Unable to contact D-Bus: org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • OS X
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

it's needed by the jack support

@mention-bot
Copy link

By analyzing the blame information on this pull request, we identified @rickynils, @peterhoeg and @edolstra to be potential reviewers

@@ -161,6 +161,7 @@ in {
ExecStart = "${getBin cfg.package}/bin/pulseaudio --daemonize=no";
Restart = "on-failure";
};
environment = { DISPLAY = ":0"; };
Copy link
Member

Choose a reason for hiding this comment

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

It can be false sometimes.

@anderspapitto
Copy link
Contributor Author

@jagajaga I switched it to use the same configuration option as the unclutter module.

@@ -118,6 +118,13 @@ in {
'';
};
};

displayName = mkOption {
Copy link
Member

Choose a reason for hiding this comment

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

There is no such option in NixOS? Like services.xserver.foobar?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not that I'm aware of. Also, in practice is it even possible to run multiple X servers with different DISPLAY values on NixOS? I've done it before on other distros, but only by manually running startx, and that doesn't work on NixOS.

So, I would also love a generic solution to this, but I think it's a problem for another day and outside of the scope of this diff.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

actually, I was completely wrong. I switched to directly using config.services.xserver.display, and also applied that fix to the unclutter service

@joachifm
Copy link
Contributor

joachifm commented Jul 3, 2016

Hm, I see that this touches several unrelated modules. Perhaps it'd be better to break these into separate commits? Otherwise, LGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants