alsa: use PIPEWIRE_REMOTE env variable

This commit is contained in:
Wim Taymans 2020-08-04 14:13:07 +02:00
parent 64067bafe3
commit 5bf6acad06
2 changed files with 11 additions and 0 deletions

View file

@ -1209,6 +1209,10 @@ SND_CTL_PLUGIN_DEFINE_FUNC(pipewire)
return -EINVAL;
}
str = getenv("PIPEWIRE_REMOTE");
if (str != NULL)
server = str;
if (fallback_name && name && !strcmp(name, fallback_name))
fallback_name = NULL; /* no fallback for the same name */
@ -1270,6 +1274,9 @@ SND_CTL_PLUGIN_DEFINE_FUNC(pipewire)
else
pw_properties_set(props, PW_KEY_APP_NAME, "ALSA plug-in");
if (server)
pw_properties_set(props, PW_KEY_REMOTE_NAME, server);
if ((err = pw_thread_loop_start(ctl->mainloop)) < 0)
goto error;

View file

@ -899,6 +899,10 @@ static int snd_pcm_pipewire_open(snd_pcm_t **pcmp, const char *name,
if (!pw)
return -ENOMEM;
str = getenv("PIPEWIRE_REMOTE");
if (str != NULL)
server_name = str;
str = getenv("PIPEWIRE_NODE");
pw_log_debug(NAME" %p: open %s %d %d %08x %d %s %d %d '%s'", pw, name,