I cant get audio from my laptop. Its a Lenovo Legion 7 ITHg6 with the Cirrus Logic CS35L41 amplifiers. I have tried so much and installed the kernel and patches from CachyOS since it works in their live environment, but no luck.
If anybody can help that would really be appreciated as im pulling out my hair here. I have been at this for days and cant get it to work.
Also relatively new to NixOS, so please be patient with me. I have experience from Arch/CachyOS as that’s what I had installed before i installed NixOS.
got it to work. needed another source of cachyos kernel that included the needed patches. As the one i used apparently didnt have those patches. I would prefer to manually include those into the stock kernel, but i dont know how to do that.
If anybody is willing to help me with that it would be great, but there’s not an issue for me to use cachyos’s kernel for the time being.
Here’s the info I have found currently:
In CachyOS’s cloned repo of the Linux upstream kernel you can see this line:
They have added a C fix, but unsure on how to add that to the standard kernel. (I’m not that advanced other that having built the kernel or using dkms on CachyOS on my machine a few times).
I have tried a few fixes other have tried with a patch found here:
But that has not worked and the person trying to maintain it has stopped maintaining it.
Cirrus has added some support for the Cirrus CS35L41 on many laptops, but that does not apply to this one.
I have messaged their open source side in hopes of getting this included in the upstream kernel, and will update here if I get an answer.
Also for anyone wanting to get working audio right now on this laptop right now you can do the following.
First setup Nix Flake, and then add the following.
add this to your configuration.nix config block:
boot.initrd.kernelModules = [
"snd_hda_scodec_cs35l41_i2c" # The missing bridge module between your card and amplifiers
"i2c_designware_platform" # The low-level ACPI driver for your Intel i2c rails
];
Got some time to look at this again and I was wrong. The C patch I was talking about earlier is indeed in the kernel already, because I found it here also:
So now I’m unsure why it works with the CachyOS kernel and not with the kernel included with nixos.
Maybe fix?
Since I’m not super knowledgeable about both nix and kernels I would like a set of other eyes on it if possible.
I seem to have found the issue and got i working on “stock” kernel. What I did was the following lines to configuration.nix:
These make the needed files for the dsp/amp readable at boot, because of how nixos starts these files are not “there” when its needed. This in turn fails the drivers to load, and creating my issue where i got no sound.
Do you @TLATER have anything to add or comment on about this solution?
It shouldn’t be necessary. hardware.enableRedistributableFirmware is enabled by default, and already includes those firmware files in the initrd. In fact, given how the NixOS initrd is configured, those paths are probably inert and your config does nothing.
Unless you explicitly disable it, the kernel should also load the modules as it spots the relevant hardware, without you explicitly forcing it.
Personally I’d remove the workaround and look at dmesg to see what’s going wrong.
Ok, now I really don’t understand whats happening. It seems to work now without anything added?
I saw in the dmsg logs earlier that it failed to load the drivers for it, but now after running cachyos kernel and trying some stuff on the stock kernel it magically works again after removing everything.
I’m glad it works but really dont want it to be intermittent. I’ll use it for a while and see if it just works.