Pipewire neglects to clean up JACK client threads on server shutdown
Creating and activating a JACK client spawns two threads; on server shutdown, jack2
cleans up these threads whereas pipewire
does not. This results in programs that expect the jack2
behavior, like jackfreqd
and the load monitor I am attempting to write for waybar
, accumulating obsolete threads when the server is repeatedly restarted.
JACK API documentation for JackShutdownCallback
says:
Note that after server shutdown, the client pointer is not deallocated by libjack, the application is responsible to properly use jack_client_close() to release client ressources. Warning: jack_client_close() cannot be safely used inside the shutdown callback and has to be called outside of the callback context.
However, calling jack_client_close()
outside of the shutdown callback as recommended seems to halt execution of the calling thread altogether, which makes me wonder if this issue is related to #2281 (closed).
I don't have logs for you because I wasn't sure what the best way to document the issue would be, but I'm happy to provide whatever info you need.