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 config uses Pulseaudio port name instead of description #480

Open
milaq opened this issue Jan 30, 2022 · 6 comments
Open

Volume config uses Pulseaudio port name instead of description #480

milaq opened this issue Jan 30, 2022 · 6 comments

Comments

@milaq
Copy link

milaq commented Jan 30, 2022

Commit 09358d2 introduced an odd behavior for the volume setting: Using the port name instead of the device name.
The rationale was to have "much friendlier names" which seems certainly not the case for many other systems.
Moreover, the port name can not be easily renamed by the user like the device decription.

If the user find themselves in the situation of unfriendly names, they can always rename their Pulse description for sane names in i3status with the old behavior.
With the new behavior from 09358d2 this is not possible anymore.

Additionally the rationale of the setting in i3status is (from my understanding) to show the audio device not the active port, as the port may change while the respective volume handler stays the same.

Attached below are screenshots of both behaviors on one of my systems.
I have two sound devices with the port "Digital Output (S/PDIF)" and cannot tell them apart with the new behavior.
screenshot_20220130_155737
screenshot_20220130_155815
screenshot_20220130_155900
screenshot_20220130_155920

When reverting the commit I can easily tell them apart after renaming the device description ("AVR" and "Headphones") in Pulseaudio or Pipewire. Pavucontrol even has a gui option for that (right-click on the device).
With the new behavior I am stuck with non-identifiable names.

So here goes my humble request to revert the commit 09358d2 or at least make the bahavor optional.

@mikelward
Copy link
Contributor

Sorry this broke you @milaq

From memory, I couldn't find a way to change the description that would persist logouts/reboots.

Trying pavucontrol just now, the UI seems to only support renaming the port, not changing the device description, and it doesn't work with Pipewire on my system.

But I'm fine with reverting.

Thanks

@johannesneyer
Copy link

I have the same problem, both of my devices are named Speakers now. PipeWire allows changing the device description property but I did not find a way to change the port description.

@milaq
Copy link
Author

milaq commented Nov 18, 2022

Same for me.

Ever since I used Pipewire with both pipewire-media-session and Wireplumber, the port ID renaming is not as straightforward as changing the device description, even impossible in some configurations.
Furthermore, in pavucontrol, when assigning output/input devices, the port name does not show up, only the device description.

For a streamlined behavior, as the device description is shown in many places around the OS, I think it'd be best to revert.

@mikelward Thanks for your reply and understanding. Pavucontrol does not work in every regard with PipeWire. But you may automatically change the device description based on rules. This also persists reboots.
For Wireplumber see https://wiki.archlinux.org/title/WirePlumber#Changing_a_device/node_property

Personally I use something like this

rule = {
  matches = {
    {
      { "alsa.card_name", "matches", "Xonar DGX" },
    },
  },
  apply_properties = {
    ["node.description"] = "Headphones",
  },
}
table.insert(alsa_monitor.rules,rule)

rule = {
  matches = {
    {
      { "alsa.card_name", "matches", "Yealink*" },
    },
  },
  apply_properties = {
    ["node.description"] = "Yealink",
  },
}
table.insert(alsa_monitor.rules,rule)

rule = {
  matches = {
    {
      { "api.alsa.path", "matches", "iec958*" },
    },
  },
  apply_properties = {
    ["node.description"] = "AVR",
  },
}
table.insert(alsa_monitor.rules,rule)

You may customize the dev description based on various sink or source attributes.
You may inspect them with:
wpctl status and wpctl inspect <num> respectively.

@milaq
Copy link
Author

milaq commented Nov 18, 2022

I just created a revert PR for the discussed behavior.
Thanks to everyone for their input.

@johannesneyer
Copy link

But this still does not work on computers where all you want is switch between ports right? Like on a laptop where the speakers and headphone jack are on two different ports on the same device.

@milaq
Copy link
Author

milaq commented Nov 18, 2022

That's correct.

Maybe an option to switch between both behaviours in i3status.conf would be worth a future implementation.
What also could be an option is to combine device description and port name or even exposing both entities as variables in the config so that every user may decide on their own which one takes priority or even combining it in a appropriate string themselves. E.g.:

format = "Vol: %devicename/%deviceport %volume"

For now though, I deem the use-case very narrow as most people switch between distinct PA sinks.
Furthermore with modern audio backends like PipeWire, port renaming is not as straightforward as device description renaming.

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

3 participants