psmokotnin / osm

Open sound meter. FFT based application for tuning sound systems.
GNU General Public License v3.0
222 stars 35 forks source link

WIP: Add JACK audio backend support #59

Closed NexAdn closed 1 year ago

NexAdn commented 1 year ago

This PR adds a JACK plugin, allowing OpenSoundMeter to run with JACK or PipeWire as sound server. This can eliminate problems when OpenSoundMeter is run alongside a sound server which wants to have exclusive access to the sound card.

This introduces libjack and the JACK headers as a new dependency on Linux.

The JACK plugin differs from other plugins in the sense that it does not automatically establish connections to devices. Instead, each opened stream (be it a measurement or a generator signal) spawns a new JACK client with each of the inputs/outputs required by OSM present as a JACK port. The user can then patch these ports freely in JACK, allowing for freedom in the audio routing. As new JACK clients are spawned upon request, this plugin does always show only a single JACK device in device lists as more is not required and avoids additional complexity when trying to do more elaborate listings.

I have successfully tested the plugin locally with PipeWire as JACK server.

The CI pipeline has been adjusted to include the libjack-dev dependency required for building against JACK as well.

Closes: https://github.com/psmokotnin/osm/issues/58

NexAdn commented 1 year ago

I've just noticed the codebase is still a bit unstable in some circumstances. I'll reopen after I had a look at it.