Understanding the mix policy with multiple audio types with the same priority

It's important to understand what happens when you have multiple audio types with the same priority. If you have three audio types with the same priority and you had set the duck_same_prio_policy key as mix. All the streams' volume levels are ducked according to the various duck_same_prior_percent settings.

Any new active streams will immediately apply ducking to other audio streams based on the settings that are specified. If there are multiple configurations specified for the same channel, then the strictest (lowest) value configured for the other channels is applied.

Let's illustrate with an example. Let's say you have three audio types (multimedia1, multimedia2, and multimedia3) configured with same priority and for channels (stereo). Each audio type has these channel settings for the duck_same_prio_percent key:

Therefore, the values for each audio type duck to the lowest (strictest) value based on the channel settings imposed by other audio types of the same priority. Based on the settings mentioned previously, the audio streams end up with the volume levels ducked in the following manner:

Here's what the audio types would look like in the audio policy configuration file:

...
...
[audio_type]
name=multimedia1
prio=same
duck_same_prio_policy=mix
duck_same_prio_percent=ch0:10,ch1:50
duck_lower_prio_percent=20

[audio_type]
name=multimedia2
prio=same
duck_same_prio_policy=mix
duck_same_prio_percent=ch0:0,ch1:100
duck_lower_prio_percent=20

[audio_type]
name=multimedia3
prio=same
duck_same_prio_policy=mix
duck_same_prio_percent=ch0:100,ch1:100
duck_lower_prio_percent=20
...
...