-
Notifications
You must be signed in to change notification settings - Fork 2k
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
audio: Prefer Pipewire over Pulseaudio (take 2) #9473
Conversation
…is running Use DBus to query Systemd to check if the pipewire-pulse service is in the "running" state. If it is, then it is certain that Pipewire is being used instead of Pulseaudio as the preferred system mixer. If DBus support is not enabled or Systemd is not being used on the underlying system, this check will simply fail and the standard driver order will be tested.
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.
Makes sense to me - I guess we should sync this with the Wayland preference change to make sure the bootstrap logic all matches?
Yeah, this is clever. I haven't looked at what the Wayland stuff does that we could sync up here, but take a look at that and see if it's worth it before we merge this. |
Posted in the Wayland thread, aside from that this should be good to go (IMO). |
Yeah, I think the Wayland stuff should match this. Okay, last call before I pull the trigger on merging this, then! |
This is broken in a lot of environments, including flatpak which is arguably the most common environment SDL will run in. The name of services is not stable, access to the session bus is restricted. This change is overall just a really bad idea and Checking for the pipewire socket should be much more robust and give you the same behavior. Usually if the pipewire socket exists, the pulse socket also comes from pipewire. |
@swick, can you open an issue on this for tracking? |
Thanks! |
If SDL is configured with both Pipewire and Pulseaudio support, this adds a preferred Pipewire bootstrap entry that uses DBus to query if the pipewire-pulse service exists and is in the "running" state. If it is, then it is certain that Pipewire is being used instead of Pulseaudio as the preferred system mixer and will be preferred over Pulseaudio. If DBus support is not enabled or Systemd is not being used on the underlying system, this check will simply fail and the standard driver order will be tested as before.
While still not 100% flawless, it is currently the best method for detecting if Pipewire is the preferred mixer for the system, as other possibilities have drawbacks:
Closes #8788
cc @flibitijibibo @icculus