pipewire-jack doesn't properly honor jack_open_client() JackUseExactName flag option flag
pipewire --version pipewire Compiled with libpipewire 0.3.58 Linked with libpipewire 0.3.58
jack_client_open function should fail with a returned status code of JackNameNotUnique when a new client requests a name that already exists. Instead, jack_client_open returns a client with a jack name slightly different than the requested conflicting name, and a subsequent call on the new client of jack_get_client_name(client) returns the original conflicting name, not the modified name.
Here is a simple example program that you can use to see the problem by running with the first parameter to a client name that already in use:
#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <jack/jack.h>
int main(int argc, char *argv[]){ // name to assign is first parameter const char *server = NULL; jack_options_t options = JackUseExactName; jack_client_t *client; jack_status_t status;
client = jack_client_open(argv[1], options, &status, server);
if(client == NULL) {
if(status & JackServerFailed)
fprintf(stderr, "\nERROR: Unable to connect to JACK server\n");
else
fprintf(stderr, "\nERROR: jack_client_open() failed\n");
return -1;
}
if(status & JackNameNotUnique)
fprintf(stdout, "\nSTATUS: jack_client_open() assigned different client name.\n");
fprintf(stdout, "\nNAME: jack_client_open() client name = %s\n", jack_get_client_name(client));
sleep(30);
finish: jack_client_close(client); return 0; }