7
rated 0 times
[
7]
[
0]
/ answers: 1 / hits: 17597
/ 3 Years ago, sun, july 11, 2021, 12:20:53
I like to switch the sound output from Speaker to USB headphone with a Shortcut.
Is there a way to accomplish this?
More From » sound
I like to switch the sound output from Speaker to USB headphone with a Shortcut.
Is there a way to accomplish this?
Check for port names pactl list sinks
(I remove non needed sinks output):
Sink #1
State: RUNNING
Name: alsa_output.pci-0000_00_1b.0.analog-stereo
Description: Built-in Audio Analog Stereo
Driver: module-alsa-card.c
...
Ports:
analog-output-speaker: Speakers (priority: 10000, not available)
analog-output-headphones: Headphones (priority: 9000, available)
Active Port: analog-output-headphones
Formats:
pcm
Set sink port using pactl set-sink-port
:
pactl set-sink-port 1 analog-output-speaker
or
pactl set-sink-port 1 analog-output-headphones
If you are using a removable device (Example: USB devices), it's better to use sink name
instead of id
. For example:
pactl set-sink-port alsa_output.pci-0000_00_1b.0.analog-stereo analog-output-headphones
Reference: man pactl