5
rated 0 times
[
5]
[
0]
/ answers: 1 / hits: 79764
/ 2 Years ago, sun, august 28, 2022, 8:15:17
I wish to select a default sound card, or disable all others, in order to have the correct one selected after suspend.
More From » sound
I wish to select a default sound card, or disable all others, in order to have the correct one selected after suspend.
This is a way set default sound output card dynamically using PulseAudio (not ALSA).
Check list of Sources and Sinks
$ pactl list short sources
0 alsa_output.pci-0000_00_1b.0.analog-stereo.monitor module-alsa-card.c s16le 2ch 44100Hz SUSPENDED
1 alsa_input.pci-0000_00_1b.0.analog-stereo module-alsa-card.c s16le 2ch 44100Hz SUSPENDED
2 combined.monitor module-combine-sink.c s16le 2ch 44100Hz SUSPENDED
$ pactl list short sinks
0 alsa_output.pci-0000_00_1b.0.analog-stereo module-alsa-card.c s16le 2ch 44100Hz RUNNING
1 combined module-combine-sink.c s16le 2ch 44100Hz IDLE
2 alsa_output.pci-0000_01_00.1.hdmi-stereo module-alsa-card.c s16le 2ch 44100Hz RUNNING
Set defaults:
$ pactl set-default-source alsa_input.pci-0000_00_1b.0.analog-stereo
$ pactl set-default-sink alsa_output.pci-0000_00_1b.0.analog-stereo
It is possible even to set ports too. See How to switch sound output with key shortcut
Reference: man pactl