Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

g.coach

Members
  • Joined

  • Last visited

  1. Hello community, I am working on a multi-channel audio project using a Rock Pi S (Rockchip RK3308) running a modern Mainline Kernel (6.18.y-current-rockchip64). My hardware setup relies on a fixed wiring where the Master Clock (MCLK) is connected to Pin 7 (GPIO2_A4) and BCLK is connected to Pin 12 (GPIO2_A5) using the i2s_8ch_0 controller. The Goal: We want to keep the working I2S/TDM master device tree foundation but replace the old, silent dummy codec (linux,spdif-dit) with the actual internal hardware codec (rockchip,rk3308-codec), so that ALSA maps the channels correctly instead of routing them into a digital void. Note: We are explicitly routing the I2S stream to the internal Rockchip SoC codec (acodec, phandle <0x80>) to avoid any external I2C/SPI control loops, so the soundcard registers perfectly in ALSA. The only remaining issue is forcing the CCF to un-gate the physical MCLK output pin. What works perfectly: When using the internal hardware codec mapping, the device tree compiles cleanly and ALSA successfully registers the sound card as a hardware device without any parsing errors or deferred probes: card 1: rockchiprk3308t [rockchip,rk3308-toslink], device 0: ff300000.i2s-rk3308-hifi ff560000.codec-0 When starting a stream (e.g. via speaker-test or MPD), hw_params confirms active playback at 44100 Hz, Stereo, S16_LE. The Core Problem: Although the software pipeline is running perfectly, the physical pins remain dead because the Common Clock Framework (CCF) shuts down the clock output gate. Checking /sys/kernel/debug/clk/clk_summary during active playback reveals the following state: clk_i2s0_8ch_tx_src 1 1 0 11289600 0 0 50000 Y clk_i2s0_8ch_tx_mux 1 1 0 11289600 0 0 50000 Y clk_i2s0_8ch_tx 2 2 0 11289600 0 0 50000 Y i2s@ff300000 clk_i2s0_8ch_tx_out 0 0 0 11289600 0 0 50000 N deviceless The internal root clock (clk_i2s0_8ch_tx) is active (Y) and running at the correct frequency, but the actual hardware output gate (clk_i2s0_8ch_tx_out) is strictly forced to inactive (N) by the kernel's runtime power management / clock gating. Current Device Tree Snippet: analog-sound { compatible = "simple-audio-card"; simple-audio-card,name = "rockchip,rk3308-toslink"; simple-audio-card,format = "i2s"; simple-audio-card,continuous-clock; simple-audio-card,mclk-fs = <0x100>; simple-audio-card,cpu { sound-dai = <&i2s_8ch_0>; /* phandle <0xaf> -> i2s@ff300000 */ frame-master; bitclock-master; }; simple-audio-card,codec { sound-dai = <&acodec>; /* phandle <0x80> -> codec@ff560000 */ }; }; The Question: Since the driver seems to assume a slave configuration or disables the external clock gate due to the acodec binding, how can we officially force clk_i2s0_8ch_tx_out to stay active (Y) during playback within the device tree or standard ALSA configuration, without having to use out-of-tree kernel modules or dirty register overrides? Are there missing properties required in the simple-audio-card routing or the i2s@ff300000 node itself to un-gate the external clock pin when combined with the internal codec? Any help or pointing towards the correct clock-handling properties for the RK3308 audio subsystem would be highly appreciated. Thanks!
  2. Hi brentr, Thank you for your fast response! To answer your questions based on my tests with this specific board: Board-specific vs. common Armbian Rockchip issue: This is very likely an issue common to all modern Mainline Rockchip audio drivers (specifically rockchip-i2s-tdm) when handling a passive/headless configuration. The driver's power-saving/runtime PM logic expects an active digital handshake from a smart codec (usually via I2C/SPI control loops) to fully claim the pins and keep the clocks alive. Power-saving logic: Yes, it is deeply related to the modern Kernel's runtime power management and clock gating. Without an active external codec answering to control commands, the ASoC framework doesn't receive the "active" trigger state back from the passive hardware side, causing the CCF layer to keep clk_i2s0_8ch_tx_out at N (gated) and leaving the pinctrl states at UNCLAIMED even though ALSA reports active playback. What I mean by "physical I2C/SPI control loop": In a standard layout, a smart DAC/Codec (like a Wolfson/Cirrus WM8804 or similar configured as an I2C slave) is actively queried by the kernel during driver initializing. If the kernel probes the device via I2C and it responds, the sound card enters a fully established state, which automatically triggers the pinctrl driver to transition from UNCLAIMED to claimed and signals the CCF to un-gate the MCLK output. In my headless/passive setup, the DAC inputs are purely wire-bound (listening to MCLK/BCLK/Data passively). There is no microcontroller or I2C bus connected to talk back to the Rock Pi S. My main obstacle right now: Since the device tree parser completes successfully and ALSA creates the card device (card 1: rockchip,rk3308-toslink), the parsing stage is fully intact. Is there an official device-tree property or driver flag within the mainline rockchip-i2s-tdm implementation to force a "dummy-handshake" or configure the controller into an un-gated, always-on clock master state for headless designs?
  3. Mainline Kernel 6.18 (Rock Pi S): rockchip-i2s-tdm registers locked in UNCLAIMED state with passive S/PDIF transverters (m0 mapping) Hardware Setup SoC: Rockchip RK3308 (Radxa Rock Pi S) Audio Extension: 3 separate Wolfson WM8805 boards (I2S to S/PDIF TOSLINK), wired in parallel to the primary I2S0 bus for a multi-channel setup. Pin Mapping (m0): Explicitly hardwired to m0 alternative function: Pin 35 = GPIO2_A4 = I2S0_8CH_MCLK_M0 (pin 68 in pinctrl) Pin 33 = GPIO2_A5 = I2S0_8CH_SCLK_M0 (pin 69 in pinctrl) Software Environment OS: Modern Armbian (Debian Trixie) Kernel: Stable Mainline Linux 6.18.43-current-rockchip64 Sound Card Configuration: Registered via decompiled Device Tree using simple-audio-card with linux,spdif-dit as a passive dummy codec backend. The Problem Description While the ALSA layer registers the multi-channel device flawlessly and playback initiates without any software errors, the physical TOSLINK TX diodes remain completely dark. Live kernel tracing exposes a strict power-gating and pinctrl-locking mechanism inside the mainline rockchip-i2s-tdm driver architecture when facing a headless/passive audio layout. Deep-Dive Diagnostic Logs (Live under Stream Load) When executing an 8-channel stream (speaker-test -D hw:1,0 -c 8), we verified the following states: Clock Subsystem (/sys/kernel/debug/clk/clk_summary) The internal audio PLL dividers calculate and lock perfectly onto the exact target frequency (48kHz multiple), and the reference counter increments from 3 to 4: clk_i2s0_8ch_tx_src 1 1 0 12288000 0 0 50000 Y deviceless no_connection_id clk_i2s0_8ch_tx_mux 1 1 0 12288000 0 0 50000 Y deviceless no_connection_id clk_i2s0_8ch_tx 4 4 0 12288000 0 0 50000 Y i2s@ff300000 no_connection_id clk_i2s0_8ch_tx_out 0 0 0 12288000 0 0 50000 N deviceless no_connection_id However, the physical output gate clk_i2s0_8ch_tx_out remains strictly locked at N (Disabled) and is flagged as deviceless. Pin Controller State (/sys/kernel/debug/pinctrl/.../pinmux-pins) Even during active ALSA playback, the pinmux controller completely refuses to route the active internal clocks out to the physical balls of the SoC: pin 68 (gpio2-4): ff300000.i2s (GPIO UNCLAIMED) function i2s_8ch_0 group i2s-8ch-0-mclk pin 69 (gpio2-5): ff300000.i2s (GPIO UNCLAIMED) function i2s_8ch_0 group i2s-8ch-0-sclktx The alternative functions are assigned correctly (function i2s_8ch_0), but the driver leaves them flagged as GPIO UNCLAIMED. Extensive Troubleshooting & Root Cause Analysis We have thoroughly tested the limits of the Device Tree and Runtime modifications: DTS Bindings Failed: Injecting properties like simple-audio-card,continuous-clock, frame-master, bitclock-master, or explicitly binding the clock output to the codec node via clocks = <&i2s0_8ch 0>; has absolutely zero effect. The primitive spdif_dit.c driver has no .probe or .set_sysclk routines to request the clock. Driver Patching (Trigger Routine): We patched the driver's rockchip_i2s_tdm_trigger routine to forcefully call clk_prepare_enable(i2s_tdm->mclk_tx). The reference counter successfully increments to 4, but the CCF/Power Management layer suppresses the physical output because no hardware handshake is returned from the passive transmitter. Direct Register Override Hack: We deployed a custom runtime kernel module executing a direct iowrite32(0x40000000, cru_reg) onto the CRU hardware register CLKGATE_CON5 (0xff500314). While dmesg confirms the hardware register write is successful and the physical gate opens on the silicon level, the pinctrl layer still isolates the pads in an UNCLAIMED state. 3. Pin Configuration State (`/sys/kernel/debug/pinctrl/.../pinconf-pins`) A live register dump of the pad configurations confirms that the m0-muxing is successfully applied on the silicon layer, and electrical drive stages are actively provisioned: pin 68 (gpio2-4): input bias disabled, output drive strength (2 mA), input schmitt enabled, slew rate (0x0), mux (0x1) pin 69 (gpio2-5): input bias disabled, output drive strength (2 mA), input schmitt enabled, slew rate (0x0), mux (0x1) This proves the issue is purely a logical lock within the ASoC / Pinctrl driver handshake, as the physical multiplexer is correctly set to mux (0x1) for I2S0 m0. The Question to the Maintainers In the old legacy vendor BSP kernels (Linux 4.4/5.10), the Rockchip driver forced the pin configurations blindly into output mode. In Mainline 6.18, the dynamic handshake locks passive audio configurations out completely. What is the officially intended mainline approach to bypass this dynamic power-saving guardrail for headless/passive setups? How can we force rockchip-i2s-tdm to permanently transition the pinctrl states to claimed and enable clk_i2s0_8ch_tx_out without a physical I2C/SPI control loop?

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.