NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
16.73k stars 13.17k forks source link

Problem with rtkit daemon #176800

Open LEv145 opened 2 years ago

LEv145 commented 2 years ago

Describe the bug

Problem with rtkit daemon, which is why a sound does not work in kde5 (plasma)

Steps To Reproduce

I don't know, I didn't touch any special settings I recently added a few settings, after which I noticed that there was a problem:

boot.kernelModules = ["nf_conntrack_pptp"];
networking.firewall.connectionTrackingModules = [ "pptp" ];

But then I removed these settings and rebuild nixos

Additional context

× rtkit-daemon.service - RealtimeKit Scheduling Policy Service
     Loaded: loaded (/etc/systemd/system/rtkit-daemon.service; linked; vendor preset: enabled)
     Active: failed (Result: exit-code) since Tue 2022-06-07 22:34:29 EET; 6s ago
    Process: 14261 ExecStart=/nix/store/kf5m1bsgi1npscwvk1mbcmmdg2mz9fhp-rtkit-0.13/libexec/rtkit-daemon (code=exited, status=1/FAILURE)
   Main PID: 14261 (code=exited, status=1/FAILURE)
         IP: 0B in, 0B out
        CPU: 2ms

июн 07 22:34:29 nixos rtkit-daemon[14261]: Successfully dropped privileges.
июн 07 22:34:29 nixos rtkit-daemon[14261]: Successfully limited resources.
июн 07 22:34:29 nixos systemd[1]: rtkit-daemon.service: Main process exited, code=exited, status=1/FAILURE
июн 07 22:34:29 nixos rtkit-daemon[14261]: pthread_create failed: Resource temporarily unavailable
июн 07 22:34:29 nixos rtkit-daemon[14261]: Demoting known real-time threads.
июн 07 22:34:29 nixos systemd[1]: rtkit-daemon.service: Failed with result 'exit-code'.
июн 07 22:34:29 nixos rtkit-daemon[14261]: Demoted 0 threads.
июн 07 22:34:29 nixos systemd[1]: rtkit-daemon.service: Start request repeated too quickly.
июн 07 22:34:29 nixos systemd[1]: rtkit-daemon.service: Failed with result 'exit-code'.
июн 07 22:34:29 nixos systemd[1]: Failed to start RealtimeKit Scheduling Policy Service.

Notify maintainers

This package has no maintainers.

Metadata

 - system: `"x86_64-linux"`
 - host os: `Linux 5.15.43, NixOS, 22.05 (Quokka), 22.05.379.08950a6e29c`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.8.1`
 - channels(root): `"nixos-unstable, nixos-22.05"`
 - channels(lev): `"home-manager-22.05.tar.gz"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
LEv145 commented 2 years ago

изображение Hmm, the sound works some time after logging in, although rtkit-daemon doesn't work, I thought it was because of this

LEv145 commented 2 years ago

Everything works on the old configuration, how can I compare configurations?

bryanasdev000 commented 2 years ago

Everything works on the old configuration, how can I compare configurations?

Take a look at https://gitlab.com/khumba/nvd for that.

You are using security.rtkit.enable = true; in your config ? Also, you are using Pulseaudio or Pipewire?

LEv145 commented 2 years ago

Take a look at https://gitlab.com/khumba/nvd for that.

OK, thanks, I'll take a look

You are using security.rtkit.enable = true; in your config ? Also, you are using Pulseaudio or Pipewire?

I use pulseaudio:

sound.enable = true;
hardware.pulseaudio.enable = true;
LEv145 commented 2 years ago

I booted from the last configuration, it seems the daemon is working (rebooted 3 times to check for sure), perhaps when updating one of the packages in the system it stopped working

