From 226cea083ee82551d0d917e06562d4f467085c8f Mon Sep 17 00:00:00 2001 From: Douglas Teles Date: Wed, 24 Jun 2026 12:30:17 -0300 Subject: [PATCH] mipi-generator: SDCLONE flag para R36S Clone sem default sound card MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Issue archr-linux/Arch-R#35 (R36S Clone V20 batch 2551 sem áudio). A DTS base rk3326-gameconsole-eeclone.dts NÃO inclui r3xs.dtsi — diferente de rk3326-gameconsole-r36s.dts (original) e rk3326-gameconsole-soysauce.dts (Y3506). Como r3xs.dtsi é onde o node `rk817-sound` padrão fica ativo, o eeclone vai pro kernel só com as duas variantes `rk817-sound-amplified` e `rk817-sound-simple`, ambas com `status="disabled"`. Para R36S Clone V20+ o vendor BSP 4.4 não publica `spk-con-gpio` nem `rockchip,codec/spk-ctl-gpios` no rk817-sound (o widget de speaker nem aparece no DTB), então a detecção atual do gerador caía no ramo "keep default" e o overlay ficava sem habilitar nenhum sound card. Resultado: `aplay -l` retornava "no soundcards found" em todo clone V20 / V21. generator.sh agora emite `sd_prefix="SDCLONE"` para subdevice=clone (antes só emitia SDORIG para original/soysauce). archr-dtbo.py trata SDCLONE como sinal de que a base DTS não tem default sound card ativo e força o `rk817-sound-amplified` como fallback safe — caso clone V20+ que carrega amp externo via GPIO não exposto no DTB. Clones sem amp explícito (raros) podem usar a variante _SRs para forçar `simple` ou o flag NAm para `spko-direct`. Co-Authored-By: Claude Opus 4.7 --- config/mipi-generator/archr-dtbo.py | 23 ++++++++++++++++++++--- config/mipi-generator/generator.sh | 10 ++++++++++ 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/config/mipi-generator/archr-dtbo.py b/config/mipi-generator/archr-dtbo.py index 40a73a3250..e4f48a435d 100644 --- a/config/mipi-generator/archr-dtbo.py +++ b/config/mipi-generator/archr-dtbo.py @@ -818,10 +818,27 @@ def make_dtbo(dtb_data, args): elif force_simple_audio_routing: rk817_path = hpdet_ovl.path+'/__overlay__/rk817-sound-simple' args['logger'].info("audio: simple variant (SRs flag: external amp on regulator)") + elif 'SDCLONE' in args['flags']: + # Clone subdevice (rk3326-gameconsole-eeclone.dts) does NOT + # include r3xs.dtsi, so there is no default `rk817-sound` + # node already active in the base DTS — both `amplified` + # and `simple` variants ship status="disabled". When the + # vendor DTB doesn't expose an amp GPIO we have to enable + # SOMETHING explicitly or `aplay -l` reports "no + # soundcards" (issue #35). Amplified is the safe default: + # the vast majority of R36S clones (V20 2024-05 onward) + # carry an external amp gated by a GPIO line that just + # isn't surfaced in the partial vendor DTB. Users on the + # rare amp-less clones can pick a _SRs (simple) overlay + # variant from the flasher. + rk817_path = hpdet_ovl.path+'/__overlay__/rk817-sound-amplified' + args['logger'].info("audio: amplified fallback (SDCLONE without detectable amp gpio — eeclone base has no default rk817-sound)") else: - # No amp GPIO detected, no SRs flag, no NAm flag. Keep the - # default rk817-sound (amp routing) active. This preserves - # R36S original/clone behaviour that worked under RC-3. + # No amp GPIO detected, no SRs flag, no NAm flag, and the + # subdevice has a default rk817-sound active in its base + # DTS (original / soysauce — via r3xs.dtsi). Keep that + # default; previous behaviour preserved for everything + # that already worked under RC-3. rk817_path = None args['logger'].info("audio: keeping default rk817-sound (amp routing from base DTS)") diff --git a/config/mipi-generator/generator.sh b/config/mipi-generator/generator.sh index 1c12748c43..684bc89dea 100755 --- a/config/mipi-generator/generator.sh +++ b/config/mipi-generator/generator.sh @@ -143,9 +143,19 @@ process_subdevice() { # boards; several clone vendor DTBs are mislabeled with `odroidgo3` # compatible and previously slipped through the short-circuit, leaving # the overlay without GPIO fixes (= "backlight on, no image"). + # + # SDCLONE: lets archr-dtbo.py know that the base DTS for this + # subdevice (rk3326-gameconsole-eeclone.dts) does NOT include the + # r3xs.dtsi `rk817-sound` default — both sound card variants ship + # with status="disabled". Without an explicit overlay to enable + # one, `aplay -l` finds no soundcards on those clones (issue #35). + # The audio block in archr-dtbo.py uses this flag to pick the + # `amplified` fallback when the vendor DTB doesn't expose enough + # to auto-classify between amplified / simple / spko-direct. local sd_prefix="" case "$sd" in original|soysauce) sd_prefix="SDORIG" ;; + clone) sd_prefix="SDCLONE" ;; esac # Soysauce (Y3506) boards have NO external speaker amplifier on