What’s going on
The interface that I’m specifically dealing with is the ALC298. It needs a long sequence of codec coefficient writes to initialize its internal speaker amplifier. Windows does this at boot, but the Linux kernel doesn’t have a quirk for the Blade 14 yet so the amp never gets switched on.
The fix is to run those writes youself using hda-verb, courtesy of a script collected by yadu-tv on GitHub (originally derived from jamir’s kernel bugzilla work). Thanks team!
It was written for the 2023 model but works on the 2022 RZ09-0508 too, and likely any Blade 14 with the ALC298.
Confirm you have the right hardware
cat /proc/asound/card*/codec* | grep -i "codec:"You should see Realtek ALC298 somewhere in the output. If not, this fix isn’t for your machine.
If you’re still with me, note which card number the device lives on:
grep -l ALC298 /proc/asound/card*/codec*If it’s anything other than card2, you’ll need to edit the script later to match (the script hardcodes hwC2D0, where the 2 is the card number).
Setup the script
You need
alsa-toolssudo apt install alsa-tools -yGrab the script from GitHub:
cd ~ curl -O https://raw.githubusercontent.com/yadu-tv/rb14-2023-audio-fix/main/rb_audio.sh chmod +x rb_audio.shIf that link is no longer working, I’ve mirrored it here.
Have a quick look at the script before you run it. It’s a couple thousand lines of
hda-verbcalls writing coefficients to codec node0x20. No filesystem changes, no persistence, nothing scary. Worst case it does nothing.Run it manually just to test things:
sudo bash ~/rb_audio.shYou’ll see a wall of
nid = 0x20, verb = ..., value = 0x0output. That’s good:value = 0x0means each write was accepted. Play something through your speakers. They should work.
Make it run on every boot
The codec resets on reboot, so set up a systemd service to have it run everytime you login.
Move the script somewhere sensible:
sudo mv ~/rb_audio.sh /usr/local/bin/rb_audio.sh sudo chmod 755 /usr/local/bin/rb_audio.shCreate this file at
/etc/systemd/system/rb_audio.service:[Unit] Description=Razer Blade 14 ALC298 speaker initialization After=sound.target Wants=sound.target [Service] Type=oneshot ExecStart=/usr/local/bin/rb_audio.sh RemainAfterExit=yes [Install] WantedBy=multi-user.targetEnable and start it:
sudo systemctl daemon-reload sudo systemctl enable rb_audio.service sudo systemctl start rb_audio.service sudo systemctl status rb_audio.serviceLook for
Active: active (exited)in the status output. Reboot to confirm speakers come up working on their own.
If suspend/resume kills the audio
The codec state may reset when the laptop suspends. If you find speakers go silent after closing and reopening the lid, drop a second unit file in /etc/systemd/system/rb_audio-resume.service:
[Unit]
Description=Re-init ALC298 speakers after resume
After=suspend.target hibernate.target hybrid-sleep.target suspend-then-hibernate.target
[Service]
Type=oneshot
ExecStart=/usr/local/bin/rb_audio.sh
[Install]
WantedBy=suspend.target hibernate.target hybrid-sleep.target suspend-then-hibernate.targetThen:
sudo systemctl daemon-reload
sudo systemctl enable rb_audio-resume.serviceSpeakers should now work on every boot and after every wake.