I have a NixOS configuration that employs pipewire, I am trying to get chrome to play higher quality audio in the 192khz range, overcoming the systems default 48khz.
This rebuilds fine but when I run pw-top,
Pw-top says chrome is running @ 48000. Additionally when I check the pipewire settings with pw-metadata it returns
It seems as if the settings aren’t being modified. I also checked /etc/pipewire with the tree command and it showed that there were 6 directories but no files ( . pipewire-pulse.conf pipewire.conf jack.conf client.conf client-rt.conf ) . These are obviously symlinks to the /nix/store. When I checked actual store path, I found that pipewire.conf.d has a one file called context.conf. With the proper setup from my nixos configuration file, but it isn’t symlinked anywhere.
I’m on 24.05, but I’ll try this way. Thanks!
Do I have to do anything special to active this profile once its installed or should pw-top and pw-metadata show these changes after a rebuild?
Update:
In 24.05 environment.etc.pipewire is no longer supported.
You probably just have to restart pipewire? Not sure if activate will pick up on that.
Hmm, I haven’t looked at what’s coming in 24.05 yet but I’m surprised that’s not supported. Is pipewire configured to not look in /etc/pipewire anymore?
When you check the sample rate with pw-top and pw-metadata does it show the proper sample rate? For me, nixos rebuilds would complete but the change in sample rate wouldn’t be reflected.
Dots in pipewire do not mean nested attr set they are just part of the attribute name and so need to be escaped to not be interpreted by nix, also extraConfig.pipewire is an attrset of file names containing pipewire settings.
You also need to restart pipewire to load the config.
My solution I posted didn’t work. It just didn’t throw an error. I mistook that with it working. I contacted the nixos matrix channel and someone there helped me. Disclaimer: I am doing sth else as the OP, therefore my answer is not especially for his/her solution.
This is my config:
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# enale the pipewire config to use noise supression
extraConfig.pipewire."99-input-denoising" = rnnoise_config;
};
I had to just use extraConfig.pipewire."99-input-denoising" = rnnoise_config and notextraConfig.pipewire."99-input-denoising" = { source = json.generate "99-input-denoising.conf" pw_rnnoise_config; };