Skip to content

Instantly share code, notes, and snippets.

@lamperez
Last active December 16, 2024 11:51
Show Gist options
  • Save lamperez/862763881c0e1c812392b5574727f6ff to your computer and use it in GitHub Desktop.
Save lamperez/862763881c0e1c812392b5574727f6ff to your computer and use it in GitHub Desktop.
CS35L41 amplifiers in an ASUS Zenbook on linux

Asus Zenbook UX3402 speakers on Linux

Important

THIS IS NOW OBSOLETE WITH KERNEL VERSIONS ≥ 6.7.0

A recent announcement in the kernel mail list by Cirrus developers will solve the problem described here. Therefore, the proposed solutions will be soon obsolete. See this comment (thanks, @flukejones, for the tip).

I got the speakers working on my Asus Zenbook 14 OLED UX3402, the one with Intel CPU and the two CS35L41 audio amplifiers connected over SPI (not the UM3402YA, with AMD and I²C). The amplifiers are supported by the snd_hda_scodec_cs35l41 module in recent kernel versions, but they require some model-specific configuration paramaters, that should be provided by the BIOS, via ACPI. Of course, they are missing. It seems that the Windows drivers have those parameters somehow hardcoded, instead of using ACPI (bad idea, but who am I to criticise). Since Asus has been nasty and refused/was not able to update the BIOS with the missing data, I have patched the ACPI tables myself.

Warning

As stated by Cirrus developers, if you try this there is a non-zero (low, I hope) possibility of blowing your speakers. Take into account that this procedure is not just configuring your box, it is hardware-level hacking with very scarce information about the hardware (thank you, ASUS, and thank you, Cirrus, for not publishing the CS35L41 datasheet and making it only available by request). Additionally, You should know how to work with DSDT or SSDT files (I have a brief guide here) and how to recover from a non booting system. You are on your own. You have been warned.

Note

I have used the patch for some months, and everything seems OK. As you can see, the most recent versions do not require electrical parameters to be specified, just providing the functions of several GPIO pins, that are already present in the original BIOS, and the behavior associated to them. I am almost sure that the patch is totally safe.

My BIOS is the most recent one (version 310). I have added two _DSD objects in the SSDT file (ssdt_csc3551.dsl, or its already assembled version, ssdt_csc3551.aml):

  • One inside the SPK1 device, providing the missing "cirrus,dev-index" and other properties, just like the I2C models. You can also provide these properties by patching the kernel module (the linux/sound/pci/hda/cs35l41_hda.c file).

  • Another one, after the SPK1 device, with the chip select GPIOs, "cs-gpios", required by the SPI bus (the somehow simpler I²C bus does not use chip select pins, but addresses). Without this _DSD object, only one amplifier can be addressed and activated. In this case, the driver refuses to load even for this single working amplifier.

Obsolete: DSDT patch

Instead of applying a SSDT file, you may patch the full DSDT dissassembled DSDT file (dsdt.dsl). This was my original solution (thanks to @thor2002ro for pointing to the simpler, nicer SSDT solution, see the comment, especially if you use grub). The patch is available for reference, just apply the SSDT file.

Obsolete: internal boost

I keep the old, original patch, that produced AMP short error messages when the volume was high enough, for reference. Please try first the simpler patch with external boost, that seems to work without flaws (thanks to @bdandy, see the comment).

Boot log

Output from journalctl -b -g CSC3551 --output short-monotonic after the old patch:

[5.358062] zenbook kernel: Serial bus multi instantiate pseudo device driver CSC3551:00: Instantiated 2 SPI devices.
[5.643640] zenbook kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.0: Cirrus Logic CS35L41 (35a40), Revision: B2
[5.680302] zenbook kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.1: Cirrus Logic CS35L41 (35a40), Revision: B2
[5.996217] zenbook kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.0: Falling back to default firmware.
[5.996608] zenbook kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.0: DSP1: Firmware version: 3
[5.996611] zenbook kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.0: DSP1: cirrus/cs35l41-dsp1-spk-prot.wmfw: Fri 24 Jun 2022 14:55:56 GMT Daylight Time
[6.069598] zenbook kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.0: DSP1: Firmware: 400a4 vendor: 0x2 v0.58.0, 2 algorithms
[6.070173] zenbook kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.0: DSP1: 0: ID cd v29.78.0 XM@94 YM@e
[6.070185] zenbook kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.0: DSP1: 1: ID f20b v0.1.0 XM@17c YM@0
[6.070192] zenbook kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.0: DSP1: spk-prot: e:\workspace\workspace\tibranch_release_playback_6.76_2\ormis\staging\default_tunings\internal\CS35L53\Fixed_Attenuation_Mono_48000_29.78.0\full\Fixed_Attenuation_Mono_48000_29.78.0_full.bin
[6.083485] zenbook kernel: snd_hda_codec_realtek ehdaudio0D0: bound spi1-CSC3551:00-cs35l41-hda.0 (ops cs35l41_hda_comp_ops [snd_hda_scodec_cs35l41])
[6.083899] zenbook kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.1: Falling back to default firmware.
[6.083962] zenbook kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.1: DSP1: Firmware version: 3
[6.083966] zenbook kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.1: DSP1: cirrus/cs35l41-dsp1-spk-prot.wmfw: Fri 24 Jun 2022 14:55:56 GMT Daylight Time
[6.145224] zenbook kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.1: DSP1: Firmware: 400a4 vendor: 0x2 v0.58.0, 2 algorithms
[6.145817] zenbook kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.1: DSP1: 0: ID cd v29.78.0 XM@94 YM@e
[6.145828] zenbook kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.1: DSP1: 1: ID f20b v0.1.0 XM@17c YM@0
[6.145834] zenbook kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.1: DSP1: spk-prot: e:\workspace\workspace\tibranch_release_playback_6.76_2\ormis\staging\default_tunings\internal\CS35L53\Fixed_Attenuation_Mono_48000_29.78.0\full\Fixed_Attenuation_Mono_48000_29.78.0_full.bin
[6.161484] zenbook kernel: snd_hda_codec_realtek ehdaudio0D0: bound spi1-CSC3551:00-cs35l41-hda.1 (ops cs35l41_hda_comp_ops [snd_hda_scodec_cs35l41])

