-
Notifications
You must be signed in to change notification settings - Fork 11
proposal: PipeWire backend #19
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
base: main
Are you sure you want to change the base?
Changes from all commits
d9644fe
f47832e
526254b
be055fa
32954a1
a359ef1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| # PipeWire support for Mixxx | ||
|
|
||
| * **Owners:** | ||
| * `@pri-yan-shu` | ||
|
|
||
| * **Implementation Status:** `Not implemented` | ||
|
|
||
| > TL;DR: This proposes PipeWire audio API support to Mixxx, SoundDevice hotplug | ||
| for PipeWire, ability to route audio from Mixxx UI, and react to external changes. | ||
|
|
||
| ## Why | ||
|
|
||
| PipeWire is an audio API for Linux. It replaces the multiple audio APIs already | ||
| present on Linux, like ALSA, JACK, PulseAudio, and has compatibility layer for | ||
| all those APIs. It also supports connecting any audio source/sink (from any | ||
| application) to Mixxx, like the system audio inputs/outputs. This allows for | ||
| flexibility in routing, for example adding an effect before input/after output. | ||
|
|
||
| ### Pitfalls of the current solution | ||
|
|
||
| Currently Mixxx supports all audio APIs through PortAudio, which abstracts over | ||
| audio APIs for multiple platforms. Features specific to a single API are not | ||
| exposed, which leads to poor experience on Linux (for example, | ||
| [incorrect naming of JACK ports](https://github.com/mixxxdj/mixxx/issues/5979)). | ||
|
|
||
| * There is no hotplug for SoundDevices | ||
| * As mentioned in the "Why" section, PortAudio only lets us route to and from | ||
| soundcards, and not the input/output of any arbitrary program | ||
|
|
||
| ## Goals | ||
|
|
||
| Goals and use cases for the solution as proposed in [How](#how): | ||
|
|
||
| * Refactor code related to current audio backends, and allow the selection of | ||
| PipeWire among the available backends. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With the latest findings, this can even be a compiler switch or a command line parameter. This releases the user form the decision if they should use Pipewire and probably you form corner cases when switching the API.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. WDYM by corner cases, conditional code in CMake files and #ifdef (PIPEWIRE) and #ifdef (PORTAUDIO) macros?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have some doubts that a common iterator over Portaudio and Pipewire is an easy thing, because of the opposite abstraction models, but I might be wrong. The #ifdef solution works probably for all users well, but it is finally your project decision. |
||
| * Get feature parity with the current PortAudio backend. Ensure that drift and | ||
| jitter correction is happening properly in case of multiple DAC's | ||
| * Provide accurate DAC sample playback timing info, which will be used for | ||
| jitter free waveform rendering. | ||
| * Hotplug for audio devices on PipeWire | ||
| * Support external patchbays by synchronizing routing UI with changes through external patchbays | ||
|
|
||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Support external patch bays. (Not like now with Jack where only anyway connected ports are exposed)
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's what I meant by:
I'll be more explicit. |
||
| ### Audience | ||
|
|
||
| This change affects linux users using PipeWire. | ||
|
|
||
| ## Non-Goals | ||
|
|
||
| * To be decided | ||
|
|
||
| ## How | ||
|
|
||
| * The proposal will be implemented as a PipeWire client which listens for all | ||
| node/port/link objects (similar to existing PipeWire patchbays), and creates | ||
| SoundDevices accordingly. Since this happens for all source/sink available, not | ||
| just soundcard source/sink, we can route any source/sink to Mixxx. This will | ||
| work with the current routing UI in Sound Hardware preference page. Same | ||
| mechanism will be used to update the routing UI to reflect any changes made by | ||
| an external patchbay. | ||
|
|
||
| * On Linux systems, PipeWire would show up in the Sound API option in the | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I don't like the idea. Portaudio enumerates all devices from all APIs at start up. The "listening" nature of Pipewire does not fit to this approach. So it is probably more straight forward to have a switch above, that decides if its a Portaudio or a Pipewire build. Even a compiler switch will work for me.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I encountered similar issue while introducing libremidi along with PortMidi. PortMidi had a So as a part of the refactor, when the This is more complex than simply having one API at a time, maybe lets keep this in back of the mind, depending on how much additional complexity we have to incur to support this case. |
||
| preference panel, among other audio APIs offered by PortAudio. The existing | ||
| soundio code would be refactored into enumerators for different audio backends, | ||
| similar to Controller enumerators. | ||
|
|
||
| ## Action Plan | ||
|
|
||
| The tasks to do in order to migrate to the new idea. | ||
|
|
||
| * [ ] (week 1 25/5 to 31/5) Implement support for PipeWire backend. | ||
| * [ ] Refactor SoundManager into individual Enumerators (PortAudioEnumerator, PipewireEnumerator, NetworkEnumerator). | ||
| * [ ] Add PipewireEnumerator, SoundDevicePipewire, test working with program and soundcard input/outputs. | ||
| * [ ] (week 2 01/6 to 07/6) Add soundcard hotplug support. | ||
| * [ ] (week 3 08/6 to 14/6) Implement drift/jitter correction and sync with multiple soundcards | ||
| * [ ] (week 4 15/6 to 21/6) Test drift/jitter correction and sync with multiple soundcards | ||
| * [ ] (week 5 22/6 to 28/6) Modify PipeWire graph from Mixxx UI | ||
| * [ ] (week 6 29/6 to 05/7) Update Mixxx UI from external graph changes | ||
| * [ ] (week 7 06/7 to 12/7) Implement hardware soundcard volume access | ||
|
|
||
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.
You may also mention the port model vs. the soundcard model.