psst icon indicating copy to clipboard operation
psst copied to clipboard

Implement pipewire output

Open azam opened this issue 10 months ago • 7 comments

  • Initial implementation for pipewire output.
  • Change psst-gui and psst-cli to explicitly pass features of psst-core by disabling psst-core default features when compiled from psst-gui or psst-cli. This makes it easier to set features at psst-gui or psst-cli without changing psst-core/Cargo.toml, since currently there is no way to switch AudioOutput implementation at runtime. This should not affect current build because default features are set at psst-gui and psst-cli and is passed down as psst-core feature as well.

azam avatar Jun 22 '25 23:06 azam

Hi, I also have a branch with selectable backend, buildable with cpal and pipewire but not tested for cubeb at https://github.com/azam/psst/tree/feature/pipewire-selectable if you want to check it out. Need a restart of the app after selection change though. Screenshot_20250625_031153

azam avatar Jun 24 '25 18:06 azam

@jacksongoode Would you consider pulling this in? I can either proceed with the output selection on a separate PR.

azam avatar Jul 01 '25 13:07 azam

I'm a little curious if you've checked out https://github.com/SolarLiner/interflow? It would be another backend, but it might have the possibility of replacing cpal and support more than just pipewire (also coreaudio, alsa, WASAPI). I would be hesitant to provide a path to pipewire support via its own backend just for the sake of maintenance.

In addition it might be easier to write support for interflow given that it's quite opinionated. Love to hear your thoughts, and thank you for the extensive work in your PR.

jacksongoode avatar Jul 01 '25 16:07 jacksongoode

@jacksongoode 🤔 I'll take a jab at interflow.

azam avatar Jul 02 '25 14:07 azam

@jacksongoode Managed to get interflow to output audio, but the sample counts are borked (channel count are not synced, so playback is 0.5x slow. Probably will try with a fixed channel count later).

I will try again later on the next weekend, in the meantime here is the branch if you want to take a look or help me with it.

https://github.com/azam/psst/tree/feature/interflow

azam avatar Jul 14 '25 01:07 azam

@azam Thank you for the effort!

I think there are some improvements coming to Interflow in the next week for the CoreAudio and Pipewire backends, so it might be even easier.

For now, would you like to make a separate PR for interflow based on this branch?

jacksongoode avatar Jul 14 '25 01:07 jacksongoode

@jacksongoode Sure, I intend to do that once I figure out the sampling issue.

azam avatar Jul 14 '25 02:07 azam