The "Falling back to default firmware" disappears if spk-id-gpios are provided (the block is commented in the patch). As a result, a different firmware is loaded, resulting in very low volume and strong distortion. If the new patch is used, that uses external boost, the sound is correct, and the log is

[0.004000] zenbook kernel: ACPI: Table Upgrade: install [SSDT-CUSTOM- CSC3551]
[0.004000] zenbook kernel: ACPI: SSDT 0x00000000368FD000 0001A0 (v01 CUSTOM CSC3551  00000001 INTL 20200925)
[5.607253] zenbook kernel: Serial bus multi instantiate pseudo device driver CSC3551:00: Instantiated 2 SPI devices.
[5.906936] zenbook kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.0: Cirrus Logic CS35L41 (35a40), Revision: B2
[5.907354] zenbook kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.1: Reset line busy, assuming shared reset
[5.938136] zenbook kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.1: Cirrus Logic CS35L41 (35a40), Revision: B2
[6.239406] zenbook kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.0: DSP1: Firmware version: 3
[6.239415] zenbook kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.0: DSP1: cirrus/cs35l41-dsp1-spk-prot-10431e02.wmfw: Fri 27 Aug 2021 14:58:19 W. Europe Daylight Time
[6.313109] zenbook kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.0: DSP1: Firmware: 400a4 vendor: 0x2 v0.43.1, 2 algorithms
[6.313524] zenbook kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.0: DSP1: 0: ID cd v29.63.1 XM@94 YM@e
[6.313530] zenbook kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.0: DSP1: 1: ID f20b v0.1.0 XM@176 YM@0
[6.313535] zenbook kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.0: DSP1: spk-prot: C:\Users\tyang\Desktop\Product Setting\SmartAMP\ASUS\ASUS_Zenbook\UX3402\Tuning Release\220304\ASUS_UX3402_L_tuning_IDYC_ReDc_PICL_RTL_0304.bin
[6.337211] zenbook kernel: snd_hda_codec_realtek ehdaudio0D0: bound spi1-CSC3551:00-cs35l41-hda.0 (ops cs35l41_hda_comp_ops [snd_hda_scodec_cs35l41])
[6.337534] zenbook kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.1: DSP1: Firmware version: 3
[6.337540] zenbook kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.1: DSP1: cirrus/cs35l41-dsp1-spk-prot-10431e02.wmfw: Fri 27 Aug 2021 14:58:19 W. Europe Daylight Time
[6.399070] zenbook kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.1: DSP1: Firmware: 400a4 vendor: 0x2 v0.43.1, 2 algorithms
[6.399612] zenbook kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.1: DSP1: 0: ID cd v29.63.1 XM@94 YM@e
[6.399623] zenbook kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.1: DSP1: 1: ID f20b v0.1.0 XM@176 YM@0
[6.399629] zenbook kernel: cs35l41-hda spi1-CSC3551:00-cs35l41-hda.1: DSP1: spk-prot: C:\Users\tyang\Desktop\Product Setting\SmartAMP\ASUS\ASUS_Zenbook\UX3402\Tuning Release\220304\ASUS_UX3402_R_tuning_IDYC_ReDc_PICL_RTL_0304.bin
[6.427637] zenbook kernel: snd_hda_codec_realtek ehdaudio0D0: bound spi1-CSC3551:00-cs35l41-hda.1 (ops cs35l41_hda_comp_ops [snd_hda_scodec_cs35l41])
--- dsdt.dsl.old 2023-03-26 01:06:48.845795666 +0100
+++ dsdt.dsl 2023-03-26 12:00:45.643851841 +0200
@@ -18,7 +18,7 @@
* Compiler ID "INTL"
* Compiler Version 0x20200717 (538969879)
*/
-DefinitionBlock ("", "DSDT", 2, "_ASUS_", "Notebook", 0x01072009)
+DefinitionBlock ("", "DSDT", 2, "_ASUS_", "Notebook", 0x0107200A)
{
/*
* iASL Warning: There were 233 external control methods found during
@@ -90642,7 +90642,48 @@
Method (_DIS, 0, NotSerialized) // _DIS: Disable Device
{
}
+
+ Name (_DSD, Package () // _DSD: Device-Specific Data
+ {
+ ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
+ Package ()
+ {
+ Package () { "cirrus,dev-index", Package () { Zero, One }},
+ Package () { "reset-gpios", Package () {
+ SPK1, One, Zero, Zero,
+ SPK1, One, Zero, Zero,
+ } },
+ // Package () { "spk-id-gpios", Package () {
+ // SPK1, 0x02, Zero, Zero,
+ // SPK1, 0x02, Zero, Zero,
+ // } },
+ Package () { "cirrus,speaker-position", Package () { Zero, One } },
+ Package () { "cirrus,gpio1-func", Package () { Zero, Zero } },
+ Package () { "cirrus,gpio2-func", Package () { 0x02, 0x02 } },
+ // boost-type: 0 internal, 1 external
+ Package () { "cirrus,boost-type", Package () { Zero, Zero } },
+ // boost-peak-milliamp: 1600 to 4500, increments of 50 mA
+ Package () { "cirrus,boost-peak-milliamp", Package () { 4500, 4500 } },
+ // boost-ind-nanohenry: 1000 | 1200 | 1500 | 2200 nH
+ Package () { "cirrus,boost-ind-nanohenry", Package () { 1000, 1000 } },
+ // boost-cap-microfarad: rounded to the nearest integer
+ Package () { "cirrus,boost-cap-microfarad", Package () { 24, 24 } },
+ },
+ })
}
+
+ Name (_DSD, Package ()
+ {
+ ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
+ Package ()
+ {
+ Package () { "cs-gpios", Package () {
+ Zero, // Native CS
+ SPK1, Zero, Zero, Zero // GPIO CS
+ } }
+ }
+ })
+
}
Scope (_SB.PC00.LPCB)
--- dsdt.dsl.old 2023-03-26 01:06:48.845795666 +0100
+++ dsdt.dsl 2023-03-26 12:00:45.643851841 +0200
@@ -18,7 +18,7 @@
* Compiler ID "INTL"
* Compiler Version 0x20200717 (538969879)
*/
-DefinitionBlock ("", "DSDT", 2, "_ASUS_", "Notebook", 0x01072009)
+DefinitionBlock ("", "DSDT", 2, "_ASUS_", "Notebook", 0x0107200A)
{
/*
* iASL Warning: There were 233 external control methods found during
@@ -90642,7 +90642,43 @@
Method (_DIS, 0, NotSerialized) // _DIS: Disable Device
{
}
+
+ Name (_DSD, Package () // _DSD: Device-Specific Data
+ {
+ ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
+ Package ()
+ {
+ Package () { "cirrus,dev-index", Package () { Zero, One }},
+ Package () { "reset-gpios", Package () {
+ SPK1, One, Zero, Zero,
+ SPK1, One, Zero, Zero,
+ } },
+ Package () { "spk-id-gpios", Package () {
+ SPK1, 0x02, Zero, Zero,
+ SPK1, 0x02, Zero, Zero,
+ } },
+ Package () { "cirrus,speaker-position", Package () { Zero, One } },
+ // gpioX-func: 0 not used, 1 VPSK_SWITCH, 2: INTERRUPT, 3: SYNC
+ Package () { "cirrus,gpio1-func", Package () { One, One } },
+ Package () { "cirrus,gpio2-func", Package () { 0x02, 0x02 } },
+ // boost-type: 0 internal, 1 external
+ Package () { "cirrus,boost-type", Package () { One, One } },
+ },
+ })
}
+
+ Name (_DSD, Package ()
+ {
+ ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
+ Package ()
+ {
+ Package () { "cs-gpios", Package () {
+ Zero, // Native CS
+ SPK1, Zero, Zero, Zero // GPIO CS
+ } }
+ }
+ })
+
}
Scope (_SB.PC00.LPCB)
DefinitionBlock ("", "SSDT", 1, "CUSTOM", "CSC3551", 0x00000001)
{
External (_SB_.PC00.SPI0, DeviceObj)
External (_SB_.PC00.SPI0.SPK1, DeviceObj)
Scope (_SB.PC00.SPI0.SPK1)
{
Name (_DSD, Package ()
{
ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
Package ()
{
Package () { "cirrus,dev-index", Package () { Zero, One }},
Package () { "reset-gpios", Package () {
SPK1, One, Zero, Zero,
SPK1, One, Zero, Zero
} },
Package () { "spk-id-gpios", Package () {
SPK1, 0x02, Zero, Zero,
SPK1, 0x02, Zero, Zero
} },
Package () { "cirrus,speaker-position", Package () { Zero, One } },
// gpioX-func: 0 not used, 1 VPSK_SWITCH, 2: INTERRUPT, 3: SYNC
Package () { "cirrus,gpio1-func", Package () { One, One } },
Package () { "cirrus,gpio2-func", Package () { 0x02, 0x02 } },
// boost-type: 0 internal, 1 external
Package () { "cirrus,boost-type", Package () { One, One } }
}
})
}
Scope (_SB.PC00.SPI0)
{
Name (_DSD, Package ()
{
ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
Package ()
{
Package () { "cs-gpios", Package () {
Zero, // Native CS
SPK1, Zero, Zero, Zero // GPIO CS
} }
}
})
}
}
@HARDWELL9191
Copy link

I recently bought a UX3402V and ran into the "no speaker sound" issue after installing Kubuntu. I was able to fix it by updating the kernel (using 6.7.10), but then observed the very low volume levels noted by others. I also saw kernel messages that the default firmware was loading.

This commit to the linux-firmware package is supposed to add the firmware links for my hardware (1043:16a3). After creating these links, no change was observed and the default firmware was still loaded.

I noticed that the links created by that patch use an upper case "A" (e.g. cs35l41-dsp1-spk-cali-104316A3.wmfw) in the filename which is different from all the other firmware files, so I recreated all the links using "104316a3" in the filenames. This worked: firmware was loaded and volume levels are back to normal. It appears this is a bug in the current linux-firmware package for this hardware.

Can you tell me the process of creating these links? I have a low volume issue with falling back to default firmware. I have the same device ID as you. I just don't know how to create these links.

@kenzoi
Copy link

kenzoi commented Apr 8, 2024

I noticed that the links created by that patch use an upper case "A" (e.g. cs35l41-dsp1-spk-cali-104316A3.wmfw) in the filename which is different from all the other firmware files, so I recreated all the links using "104316a3" in the filenames. This worked: firmware was loaded and volume levels are back to normal. It appears this is a bug in the current linux-firmware package for this hardware.

Very nice! This worked for me too! @szweep could you send a patch with this fix to upstream?

@HARDWELL9191 for me on Fedora the files are located here /lib/firmware/cirrus.

Create new symlinks as proposed above:

ln -s cs35l41-dsp1-spk-cali-10431e12-spkid0-l0.bin.xz cs35l41-dsp1-spk-cali-104316a3-spkid0-l0.bin.xz
ln -s cs35l41-dsp1-spk-cali-10431e12-spkid0-r0.bin.xz cs35l41-dsp1-spk-cali-104316a3-spkid0-r0.bin.xz
ln -s cs35l41-dsp1-spk-cali-10431e12-spkid1-l0.bin.xz cs35l41-dsp1-spk-cali-104316a3-spkid1-l0.bin.xz
ln -s cs35l41-dsp1-spk-cali-10431e12-spkid1-r0.bin.xz cs35l41-dsp1-spk-cali-104316a3-spkid1-r0.bin.xz
ln -s cs35l41/v6.61.1/halo_cspl_RAM_revB2_29.63.1.wmfw.xz cs35l41-dsp1-spk-cali-104316a3.wmfw.xz
ln -s cs35l41-dsp1-spk-prot-10431e12-spkid0-l0.bin.xz cs35l41-dsp1-spk-prot-104316a3-spkid0-l0.bin.xz
ln -s cs35l41-dsp1-spk-prot-10431e12-spkid0-r0.bin.xz cs35l41-dsp1-spk-prot-104316a3-spkid0-r0.bin.xz
ln -s cs35l41-dsp1-spk-prot-10431e12-spkid1-l0.bin.xz cs35l41-dsp1-spk-prot-104316a3-spkid1-l0.bin.xz
ln -s cs35l41-dsp1-spk-prot-10431e12-spkid1-r0.bin.xz cs35l41-dsp1-spk-prot-104316a3-spkid1-r0.bin.xz
ln -s cs35l41/v6.61.1/halo_cspl_RAM_revB2_29.63.1.wmfw cs35l41-dsp1-spk-prot-104316a3.wmfw
ln -s cs35l41/v6.61.1/halo_cspl_RAM_revB2_29.63.1.wmfw.xz cs35l41-dsp1-spk-prot-104316a3.wmfw.xz

@tiaga
Copy link

tiaga commented Apr 8, 2024

BTW, guys with UX3402ZA/UX3402VA, could you please check is headset mic working properly in your laptops with 6.7+ kernels?

For me on UX3402VA and Linux Mint 21.3 headset microphone stopped working.
Same issue can be seen in 6.5.0-17 from official Linux Mint repo. I guess something is wrong with 3.5 jack pins mapping, but unfortunately I couldn't figure what changes lead to this.

@pavelkaptsiuh
Copy link

BTW, guys with UX3402ZA/UX3402VA, could you please check is headset mic working properly in your laptops with 6.7+ kernels?

For me on UX3402VA and Linux Mint 21.3 headset microphone stopped working. Same issue can be seen in 6.5.0-17 from official Linux Mint repo. I guess something is wrong with 3.5 jack pins mapping, but unfortunately I couldn't figure what changes lead to this.

Wired seems to work for me too.

Interesting. I searched the internet quite extensively for a headset mic issue and it was nothing there. Might be it's some how related to BIOS config or Mint's version of GRUB.

@szweep
Copy link

szweep commented Apr 13, 2024

Very nice! This worked for me too! @szweep could you send a patch with this fix to upstream?

@kenzoi - I created a PR here: CirrusLogic/linux-firmware#31. I'm not sure what the procedures are for approval and merge as I've never done this before, but hopefully it will be seen.

@smallcms
Copy link

Looks, UX3405MA works now on kernel 6.8.5. Tested on Fedora 39, works: amplifiers, 3.5 jack headset. Like @steffengy i'm decompiled ssdt16.dat, but added "spk-id-gpios" Package section. Works without patching kernel:
https://github.com/smallcms/asus_zenbook_ux3405ma

@rmuhamedgaliev
Copy link

rmuhamedgaliev commented Apr 29, 2024

Hello, i tried apply patch but have error

[    0.009166] ACPI: Table Upgrade: install [SSDT-CUSTOM- CSC3551]
[    0.009168] ACPI: SSDT 0x00000000394ED000 000158 (v01 CUSTOM CSC3551  00000001 INTL 20220331)
[    5.850427] Serial bus multi instantiate pseudo device driver CSC3551:00: Instantiated 2 SPI devices.
[    6.018972] cs35l41-hda spi0-CSC3551:00-cs35l41-hda.0: OTP Boot status 80000000 error
[    6.031984] cs35l41-hda: probe of spi0-CSC3551:00-cs35l41-hda.0 failed with error -5
[    6.039965] cs35l41-hda spi0-CSC3551:00-cs35l41-hda.1: OTP Boot status 80000000 error
[    6.053183] cs35l41-hda: probe of spi0-CSC3551:00-cs35l41-hda.1 failed with error -5

My patch and SPI3 info - https://gist.github.com/rmuhamedgaliev/e0886c86061e0ee99390f9044640c1de

My Setup - ROG Strix SCAR 18 G834JYR_G834JYR - 6.8.7-201.fsync.fc39.x86_64 Nobara 39

@RasAlhague
Copy link

Updated my ASUS Zenbook UX6404VV to Ubuntu 24.04 (which comes with 6.8.0 kernel) and sound works well now. (I did not apply any patches before)
My BIOS is v304

@DeltaNeverUsed
Copy link

I still get no audio on 6.8.8 and the previous solution I used

hda-verb /dev/snd/hwC0D0 0x20 0x500 0x1b
hda-verb /dev/snd/hwC0D0 0x20 0x477 0x4a4b
hda-verb /dev/snd/hwC0D0 0x20 0x500 0xf
hda-verb /dev/snd/hwC0D0 0x20 0x477 0x74

doesn't work on any version higher than 6.6.10 on my ASUS Zenbook UX582L

@bkonkle
Copy link

bkonkle commented May 1, 2024

It works out-of-the-box for me in Ubuntu 24.04 on my ROG Strix G814JZ! 🚀

@Oless-N
Copy link

Oless-N commented May 8, 2024

hello guys!! I need help with a problem: asus rog zephyrus g16 2024 gu605m: low-level sound.
Linux user-GU605MI 6.8.8-060808-generic #202404271536 SMP PREEMPT_DYNAMIC Sat Apr 27 15:54:17 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux Ubuntu 24.04
journalctl -b -g CSC3556 --output short-monotonic
[ 2.373898] user-GU605MI kernel: Serial bus multi instantiate pseudo device driver CSC3556:00: Instantiated 2 SPI devices.
[ 2.484345] user-GU605MI kernel: cs35l56-hda spi0-CSC3556:00-cs35l56-hda.0: Cirrus Logic CS35L56 Rev B0 OTP3 fw:3.4.4 (patched=0)
[ 2.493213] user-GU605MI kernel: cs35l56-hda spi0-CSC3556:00-cs35l56-hda.1: Reset GPIO busy, assume shared reset
[ 2.500317] user-GU605MI kernel: cs35l56-hda spi0-CSC3556:00-cs35l56-hda.1: Cirrus Logic CS35L56 Rev B0 OTP3 fw:3.4.4 (patched=0)
[ 6122.443562] user-GU605MI kernel: cs35l56-hda spi0-CSC3556:00-cs35l56-hda.0: .bin file required but not found
[ 6122.443566] user-GU605MI kernel: cs35l56-hda spi0-CSC3556:00-cs35l56-hda.0: PM: dpm_run_callback(): cs35l56_hda_system_resume+0x0/0xd0 [snd_hda_scodec_cs35l56] returns -2
[ 6122.443583] user-GU605MI kernel: cs35l56-hda spi0-CSC3556:00-cs35l56-hda.0: PM: failed to resume: error -2
[ 6122.456528] user-GU605MI kernel: cs35l56-hda spi0-CSC3556:00-cs35l56-hda.1: .bin file required but not found
[ 6122.456532] user-GU605MI kernel: cs35l56-hda spi0-CSC3556:00-cs35l56-hda.1: PM: dpm_run_callback(): cs35l56_hda_system_resume+0x0/0xd0 [snd_hda_scodec_cs35l56] returns -2
[ 6122.456544] user-GU605MI kernel: cs35l56-hda spi0-CSC3556:00-cs35l56-hda.1: PM: failed to resume: error -2

@HARDWELL9191
Copy link

I noticed that the links created by that patch use an upper case "A" (e.g. cs35l41-dsp1-spk-cali-104316A3.wmfw) in the filename which is different from all the other firmware files, so I recreated all the links using "104316a3" in the filenames. This worked: firmware was loaded and volume levels are back to normal. It appears this is a bug in the current linux-firmware package for this hardware.

Very nice! This worked for me too! @szweep could you send a patch with this fix to upstream?

@HARDWELL9191 for me on Fedora the files are located here /lib/firmware/cirrus.

Create new symlinks as proposed above:

ln -s cs35l41-dsp1-spk-cali-10431e12-spkid0-l0.bin.xz cs35l41-dsp1-spk-cali-104316a3-spkid0-l0.bin.xz
ln -s cs35l41-dsp1-spk-cali-10431e12-spkid0-r0.bin.xz cs35l41-dsp1-spk-cali-104316a3-spkid0-r0.bin.xz
ln -s cs35l41-dsp1-spk-cali-10431e12-spkid1-l0.bin.xz cs35l41-dsp1-spk-cali-104316a3-spkid1-l0.bin.xz
ln -s cs35l41-dsp1-spk-cali-10431e12-spkid1-r0.bin.xz cs35l41-dsp1-spk-cali-104316a3-spkid1-r0.bin.xz
ln -s cs35l41/v6.61.1/halo_cspl_RAM_revB2_29.63.1.wmfw.xz cs35l41-dsp1-spk-cali-104316a3.wmfw.xz
ln -s cs35l41-dsp1-spk-prot-10431e12-spkid0-l0.bin.xz cs35l41-dsp1-spk-prot-104316a3-spkid0-l0.bin.xz
ln -s cs35l41-dsp1-spk-prot-10431e12-spkid0-r0.bin.xz cs35l41-dsp1-spk-prot-104316a3-spkid0-r0.bin.xz
ln -s cs35l41-dsp1-spk-prot-10431e12-spkid1-l0.bin.xz cs35l41-dsp1-spk-prot-104316a3-spkid1-l0.bin.xz
ln -s cs35l41-dsp1-spk-prot-10431e12-spkid1-r0.bin.xz cs35l41-dsp1-spk-prot-104316a3-spkid1-r0.bin.xz
ln -s cs35l41/v6.61.1/halo_cspl_RAM_revB2_29.63.1.wmfw cs35l41-dsp1-spk-prot-104316a3.wmfw
ln -s cs35l41/v6.61.1/halo_cspl_RAM_revB2_29.63.1.wmfw.xz cs35l41-dsp1-spk-prot-104316a3.wmfw.xz

This was it. My speakers finally work like they're supposed to. Now this just needs to be fixed in the kernel. Thank you brother.

@simontrimmer
Copy link

hello guys!! I need help with a problem: asus rog zephyrus g16 2024 gu605m: low-level sound.
[ 2.484345] user-GU605MI kernel: cs35l56-hda spi0-CSC3556:00-cs35l56-hda.0: Cirrus Logic CS35L56 Rev B0 OTP3 fw:3.4.4 (patched=0)
[ 6122.443562] user-GU605MI kernel: cs35l56-hda spi0-CSC3556:00-cs35l56-hda.0: .bin file required but not found

This is a different amplifier family, but I believe I upstreamed linux-firmware support for this model 30th April

https://lore.kernel.org/linux-firmware/001701da9b0b$223057b0$66910710$@opensource.cirrus.com/T/#u

Cheers,
-Simon

@SalahAdDin
Copy link

I have this issue today (2024) with my ASUS ROG Strix 18" G834JYR!

@simontrimmer
Copy link

I have this issue today (2024) with my ASUS ROG Strix 18" G834JYR!

https://lore.kernel.org/linux-firmware/d9869d7c-b613-87c9-f00c-f61b98b40c6d@opensource.cirrus.com/

@SalahAdDin
Copy link

I have this issue today (2024) with my ASUS ROG Strix 18" G834JYR!

https://lore.kernel.org/linux-firmware/d9869d7c-b613-87c9-f00c-f61b98b40c6d@opensource.cirrus.com/

I'm waiting for the latest kernel to have it patched.

@Oless-N
Copy link

Oless-N commented Jul 15, 2024

@simontrimmer
Copy link

I'm waiting for the latest kernel to have it patched.

That's cool, the firmware repository isn't distributed as part of the kernel releases and distributions often update it infrequently.

@Oless-N 's link is good, though I'd highlight that linux-firmware uses softlinks where there is the potential for lots of duplicats (like our .wmfw files) so running the make install step and copying the lot can get you out of a bind.

@SalahAdDin
Copy link

try the kernel 6.9.9 or https://ubuntuforums.org/showthread.php?t=2497994&page=2&s=4f6cf9ee26d06f746ea4fbc30becd96f

I'm testing the release candidate on Manjaro.

@Annaiz11
Copy link

Horrible, crackling sound from speakers on the ASUS Zenbook Q529Z.

I guess I have tried everything I could find online to fix this. I tried KDE and Gnome on different distros (I am on KDE Manjaro, no dual boot), but the problem persists.

The patch in the kernel for my model seems to be:

SND_PCI_QUIRK (0x1043, 0x1da2, "ASUS UP6502ZA/ZD", ALC245_FIXUP_CS35L41_SPI_2)

with the difference that my particular laptop is on ALC294. Could this be what causes the problem?

@SalahAdDin
Copy link

try the kernel 6.9.9 or https://ubuntuforums.org/showthread.php?t=2497994&page=2&s=4f6cf9ee26d06f746ea4fbc30becd96f

I'm testing the release candidate on Manjaro.

Working in Linux 6.10

@Annaiz11
Copy link

try the kernel 6.9.9 or https://ubuntuforums.org/showthread.php?t=2497994&page=2&s=4f6cf9ee26d06f746ea4fbc30becd96f

I'm testing the release candidate on Manjaro.

Working in Linux 6.10

Thanks a lot. I am trying every new kernel released by Manjaro, was experimenting with symlinks, but none of them helped, so removed them.

The original entries in lib/firmware/cirrus for 1da2 look like this:
Screenshot_20240730_105944

Different solutions proposed here and there for ALC294 did not work either.

Sound seems to be clear only at an almost inaudible level, with a bit of volume up it gets very distorted.

@simplepoint1024
Copy link

hi,I also had issues with my ROG Strix SCAR 16 G634JZR, which is very quiet and gets distorted as the volume gets louder!

sudo dmesg |grep CSC3551

[    0.009760] ACPI: Table Upgrade: install [SSDT-CUSTOM- CSC3551]
[    0.009761] ACPI: SSDT 0x0000000039C33000 0001A0 (v01 CUSTOM CSC3551  00000001 INTL 20230628)
[    4.122780] cs35l41-hda spi1-CSC3551:00-cs35l41-hda.0: Adding DSD properties for 10433A60
[    4.122783] cs35l41-hda spi1-CSC3551:00-cs35l41-hda.0: Cannot add Reset/Speaker ID/SPI CS GPIO Mapping, _DSD already exists.
[    4.122784] cs35l41-hda spi1-CSC3551:00-cs35l41-hda.0: Cannot update SPI CS, _DSD already exists.
[    4.122947] cs35l41-hda spi1-CSC3551:00-cs35l41-hda.0: Using extra _DSD properties, bypassing _DSD in ACPI
[    4.122947] cs35l41-hda spi1-CSC3551:00-cs35l41-hda.0: Reset line busy, assuming shared reset
[    4.142200] cs35l41-hda spi1-CSC3551:00-cs35l41-hda.0: Cirrus Logic CS35L41 (35a40), Revision: B2
[    4.142436] cs35l41-hda spi1-CSC3551:00-cs35l41-hda.1: Adding DSD properties for 10433A60
[    4.142437] cs35l41-hda spi1-CSC3551:00-cs35l41-hda.1: Cannot add Reset/Speaker ID/SPI CS GPIO Mapping, _DSD already exists.
[    4.142437] cs35l41-hda spi1-CSC3551:00-cs35l41-hda.1: Cannot update SPI CS, _DSD already exists.
[    4.142538] cs35l41-hda spi1-CSC3551:00-cs35l41-hda.1: Using extra _DSD properties, bypassing _DSD in ACPI
[    4.142539] cs35l41-hda spi1-CSC3551:00-cs35l41-hda.1: Reset line busy, assuming shared reset
[    4.164755] cs35l41-hda spi1-CSC3551:00-cs35l41-hda.1: Cirrus Logic CS35L41 (35a40), Revision: B2
[    4.164764] Serial bus multi instantiate pseudo device driver CSC3551:00: Instantiated 2 SPI devices.
[    4.168730] cs35l41-hda spi1-CSC3551:00-cs35l41-hda.0: Falling back to default firmware.
[    4.169155] cs35l41-hda spi1-CSC3551:00-cs35l41-hda.0: DSP1: Firmware version: 3
[    4.169157] cs35l41-hda spi1-CSC3551:00-cs35l41-hda.0: DSP1: cirrus/cs35l41-dsp1-spk-prot.wmfw: Fri 24 Jun 2022 14:55:56 GMT Daylight Time
[    4.230204] cs35l41-hda spi1-CSC3551:00-cs35l41-hda.0: DSP1: Firmware: 400a4 vendor: 0x2 v0.58.0, 2 algorithms
[    4.230792] cs35l41-hda spi1-CSC3551:00-cs35l41-hda.0: DSP1: cirrus/cs35l41-dsp1-spk-prot.bin: v0.58.0
[    4.230794] cs35l41-hda spi1-CSC3551:00-cs35l41-hda.0: DSP1: spk-prot: e:\workspace\workspace\tibranch_release_playback_6.76_2\ormis\staging\default_tunings\internal\CS35L53\Fixed_Attenuation_Mono_48000_29.78.0\full\Fixed_Attenuation_Mono_48000_29.78.0_full.bin
[    4.241936] cs35l41-hda spi1-CSC3551:00-cs35l41-hda.0: Firmware Loaded - Type: spk-prot, Gain: 17
[    4.242025] cs35l41-hda spi1-CSC3551:00-cs35l41-hda.0: CS35L41 Bound - SSID: 10433A60, BST: 0, VSPK: 0, CH: L, FW EN: 1, SPKID: 1
[    4.242033] snd_hda_codec_realtek hdaudioC0D0: bound spi1-CSC3551:00-cs35l41-hda.0 (ops cs35l41_hda_comp_ops [snd_hda_scodec_cs35l41])
[    4.242275] cs35l41-hda spi1-CSC3551:00-cs35l41-hda.1: Falling back to default firmware.
[    4.242647] cs35l41-hda spi1-CSC3551:00-cs35l41-hda.1: DSP1: Firmware version: 3
[    4.242652] cs35l41-hda spi1-CSC3551:00-cs35l41-hda.1: DSP1: cirrus/cs35l41-dsp1-spk-prot.wmfw: Fri 24 Jun 2022 14:55:56 GMT Daylight Time
[    4.304303] cs35l41-hda spi1-CSC3551:00-cs35l41-hda.1: DSP1: Firmware: 400a4 vendor: 0x2 v0.58.0, 2 algorithms
[    4.305169] cs35l41-hda spi1-CSC3551:00-cs35l41-hda.1: DSP1: cirrus/cs35l41-dsp1-spk-prot.bin: v0.58.0
[    4.305180] cs35l41-hda spi1-CSC3551:00-cs35l41-hda.1: DSP1: spk-prot: e:\workspace\workspace\tibranch_release_playback_6.76_2\ormis\staging\default_tunings\internal\CS35L53\Fixed_Attenuation_Mono_48000_29.78.0\full\Fixed_Attenuation_Mono_48000_29.78.0_full.bin
[    4.320124] cs35l41-hda spi1-CSC3551:00-cs35l41-hda.1: Firmware Loaded - Type: spk-prot, Gain: 17
[    4.320208] cs35l41-hda spi1-CSC3551:00-cs35l41-hda.1: CS35L41 Bound - SSID: 10433A60, BST: 0, VSPK: 0, CH: R, FW EN: 1, SPKID: 1
[    4.320215] snd_hda_codec_realtek hdaudioC0D0: bound spi1-CSC3551:00-cs35l41-hda.1 (ops cs35l41_hda_comp_ops [snd_hda_scodec_cs35l41])

dsdt.dsl

Scope (_SB.PC00.SPI3)
    {
        Device (SPK1)
        {
            OperationRegion (GH16, SystemMemory, 0xE06D0A00, 0x10)
            Field (GH16, ByteAcc, Lock, Preserve)
            {
                    ,   1, 
                IH16,   1
            }

            Name (_HID, "CSC3551")  // _HID: Hardware ID
            Method (_SUB, 0, NotSerialized)  // _SUB: Subsystem ID
            {
                If ((IH16 == One))
                {
                    Return ("10433A60")
                }
                Else
                {
                    Return ("10433A20")
                }
            }

            Name (_UID, One)  // _UID: Unique ID
            Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
            {
                Name (SBUF, ResourceTemplate ()
                {
                    SpiSerialBusV2 (0x0000, PolarityLow, FourWireMode, 0x08,
                        ControllerInitiated, 0x003D0900, ClockPolarityLow,
                        ClockPhaseFirst, "\\_SB.PC00.SPI3",
                        0x00, ResourceConsumer, , Exclusive,
                        )
                    SpiSerialBusV2 (0x0001, PolarityLow, FourWireMode, 0x08,
                        ControllerInitiated, 0x003D0900, ClockPolarityLow,
                        ClockPhaseFirst, "\\_SB.PC00.SPI3",
                        0x00, ResourceConsumer, , Exclusive,
                        )
                    GpioIo (Exclusive, PullUp, 0x0000, 0x0000, IoRestrictionOutputOnly,
                        "\\_SB.GPI0", 0x00, ResourceConsumer, ,
                        )
                        {   // Pin list
                            0x01D4
                        }
                    GpioIo (Exclusive, PullDown, 0x0000, 0x0000, IoRestrictionOutputOnly,
                        "\\_SB.GPI0", 0x00, ResourceConsumer, ,
                        )
                        {   // Pin list
                            0x0140
                        }
                    GpioIo (Exclusive, PullUp, 0x0000, 0x0000, IoRestrictionInputOnly,
                        "\\_SB.GPI0", 0x00, ResourceConsumer, ,
                        )
                        {   // Pin list
                            0x00C0
                        }
                    GpioIo (Shared, PullUp, 0x0064, 0x0000, IoRestrictionInputOnly,
                        "\\_SB.GPI0", 0x00, ResourceConsumer, ,
                        )
                        {   // Pin list
                            0x0141
                        }
                    GpioInt (Edge, ActiveBoth, Shared, PullUp, 0x0064,
                        "\\_SB.GPI0", 0x00, ResourceConsumer, ,
                        )
                        {   // Pin list
                            0x0141
                        }
                })
                Return (SBUF) /* \_SB_.PC00.SPI3.SPK1._CRS.SBUF */
            }

            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                Return (0x0F)
            }

            Method (_DIS, 0, NotSerialized)  // _DIS: Disable Device
            {
            }
        }
    }

