Fix no audio on cold boot for rk817 clone boards (force Playback Path re-program) - #193
Open
kico1603 wants to merge 1 commit into
Open
Fix no audio on cold boot for rk817 clone boards (force Playback Path re-program)#193kico1603 wants to merge 1 commit into
kico1603 wants to merge 1 commit into
Conversation
… re-program) Problem On a **cold boot there is no audio** (speaker or headphones, menu or emulators) on rk817 clone boards. A **suspend/resume** is currently the only workaround, and it lasts until the next cold boot. - Board (`/proc/cpuinfo` Hardware): `G80CA-MB V1.3-20251212 Panel 8`, variant `clone` - Codec: `rockchip,rk817-codec` (card 0, `ff070000.i2s-rk817-hifi`), ALSA only ### Root cause `r36_config.sh` sets the output path on every boot with: ```sh amixer -c 0 cset iface=MIXER,name='Playback Path' "$CUR_ALSA_PATH" # SPK_HP ``` But these boards **power up with `Playback Path` already at `SPK_HP`**, so writing the *same* value is a **no-op**: the codec's output route is never (re)programmed and it stays silent until a suspend/resume forces a re-sync. `amixer contents` on a silent cold boot shows everything already looks correct, yet there is no sound: ``` numid=1 'Playback Path' items: OFF/SPK/HP/SPK_HP : values=3 (SPK_HP) numid=3 'Playback Volume' 0..237 : 232,232 numid=5 'Headphone Jack' : off ``` `alsa-restore.service` already runs `alsactl restore` at boot, so a plain state restore is not enough — what fixes it on resume is the codec being forced to reprogram the route. ### Fix Force a **real transition** (`OFF` -> target) before the target path, so the driver actually reprograms/enables the output route. ### Testing On my `G80CA-MB V1.3` (clone) unit, cold boot was silent until a suspend/resume. Running exactly this forced `OFF -> SPK_HP` transition restores speaker output on cold boot (verified on-device). It is harmless on boards that don't have the bug — it just re-asserts the same path. Note: my on-device verification ran the toggle shortly after boot; here it is folded into `r36_config.sh`. The mechanism (updating the route before EmulationStation opens the PCM) should be equivalent. Happy to gate it to `variant = clone` or adjust placement/timing if you prefer. ### Scope Likely affects other rk817 clone boards, not just `G80CA-MB V1.3`.
|
This looks related to the audio issue I ran into on my board (Y3506_V04_20250523, I opened #195 with scripts (audio-hp.sh / audio-speaker.sh / audio-toggle.sh) |
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.
Problem
On a cold boot there is no audio (speaker or headphones, menu or emulators) on rk817 clone boards. A suspend/resume is currently the only workaround, and it lasts until the next cold boot.
/proc/cpuinfoHardware):G80CA-MB V1.3-20251212 Panel 8, variantclonerockchip,rk817-codec(card 0,ff070000.i2s-rk817-hifi), ALSA onlyRoot cause
r36_config.shsets the output path on every boot with:But these boards power up with
Playback Pathalready atSPK_HP, so writing the same value is a no-op: the codec's output route is never (re)programmed and it stays silent until a suspend/resume forces a re-sync.amixer contentson a silent cold boot shows everything already looks correct, yet there is no sound:alsa-restore.servicealready runsalsactl restoreat boot, so a plain state restore is not enough — what fixes it on resume is the codec being forced to reprogram the route.Fix
Force a real transition (
OFF-> target) before the target path, so the driver actually reprograms/enables the output route.Testing
On my
G80CA-MB V1.3(clone) unit, cold boot was silent until a suspend/resume. Running exactly this forcedOFF -> SPK_HPtransition restores speaker output on cold boot (verified on-device). It is harmless on boards that don't have the bug — it just re-asserts the same path.Note: my on-device verification ran the toggle shortly after boot; here it is folded into
r36_config.sh. The mechanism (updating the route before EmulationStation opens the PCM) should be equivalent. Happy to gate it tovariant = cloneor adjust placement/timing if you prefer.Scope
Likely affects other rk817 clone boards, not just
G80CA-MB V1.3.