Skip to content

alsa-ucm-conf: fix the rk817 playback mixer element - #3249

Closed
pkilar wants to merge 1 commit into
ROCKNIX:nextfrom
pkilar:alsa-ucm-rk817-mixer-elem
Closed

alsa-ucm-conf: fix the rk817 playback mixer element#3249
pkilar wants to merge 1 commit into
ROCKNIX:nextfrom
pkilar:alsa-ucm-rk817-mixer-elem

Conversation

@pkilar

@pkilar pkilar commented Aug 30, 2026

Copy link
Copy Markdown

Summary

  • What is the goal of this PR? Make the volume control actually work on RK3326 handhelds using the rk817 codec.

The rk817-sound UCM profile sets:

PlaybackMixerElem "Master Playback Volume"

PlaybackMixerElem takes the simple mixer element name — Master — not the raw kcontrol name. Everywhere else in alsa-ucm-conf it is spelled that way (Headphone, Speaker, HP); rk817-sound is the only file using the long form.

So the element is never found, pipewire gets no hardware volume control, and its sink volume controls nothing audible — while common/050-audio deliberately pins ALSA Master to 100%. The symptom is a device that comes up at full volume after a cold boot while the stored setting reads whatever the user had chosen, and where changing the volume moves the number without moving the sound.

Testing

  • How was this tested? Built and run on a Gusgu H7 (RK3326, rk817 codec).
  • Test results: With the fix the pipewire sink drives the hardware on the dB curve — sink 0.30Master 67%, 0.20 → 56%. Before the fix Master never moved from 100% regardless of the sink value. Confirmed audible.

Additional Context

  • This is a two-line change to an existing patch directory (patches/RK3326/), so it only affects RK3326.
  • I deliberately left CaptureMasterElem "Master Capture Volume" alone. It looks like exactly the same error, but I have no way to test capture on this device and did not want to change what I could not verify — worth a look from someone who can.
  • I only have one rk817 device. If the volume behaviour above is familiar on other RK3326 handhelds, this is likely the cause there too; a second data point would be welcome.

AI Usage

Did you use AI tools to help write this code? YES — Claude Code was used for the investigation and to draft the patch and this description. The root cause was confirmed by reading the alsa-ucm-conf tree for how PlaybackMixerElem is spelled elsewhere, and the fix was verified against amixer readings on hardware.

RK3326 handhelds using the rk817 codec come up at full volume after a cold
boot while the stored setting reads whatever the user had chosen, and changing
the volume moves the number without moving the sound.

Root cause is in the rk817-sound UCM profile:

    PlaybackMixerElem "Master Playback Volume"

PlaybackMixerElem takes the simple mixer ELEMENT name - "Master" - not the raw
kcontrol name. Everywhere else in alsa-ucm-conf it is spelled that way
("Headphone", "Speaker", "HP"); rk817-sound is the only file using the long
form. The element is therefore never found, pipewire gets no hardware volume
control, and its sink volume controls nothing audible - while common/050-audio
deliberately pins ALSA Master to 100%. Hence loud, with a correct-looking
number.

With the fix, the pipewire sink drives the hardware: sink 0.30 -> Master 67%,
0.20 -> 56% on the dB curve. Before, Master never moved. Confirmed audible on
hardware (Gusgu H7, RK3326).

Left CaptureMasterElem "Master Capture Volume" alone. It looks like the same
error, but I have not tested capture and will not change what I cannot verify.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01985tp15STZZvPFMfnVBGnm
@stolen
stolen force-pushed the alsa-ucm-rk817-mixer-elem branch from e50c885 to fe03494 Compare August 30, 2026 05:37
@stolen
stolen enabled auto-merge August 30, 2026 05:37
@pkilar pkilar closed this Sep 4, 2026
auto-merge was automatically disabled September 4, 2026 21:23

Pull request was closed

@pkilar
pkilar deleted the alsa-ucm-rk817-mixer-elem branch September 4, 2026 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants