ucm-validator: catch up with alsa-info.sh, and add the Pine64 PineNote - #27
Open
cverorg wants to merge 3 commits into
Open
ucm-validator: catch up with alsa-info.sh, and add the Pine64 PineNote#27cverorg wants to merge 3 commits into
cverorg wants to merge 3 commits into
Conversation
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:<n>",
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>
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>
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-<machine id> paths and unrelated log filenames. Signed-off-by: cverorg <292680828+cverorg@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three commits: two validator fixes that are independent of any new hardware,
and the alsa-info.sh dump for a Pine64 PineNote, whose UCM profile is submitted
as alsa-project/alsa-ucm-conf#844.
1. The dump parser has fallen behind alsa-info.sh
Six sections the current script writes are missing from
SECTIONS, and anunknown section is fatal, so a dump taken today is rejected before it is read:
Sysfs card info,Sysfs ctl-led info,ACPI SoundWire Device Status Information,AC97 Codec information,USB Descriptors,USB Stream information.This already affects this repository, not just new submissions:
With the sections added, that file gets past the parser. It then fails on an
unrelated
${var:@HDA} is not defined, which I have not touched — I mention itso the fix is not mistaken for making ALC4080 pass.
The amixer regex has drifted the same way. It requires
Card hw:<n>, butalsa-info.sh addresses the card by id (
amixer -c PineNote info) and alsa-libanswers
Card sysdefault:0, so the match fails and the parse dies with anAttributeErroronNone. The patch accepts any control-device prefix andtakes the index after it. Older
Card hw:0dumps still match;configs/Rockchip/rk3399-gru-sound.txtwas re-run to confirm it still passes.2. A crash where an error message was intended
check_device_namesmeans to reject mixing an unindexed device with an indexedone of the same base, and has the message for it. It never reaches it when the
unindexed device sorts first —
Micleavesprev['index']asNone,Mic2evaluates
prev['index'] + 1:After the patch that profile reports
mixing non-indexed devices with indexed devices is not allowed (device "Mic2" previous "Mic"), which is what thefunction was already trying to say. This is how I found it: the PineNote
profile named its two capture devices
MicandMic2before I corrected it.3. configs/Rockchip/PineNote.txt
Generated with
--no-upload, and deliberately from an empty working directory:run from a populated one, an unquoted expansion in alsa-info.sh globs the
directory into the distro line. On this machine that pulled
systemd-private-<machine id>paths and unrelated log filenames into the dump,which is not something to commit to a public tree. Worth knowing for anyone
collecting these.
With all three applied, the PineNote profile validates clean:
Two things I could not evaluate and am not claiming to have fixed: the
allpass is red on an untouched alsa-ucm-conf master
(
USB-Audio/USB-Audio.conf: 'If'.'opt' If requires condition section), and 31of the 39 dumps in
configs/fail theconfigspass for reasons that predatethis branch. I have hardware and am happy to test anything.