Closed VeilSilence closed 1 month ago
I'd generally recommend avoiding NixOS wiki(s). Both the official and the unofficial ones lack any sort of quality assurance, and the information on there is generally out of date.
After a bit of research, I found that the configuration file format changed in 0.5 version Wireplumber. Lua no longer supported by it.
That is correct, and I seem to have missed WP 0.5 merge entirely - which means my configuration is out of date. I'll take a look at that later, but you probably want to read the migration docs and move the lua config to their new conf format.
Migrated to the new API ın https://github.com/NotAShelf/nyx/commit/0197527c06215d88e40f80e85555764b101ad901
/> Migrated to the new API ın 0197527
Sorry for reopen, but is your new low latency setup working for you? If it is, i'm gonna looking for answers elsewhere, just to make sure...
I copy-pasted your updated low-latency module again and edit just a bit ( changed quant to 64
, clock to 44100
) for the test.
I verified everything what I could possibly think of which include:
1: Verified that device.name
, node.name
is right.
device.name = "alsa_card.usb-SteelSeries_Arctis_Pro_Wireless-00" device.name = "alsa_card.pci-0000_0b_00.1" device.name = "alsa_card.usb-Kingston_HyperX_Quadcast_4110-00" node.name = "alsa_output.usb-SteelSeries_Arctis_Pro_Wireless-00.stereo-game" node.name = "alsa_input.usb-SteelSeries_Arctis_Pro_Wireless-00.mono-chat" node.name = "alsa_input.usb-Kingston_HyperX_Quadcast_4110-00.analog-stereo" node.name = "alsa_output.pci-0000_0d_00.4.analog-stereo"
With that in mind, I assume that rules in your low-latency module should be correct for my case also.
2: after nh os switch
, pipewire directory symlink created in etc
. 92-low-latency.conf
and other conf exist and not empty.
3:Verified that pipewire and wireplumber start without erros about conf
.
```shell systemctl --user status pipewire.service ● pipewire.service - PipeWire Multimedia Service Loaded: loaded (/etc/systemd/user/pipewire.service; enabled; preset: enabled) Drop-In: /nix/store/5s2xsb45dsfcnx30q09gwmzpdn4xn6ia-user-units/pipewire.service.d └─overrides.conf Active: active (running) since Wed 2024-05-08 15:13:20 +03; 4min 46s ago TriggeredBy: ● pipewire.socket Main PID: 2310 (pipewire) Tasks: 2 (limit: 76965) Memory: 26.7M (peak: 27.1M) CPU: 249ms CGroup: /user.slice/user-1000.slice/user@1000.service/session.slice/pipewire.service └─2310 /nix/store/wjxawc5kg90ijr011i8r1br5wpxx10ky-pipewire-1.0.5/bin/pipewire May 08 15:13:20 Nix systemd[2275]: Started PipeWire Multimedia Service. May 08 15:13:20 Nix pipewire[2310]: mod.jackdbus-detect: Failed to receive jackdbus reply: org.freedesktop.DBus.Error.ServiceUnknown: The name is not activatable ```
```shell
systemctl --user status wireplumber.service plumber
● wireplumber.service - Multimedia Service Session Manager
Loaded: loaded (/etc/systemd/user/wireplumber.service; enabled; preset: enabled)
Drop-In: /nix/store/5s2xsb45dsfcnx30q09gwmzpdn4xn6ia-user-units/wireplumber.service.d
└─overrides.conf
Active: active (running) since Wed 2024-05-08 15:13:20 +03; 5min ago
Main PID: 2313 (wireplumber)
Tasks: 8 (limit: 76965)
Memory: 9.3M (peak: 10.0M)
CPU: 1.182s
CGroup: /user.slice/user-1000.slice/user@1000.service/session.slice/wireplumber.service
└─2313 /nix/store/mfz79x57mga5q0ykysv41wr6fvi3s0dg-wireplumber-0.5.2/bin/wireplumber
May 08 15:13:20 Nix systemd[2275]: Started Multimedia Service Session Manager.
May 08 15:13:21 Nix wireplumber[2313]: The decibel volume range for element 'Speaker' (-4000 dB - -900 dB) has negative maximum. Disabling the decibel range.
May 08 15:13:21 Nix wireplumber[2313]: The decibel volume range for element 'Speaker' (-4000 dB - -900 dB) has negative maximum. Disabling the decibel range.
May 08 15:13:21 Nix wireplumber[2313]: The decibel volume range for element 'Speaker' (-4000 dB - -900 dB) has negative maximum. Disabling the decibel range.
May 08 15:13:21 Nix wireplumber[2313]: The decibel volume range for element 'Speaker' (-4000 dB - -900 dB) has negative maximum. Disabling the decibel range.
May 08 15:13:22 Nix wireplumber[2313]:
This is what I got after switch
. Small part of pw-mon
output:
```shell type: PipeWire:Interface:Core cookie: 4074249876 user-name: "veil" host-name: "Nix" version: "1.0.5" name: "pipewire-0" * properties: * config.name = "pipewire.conf" * link.max-buffers = "16" * core.daemon = "true" * core.name = "pipewire-0" * module.jackdbus-detect = "true" * module.x11.bell = "true" * module.access = "true" * cpu.max-align = "32" * default.clock.rate = "48000" * default.clock.quantum = "1024" * default.clock.min-quantum = "32" * default.clock.max-quantum = "2048" * default.clock.quantum-limit = "8192" * default.clock.quantum-floor = "4" * default.video.width = "640" * default.video.height = "480" * default.video.rate.num = "25" * default.video.rate.denom = "1" * log.level = "2" * clock.power-of-two-quantum = "true" * mem.warn-mlock = "false" * mem.allow-mlock = "true" * settings.check-quantum = "false" * settings.check-rate = "false" * object.id = "0" * object.serial = "0" ```
pm-mon
output have nothing about 92-low-latency
and other settings. It's basically equal to default settings in:
cat "$(nix eval pipewire.outPath | sed 's/"//g')/share/pipewire/pipewire.conf"
pw-top
also confirms that clock and quant settings not applied.
Is services.pipewire.extraConfig.pipewire broked, or I'm missing something crucial here?
NixOS 24.05.
I have updated the configuration again, will push the changes shortly.
See if https://github.com/NotAShelf/nyx/commit/3ff41102374958a077bb63d3ec524fa8171538de helps. I haven't paid much attention, but according to pw-top
and pw-metadata -n settings 0
the values seem to be inline with my configuration.
I stand corrected. the values are not inline, and seem to follow the defaults as you have mentioned.
After an hour, I've found the issue. Latest commit should work as intended, cheers.
pw-metadata -n settings
Found "settings" metadata 35
update: id:0 key:'log.level' value:'2' type:''
update: id:0 key:'clock.rate' value:'48000' type:''
update: id:0 key:'clock.allowed-rates' value:'[ 48000 ]' type:''
update: id:0 key:'clock.quantum' value:'64' type:''
update: id:0 key:'clock.min-quantum' value:'64' type:''
update: id:0 key:'clock.max-quantum' value:'64' type:''
update: id:0 key:'clock.force-quantum' value:'0' type:''
update: id:0 key:'clock.force-rate' value:'0' type:''
Well, it take too long for me, but i found the way:
```nix
{
config,
pkgs,
lib,
...
}: let
inherit (lib) isx86Linux;
inherit (lib.modules) mkIf;
inherit (lib.lists) optionals;
cfg = config.modules.system.sound;
dev = config.modules.device;
in {
config = mkIf (cfg.enable && dev.hasSound) {
# If the device advertises sound enabled, and pipewire is disabled
# for whatever reason, we may fall back to PulseAudio to ensure
# that we still have audio. Although we should always use
# PipeWire where available.
hardware.pulseaudio.enable = !config.services.pipewire.enable;
# Able to change scheduling policies, e.g. to SCHED_RR.
# Sound servers use RealtimeKit (rtkit) to acquire
# realtime priority.
security.rtkit.enable = config.services.pipewire.enable;
# Enable the threadirqs kernel parameter to reduce audio latency
# See
Small note. I saw that steam also brings his pipewire.conf in .steam/steam/steamapps/common/SteamLinuxRuntime_sniper/sniper_platform_0.20240415.84603/files/share/pipewire/
for example
Something tells me that steam might ignore system settings for pipewire. I didn't test it.
Either way, thank you for assisting.
pkgs.writeTextDir
is certainly an option. I've elected to avoid it, because string interpolation becomes a pain with it. Using extraConfig, albeit finicky, works as intended.
Greetings. I'm a newbie in NixOS, so I am bit clueless about how thing work on NixOS.
As title says, low latency setup not working at all, or at least for me? Initially, I followed the low-latency setup outlined in the official wiki. I set the quantum to 64 for example. After
nh os switch
, I didpw-top
to check my quant level. In the QUANT column,pw-top
show 2048 instead of 64.For instance, when I ran
pw-metadata -n settings 0 clock.force-quantum 64
, it successfully changed to 64 inpw-top
. I began to wonder if I misunderstood something in the wiki, so I decided to try your low-latency setup, but encountered the same issue in the end. I inspect your low-latency setup closely, and noticed this:After a bit of research, I found that the configuration file format changed in 0.5 version Wireplumber. Lua no longer supported by it.
Maybe you can provide assistance about this? Is
pw-top
show correctquant
on your side? Do I misunderstand something?Your flake looks amazing btw, much more useful than nix wiki, so that's why I decide to ask here about this. Thank you so much for this amazing flake.