]> git.alsa-project.org Git - alsa-lib.git/commit
ucm: add sys-card substitution
authorJaroslav Kysela <perex@perex.cz>
Thu, 13 Mar 2025 16:46:58 +0000 (17:46 +0100)
committerJaroslav Kysela <perex@perex.cz>
Thu, 13 Mar 2025 17:28:05 +0000 (18:28 +0100)
commit7fbd47ce797939862025ef424865570dcdc2565b
tree1026b9f205eb9fc49424682a0262ba95985b689d
parent0c7086777aa4e6076a8277b3918c5243daf1c56a
ucm: add sys-card substitution

It may be useful to check additional sysfs parameters like USB descriptors
to determine the exact hardware capabilities.

Introduce 'sys-card' substitution and 'sys' substitution to allow data
fetching from given range. Also, add conversion to hexadecimal format
when the source file has binary contents.

Example - fetch bytes from positions 0x10..0x15 (6 bytes):

  Define.Bytes1 "${sys-card:[type=hex,pos=0x10,size=6]device/../descriptors}"

Example - fetch one byte from position 0x22:

  Define.Bytes2 "${sys-card:[type=hex,pos=0x22]device/../descriptors}"

Replace type=hex or omit this variable settings to work with ASCII
characters.

Link: https://github.com/alsa-project/alsa-ucm-conf/issues/444
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
src/ucm/ucm_local.h
src/ucm/ucm_subs.c