My audio is supposed to be routed through my monitor HDMI. But every time my monitor shuts off for any reason, audio switches to my laptop speakers and I have to manually switch it back via Kubuntu GUI. This is tiresome.
I would like to know how to do it through the CLI?
I have tried using pactl and pacmd which have been utterly unsuccessful owing to them only recognizing the name or index of the currently used "sink". I can't even use the index because every time I switch the audio, the index increments by 2.
Here are some examples:
if I type
$ pactl get-default-sink
depending on which device is active I get either
alsa_output.pci-0000_00_1f.3.analog-stereo
or
alsa_output.pci-0000_00_1f.3.hdmi-stereo
This is the result of me trying to change from analog to HDMI
$: pactl set-default-sink alsa_output.pci-0000_00_1f.3.hdmi-stereo
$: Failure: No such entity
It doesn't seem to matter what arguments are provided. Nothing works. Names, indexes, doesn't matter.
Obviously there's a way to switch because the GUI does it. But how do I do it via the CLI?
I would like to know how to do it through the CLI?
I have tried using pactl and pacmd which have been utterly unsuccessful owing to them only recognizing the name or index of the currently used "sink". I can't even use the index because every time I switch the audio, the index increments by 2.
Here are some examples:
if I type
$ pactl get-default-sink
depending on which device is active I get either
alsa_output.pci-0000_00_1f.3.analog-stereo
or
alsa_output.pci-0000_00_1f.3.hdmi-stereo
This is the result of me trying to change from analog to HDMI
$: pactl set-default-sink alsa_output.pci-0000_00_1f.3.hdmi-stereo
$: Failure: No such entity
It doesn't seem to matter what arguments are provided. Nothing works. Names, indexes, doesn't matter.
Obviously there's a way to switch because the GUI does it. But how do I do it via the CLI?
Comment