NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.42k stars 13.63k forks source link

Sound often muted on gnome+pipewire #209155

Open astrojhgu opened 1 year ago

astrojhgu commented 1 year ago

Describe the bug

The sound is muted from time to time automatically on gnome+pipewire system

Steps To Reproduce

Steps to reproduce the behavior:

  1. set the pipewire as
    services.pipewire = {
      enable = true;
      alsa = {
        enable = true;
        support32Bit = true;
      };
      jack.enable = true;
      pulse.enable = true;
    };
  2. nixos-rebuild boot
  3. reboot
  4. then the sound is randomly and automatically muted from time to time. Restart the pipewire service by systemctl restart --user pipewire.service can solve this problem temporarily before next random muting. Restarting pipewire.socket also fixes this problem temporarily.

Expected behavior

The sound system should work normally.

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

The sound system works well before the latest update. However, I have not updated the system for about three months, so not sure which update caused this problem.

Notify maintainers

@Kranzes

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
Place your finger on the fingerprint reader
Failed to match fingerprint
Place your finger on the fingerprint reader
 - system: `"x86_64-linux"`
 - host os: `Linux 5.15.85, NixOS, 23.05 (Stoat), 23.05pre439146.0fc9fca9c8d`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.12.0`
 - channels(root): `"nixos"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
jlesquembre commented 1 year ago

I'm having the same issue with latest nixos-unstable (latest commit https://github.com/NixOS/nixpkgs/commit/a518c77148585023ff56022f09c4b2c418a51ef5)

Sound works after (re)starting pipewire, but randomly stops working. As long as the application producing sound doesn't stops/pauses, there is sound, but it randomly stops when I switch between applications. There is no sound, but pavucontrol doesn't report any output device as muted.

In my case, I only have pulse support enabled (no jack nor alsa), and I use Sway (no gnome)

With latest nixos 22.05 I don't see the error, but I can reproduce it with some of previous versions in the 22.11 branch.

jlesquembre commented 1 year ago

Debugging it a bit more, I noticed that restarting the wireplumber service fixes the issue

nerosnm commented 1 year ago

I'm also having this problem.

lpuv commented 1 year ago

Same issue!

jlesquembre commented 1 year ago

According to https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/2886 seems to be a bug in the linux kernel

jlesquembre commented 1 year ago

Seems fixed with linux kernel 5.15.88

pedrovelho commented 1 year ago

Same issue here, but it is also the same issue with pulse when disabling pipewire. It happens with wireplumber and pipewire-media-session. Restarting pipewire services is a valid workaround for me, I use:

systemctl --user restart pipewire{,-pulse}.{socket,service}

The status of pipewire services show one suspected ALSA error:

systemctl --user restart pipewire{,-pulse}.{socket,service}
...
Jan 30 10:05:20 pipewire[****]: default: can't setup properties: No such file or directory
Jan 30 10:05:20 pipewire[****]: default: can't setup properties: No such file or directory
Jan 30 10:05:20 pipewire[****]: jack-device 0x5582e162bc38: can't open client: Input/output error
Jan 30 10:05:20 pipewire[*]: ALSA lib parser.c:1194:(parse_sequence) error: sequence command 'devdisall' is ignored
Jan 30 10:13:35 systemd[*]: pipewire.service: Current command vanished from the unit file, execution of the command list won't be resumed.
...

I searched for this ALSA lib error and it has been fixed on version 1.2.8, i am on 1.2.7: https://github.com/alsa-project/alsa-ucm-conf/commit/c802ca0b7d8186413b728382f8310359afa6a144

I am on kernel 5.15.85 and alsa-ucm-conf 1.2.7. I have a lenovo thinkpad X1 extreme gen 3.

If I manage to get these updated I will report back here.

pedrovelho commented 1 year ago

If I manage to get these updated I will report back here.

Updated to kernel 5.15.9 and it seems to be working for now.

nerosnm commented 1 year ago

I don't know if the issue I'm having is the same one, because I was on 5.17 before and I'm on 6.0 now, and I'm still having the problem.

damien-biasotto commented 1 year ago

I also have sound randomly muted (on swaywm though).


 - system: `"x86_64-linux"`
 - host os: `Linux 6.1.24, NixOS, 23.05 (Stoat), 23.05.20230417.f00994e`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.13.3`
 - channels(root): `"home-manager, nixos"`
 - channels(damien): `"home-manager"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`