Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Volume is set to 0 after mute/unmute in pipewire #1161

Open
chatziko opened this issue Oct 7, 2023 · 0 comments
Open

Volume is set to 0 after mute/unmute in pipewire #1161

chatziko opened this issue Oct 7, 2023 · 0 comments

Comments

@chatziko
Copy link

chatziko commented Oct 7, 2023

Describe the bug

Since #931 snapclient closes the pulseaudio stream when the client is muted. However, when pipewire is used, wireplumber restores the stream's volume when it is reopened. This has the side effect of incorrectly restoring the volume to 0.

Steps to Reproduce

  1. Mute a client (that uses pipewire/wireplumber) while playing.
    The stream's volume in pipewire becomes 0.

  2. Wait a few seconds for the stream to close

  3. Unmute. The stream is reopened, but wireplumber restores its volume to 0.

I'm not sure wether this should be considered a bug in snapclient or in wireplumber (see the workaround below). Maybe when we reopen the stream we can explicitly set the volume to avoid wireplumber restoring it?

Moreover when the client is muted it woud be preferable to mute the pulseaudio stream instead of setting its volume to 0. This could potentially fix the problem (it's possible that wireplumber restores the volume but not the muted flag).

Workaround

Edit ~/.config/wireplumber/main.lua.d/40-stream-defaults.lua (copy from /usr/share/wireplumber/... if not exists), adding the following config, which disables restoring the volume for snapcast clients.

stream_defaults.rules = {
  {
    matches = {
      {
        { "application.name", "matches", "Snapcast" },
      },
    },
    apply_properties = {
      ["state.restore-props"] = false,
    },
  },
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant