kgshank / gse-sound-output-device-chooser

Gnome Shell Extension to show a simple chooser to select Input & Output device based on gnome control center
https://extensions.gnome.org/extension/906/sound-output-device-chooser/
GNU General Public License v3.0
771 stars 95 forks source link

Device names don't follow PAV's renaming #71

Open CommanderAlchemy opened 5 years ago

CommanderAlchemy commented 5 years ago

Renaming devices in PAV seem not to work with this. pretty annoying when by default they are really long.

image

kgshank commented 5 years ago

Yes, the extension uses gnome control center back-end for device details. Looks like control center has as slightly different behaviour here. So renaming in pulse audio alone will not affect the extension.

If the menu is longer, there is a new option introduced in the extension to not expand the menu to fit the long device name. You can turn off the option.

artur-woocode commented 5 years ago

Yes, the extension uses gnome control center back-end for device details. Looks like control center has as slightly different behaviour here. So renaming in pulse audio alone will not affect the extension.

If the menu is longer, there is a new option introduced in the extension to not expand the menu to fit the long device name. You can turn off the option.

Hi, yes i noticed that option, but it feels like a workaround for the issue at hand. I'll see if there is a bug in GCC regarding it not following pulse rename. That in turn should fix this issue then.

Cannot really understand why they give so long and detailed names.

kgshank commented 4 years ago

Could be same as #89 Need t obe verified

chrisgraham commented 3 years ago

I took a deep dive into this.

From what I can tell, the extension essentially is a new front-end to Gnome's built in volume control. And Gnome's volume control uses card/device descriptions, rather than sink/source descriptions. There's no way to change Pulseaudio card/device descriptions, only the sink/source ones.

I see the extension code can also call (via Python) a probe of all the metadata from Pulseaudio, but it can't actually use this for the main widget because the device IDs for Gnome's volume control have no bearing on the IDs used by Pulseaudio - i.e. it can't match anything up. I tried hacking the code, no avail.

It's really unfortunate. I think Gnome needs to fix this, so if someone could report upstream that would be great. In my case I have multiple of the same USB audio cards, so they show up with the same name in Gnome.

What I've ended up is following this to rename the sink/source in a reliable way (works even if devices are probed in another order as it works via bus paths). https://gist.github.com/mpaolino/91c3587045fa8d1a9353b74bf102c83b

Then I wrote some simple command line scripts so I would not have to work via the Gnome UI...

:~$ cat /usr/local/bin/speaker
#!/bin/sh

pacmd set-default-sink alsa_output.Speaker.analog-stereo
pacmd set-default-source alsa_input.StandMic.mono-fallback
:~$ cat /usr/local/bin/headset
#!/bin/sh

pacmd set-default-sink alsa_output.Headset.analog-stereo
pacmd set-default-source alsa_input.Headset.mono-fallback

The author of this extension could consider no longer working from the Gnome volume control, and directly talking to PulseAudio like my script does. But obviously it would be a bit rewrite for them. Better to just get Gnome fixed IMO.

aport commented 3 years ago

If you are using PipeWire you can rename the card itself using .config/pipewire/media-session.d/alsa-monitor.conf :

    {
        matches = [
            {
                device.name = "alsa_card.pci-0000_00_1f.3-platform-skl_hda_dsp_generic"
            }
        ]
        actions = {
            update-props = {
                device.description = "Laptop"
            }
       }
    }
jgcodes2020 commented 2 years ago

It's really unfortunate. I think Gnome needs to fix this, so if someone could report upstream that would be great. In my case I have multiple of the same USB audio cards, so they show up with the same name in Gnome.

I've created an issue report here, now to see if the GNOME devs are willing to respond.