sound: bring up the mici audio card on the mainline kernel - #128
Draft
greatgitsby wants to merge 4 commits into
Draft
sound: bring up the mici audio card on the mainline kernel#128greatgitsby wants to merge 4 commits into
greatgitsby wants to merge 4 commits into
Conversation
Wire up the comma four (mici) audio card end to end on vamOS: kernel config, device tree, ADSP firmware, driver fixes, and the runit userspace init. Kernel: - vamos.config: enable the QDSP6 audio stack (APR, PD mapper, Q6V5 PAS, SoundWire, SND_SOC_QDSP6/SDM845/SPDIF). - sdm845-comma-mici.dts: describe the sound card. adsp_pas is enabled with firmware-name qcom/sdm845/adsp.mbn; q6afedai/q6asmdai declare Secondary MI2S RX/TX and the MultiMedia1 (RX) / MultiMedia2 (TX) frontends; the qcom sdm845-sndcard links MM1/MM2 to spdif-dit/dir dummy codecs over sec_mi2s. - patches 0013-0015: guard NULL dai ops in snd_soc_dai_set/get_stream (the spdif dummy codecs register without an ops struct); constrain q6asm audio buffer IOVAs to the ADSP shared-mem aperture the downstream AVS 2.8 firmware validates against; track DSP stream open state across prepare failures so a failed prepare doesn't leak the stream for the rest of the boot. Firmware: - ship the factory ADSP PAS firmware (adsp.mdt + adsp.b00..b13) pulled from the device, tracked in LFS; Dockerfile symlinks adsp.mbn -> adsp.mdt so the q6v5-pas loader finds the MDT header and loads the segments alongside it. Userspace: - sound_init.sh: the ADSP auto-boots via q6v5-pas, so just wait for the commamici ASoC card, fix /dev/snd perms (no udev rule fires), and route MultiMedia1->SEC_MI2S_RX (playback hw:0,0) + MultiMedia2->SEC_MI2S_TX (capture hw:0,1). Bail cleanly if no card appears (e.g. tizi). - asound.conf: card-id-gated asym default so PortAudio opens playback on hw:0,0 and capture on hw:0,1. - drop the downstream adsp/cdsp remoteproc services, adsp-start.sh, and amplifier.py; init.qcom.sh no longer pokes the downstream subsys restart knobs.
The q6v5-pas driver auto-boots the ADSP at probe (~0.5s), but with no initramfs the rootfs firmware isn't available yet, so the load fails with -ENOENT and the remoteproc stays offline permanently -- the sound card never registers (msm-snd-sdm845 deferred-probes forever on "error getting cpu dai name"). Start the adsp explicitly from sound_init, which runs as root after /lib/firmware is mounted, so the baked-in adsp.mbn loads and the q6 audio services come up. Verified on device: card commamici registers, pcm0p/pcm1c present, aplay hw:0,0 and arecord hw:0,1 both run clean with no q6asm errors.
vamOS System ProfileChanges vs master
Directory size changes (>1MB)
Top 10 Directories
Category Breakdown
Top 10 Packages by Size
|
| File | Size |
|---|---|
| /usr/lib/llvm/21/lib/libLLVM.so.21.1 | 124.3MB |
| /usr/lib/llvm/21/lib/libMLIR.so.21.1 | 89.7MB |
| /usr/lib/llvm/21/bin/mlir-transform-opt | 82.9MB |
| /usr/lib/llvm/21/lib/libclang-cpp.so.21.1 | 56MB |
| /usr/bin/uv | 54MB |
| /usr/lib/llvm/21/bin/mlir-translate | 53.2MB |
| /usr/lib/llvm/21/bin/llvm-exegesis | 52MB |
| /usr/lib/llvm/21/bin/llvm-bolt-binary-analysis | 50.6MB |
| /usr/lib/gcc/aarch64-linux-gnu/14.2/gnat1 | 40.1MB |
| /usr/bin/gdb | 39.1MB |
| /usr/lib/libgallium-26.1.3.so | 37.7MB |
| /usr/lib/gcc/aarch64-linux-gnu/14.2/cc1plus | 37.3MB |
| /usr/lib/libllvm-qcom.so | 35.2MB |
| /usr/lib/gcc/aarch64-linux-gnu/14.2/cc1 | 35.2MB |
| /usr/lib/libRusticlOpenCL.so.1.0.0 | 34.3MB |
| /usr/lib/gcc/aarch64-linux-gnu/14.2/lto1 | 33.9MB |
| /usr/bin/lto-dump | 33.9MB |
| /usr/local/venv/bin/ruff | 31.8MB |
| /usr/share/icu/78.3/icudt78l.dat | 31.5MB |
| /usr/lib/llvm/21/lib/libclang.so.21.1.7 | 30.2MB |
| /usr/lib/llvm/21/bin/c-index-test | 28.6MB |
| /usr/local/venv/lib/python3.12/site-packages/gcc_arm_none_eabi/toolchain/libexec/gcc/arm-none-eabi/13.2.1/cc1 | 28.2MB |
| /usr/lib/libz3.so | 27.9MB |
| /usr/bin/run | 26.7MB |
| /usr/local/venv/lib/python3.12/site-packages/numpy.libs/libscipy_openblas64_-71e1b124.so | 23.6MB |
| /usr/comma/updater | 23.5MB |
| /usr/comma/setup | 23.5MB |
| /usr/comma/reset | 23.5MB |
| /usr/local/uv/python/cpython-3.12.13-linux-aarch64-gnu/bin/python3.12 | 22.2MB |
| /usr/local/uv/python/cpython-3.12.13-linux-aarch64-gnu/lib/libpython3.12.so.1.0 | 22.1MB |
okias
reviewed
Aug 3, 2026
Comment on lines
+153
to
+158
| sec_mi2s_active: sec-mi2s-active-state { | ||
| pins = "gpio80", "gpio81", "gpio82", "gpio83"; | ||
| function = "sec_mi2s"; | ||
| drive-strength = <8>; | ||
| bias-disable; | ||
| }; |
Contributor
There was a problem hiding this comment.
this part should be sent to the mainling list into sdm845.dtsi (b4 is your friend).
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.
Kernel
vamos.config: enable the QDSP6 audio stack (APR, PD mapper, Q6V5 PAS, SoundWire,SND_SOC_QDSP6/SDM845/SPDIF).sdm845-comma-mici.dts: describe the sound card —adsp_pasenabled withfirmware-name = qcom/sdm845/adsp.mbn;q6afedai/q6asmdaideclare Secondary MI2S RX/TX and the MultiMedia1 (RX) / MultiMedia2 (TX) frontends; theqcom,sdm845-sndcardlinks MM1/MM2 tospdif-dit/dirdummy codecs oversec_mi2s.snd_soc_dai_set/get_stream(the spdif dummy codecs register without an ops struct);Firmware
adsp.mdt+adsp.b00..b13, tracked in LFS); the Dockerfile symlinksadsp.mbn -> adsp.mdtso theq6v5-pasloader finds the MDT header and loads the segments alongside it.Userspace
sound_init.sh: start the ADSP remoteproc explicitly. With no initramfs,q6v5-pasauto-boots the ADSP at probe (~0.5s) before the rootfs firmware is mounted, so that load fails and the remoteproc stays offline —sound_init(root, after/lib/firmwareis up) starts it, then routes MultiMedia1→SEC_MI2S_RX (playbackhw:0,0) + MultiMedia2→SEC_MI2S_TX (capturehw:0,1). Bails cleanly on boards with no adsp/card (e.g. tizi).asound.conf: card-id-gated asym default so PortAudio opens playback onhw:0,0and capture onhw:0,1.adsp-start.sh, andamplifier.py;init.qcom.shno longer pokes the downstream subsys restart knobs.Verified on device (comma four, kernel
6.18.0-vamos)soundservice brings thecommamicicard up, adsp remoteprocrunningfrom the baked-inadsp.mbn(no runtime firmware farm),pcm0p/pcm1cpresent,/dev/sndatroot:audio 0660.aplay -D hw:0,0andarecord -D hw:0,1both run clean with no q6asm/ADSP errors.