nvd ```sh lev@nixos  ~  nvd diff /nix/var/nix/profiles/system-{52,59}-link <<< /nix/var/nix/profiles/system-52-link >>> /nix/var/nix/profiles/system-59-link Version changes: [C.] #01 bash 5.1-p16 x2 -> 5.1-p16 x2, 5.1-p8 [C*] #02 bzip2 1.0.6.0.2 x2, 1.0.6.0.2-bin x2, 1.0.6.0.2-man x2 -> 1.0.6.0.2 x3, 1.0.6.0.2-bin x2, 1.0.6.0.2-man x2 [C+] #03 docker-compose 2.5.1 -> 1.29.2, 2.5.1 [C.] #04 expat 2.4.8 x2 -> 2.4.7, 2.4.8 x2 [C.] #05 gdbm 1.23 x2 -> 1.20, 1.23 x2 [C*] #06 glibc 2.34-210 x2, 2.34-210-bin x2, 2.34-210-dev x2 -> 2.33-123, 2.34-210 x2, 2.34-210-bin x2, 2.34-210-dev x2 [C.] #07 libffi 3.4.2 x2, 3.4.2-dev -> 3.4.2 x3, 3.4.2-dev [C.] #08 libidn2 2.3.2 x2, 2.3.2-bin x2 -> 2.3.2 x3, 2.3.2-bin x2 [C.] #09 libunistring 1.0 x2 -> 0.9.10, 1.0 x2 [C*] #10 ncurses 6.3 x2, 6.3-man -> 6.2, 6.3 x2, 6.3-man [C.] #11 openssl 1.1.1o x3, 1.1.1o-bin x2, 1.1.1o-man x2 -> 1.1.1o x4, 1.1.1o-bin x2, 1.1.1o-man x2 [D*] #12 pipenv 2022.4.8 -> 2022.1.8 [C*] #13 python3 3.10.4, 3.9.12 x3, 3.9.12-env x2 -> 3.10.4, 3.9.12 x3, 3.9.12-env, 3.9.13, 3.9.13-env [D.] #14 python3.9-backports-entry-points-selectable 1.1.1 -> 1.1.0 [C.] #15 python3.9-certifi 2021.10.08, 2021.10.8 -> 2021.10.08 x2, 2021.10.8 [C.] #16 python3.9-cryptography 36.0.2 -> 36.0.2 x2, 36.0.2-dev [C.] #17 python3.9-distlib 0.3.4 x2 -> 0.3.3, 0.3.4 [C.] #18 python3.9-filelock 3.2.1, 3.6.0 -> 3.2.1, 3.3.0 [D.] #19 python3.9-pip 22.0.4 -> 21.1.3 [C.] #20 python3.9-platformdirs 2.0.2, 2.5.2 -> 2.0.2, 2.4.0 [C.] #21 python3.9-setuptools 61.2.0 -> 57.2.0, 61.2.0 [C.] #22 python3.9-six 1.16.0 x2 -> 1.16.0 x3 [C.] #23 python3.9-virtualenv 20.14.0 x2 -> 20.14.0, 20.8.1 [D.] #24 python3.9-virtualenv-clone 0.5.7 -> 0.5.6 [C.] #25 readline 6.3p08 x2, 8.1p2 x2 -> 6.3p08 x3, 8.1p2 x2 [C.] #26 sqlite 3.38.5 x2, 3.38.5-bin -> 3.36.0, 3.38.5 x2, 3.38.5-bin [C.] #27 tzdata 2022a x2 -> 2022a x3 [C*] #28 xz 5.2.5 x2, 5.2.5-bin x2, 5.2.5-doc, 5.2.5-man -> 5.2.5 x3, 5.2.5-bin x2, 5.2.5-doc, 5.2.5-man [C.] #29 zlib 1.2.12 x2, 1.2.12-dev -> 1.2.12 x3, 1.2.12-dev Added packages: [A.] #01 daemon.json [A.] #02 mime-types 9 [A.] #03 python3.9-async-generator 1.10 [A.] #04 python3.9-async-timeout 4.0.2 [A.] #05 python3.9-bcrypt 3.2.0 [A.] #06 python3.9-cached-property 1.5.2 [A.] #07 python3.9-click 8.1.3 [A.] #08 python3.9-colorama 0.4.4 [A.] #09 python3.9-curio 1.5 [A.] #10 python3.9-distro 1.7.0 [A.] #11 python3.9-docker 5.0.3 [A.] #12 python3.9-dockerpty 0.4.1 [A.] #13 python3.9-jsonschema 4.5.1 [A.] #14 python3.9-outcome 1.1.0 [A.] #15 python3.9-paramiko 2.10.4 [A.] #16 python3.9-pyasn1 0.4.8 [A.] #17 python3.9-pynacl 1.5.0 [A.] #18 python3.9-pyrsistent 0.18.1 [A.] #19 python3.9-python-dotenv 0.20.0 [A.] #20 python3.9-python-socks 2.0.3 [A.] #21 python3.9-pyyaml 6.0 [A.] #22 python3.9-sniffio 1.2.0 [A.] #23 python3.9-sortedcontainers 2.4.0 [A.] #24 python3.9-texttable 1.6.4 [A.] #25 python3.9-trio 0.20.0 [A.] #26 python3.9-typing-extensions 4.1.1 [A.] #27 python3.9-websocket-client 1.3.2 [A.] #28 unit-docker-prune.service [A.] #29 unit-docker.service [A.] #30 unit-docker.socket [A.] #31 unit-script-docker-prune-start Closure size: 2030 -> 2083 (80 paths added, 27 paths removed, delta +53). ```
environment.systemPackages ```cs environment.systemPackages = with pkgs; [ vim wget curl git htop neofetch rar unrar flameshot firefox chromium docker-compose vscode jetbrains.pycharm-community python39Full python310 nixos2111.pipenv poetry discord discord-canary betterdiscordctl tdesktop libsForQt5.kdenlive obs-studio kdeconnect gparted libsForQt5.ark libreoffice vlc ]; ```
LEv145 commented 2 years ago

No, the problem has not disappeared on the old configuration, sometimes when loading rtkit-daemon it works fine, and sometimes it does not work

LEv145 commented 2 years ago

I just deleted /var/ and the problem seems to be gone

LEv145 commented 2 years ago

No, strange, but it stopped working again, the service sometimes just stops working for no reason, and then the sound falls off

изображение

It looks like this: https://bugs.launchpad.net/ubuntu/+source/rtkit/+bug/1871543

Although the sound in KDE can work even when rtkit is not working, but they are usually cut off together

sergei-mironov commented 1 year ago

Same problem here. I'm on nixpgs cc4bb87f5457ba06 (above 22.11) Note, that the following patch might by used as a workaround (but hardly as a solution, because of security issues).

diff -ruN ./result/rtkit-daemon.service.in ./rtkit/rtkit-daemon.service.in
--- ./rtkit-daemon.service.in   1970-01-01 04:00:01.000000000 +0400
+++ ./rtkit-daemon.service.in   2023-04-30 16:24:13.800639661 +0400
@@ -19,7 +19,7 @@
 Description=RealtimeKit Scheduling Policy Service

 [Service]
-ExecStart=@LIBEXECDIR@/rtkit-daemon
+ExecStart=@LIBEXECDIR@/rtkit-daemon --no-drop-privileges
 Type=dbus
 BusName=org.freedesktop.RealtimeKit1
 NotifyAccess=main
4z3 commented 1 month ago

This issue occurred to me after upgrading from 23.11 to 24.05. Another, similar machine doesn't exhibit this issue. The major difference between these two machines is that the one with the issue hasn't been rebooted after the upgrade.

Besides spamming the journal the failed rtkit-daemon doesn't seem to have an effect here (using pipewire and no desktop environment.)

EDIT: after rebooting there isn't an issue anymore.