How to switch between audio controller profiles fast?

Hello friends, new to Linux /Manjaro.
I have SPDIF connected on the back and Headphones connected on the front.
I dont want to unplug the Headphones everytime so i go into audio mixer, then into configuration and finally switch between Analog Stereo and Digital Output.
Can i achieve this faster somehow?

You can install pavucontrol and launch it with some shortcut. Works with both pipewire and pulseaudio.

If you are using Pulseaudio...

…then you can list all profiles with pacmd list-sinks and change the default sound device with pacmd set-default-sink <sink_number>. Bind it to some shortcut for SPEEEEED!!

1 Like

I am using pulseaudio, but
it lists me only 1 sink

pacmd list-sinks
 1 sink(s) available.
   * index: 0
 	name: <alsa_output.pci-0000_09_00.4.analog-stereo
 	driver: <module-alsa-card.c
 	state: RUNNING
 	suspend cause: (none)
 	priority: 9039
 	volume: front-left: 28835 /  44% / -21.39 dB,   front-right: 28835 /  44% / -21.39 dB
 	        balance 0.00
 	base volume: 65536 / 100% / 0.00 dB
 	volume steps: 65537
 	muted: no
 	current latency: 677.11 ms
 	max request: 168 KiB
 	max rewind: 168 KiB
 	monitor source: 0
 	sample spec: s16le 2ch 44100Hz
 	channel map: front-left,front-right
 	used by: 1
 	linked by: 1
 	configured latency: 980.00 ms; range is 0.50 .. 1999.82 ms
 	card: 1 <alsa_card.pci-0000_09_00.4
 	module: 7
 		alsa.resolution_bits = "16"
 		device.api = "alsa"
 		device.class = "sound"
 		alsa.class = "generic"
 		alsa.subclass = "generic-mix" = "ALC1220 Analog" = "ALC1220 Analog"
 		alsa.subdevice = "0"
 		alsa.subdevice_name = "subdevice #0"
 		alsa.device = "0"
 		alsa.card = "1"
 		alsa.card_name = "HD-Audio Generic"
 		alsa.long_card_name = "HD-Audio Generic at 0xfc400000 irq 97"
 		alsa.driver_name = "snd_hda_intel"
 		device.bus_path = "pci-0000:09:00.4"
 		sysfs.path = "/devices/pci0000:00/0000:00:08.1/0000:09:00.4/sound/card1"
 		device.bus = "pci" = "1022" = "Advanced Micro Devices, Inc. [AMD]" = "1487" = "Starship/Matisse HD Audio Controller"
 		device.string = "front:1"
 		device.buffering.buffer_size = "352768"
 		device.buffering.fragment_size = "176384"
 		device.access_mode = "mmap+timer" = "analog-stereo"
 		device.profile.description = "Analog Stereo"
 		device.description = "Starship/Matisse HD Audio Controller Analog Stereo"
 		module-udev-detect.discovered = "1"
 		device.icon_name = "audio-card-pci"
 		analog-output-lineout: Line Out (priority 9000, latency offset 0 usec, available: no)
 		analog-output-headphones: Headphones (priority 9900, latency offset 0 usec, available: yes)
 				device.icon_name = "audio-headphones"
 	active port: <analog-output-headphones

Moderator edit: In the future, please use proper formatting: [HowTo] Post command output and file content as formatted text

Have you tried xfce4-pulseaudio-plugin ?

Please post response to this command to show the PulseAudio Profile configuration for headphones

pacmd dump | grep card-profile

Then change the profile to use S/PDIF output and run the command again to get Profile for S/PDIF

The 2 responses will supply most of the information needed to create commands to switch profiles
(just add pactl before terminal response)
The commands can be used in a script to switch between the profiles
and script could be run with one click on a .desktop launcher on desktop or panel

…then you can list all profiles with pacmd list-sinks and change the default sound device with pacmd set-default-sink <sink_number>. Bind it to some shortcut for SPEEEEED!!

Can’t do this so easily. You need first to get the rigth sink number, which changes if you have changing source config like i.e. TV on or OFF which add a sink. If you add a Sink, all sink numbers change.