LADI
/
spa
1
Fork 0

impl-node: don't move rate/quantum when moving drivers

When we move a node from one driver to another, don't move the rate
and quantum because this tricks the new driver into thinking it's
already in the correct rate and it will skip doing a complete rate
switch.

This causes some nodes to fail to switch to the new rate, like in this
scenario:

1. mpv (node.always-process = true) appears and is added to the dummy
   driver with rate/quantum of 48000/512
2. mpv is linked to an equalizer, linked to a sink, nodes are moved
   to the new sink, target rate/quantum is copied to the new sink.
3. sink and followers are started in 48000/512, all is good. The sink
   is now configured in 48000/512.
4. mpv is stopped, sinks and eq (input, not output) suspend
5. mpv appears again with 44100/512 and is added to dummy driver, which
   is then configured in 44100/512
6. mpv is linked again to eq, nodes are moved, the sink rate/quantum
   is copied and the sink thinks it's in 44100/512
7. sink and followes are started but no rate switch is happening because
   rate/quantum was copied in step 6. Some followers are not suspended
   and don't apply the rate change correctly (eq output).

By eliminating the rate/quantum copy when moving drivers, the sink will
correctly perform the rate change on all nodes.

Fixes #3159
This commit is contained in:
Wim Taymans 2023-04-25 10:13:02 +02:00
parent 78e54b1b2a
commit a544c5d4ad
1 changed files with 0 additions and 12 deletions

View File

@ -841,18 +841,6 @@ int pw_impl_node_set_driver(struct pw_impl_node *node, struct pw_impl_node *driv
remove_segment_owner(old, node->info.id);
if (old != node && old->driving && driver->info.state < PW_NODE_STATE_RUNNING) {
pw_log_info("move quantum:%"PRIu64"->%"PRIu64" rate:%d->%d (%s-%d -> %s-%d)",
driver->target_quantum,
old->target_quantum,
driver->target_rate.denom,
old->target_rate.denom,
old->name, old->info.id,
driver->name, driver->info.id);
driver->target_rate = old->target_rate;
driver->target_quantum = old->target_quantum;
driver->target_pending = true;
}
was_driving = node->driving;
node->driving = node->driver && driver == node;