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

Wireplumber source refers to Sink if there is no source #4010

Open
yuannan opened this issue Mar 28, 2025 · 1 comment
Open

Wireplumber source refers to Sink if there is no source #4010

yuannan opened this issue Mar 28, 2025 · 1 comment
Labels

Comments

@yuannan
Copy link

yuannan commented Mar 28, 2025

Thanks to this PR (#3638) we now have source audio support in Waybar 🎉 !

I have noticed a weird bug from this, and while I think it is a upstream Wireplumber issues. I think we should put a fix/hack in place for now.

Steps to reproduce:

  1. Disable any sources you have. I used pwvucontrol and set the default sound card's (the one built into my laptop) profile to only output, and then I unplugged any webcams/microphones.
  2. Run wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle
  3. This will then toggle the mute on the SINK i.e. the output instead of the source (input).

Due to this weird behavior, waybar crashes on launch as it tries to update the name of the card.

[2025-03-28 12:57:30.741] [error] [wireplumber]: Object '81' not found
[2025-03-28 12:57:30.741] [error] [wireplumber]: Object '81' not found
> pw-cli ls | grep -A 11 "id 81"
	id 81, type PipeWire:Interface:Node/3
 		object.serial = "375"
 		object.path = "alsa:acp:Generic:3:playback"
 		factory.id = "19"
 		client.id = "43"
 		device.id = "51"
 		priority.session = "1009"
 		priority.driver = "1009"
 		node.description = "Family 17h/19h/1ah HD Audio Controller Analog Stereo"
 		node.name = "alsa_output.pci-0000_06_00.6.analog-stereo"
 		node.nick = "ALC287 Analog"
 		media.class = "Audio/Sink"

my config

    "wireplumber#sink": {
      "format": "{icon} {volume}%",
      "format-icons": [
        "🔈",
        "🔉",
        "🔊"
      ],
      "format-muted": "🔇",
      "on-click": "wpctl set-mute   @DEFAULT_SINK@ toggle",
      "on-click-middle": "easyeffects",
      "on-click-right": "pwvucontrol",
      "on-scroll-down": "wpctl set-volume @DEFAULT_SINK@ 1%-",
      "on-scroll-up": "wpctl set-volume @DEFAULT_SINK@ 1%+"
    },
    "wireplumber#source": {
      "format": " {volume}%",
      "format-muted": "",
      "node-type": "Audio/Source",
      "on-click": "wpctl set-mute   @DEFAULT_SOURCE@ toggle",
      "on-click-middle": "easyeffects",
      "on-click-right": "pwvucontrol",
      "on-scroll-down": "wpctl set-volume @DEFAULT_SOURCE@ 1%-",
      "on-scroll-up": "wpctl set-volume @DEFAULT_SOURCE@ 1%+",
      "scroll-step": 1
    },

Notice how it's trying to reference the object with "Audio/Sink" instead of a source.

@RowanLeeder, any ideas on how we should fix this? We could try and split out the code like in PR: #1905

If we place

throw std::runtime_error(err);
with just return it prints off the error, but keeps the program running.

But if you try to change the volume, mute, or use the module, it will instead send the commands down to the sink instead. This is the same behaviour as wireplumber wpctl command.

@yuannan
Copy link
Author

yuannan commented Mar 28, 2025

I found this issue that is related: https://gitlab.freedesktop.org/pipewire/wireplumber/-/issues/509

You'll need to sign in to see it unfortunately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant