yktoo / indicator-sound-switcher

Sound input/output selector indicator for Linux
https://yktoo.com/en/software/sound-switcher-indicator/
GNU General Public License v3.0
367 stars 29 forks source link

Add configuration option to override port unavailability #39

Closed GoodGuyNick closed 7 years ago

GoodGuyNick commented 7 years ago

I can switch in the PulseAudio Volume Control between speakers and headphones but cannot in the indicator-sound-switcher. There are only one choice "My lovely card>Headphones" when headphones plugged in. Here is indicator-sound-switcher.json:

{
    "show_inputs": false,
    "show_outputs": true,
    "devices": {
        "alsa_card.pci-0000_00_1b.0": {
            "name": "My lovely card",
            "ports": {
                "analog-output-speaker": "Speakers",
                "analog-output-headphones": "Headphones"
            }
        }
    }
}

AlsaMixer Volume Control

-vv output:

indicator-sound-switcher -vv
INF Loaded configuration file /home/user/.config/indicator-sound-switcher.json
INF Context connected
DEB   + Card[0] added: `alsa_card.pci-0000_00_03.0`
DEB     + Card profile added: `output:hdmi-stereo` (`Digital Stereo (HDMI) Output`), 1 sinks, 0 sources, priority: 5400 -- Active
DEB     + Card profile added: `output:hdmi-surround71` (`Digital Surround 7.1 (HDMI) Output`), 1 sinks, 0 sources, priority: 300
DEB     + Card profile added: `output:hdmi-surround` (`Digital Surround 5.1 (HDMI) Output`), 1 sinks, 0 sources, priority: 300
DEB     + Card profile added: `off` (`Off`), 0 sinks, 0 sources, priority: 0
DEB     + Card port added: `hdmi-output-0` (`HDMI / DisplayPort`); priority: 5900; direction: 1; available: No
DEB       . Supported profile: `output:hdmi-stereo`
DEB       . Supported profile: `output:hdmi-surround`
DEB       . Supported profile: `output:hdmi-surround71`
DEB   + Card[1] added: `alsa_card.pci-0000_00_1b.0`
DEB     + Card profile added: `input:analog-stereo` (`Analog Stereo Input`), 0 sinks, 1 sources, priority: 60
DEB     + Card profile added: `output:analog-stereo` (`Analog Stereo Output`), 1 sinks, 0 sources, priority: 6000
DEB     + Card profile added: `output:analog-stereo+input:analog-stereo` (`Analog Stereo Duplex`), 1 sinks, 1 sources, priority: 6060 -- Active
DEB     + Card profile added: `off` (`Off`), 0 sinks, 0 sources, priority: 0
DEB     + Card port added: `analog-output-headphones` (`Headphones`); priority: 9000; direction: 1; available: Yes
DEB       . Supported profile: `output:analog-stereo`
DEB       . Supported profile: `output:analog-stereo+input:analog-stereo`
DEB     + Card port added: `analog-input-mic` (`Microphone`); priority: 8700; direction: 2; available: No
DEB       . Supported profile: `input:analog-stereo`
DEB       . Supported profile: `output:analog-stereo+input:analog-stereo`
DEB     + Card port added: `analog-input-internal-mic` (`Internal Microphone`); priority: 8900; direction: 2; available: Yes
DEB       . Supported profile: `input:analog-stereo`
DEB       . Supported profile: `output:analog-stereo+input:analog-stereo`
DEB     + Card port added: `analog-output-speaker` (`Speakers`); priority: 10000; direction: 1; available: No
DEB       . Supported profile: `output:analog-stereo`
DEB       . Supported profile: `output:analog-stereo+input:analog-stereo`
DEB   + Source[2] added: `alsa_input.pci-0000_00_1b.0.analog-stereo`, card 1
DEB     + Source port added: `analog-input-internal-mic` (`Internal Microphone`); priority: 8900; available: Yes
DEB     + Source port added: `analog-input-mic` (`Microphone`); priority: 8700; available: No
DEB     * Activated source port `analog-input-internal-mic`
DEB   + Source output[6] added: `Peak detect`
DEB   + Source output[7] added: `Peak detect`
DEB   + Source output[8] added: `Peak detect`
DEB   + Source output[9] added: `Peak detect`
DEB   + Source output[11] added: `Peak detect`
DEB   + Sink[0] added: `alsa_output.pci-0000_00_03.0.hdmi-stereo`, card 0
DEB     + Sink port added: `hdmi-output-0` (`HDMI / DisplayPort`); priority: 5900; available: No
DEB     * Activated sink port `hdmi-output-0`
DEB   + Sink[1] added: `alsa_output.pci-0000_00_1b.0.analog-stereo`, card 1
DEB     + Sink port added: `analog-output-speaker` (`Speakers`); priority: 10000; available: No
DEB     + Sink port added: `analog-output-headphones` (`Headphones`); priority: 9000; available: Yes
DEB     * Activated sink port `analog-output-headphones`
DEB   + Sink input[5] added: `Playback Stream` -> sink 1
DEB   + Sink input[6] added: `Audacious` -> sink 1
DEB * Activated sink: `alsa_output.pci-0000_00_1b.0.analog-stereo`
DEB * Activated source: `alsa_output.pci-0000_00_1b.0.analog-stereo.monitor`
yktoo commented 7 years ago

Well, both from your screenshot and the log I see that the Speakers output isn't available:

DEB     + Card port added: `analog-output-headphones` (`Headphones`); priority: 9000; direction: 1; available: Yes
DEB     + Card port added: `analog-output-speaker` (`Speakers`); priority: 10000; direction: 1; available: No

which explains why it isn't shown. The same logic is implemented in the stock Sound Indicator. That looks okay to me, do you not agree?

GoodGuyNick commented 7 years ago

It's shows unavailable but it's available, i can switch to the Speakers and they work. Switching between headphones and speakers work if i do this through Volume Control.

yktoo commented 7 years ago

As I see it, it's a quirk of the driver of your particular soundcard, that something is marked unavailable while it isn't. In theory it's be possible to add an option to override that, of course.

GoodGuyNick commented 7 years ago

It's not only for my soundcard because my soundcard is rare and i found how to make the switch working using a general search. So for now there is no option for making "unavailable" speakers appear along side with the headphones for switch?

yktoo commented 7 years ago

No there's none. But I'll update this item to reflect this feature.

GoodGuyNick commented 7 years ago

Thank you.

yktoo commented 7 years ago

Fixed in 2.1.1.