mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
module-loopback: connect playback before capture
Connect the playback stream before the capture stream since the capture stream can otherwise trigger playback_process() before the playback node has been activated.
This commit is contained in:
parent
dee2a51eb0
commit
83f1de95c0
1 changed files with 14 additions and 15 deletions
|
|
@ -451,25 +451,11 @@ static int setup_streams(struct impl *impl)
|
||||||
&impl->playback_listener,
|
&impl->playback_listener,
|
||||||
&out_stream_events, impl);
|
&out_stream_events, impl);
|
||||||
|
|
||||||
n_params = 0;
|
/* connect playback first to activate it before capture triggers it */
|
||||||
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
|
||||||
params[n_params++] = spa_format_audio_raw_build(&b, SPA_PARAM_EnumFormat,
|
|
||||||
&impl->capture_info);
|
|
||||||
|
|
||||||
if ((res = pw_stream_connect(impl->capture,
|
|
||||||
PW_DIRECTION_INPUT,
|
|
||||||
PW_ID_ANY,
|
|
||||||
PW_STREAM_FLAG_AUTOCONNECT |
|
|
||||||
PW_STREAM_FLAG_MAP_BUFFERS |
|
|
||||||
PW_STREAM_FLAG_RT_PROCESS,
|
|
||||||
params, n_params)) < 0)
|
|
||||||
return res;
|
|
||||||
|
|
||||||
n_params = 0;
|
n_params = 0;
|
||||||
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
||||||
params[n_params++] = spa_format_audio_raw_build(&b, SPA_PARAM_EnumFormat,
|
params[n_params++] = spa_format_audio_raw_build(&b, SPA_PARAM_EnumFormat,
|
||||||
&impl->playback_info);
|
&impl->playback_info);
|
||||||
|
|
||||||
if ((res = pw_stream_connect(impl->playback,
|
if ((res = pw_stream_connect(impl->playback,
|
||||||
PW_DIRECTION_OUTPUT,
|
PW_DIRECTION_OUTPUT,
|
||||||
PW_ID_ANY,
|
PW_ID_ANY,
|
||||||
|
|
@ -480,6 +466,19 @@ static int setup_streams(struct impl *impl)
|
||||||
params, n_params)) < 0)
|
params, n_params)) < 0)
|
||||||
return res;
|
return res;
|
||||||
|
|
||||||
|
n_params = 0;
|
||||||
|
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
||||||
|
params[n_params++] = spa_format_audio_raw_build(&b, SPA_PARAM_EnumFormat,
|
||||||
|
&impl->capture_info);
|
||||||
|
if ((res = pw_stream_connect(impl->capture,
|
||||||
|
PW_DIRECTION_INPUT,
|
||||||
|
PW_ID_ANY,
|
||||||
|
PW_STREAM_FLAG_AUTOCONNECT |
|
||||||
|
PW_STREAM_FLAG_MAP_BUFFERS |
|
||||||
|
PW_STREAM_FLAG_RT_PROCESS,
|
||||||
|
params, n_params)) < 0)
|
||||||
|
return res;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue