Sequences

The sequences are a custom scripting system for UCM. These are used in the EnableSequence and DisableSequence blocks in the usecase files and in the BootSequence and SequenceDefaults in the master file:

EnableSequence [
    cset "name='Master Playback Switch' on"
    cset "name='AIF1 DA0 Stereo Playback Route' Mix Mono"
    cset "name='Earpiece Playback Volume' 100%"
    cdev "hw:0"
    usleep 10000
    msleep 10
    exec "apt-get install pipewire"
    shell "-dnf purge linux"
    cset-bin-file "path-to-the-file.bin"
    cset-tlv ????
    cset-new "name='Cool demo Switch' type=bool,count=1 off"
    ctl-remove ???
    sysw "-/class/sound/example/attach:coolvalue"
    cfg-save ???
    comment "Yes this does nothing"
]

Every line in the sequence is a command that will be executed in the defined order. The most common command is cset whichs sets the value of an alsa control.

cset

The cset command takes a single string as argument which is a control set description. The syntax of this is the same as the amixer cset commandline tool.

cdev

The cdev command allows the script to switch to another device to manage in the middle of the sequence. The sequence starts off controlling the controls in the PCM defined in the PlaybackPCM or CapturePCM in the variables section.

usleep / msleep

This is for inserting a delay before executing the rest of the commands. The usleep command takes the sleep time in microseconds and the msleep command takes it in milliseconds.

exec / shell

The exec and shell commands add arbitrary command executing to the mix. The difference between exec and shell is that exec will run the defined command with fork() andexecve() and shell will dump the command straight into system()

If the first char of the command is “-” the return status of the executed command is ignored.

The main usecase for this seems to be calling modprobe

sysw

Sysw is the sysfs write command. The first part is the file in sysfs to write without the leading /sys, then a colon and the value to write to the sysfs node.

This command also accepts “-” as the first character to make this ignore errors.

The main usecase for this seems to be calling “attach” nodes in sysfs to bind leds.

cset-new

This command can be used to define a new control. This seems to be used in the BootSequence to define a dummy switch to control leds.