From 0a7f5d5cd158ff63dce85f9e43a84219ae0c3707 Mon Sep 17 00:00:00 2001 From: cverorg <292680828+cverorg@users.noreply.github.com> Date: Mon, 31 Aug 2026 15:54:20 +0900 Subject: [PATCH 1/3] alsainfo: keep up with the sections alsa-info.sh emits Any dump from a current alsa-info.sh is rejected before it is read. Six of the sections it writes are absent from SECTIONS, and an unknown section is fatal: Sysfs card info Sysfs ctl-led info ACPI SoundWire Device Status Information AC97 Codec information USB Descriptors USB Stream information This is not hypothetical for new submissions only -- configs/USB/ALC4080.txt, already in this tree, fails with "unknown section 'Sysfs card info'". With these added it gets past the parser (it then hits an unrelated ${var:@HDA} problem, which is a separate matter). The amixer block regex has drifted the same way. It requires "Card hw:", but alsa-info.sh addresses the card by id (amixer -c PineNote info) and alsa-lib answers "Card sysdefault:0", so the match fails and the parse dies with an AttributeError on None. Accept any control-device prefix and take the card index after it; the older "Card hw:0" dumps in configs/ still match, and configs/Rockchip/rk3399-gru-sound.txt was checked for that. Signed-off-by: cverorg <292680828+cverorg@users.noreply.github.com> --- python/lib/alsainfo.py | 49 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/python/lib/alsainfo.py b/python/lib/alsainfo.py index c65a8d6..51226a4 100644 --- a/python/lib/alsainfo.py +++ b/python/lib/alsainfo.py @@ -31,6 +31,12 @@ 'Alsactl output': 'Alsactl', 'All Loaded Modules': 'AllModules', 'Sysfs Files': 'Sysfs', + 'Sysfs card info': 'SysfsCard', + 'Sysfs ctl-led info': 'SysfsCtlLed', + 'ACPI SoundWire Device Status Information': 'AcpiSoundWire', + 'AC97 Codec information': 'Ac97Codec', + 'USB Descriptors': 'UsbDescriptors', + 'USB Stream information': 'UsbStream', 'ALSA/HDA dmesg': 'Dmesg', 'Packages installed': 'Packages' } @@ -225,7 +231,12 @@ def __init__(self, parent, text): self.text = text blocks = text.split('!!--') r1 = r".*--Mixer controls for card (?P\w+) \[(?P.*)\]\n\nCard hw:.*\n[ \t]*Mixer name[ \t]*: '(?P.*)'\n[ \t]*Components[ \t]*: '(?P.*)'\n" - r2 = r".*--Mixer controls for card (?P.*)\n\nCard hw:(?P\w+).*\n[ \t]*Mixer name[ \t]*: '(?P.*)'\n[ \t]*Components[ \t]*: '(?P.*)'\n" + # amixer names the control device it opened, and which name that is + # depends on how alsa-info.sh addressed the card. Current versions pass + # the card id (`amixer -c PineNote info`) and alsa-lib answers + # "Card sysdefault:0"; older dumps in configs/ say "Card hw:0". Accept + # any device prefix and take the card index that follows it. + r2 = r".*--Mixer controls for card (?P.*)\n\nCard [^\s:]+:(?P\d+).*\n[ \t]*Mixer name[ \t]*: '(?P.*)'\n[ \t]*Components[ \t]*: '(?P.*)'\n" for block in blocks: if not block: continue @@ -269,6 +280,42 @@ def __init__(self, parent, text): self.parent = parent self.text = text +class AlsaInfoSysfsCard: + + def __init__(self, parent, text): + self.parent = parent + self.text = text + +class AlsaInfoSysfsCtlLed: + + def __init__(self, parent, text): + self.parent = parent + self.text = text + +class AlsaInfoAcpiSoundWire: + + def __init__(self, parent, text): + self.parent = parent + self.text = text + +class AlsaInfoAc97Codec: + + def __init__(self, parent, text): + self.parent = parent + self.text = text + +class AlsaInfoUsbDescriptors: + + def __init__(self, parent, text): + self.parent = parent + self.text = text + +class AlsaInfoUsbStream: + + def __init__(self, parent, text): + self.parent = parent + self.text = text + class AlsaInfo: """Parses the output from the alsa-info.sh file.""" From 209fd69a3c88b4a8a3629457cd7475c63825fbbe Mon Sep 17 00:00:00 2001 From: cverorg <292680828+cverorg@users.noreply.github.com> Date: Mon, 31 Aug 2026 15:54:29 +0900 Subject: [PATCH 2/3] ucm-validator: report the mixed-index case instead of crashing on it check_device_names means to reject a verb that mixes an unindexed device with an indexed one of the same base, and says so in the else branch. It never gets there when the unindexed device sorts first: "Mic" leaves prev['index'] as None, "Mic2" then evaluates prev['index'] + 1 and the run dies with TypeError: unsupported operand type(s) for +: 'NoneType' and 'int' Check for it and raise the error the function already has. A profile with SectionDevice."Mic" and SectionDevice."Mic2" now reports mixing non-indexed devices with indexed devices is not allowed (device "Mic2" previous "Mic") Signed-off-by: cverorg <292680828+cverorg@users.noreply.github.com> --- python/ucm-validator/ucmlib.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/python/ucm-validator/ucmlib.py b/python/ucm-validator/ucmlib.py index 8fa44cc..0a597f0 100644 --- a/python/ucm-validator/ucmlib.py +++ b/python/ucm-validator/ucmlib.py @@ -573,7 +573,13 @@ def check_device_names(self): if prev and prev['base'] == d['base']: if d['index']: index = int(d['index']) - if prev and index > 1: + if prev['index'] is None: + # The previous device of this base had no index at all + # ("Mic" followed by "Mic2"). That is the same mixing + # the else branch below reports; without this it fell + # through to None + 1 and raised TypeError instead. + self.error(0, 'mixing non-indexed devices with indexed devices is not allowed (device "%s" previous "%s")' % (name, prev['name'])) + elif index > 1: if prev['index'] + 1 != index: self.error(0, 'non-continous device index (device "%s" previous "%s")' % (name, prev['name'])) else: From 7b846bd1916c2983d2079f7ca7eb689ae2e2c764 Mon Sep 17 00:00:00 2001 From: cverorg <292680828+cverorg@users.noreply.github.com> Date: Mon, 31 Aug 2026 15:54:37 +0900 Subject: [PATCH 3/3] configs: add the Pine64 PineNote alsa-info.sh output for the PineNote, so the UCM profile submitted to alsa-ucm-conf as "Rockchip: add PineNote (rk817 + PDM microphone array)" can be validated without the hardware. The card is a simple-card pairing an rk817 codec with a four-microphone PDM array on a second PCM. Generated with --no-upload from an empty working directory. The latter matters: run from a populated one, an unquoted expansion in alsa-info.sh globs the directory into the distro line, which on this machine pulled in systemd-private- paths and unrelated log filenames. Signed-off-by: cverorg <292680828+cverorg@users.noreply.github.com> --- .../configs/Rockchip/PineNote.txt | 400 ++++++++++++++++++ 1 file changed, 400 insertions(+) create mode 100644 python/ucm-validator/configs/Rockchip/PineNote.txt diff --git a/python/ucm-validator/configs/Rockchip/PineNote.txt b/python/ucm-validator/configs/Rockchip/PineNote.txt new file mode 100644 index 0000000..284ea3e --- /dev/null +++ b/python/ucm-validator/configs/Rockchip/PineNote.txt @@ -0,0 +1,400 @@ +name=user&type=33&description=/tmp/alsa-info.txt&expiry=&s=Submit+Post&content= +!!################################ +!!ALSA Information Script v 0.5.4 +!!################################ + +!!Script ran on: Mon Aug 31 06:53:34 UTC 2026 + + +!!Linux Distribution +!!------------------ + +Debian GNU/Linux trixie/sid + \l PRETTY_NAME="Debian GNU/Linux trixie/sid" NAME="Debian GNU/Linux" ID=debian HOME_URL="https://www.debian.org/" SUPPORT_URL="https://www.debian.org/support" BUG_REPORT_URL="https://bugs.debian.org/" git@github.com:PNDeb/pinenote-debian-image.git 14d3043 only-factory-build: * reinstall u-boot files from shipped files upon first boot this is required to fix issues with the factory Windows flashing tools + + +!!DMI Information +!!--------------- + +Manufacturer: +Product Name: +Product Version: +Firmware Version: +System SKU: +Board Vendor: +Board Name: + + +!!ACPI Device Status Information +!!--------------- + + + +!!ACPI SoundWire Device Status Information +!!--------------- + + + +!!Kernel Information +!!------------------ + +Kernel release: #1 SMP Tue Jan 28 17:04:28 CST 2025 +Operating System: GNU/Linux +Architecture: aarch64 +Processor: unknown +SMP Enabled: No + + +!!ALSA Version +!!------------ + +Driver version: k6.12.11-pinenote-202501281646-00249-g211ba27556cc +Library version: 1.2.14 +Utilities version: 1.2.14 + + +!!Loaded ALSA modules +!!------------------- + +snd_soc_simple_card (card 0) + + +!!Sound Servers on this system +!!---------------------------- + + +!!Soundcards recognised by ALSA +!!----------------------------- + + 0 [PineNote ]: simple-card - PineNote + PineNote + + +!!Modprobe options (Sound related) +!!-------------------------------- + +snd_pcsp: index=-2 +snd_atiixp_modem: index=-2 +snd_intel8x0m: index=-2 +snd_via82xx_modem: index=-2 + + +!!Loaded sound module options +!!--------------------------- + +!!Module: snd_soc_simple_card +-ne +* : + + +!!Sysfs card info +!!--------------- + +!!Card: /sys/class/sound/card0 +Driver: /sys/bus/platform/drivers/asoc-simple-card +Tree: + /sys/class/sound/card0 + |-- controlC0 + | |-- dev + | |-- device -> ../../card0 + | |-- power + | |-- subsystem -> ../../../../../../class/sound + | `-- uevent + |-- device -> ../../../sound + |-- id + |-- number + |-- pcmC0D0c + | |-- dev + | |-- device -> ../../card0 + | |-- pcm_class + | |-- power + | |-- subsystem -> ../../../../../../class/sound + | `-- uevent + |-- pcmC0D0p + | |-- dev + | |-- device -> ../../card0 + | |-- pcm_class + | |-- power + | |-- subsystem -> ../../../../../../class/sound + | `-- uevent + |-- pcmC0D1c + | |-- dev + | |-- device -> ../../card0 + | |-- pcm_class + | |-- power + | |-- subsystem -> ../../../../../../class/sound + | `-- uevent + |-- power + | |-- async + | |-- autosuspend_delay_ms + | |-- control + | |-- runtime_active_kids + | |-- runtime_active_time + | |-- runtime_enabled + | |-- runtime_status + | |-- runtime_suspended_time + | `-- runtime_usage + |-- subsystem -> ../../../../../class/sound + `-- uevent + + +!!ALSA Device nodes +!!----------------- + +crw-rw----+ 1 root audio 116, 5 Aug 30 01:18 /dev/snd/controlC0 +crw-rw----+ 1 root audio 116, 3 Aug 30 01:18 /dev/snd/pcmC0D0c +crw-rw----+ 1 root audio 116, 2 Aug 30 01:18 /dev/snd/pcmC0D0p +crw-rw----+ 1 root audio 116, 4 Aug 30 01:18 /dev/snd/pcmC0D1c +crw-rw----+ 1 root audio 116, 33 Aug 30 01:18 /dev/snd/timer + +/dev/snd/by-path: +total 0 +drwxr-xr-x 2 root root 60 Aug 30 01:18 . +drwxr-xr-x 3 root root 160 Aug 30 01:18 .. +lrwxrwxrwx 1 root root 12 Aug 30 01:18 platform-sound -> ../controlC0 + + +!!Aplay/Arecord output +!!-------------------- + +APLAY + +**** List of PLAYBACK Hardware Devices **** +card 0: PineNote [PineNote], device 0: fe410000.i2s-rk817-hifi rk817-hifi-0 [fe410000.i2s-rk817-hifi rk817-hifi-0] + Subdevices: 1/1 + Subdevice #0: subdevice #0 + +ARECORD + +**** List of CAPTURE Hardware Devices **** +card 0: PineNote [PineNote], device 0: fe410000.i2s-rk817-hifi rk817-hifi-0 [fe410000.i2s-rk817-hifi rk817-hifi-0] + Subdevices: 1/1 + Subdevice #0: subdevice #0 +card 0: PineNote [PineNote], device 1: fe440000.pdm-dmic-hifi dmic-hifi-1 [fe440000.pdm-dmic-hifi dmic-hifi-1] + Subdevices: 1/1 + Subdevice #0: subdevice #0 + +!!Amixer output +!!------------- + +!!-------Mixer controls for card PineNote + +Card sysdefault:0 'PineNote'/'PineNote' + Mixer name : '' + Components : '' + Controls : 5 + Simple ctrls : 4 +Simple mixer control 'Master',0 + Capabilities: pvolume cvolume + Playback channels: Front Left - Front Right + Capture channels: Front Left - Front Right + Limits: Playback 0 - 255 Capture 0 - 255 + Front Left: Playback 217 [85%] [-14.16dB] Capture 255 [100%] [0.00dB] + Front Right: Playback 217 [85%] [-14.16dB] Capture 255 [100%] [0.00dB] +Simple mixer control 'Mic Capture Gain',0 + Capabilities: volume + Playback channels: Front Left - Front Right + Capture channels: Front Left - Front Right + Limits: 0 - 15 + Front Left: 15 [100%] [27.00dB] + Front Right: 15 [100%] [27.00dB] +Simple mixer control 'Playback Mux',0 + Capabilities: enum + Items: 'HP' 'SPK' + Item0: 'HP' +Simple mixer control 'Internal Speakers',0 + Capabilities: pswitch pswitch-joined + Playback channels: Mono + Mono: Playback [on] + + +!!Alsactl output +!!-------------- + +--startcollapse-- +state.PineNote { + control.1 { + iface MIXER + name 'Master Playback Volume' + value.0 217 + value.1 217 + comment { + access 'read write' + type INTEGER + count 2 + range '0 - 255' + dbmin -9500 + dbmax 0 + dbvalue.0 -1416 + dbvalue.1 -1416 + } + } + control.2 { + iface MIXER + name 'Master Capture Volume' + value.0 255 + value.1 255 + comment { + access 'read write' + type INTEGER + count 2 + range '0 - 255' + dbmin -9500 + dbmax 0 + dbvalue.0 0 + dbvalue.1 0 + } + } + control.3 { + iface MIXER + name 'Mic Capture Gain' + value.0 15 + value.1 15 + comment { + access 'read write' + type INTEGER + count 2 + range '0 - 15' + dbmin -1800 + dbmax 2700 + dbvalue.0 2700 + dbvalue.1 2700 + } + } + control.4 { + iface MIXER + name 'Internal Speakers Switch' + value true + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.5 { + iface MIXER + name 'Playback Mux' + value HP + comment { + access 'read write' + type ENUMERATED + count 1 + item.0 HP + item.1 SPK + } + } +} +--endcollapse-- + + +!!All Loaded Modules +!!------------------ + +adc_keys +aes_ce_blk +aes_ce_cipher +af_alg +algif_hash +algif_skcipher +bluetooth +bnep +brcmfmac +brcmfmac_wcc +brcmutil +btbcm +cfg80211 +crc_itu_t +cyttsp5 +drm +drm_display_helper +drm_dma_helper +drm_epd_helper +drm_kms_helper +drm_panel_orientation_quirks +drm_shmem_helper +drm_ttm_helper +dw_hdmi +dw_mipi_dsi +ecc +ecdh_generic +fuse +gf128mul +ghash_ce +gpio_rockchip +gpu_sched +hantro_vpu +hci_uart +i2c_hid +i2c_hid_of +industrialio +industrialio_triggered_buffer +industrialio_triggered_event +ip_tables +kfifo_buf +libaes +mc +mousedev +nf_tables +nfnetlink +panel_simple +panfrost +phy_rockchip_inno_usb2 +polyval_ce +polyval_generic +rfkill +rockchip_dfi +rockchip_ebc +rockchip_saradc +rockchipdrm +sha1_ce +sha1_generic +sha256_arm64 +sha2_ce +snd +snd_pcm +snd_pcm_dmaengine +snd_soc_bt_sco +snd_soc_core +snd_soc_dmic +snd_soc_rk817 +snd_soc_rockchip_i2s_tdm +snd_soc_rockchip_pdm +snd_soc_simple_amplifier +snd_soc_simple_card +snd_soc_simple_card_utils +snd_timer +soundcore +spi_bitbang +spi_gpio +st_accel +st_accel_i2c +st_sensors +st_sensors_i2c +tps65185_regulator +ttm +tun +uhid +v4l2_h264 +v4l2_jpeg +v4l2_mem2mem +v4l2_vp9 +videobuf2_common +videobuf2_dma_contig +videobuf2_memops +videobuf2_v4l2 +videodev +wusb3801 +x_tables + + +!!ALSA/HDA dmesg +!!-------------- + + + +!!Packages installed +!!-------------------- + +ii alsa-ucm-conf 1.2.14-1 all ALSA Use Case Manager configuration files +ii alsa-utils 1.2.14-1 arm64 Utilities for configuring and using ALSA +