Re: [PATCH v2] ALSA: hda/realtek: Enable internal speakers on Razer Blade 16 (2025)

From: Takashi Iwai

Date: Tue Jun 23 2026 - 06:43:11 EST


On Mon, 22 Jun 2026 19:43:09 +0200,
Christopher Höner wrote:
>
> Hi Takashi,
>
> Thanks for the review.
>
> On the size: agreed, that was too much to sit inline. v3 moves the
> captured DSP tables into a separate header (alc298_rb16_2025.h) that the
> codec includes, so alc269.c keeps only the apply helper, the PCM hook
> and the fixup.

Thanks! We have this kind of large code in sound/hda/codecs/helpers,
and you can follow the pattern, too.

> On power_save_node: I tried it and it does work. The catch is that the
> amp wake and park have to come out of the init sequence first, the park
> in particular. If the amp is parked at the end of init, nothing wakes it
> again, since power_save_node only toggles the codec's own widgets and the
> amp isn't one of them; it sits behind the coef mailbox on NID 0x20 and
> isn't a power-managed node. Dropping the init wake as well seemed fine
> here, though I'm less sure about that one, since the Windows driver does
> send a wake at init.
>
> With the amp left on and power_save_node handling the widget PM, playback
> is fine. The one thing I noticed is that every stream then starts with a
> small but audible click, the speaker DAC and pin going D3->D0 in a single
> step. The mailbox wake/park ramps the amp up and down instead, so the
> hook path doesn't click, and for me that transition is the nicer result.
>
> The trade-offs run the other way too. power_save_node would let the codec
> power its widgets down when idle, which on a laptop is probably worth
> having, and I can't really put a number on what the hook costs by leaving
> them up, so I'm not weighing that part heavily. The fact that it's
> codec-wide is presumably a good thing for the headphone and the mics too;
> I don't know that side well enough to have a strong opinion there.
>
> Where I landed for v3 was the pcm_playback_hook with power_save_node left
> at its default, mostly for the cleaner transition, and because it matches
> the other ALC298 external-amp fixups: Samsung and LG Gram both drive the
> amp from a pcm_playback_hook and leave power_save_node alone,
> alc274_fixup_bind_dacs sets it to 0, and alc_fixup_tpt440_dock sets it to
> 0 specifically to avoid click noises.
>
> That said, you've seen far more of these than I have, and I don't have a
> strong stake in the PM side beyond that transition. If you'd rather this
> used power_save_node, say so and I'll switch v3 over: drop the wake/park
> and let the widgets manage themselves.

Hm, indeed there is no direct hook associated to each widget node for
the power amp. A tricky way would be, though, to use the existing
codec->power_filter callback; you can define something like:

static int razer_amp_power_filter(struct hda_codec *codec, hda_nid_t nid,
unsigned int power_state)
{
int state = snd_hda_gen_path_power_filter(codec, nid, power_state);

if (nid == SOME_OUTPUT_PIN) {
if (state == AC_PWRST_D0)
power_up_amp(codec, nid);
else
power_down_amp(codec, nid);
}

return state;
}

and set codec->power_filter = razer_amp_power_filter in the fixup,
together with codec->power_save_node = 1.

It's just an idea, and if this doesn't look working well, we can go
with your approach with the PCM hook, too.


thanks,

Takashi