-
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.
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.
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).
- 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 and use cases for the solution as proposed in How:
- Refactor code related to current audio backends, and allow the selection of PipeWire among the available backends.
- 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
This change affects linux users using PipeWire.
- To be decided
-
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 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.
The tasks to do in order to migrate to the new idea.
-
(week 1-4 25/5 to 21/6) Implement support for PipeWire backend.
- (#16544) Refactor SoundManager into individual Enumerators (PortAudioEnumerator, PipewireEnumerator, NetworkEnumerator).
- (#16590) Add PipewireEnumerator, SoundDevicePipewire.
-
(week 4-8 15/6 to 19/7) Hotplug
- (#16590) Add soundcard hotplug support.
- (#16590) Modify PipeWire graph from Mixxx UI
-
(week 7-9 06/7 to 27/7) Handle patchbay events
- Sync Mixxx UI with patchbay routing
- Configure SoundDevices without stopping audio thread
- Remove internal mono to stereo conversion for PipeWire
-
(week 10 28/7 to 3/8) callback scheduling fixes
- Make PipeWire work while not being clock reference (for ex. with network clock)
- Find a solution to make the PipeWire callbacks run from soundcard connected to Main
-
(week 11-12 4/8 to 17/8) Implement hardware soundcard volume access
- Add Controller mapping to set AudioPath hardware volume
- Map each AudioPath to the connected soundcard analog volume
-
(week 13 18/8 to 24/8) Finalize the project
More uncategorizable tasks:
- (#16707) Deinitialize unused SoundAPI
- (#16707) Handle PipeWire server restarts
- (#16712) Better SoundDevice and port naming
- Route newly created PipeWire devices according to config from disk
- End evaluation blog post