Skip to content

PulseAudio support #957

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

PulseAudio support #957

wants to merge 2 commits into from

Conversation

colinmarc
Copy link

Fixes #259.

I finally got around to this after promising to PR it in #259 a year ago. 😅

This is based on colinmarc/pulseaudio-rs#2, which obviously needs to land before this. However, I developed both PRs in parallel. If you're feeling generous and would like to review that as well, I would welcome any feedback.

The first commit is unrelated and a bit opinionated, but it seemed nicer. Let me know if I should move that to a separate PR or just drop it.

This reduces the exported surface area of each host implementation, and makes
the impl_platform_host macro more robust.
This adds support for PulseAudio on hosts with a PA or PipeWire server
(the latter via pipewire-pulse).

Since the underlying client is async, some amount of bridging has to be
done.
@jacksongoode
Copy link

jacksongoode commented Jun 5, 2025

@colinmarc How does this PR differ from #938? Or were both created independent of each other? Disregard this, I just misread the titles :)

@colinmarc
Copy link
Author

colinmarc commented Jun 5, 2025

@colinmarc How does this PR differ from #938? Or were both created independent of each other?

Pipewire and Pulseaudio are completely different protocols. Pulseaudio is the established linux audio server, and Pipewire is the new hotness. This PR implements the Pulseaudio protocol, while the other PR implements the Pipewire protocol.

The other useful thing to know is that Pipewire (the server) supports the Pulse protocol as a first-class thing, and that this library has been tested with both audio servers. That means merging this would be enough to handle both cases. The PA server does not support the Pipewire protocol.

Finally, this is just my opinion, but I think the Pipewire protocol is also significantly more complicated.

@jacksongoode
Copy link

I actually misread the issue and would have removed my comment if you weren't so quick to respond! 🤣

The other useful thing to know is that Pipewire (the server) supports the Pulse protocol as a first-class thing, and that this library has been tested with both audio servers. That means merging this would be enough to handle both cases. The PA server does not support the Pipewire protocol.

Right, since Pipewire could just interpret cpal through its PulseAudio interface. Thank you for the explanation :)

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.

Pulse Audio support
2 participants