cirrus_ssdt_patch.dsl

DefinitionBlock ("", "SSDT", 1, "CUSTOM", "CSC3551", 0x00000001)
{
    External (_SB_.PC00.SPI3, DeviceObj)
    External (_SB_.PC00.SPI3.SPK1, DeviceObj)

    Scope (_SB.PC00.SPI3.SPK1)
    {
        Name (_DSD, Package ()   // _DSD: Device-Specific Data
        {
            ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
            Package ()
            {
                Package () { "cirrus,dev-index", Package () { Zero, One }},
                Package () { "reset-gpios", Package () {
					SPK1, Zero, Zero, Zero,
					SPK1, Zero, Zero, Zero,
                } },
                Package () { "spk-id-gpios", Package () {
					SPK1, 0x02, Zero, Zero,
					SPK1, 0x02, Zero, Zero,
                } },
                Package () { "cirrus,speaker-position",     Package () { Zero, One } },
                // gpioX-func: 0 not used, 1 VPSK_SWITCH, 2: INTERRUPT, 3: SYNC
                Package () { "cirrus,gpio1-func",           Package () { One, One } },
                Package () { "cirrus,gpio2-func",           Package () { 0x02, 0x02 } },
                // boost-type: 0 internal, 1 external
                Package () { "cirrus,boost-type",           Package () { One, One } },
            },
        })
    }

    Scope (_SB.PC00.SPI3)
    {
        Name (_DSD, Package ()
        {
            ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
            Package ()
            {
                Package () { "cs-gpios", Package () {
                    Zero,                    // Native CS
                    SPK1, Zero, Zero, Zero   // GPIO CS
                } }
            }
        })
    }
}

