filter-chain: allow unconnected filter ports

When there are unconnected filter ports, allow this but give a warning.
Improve error messages.
This commit is contained in:
Wim Taymans 2022-06-21 13:07:11 +02:00
parent eb26c2a95e
commit a4998e0b87

View file

@ -1690,19 +1690,28 @@ static int setup_graph(struct graph *graph, struct spa_json *inputs, struct spa_
* graph n_hndl times when needed. */
n_hndl = impl->capture_info.channels / n_input;
if (n_hndl != impl->playback_info.channels / n_output) {
pw_log_error("invalid channels");
pw_log_error("invalid channels. The capture stream has %1$d channels and "
"the filter has %2$d inputs. The playback stream has %3$d channels "
"and the filter has %4$d outputs. capture:%1$d / input:%2$d != "
"playback:%3$d / output:%4$d. Check inputs and outputs objects.",
impl->capture_info.channels, n_input,
impl->playback_info.channels, n_output);
res = -EINVAL;
goto error;
}
if (n_hndl > MAX_HNDL) {
pw_log_error("too many channels");
pw_log_error("too many channels. %d > %d", n_hndl, MAX_HNDL);
res = -EINVAL;
goto error;
}
if (n_hndl == 0) {
pw_log_error("not enough channels");
res = -EINVAL;
goto error;
n_hndl = 1;
pw_log_warn("The capture stream has %1$d channels and "
"the filter has %2$d inputs. The playback stream has %3$d channels "
"and the filter has %4$d outputs. Some filter ports will be "
"unconnected..",
impl->capture_info.channels, n_input,
impl->playback_info.channels, n_output);
}
pw_log_info("using %d instances %d %d", n_hndl, n_input, n_output);