Libvisual / libvisual

Libvisual Audio Visualization
http://libvisual.org/
81 stars 31 forks source link

Support PipeWire #264

Open kaixiong opened 1 year ago

kaixiong commented 1 year ago

PipeWire is becoming a standard on Linux and we should have an actor and an input plugin supporting it.

hartwork commented 1 year ago

@kaixiong I agree and already played a bit with client code but it's a bit of bumpy road, and https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/2997 only is the start of it. If it was less bumpy I had already added a version to my https://github.com/hartwork/audio_pump_demo . Note that their API seems to be fully asynchronous, so we'll need tricks similar to what we have for PulseAudio's synchronous API. Happy to learn I'm wrong about any of this :smiley:

hartwork commented 1 year ago

PS: What I find interesting is how they hand out and take in buffers with pw_stream_dequeue_buffer and pw_stream_queue_buffer.

kaixiong commented 1 year ago

@kaixiong I agree and already played a bit with client code but it's a bit of bumpy road, and https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/2997 only is the start of it. If it was less bumpy I had already added a version to my https://github.com/hartwork/audio_pump_demo

@hartwork That is.. surprising :facepalm:

Note that their API seems to be fully asynchronous, so we'll need tricks similar to what we have for PulseAudio's synchronous API. Happy to learn I'm wrong about any of this smiley.

It's probably time to convert all the input plugins to use asynchronous calls. We can maybe factor out the lock-free ring buffer implementation in input_pulseaudio and make it part of the low-level or 'primitives' API for a start. Some ideas for the high-level API for input plugins were brought up in #54.

hartwork commented 1 year ago

@kaixiong we definitely need a way to support asynchronous input APIs out of the box, I agree.