ucm: implement ValueDefaults.BootCardGroup and define use

We need a boot synchronization for multiple UCM cards where linking
is expected like AMD ACP or Intel AVS drivers. This method is
using a timestamp file which can be created and modified during
the boot process (e.g. from the alsactl tool).

The goal is to return a valid UCM configuration for standard
applications combining multiple ALSA cards into one UCM configuration
and cover the time window when all cards have not been probed yet.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Jaroslav Kysela 2025-12-01 13:32:10 +01:00
parent 5c4a683bd0
commit 554efca497
5 changed files with 356 additions and 12 deletions

View file

@ -462,6 +462,38 @@ boot).
\image html ucm-seq-boot.svg
#### Boot Synchronization (Syntax 8+)
The *BootCardGroup* value in *ValueDefaults* allows multiple sound cards to coordinate
their boot sequences. This value is detected at boot (alsactl/udev/systemd) time. Boot
tools can provide boot synchronization information through a control element named
'Boot' with 64-bit integer type. When present, the UCM library uses this control element
to coordinate initialization timing.
The 'Boot' control element contains:
- **index 0**: Boot time in CLOCK_MONOTONIC_RAW (seconds)
- **index 1**: Restore time in CLOCK_MONOTONIC_RAW (seconds)
- **index 2**: Primary card number (identifies also group)
The UCM open call waits until the boot timeout has passed or until restore state
is notified through the synchronization Boot element. The timeout defaults to 30 seconds
and can be customized using 'BootCardSyncTime' in 'ValueDefaults' (maximum 240 seconds).
If the 'Boot' control element is not present, no boot synchronization is performed.
Other cards in the group (primary card number is different) will have the "Linked"
value set to "1", allowing UCM configuration files to detect and handle secondary
cards appropriately.
Example configuration:
~~~{.html}
ValueDefaults {
BootCardGroup "amd-acp"
BootCardSyncTime 10 # seconds
}
~~~
### Device volume
It is expected that the applications handle the volume settings. It is not recommended