Skip to content

fix(h700): dimmer low brightness and audible, quieter low volume - #858

Draft
SimoGecko wants to merge 1 commit into
LoveRetro:mainfrom
SimoGecko:fix/h700-low-brightness-volume
Draft

SimoGecko wants to merge 1 commit into
LoveRetro:mainfrom
SimoGecko:fix/h700-low-brightness-volume

Conversation

@SimoGecko

Copy link
Copy Markdown

Two fixes to the H700 (Anbernic) libmsettings, reported on an RG SP.

Brightness levels 0-3 are too bright in the dark

The disp driver sets the backlight PWM duty to (raw+1)/256 and raw 0 turns the backlight off, so the old floor (raw 4) was not the dimmest lit level. Levels 0-3 now use raw 1/3/7/15, a duty of 2/4/8/16 out of 256, doubling each step. Level 0 is about 2.5x dimmer than before. Level 4 and up, and the default, are unchanged. muOS also uses raw 1 as its minimum on these devices.

Volume step 1 is silent and step 2 is already loud

The speaker path wrote percentages to the codec controls, and tinyalsa's truncation put step 1 on lineout volume raw 1. On the H616/H700 codec, lineout raw 0 and 1 are both mute (mainline sun6i_codec_lineout_vol_scale: 0-1 mute, 2-31 is -43.5 dB to 0 dB in 1.5 dB steps). Step 2 then landed on raw 3, -42 dB.

This replaces the percentages with an explicit {lineout, digital} table per step:

  • Lineout rises by one every step from raw 2, so no non-zero step is muted.
  • Steps 1-5 add digital volume attenuation (1.16 dB per raw step) to reach about -55 dB at step 1.
  • Digital stays at 0 dB from step 6 up, and the mid and upper steps stay within about 3 dB of the old levels.
  • The Bluetooth and USB DAC paths are unchanged.

Open question

With the old mapping, step 2 should have been about -107 dB in total (lineout -42 dB plus digital raw 56, about -65 dB), yet it is clearly audible on the RG SP. That suggests digital volume may not attenuate on this unit. If so, steps 1-5 only reach lineout's -43.5 dB to -37.5 dB, but each step is still audible and distinct. Running amixer sset 'digital volume' 30 during playback would confirm it either way.

Testing

  • Build and test on an RG SP (draft until this is done)
  • Checked the dB value of every table entry with a script

🤖 Generated with Claude Code

Brightness: the disp driver drives the backlight PWM at (raw+1)/256 and
raw 0 turns it off, so levels 0-3 (raw 4/6/10/16) left room below them.
They now use raw 1/3/7/15, doubling the duty each step from the dimmest
lit level. Level 0 is ~2.5x dimmer than before; level 4 and up, and the
default, are unchanged.

Volume: the speaker path wrote percentages to the codec controls. With
the tinyalsa rounding, step 1 put 'lineout volume' on raw 1, which the
codec treats as mute like raw 0 (H616/H700 lineout: 0-1 mute, 2-31 is
-43.5dB..0dB), so step 1 was silent. Step 2 jumped straight to -42dB.

Use an explicit {lineout, digital} table per step instead. Lineout goes
up every step from raw 2, so no non-zero step is silent. The lowest
steps add 'digital volume' attenuation on top to reach about -55dB at
step 1. Digital stays at 0dB from step 6 up, and the mid/upper steps
stay within ~3dB of what lineout gave before. Bluetooth and USB DAC
volume are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

1 participant