linux/sound/hda/codecs/helpers
Christopher Höner 961d9f98da ALSA: hda/realtek: Enable internal speakers on Razer Blade 16 (2025)
On the Razer Blade 16 (2025) (Realtek ALC298, PCI SSID 1a58:300e) the
internal speakers are driven through an external smart amplifier whose
crossover, voicing and protection live in a DSP reached over a vendor
coef mailbox on NID 0x20.  Both speaker pins are fed from one DAC
through a mixer and the amplifier does the crossover.  The BIOS leaves
the tweeter pin (NID 0x14) disabled (default config 0x411111f0), so the
tweeters are not exposed and the amplifier is never programmed for this
machine under Linux.

Add a fixup for the machine that:

  - re-exposes the tweeter pin (NID 0x14) as an internal speaker in the
    same association (2) as the woofer (NID 0x17), so the controls come
    out as "Speaker"/"Bass Speaker", with auto-mute on headphone
    insertion;

  - pins every output to a fixed converter via preferred_dacs so the
    routing does not depend on the generic parser's DAC-allocation
    heuristics: both speaker pins share DAC 0x03 (the only converter
    that drives the woofer on this machine) through the mixer, while the
    headphone (NID 0x21) keeps DAC 0x02.  Without a fixed assignment the
    parser brings up only one speaker pin and leaves the other silent;

  - wakes the external amp, programs its DSP over the NID-0x20 mailbox
    at init (boot and resume) and parks it; it is woken again for
    playback and parked afterwards from a pcm_playback_hook, like the
    existing Samsung and LG Gram amplifier fixups.

The DSP sequence was obtained by capturing the Windows driver's HD-audio
traffic via QEMU/VFIO passthrough of the controller and reducing it to
the NID-0x20 writes this machine needs; everything else the parser
rebuilds.  The captured tables are large, so the programming and
the fixup live in a separate file under
sound/hda/codecs/helpers/ that the codec driver includes.

Signed-off-by: Christopher Höner <christopher-hoener@web.de>
Link: https://patch.msgid.link/20260623191436.6605-1-christopher-hoener@web.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2026-06-29 12:28:40 +02:00
..
hp_x360.c
ideapad_hotkey_led.c
ideapad_s740.c
razer_blade16_2025.c ALSA: hda/realtek: Enable internal speakers on Razer Blade 16 (2025) 2026-06-29 12:28:40 +02:00
thinkpad.c