Skip to content

kernel/system: Bringup Sound#97

Open
ssysm wants to merge 7 commits intocommaai:masterfrom
ssysm:sound
Open

kernel/system: Bringup Sound#97
ssysm wants to merge 7 commits intocommaai:masterfrom
ssysm:sound

Conversation

@ssysm
Copy link
Copy Markdown
Contributor

@ssysm ssysm commented Mar 29, 2026

Sound Bringup: mici and tizi

Commit 20cf50d — mici sound bringup

This established the foundational sound infrastructure for the SDM845 platform.

Kernel DTS (kernel/dts/sdm845-comma-common.dtsi)

  • Added a stub generic-codec device (since the audio path uses the DSP, not a discrete codec)
  • Enabled adsp_pas (ADSP peripheral authentication service) pointing to qcom/sdm845/adsp.mdt
  • Configured the Q6AFE DAI for SECONDARY_MI2S_RX (playback, SD line 1) and SECONDARY_MI2S_TX (capture, SD line 0)
  • Wired up the full ALSA sound card with two frontend DAIs (MultiMedia1/2) and playback/capture backend links routed through SECONDARY_MI2S via the Q6 routing graph

ADSP startup (userspace/root/usr/comma/sound/adsp-start.sh)

  • Rewrote the script to support both the modern remoteproc interface and the legacy msm_subsys interface, auto-detecting which is present
  • Probes multiple firmware paths, attempts to mount the modem partition if needed

Sound init (userspace/root/usr/comma/sound/sound_init.sh)

  • Replaced the hardcoded sdm845tavilsndc card name check with a generic "wait until any card appears" loop
  • Added a wait_for_tinymix_control helper that polls for SEC_MI2S_RX Audio Mixer MultiMedia1

Sound watchdog (userspace/root/usr/comma/sound/sound_watchdog.sh) — new file

  • The runit service (userspace/root/etc/sv/sound/run) was changed from a one-shot to a persistent watchdog
  • Every 2 seconds: if soundcards are present, re-asserts the playback route; if they disappear, re-runs sound_init.sh

Commit 25f7779 — tizi sound bringup

Adds microphone/capture support specifically for tizi, which uses a MAX98089 amp with digital mics wired through DAI1 → TERTIARY MI2S (GPIO 74–78), rather than the secondary MI2S used for mici.

Kernel patch (0012)

  • Adds tert_mi2s pinctrl states to sdm845.dtsi
  • Fixes a bug where SECONDARY_MI2S_RX startup/shutdown fell through to the TX clock path, causing EINVAL
  • Adds TERTIARY_MI2S_TX clock handling

DTS (kernel/dts/sdm845-comma-tizi.dts)

  • Registers a new main5v fixed regulator (GPIO 25) needed to power the amp
  • Adds a qi2s@21 Q6AFE DAI node for TERTIARY_MI2S_TX with SD line 0
  • Overrides the common &sound node: changes the model name, swaps pinctrl to use tert_mi2s pins for capture (drops sec_mi2s_sd0, keeps sec_mi2s_sd1 for playback), and re-routes the capture-dai-link CPU to TERTIARY_MI2S_TX instead of secondary

Common DTS (kernel/dts/sdm845-comma-common.dtsi)

  • Adds sec_mi2s_mclk pinctrl states to the mici pinctrl (needed by both devices)

Watchdog (userspace/root/usr/comma/sound/sound_watchdog.sh)

  • Detects tizi via /sys/firmware/devicetree/base/model
  • On tizi, also periodically re-asserts MultiMedia1 Mixer TERT_MI2S_TX (the capture route) in addition to the playback route

ssysm and others added 3 commits March 29, 2026 08:11
Add TERTIARY_MI2S_TX capture support for the tizi device (MAX98089 digital
mics via DAI1→TERT MI2S on GPIO 74-78), while preserving mici playback.

- kernel/patches/0012: add tert MI2S pinctrl states to sdm845.dtsi; fix
  SECONDARY_MI2S_RX startup/shutdown to use dedicated PLAYBACK clock path
  (was falling through to TX, causing EINVAL); add TERTIARY_MI2S_TX clock
  handling
- kernel/dts/sdm845-comma-common.dtsi: add sec_mi2s_mclk to mici pinctrl
- kernel/dts/sdm845-comma-tizi.dts: override sound node for tizi — route
  capture to TERTIARY_MI2S_TX, set tert MI2S pinctrl, disable sec SD0
- userspace/sound_watchdog.sh: maintain TERT_MI2S_TX capture route on tizi

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Robin Reckmann <robin.reckmann@gmail.com>
diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
index 9c0d1a77498f4f..f3f7c334da5395 100644
--- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These can go into the mici/tizi dts.

function = "gpio";
diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig
index 160c07699a8b72..1aff6a6a8ad45d 100644
--- a/sound/soc/codecs/Kconfig
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better to move just the generic codec into its own patch

};

- quat_mi2s_sleep: quat-mi2s-sleep-state {
+ tert_mi2s_mclk_sleep: tert-mi2s-mclk-sleep-state {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These can go into the mici/tizi dts.

greatgitsby and others added 4 commits March 29, 2026 19:50
Co-authored-by: Trey Moen <50057480+greatgitsby@users.noreply.github.com>
Co-Authored-By: Robin Reckmann <robin.reckmann@gmail.com>
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 1, 2026

vamOS System Profile

Changes vs master

Metric Change
Used space 3481.1MB → 3481.1MB (+0MB)
Sparse image 3435.6MB → 3435.6MB (0MB)
Package count 524 → 524
Directory size changes (>1MB)
Directory Change

Metric Value
Used space 3481.1MB / 5959.5MB
Files 56331
Directories 4762
Symlinks 3602
Packages 524

Top 10 Directories

Directory Size

Category Breakdown

Category Size %
xbps packages 2484.5MB 71.3%
Python venv 655.3MB 18.8%
Firmware 11.5MB .3%
Other 329.7MB 9.4%

Top 10 Packages by Size

Package Size
mit-krb5-libs-1.21.3_1 270.4MB
gawk-5.3.2_1 210.3MB
llvm-21_3 148.6MB
libldns-1.9.0_1 124.3MB
pd-mapper-1.0_1 73.9MB
libclang21-21.1.7_1 70.2MB
glib-2.86.1_2 67.1MB
gcc-14.2.1+20250405_4 65.4MB
libcap-progs-2.77_1 56MB
cmake-4.2.2_1 53.2MB

Top 30 Files 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/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/local/venv/lib/python3.12/site-packages/ffmpeg/install/lib/libavcodec.a 50.5MB
/usr/bin/uv 48.1MB
/usr/lib/gcc/aarch64-linux-gnu/14.2/gnat1 40.1MB
/usr/bin/gdb 38.1MB
/usr/lib/gcc/aarch64-linux-gnu/14.2/cc1plus 37.3MB
/usr/lib/libgallium-25.3.3.so 35.4MB
/usr/lib/libllvm-qcom.so 35.2MB
/usr/lib/gcc/aarch64-linux-gnu/14.2/cc1 35.2MB
/usr/lib/gcc/aarch64-linux-gnu/14.2/lto1 33.9MB
/usr/bin/lto-dump 33.9MB
/usr/lib/libRusticlOpenCL.so.1.0.0 32.5MB
/usr/local/venv/bin/ruff 31.8MB
/usr/share/icu/78.2/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.6MB
/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.1MB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants