Add pipewire audio backend
For your consideration : My implementation of a native pipewire audio-backend.
Hi Roderick, I might need your assistance on some of it as I'm not an rust expert. I tried implementing various buffering methods but always end up with choppy/unreliable playback when i do so and I'm not sure what I'm doing wrong. On paper things should be more efficient when passing stuff in chunks instead of spoon-feeding the channels byte by byte but in practice I can't seem to get it to work. I've created a branch called pipewire-buffer-test in my fork that is my attempt at such improvement but the playback performance is horrible (choppy at random) even when compiled in release mode. The current implementation in the dev branch seems to be the one behaving the best so far but I know its not optimal.
First a bit of a low-effort but hopefully high-impact reply: does looking at https://github.com/RustAudio/cpal/pull/938 help? That implementation is not perfect, but the use of pipewire::buffer::Buffer seems interesting.
In your fork I see that you're pushing a Vec<u8> through a sync channel. I suspect that will have poor performance too. You may want to look like at using a ring buffer (ringbuf crate or rtrb if you don't need to work across threads).
Hope this helps.