ASUSTeK COMPUTER INC. ROG Strix SCAR 16 G634JZR
OS: Arch Linux
Kernel Version: Linux 6.10.3-zen1-2-zen
Firmware Version : G634JZR.316

@flukejones
Copy link

@159356-1702-Extramural your laptop is patched in upstream kernel (my patch was accepted last week). This should be in next 6.10 version, and in 6.11-RC3. You will need latest firmware.

@ninja-
Copy link

ninja- commented Aug 28, 2024

I am getting bad sound quality on latest kernel unless the volume is low(<50%), I am runing mainline kernel.

the volume at >50% feels ok, but it starts getting a bit of crackling and bass which makes human voice annoying in audio calls
(or maybe I am just imagining it and that's just the way this hardware is supposed to work, I wiped Windows so I can't compare)

My active quirk in mainline is

SND_PCI_QUIRK(0x1043, 0x1c03, "ASUS UM3406HA", ALC287_FIXUP_CS35L41_I2C_2)

Is there something else that can be done or was done to similar machines?

[121739.231216] cs35l41-hda i2c-CSC3551:00-cs35l41-hda.0: DSP1: cirrus/cs35l41-dsp1-spk-prot-10431c03.wmfw: format 3 timestamp 0x64269d09
[121739.231230] cs35l41-hda i2c-CSC3551:00-cs35l41-hda.0: DSP1: cirrus/cs35l41-dsp1-spk-prot-10431c03.wmfw: Fri 31 Mar 2023 10:42:49 W. Europe Daylight Time
[121739.549909] cs35l41-hda i2c-CSC3551:00-cs35l41-hda.1: DSP1: Firmware: 400a4 vendor: 0x2 v0.65.0, 2 algorithms
[121739.584748] cs35l41-hda i2c-CSC3551:00-cs35l41-hda.1: DSP1: cirrus/cs35l41-dsp1-spk-prot-10431c03-spkid1-r0.bin: v0.65.0
[121739.584758] cs35l41-hda i2c-CSC3551:00-cs35l41-hda.1: DSP1: spk-prot: C:\Users\tyang\Desktop\ProductSetting\UX3406\Tuning\01192024\Tuning\UM3406HA_Xmax0p6Redc6p7_Rch_Tuni
[121740.087612] cs35l41-hda i2c-CSC3551:00-cs35l41-hda.0: DSP1: Firmware: 400a4 vendor: 0x2 v0.65.0, 2 algorithms
[121740.089252] cs35l41-hda i2c-CSC3551:00-cs35l41-hda.0: DSP1: cirrus/cs35l41-dsp1-spk-prot-10431c03-spkid1-l0.bin: v0.65.0
[121740.089261] cs35l41-hda i2c-CSC3551:00-cs35l41-hda.0: DSP1: spk-prot: C:\Users\tyang\Desktop\ProductSetting\UX3406\Tuning\01192024\Tuning\UM3406HA_Xmax0p6Redc6p7_Lch_Tuni
[121740.171526] cs35l41-hda i2c-CSC3551:00-cs35l41-hda.1: Calibration applied: R0=9172
[121740.174720] cs35l41-hda i2c-CSC3551:00-cs35l41-hda.0: Calibration applied: R0=9117
[121740.194842] cs35l41-hda i2c-CSC3551:00-cs35l41-hda.1: Firmware Loaded - Type: spk-prot, Gain: 19
[121740.196769] cs35l41-hda i2c-CSC3551:00-cs35l41-hda.0: Firmware Loaded - Type: spk-prot, Gain: 19

@ninja-
Copy link

ninja- commented Aug 28, 2024

@ninja-
Copy link

ninja- commented Aug 28, 2024

the commit you were referring to is probably torvalds/linux@e6e1802

would ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS be a better quirk for my hardware too by any chance?

@danee940
Copy link

danee940 commented Sep 8, 2024

Hi guys!

I tried to read the whole thread but sorry if missed out important info.

I have an UX3405MA, installed the following patch, but the audio is still really quiet.

https://github.com/smallcms/asus_zenbook_ux3405ma

Is there anything that can be done extra to fix this issue? I'm dual booting windows, on Windows it works miles better.

I'm on kernel 6.10.7-200.fc40.x86_64

@paul-ri
Copy link

paul-ri commented Sep 8, 2024

@danee940 , you'll get answers on this thread for the UX3405: smallcms/asus_zenbook_ux3405ma#7

tldr; wait for the Linux kernel 6.11 to come out, or build the kernel with the patch mentioned there.

@danee940
Copy link

danee940 commented Sep 9, 2024

Thank you @paul-ri !

I think I'll wait for the next kernel. But hope is not lost, that's great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment