From 595115758be25e7c17c9e843eb0e418848b99a82 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Fri, 16 Sep 2022 19:02:16 +0200 Subject: [PATCH] doc: ucm - add sequence graphs Signed-off-by: Jaroslav Kysela --- doc/pictures/Makefile.am | 10 +++++++- doc/pictures/ucm-seq-boot.puml | 17 ++++++++++++++ doc/pictures/ucm-seq-boot.svg | 27 +++++++++++++++++++++ doc/pictures/ucm-seq-device.puml | 26 +++++++++++++++++++++ doc/pictures/ucm-seq-device.svg | 36 ++++++++++++++++++++++++++++ doc/pictures/ucm-seq-verb.puml | 30 ++++++++++++++++++++++++ doc/pictures/ucm-seq-verb.svg | 40 ++++++++++++++++++++++++++++++++ src/ucm/ucm_confdoc.h | 7 ++++++ 8 files changed, 192 insertions(+), 1 deletion(-) create mode 100644 doc/pictures/ucm-seq-boot.puml create mode 100644 doc/pictures/ucm-seq-boot.svg create mode 100644 doc/pictures/ucm-seq-device.puml create mode 100644 doc/pictures/ucm-seq-device.svg create mode 100644 doc/pictures/ucm-seq-verb.puml create mode 100644 doc/pictures/ucm-seq-verb.svg diff --git a/doc/pictures/Makefile.am b/doc/pictures/Makefile.am index 17b6e12d..df3128bd 100644 --- a/doc/pictures/Makefile.am +++ b/doc/pictures/Makefile.am @@ -1 +1,9 @@ -EXTRA_DIST=wave1.gif wave2.gif +GIT_FILES=$(wildcard *.gif) +PUML_FILES=$(wildcard *.puml) +SVG_FILES=$(PUML_FILES:.puml=.svg) +EXTRA_DIST=$(GIT_FILES) $(PUML_FILES) $(SVG_FILES) + +all: $(SVG_FILES) + +.puml.svg: + plantuml -tsvg $< diff --git a/doc/pictures/ucm-seq-boot.puml b/doc/pictures/ucm-seq-boot.puml new file mode 100644 index 00000000..3b797280 --- /dev/null +++ b/doc/pictures/ucm-seq-boot.puml @@ -0,0 +1,17 @@ +@startuml +title "UCM sequence boot order (using udev and alsactl)" + +start +:Sound card detected (udev); +:UCM: FixedBootSequence; +if (Card state (/var/lib/alsa/asound.state)) then (not present) + :UCM: BootSequence; +else (present) + :alsactl: Restore state (from asound.state); +endif +:Standard sound card use (with or without UCM); +:Save sound card state (asound.state); +:Sound card detached; +stop + +@enduml diff --git a/doc/pictures/ucm-seq-boot.svg b/doc/pictures/ucm-seq-boot.svg new file mode 100644 index 00000000..867c817e --- /dev/null +++ b/doc/pictures/ucm-seq-boot.svg @@ -0,0 +1,27 @@ +UCM sequence boot order (using udev and alsactl)Sound card detected (udev)UCM: FixedBootSequenceCard state (/var/lib/alsa/asound.state)not presentpresentUCM: BootSequencealsactl: Restore state (from asound.state)Standard sound card use (with or without UCM)Save sound card state (asound.state)Sound card detached \ No newline at end of file diff --git a/doc/pictures/ucm-seq-device.puml b/doc/pictures/ucm-seq-device.puml new file mode 100644 index 00000000..a1c3f8cd --- /dev/null +++ b/doc/pictures/ucm-seq-device.puml @@ -0,0 +1,26 @@ +@startuml +title "UCM device sequence graph" + +start +split + :Enable device; + :EnableSequence; + :Use device; + :Disable device; + :DisableSequence; +split again + :Switch device; + :Disable old device; + if (TransitionSequence) then (present) + :TransitionSequence; + :Enable new device; + else (not present) + :Disable old device; + :DisableSequence; + :Enable new device; + :EnableSequence; + endif +end split +stop + +@enduml diff --git a/doc/pictures/ucm-seq-device.svg b/doc/pictures/ucm-seq-device.svg new file mode 100644 index 00000000..fff208dc --- /dev/null +++ b/doc/pictures/ucm-seq-device.svg @@ -0,0 +1,36 @@ +UCM device sequence graphEnable deviceEnableSequenceUse deviceDisable deviceDisableSequenceSwitch deviceDisable old deviceTransitionSequencepresentnot presentTransitionSequenceEnable new deviceDisable old deviceDisableSequenceEnable new deviceEnableSequence \ No newline at end of file diff --git a/doc/pictures/ucm-seq-verb.puml b/doc/pictures/ucm-seq-verb.puml new file mode 100644 index 00000000..e0e54805 --- /dev/null +++ b/doc/pictures/ucm-seq-verb.puml @@ -0,0 +1,30 @@ +@startuml +title "UCM verb sequence graph" + + +start +split + :Enable verb; + :SectionDefaults sequence; + :EnableSequence; + + :Enable, use and disable verb devices; + + :Disable verb; + :DisableSequence; +split again + :Switch verb; + :Disable old verb; + if (TransitionSequence) then (present) + :TransitionSequence; + :Enable new verb; + else (not present) + :Disable old verb; + :DisableSequence; + :Enable new verb; + :EnableSequence; + endif +end split +stop + +@enduml diff --git a/doc/pictures/ucm-seq-verb.svg b/doc/pictures/ucm-seq-verb.svg new file mode 100644 index 00000000..82eb9da6 --- /dev/null +++ b/doc/pictures/ucm-seq-verb.svg @@ -0,0 +1,40 @@ +UCM verb sequence graphEnable verbSectionDefaults sequenceEnableSequenceEnable, use and disable verb devicesDisable verbDisableSequenceSwitch verbDisable old verbTransitionSequencepresentnot presentTransitionSequenceEnable new verbDisable old verbDisableSequenceEnable new verbEnableSequence \ No newline at end of file diff --git a/src/ucm/ucm_confdoc.h b/src/ucm/ucm_confdoc.h index 27ec722e..cf928c67 100644 --- a/src/ucm/ucm_confdoc.h +++ b/src/ucm/ucm_confdoc.h @@ -218,6 +218,11 @@ SectionModifier."Capture Voice" { } ~~~ +### Sequence graphs + +\image html ucm-seq-verb.svg +\image html ucm-seq-device.svg + ### Sequence commands Command name | Description @@ -278,6 +283,8 @@ configuration like volumes or switches. The alsactl ensures the persistency (sto the state of the controls to the /var tree and loads the previous state in the next boot). +\image html ucm-seq-boot.svg + ### Device volume It is expected that the applications handle the volume settings. It is not recommended -- 2.47.1