You are not logged in.

#1 2022-01-05 18:54:49

sebastian-65
Member
Registered: 2021-11-08
Posts: 40

[SOLVED] Can't get port names for headphones / speaker

I need to use a script to switch between headphones and speakers ports. I would like to use this command:

pactl set-sink-port <sink index = 4> <port symbolic name>

Hower I don't know how to get correct port (symbolic) names as stated as required in manual. All I see is pacmd list output where only "speaker" is present (I would excpect something like "analog-output-headphones").

Sink #4
	State: IDLE
	Name: alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__hw_sofhdadsp__sink
	Description: Tiger Lake-LP Smart Sound Technology Audio Controller Speaker + Headphones
	Driver: module-alsa-card.c
	Sample Specification: s16le 2ch 48000Hz
	Channel Map: front-left,front-right
	Owner Module: 26
	Mute: no
	Volume: front-left: 10486 /  16% / -47.75 dB,   front-right: 10486 /  16% / -47.75 dB
	        balance 0.00
	Base Volume: 65536 / 100% / 0.00 dB
	Monitor Source: alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__hw_sofhdadsp__sink.monitor
	Latency: 40763 usec, configured 40000 usec
	Flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY 
	Properties:
		alsa.resolution_bits = "16"
		device.api = "alsa"
		device.class = "sound"
		alsa.class = "generic"
		alsa.subclass = "generic-mix"
		alsa.name = ""
		alsa.id = "HDA Analog (*)"
		alsa.subdevice = "0"
		alsa.subdevice_name = "subdevice #0"
		alsa.device = "0"
		alsa.card = "0"
		alsa.card_name = "sof-hda-dsp"
		alsa.long_card_name = "ASUSTeKCOMPUTERINC.-VivoBook_ASUSLaptopX435EA_S435EA-1.0-X435EA"
		alsa.driver_name = "snd_soc_skl_hda_dsp"
		device.bus_path = "pci-0000:00:1f.3-platform-skl_hda_dsp_generic"
		sysfs.path = "/devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0"
		device.bus = "pci"
		device.vendor.id = "8086"
		device.vendor.name = "Intel Corporation"
		device.product.id = "a0c8"
		device.product.name = "Tiger Lake-LP Smart Sound Technology Audio Controller"
		device.string = "_ucm0001.hw:sofhdadsp"
		device.buffering.buffer_size = "65536"
		device.buffering.fragment_size = "16384"
		device.access_mode = "mmap+timer"
		device.profile.name = "HiFi: hw:sofhdadsp: sink"
		device.profile.description = "Speaker + Headphones"
		alsa.mixer_device = "_ucm0001.hw:sofhdadsp"
		device.description = "Tiger Lake-LP Smart Sound Technology Audio Controller Speaker + Headphones"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-pci"
	Ports:
		[Out] Speaker: Speaker (type: Speaker, priority: 100, availability unknown)
		[Out] Headphones: Headphones (type: Headphones, priority: 200, available)
	Active Port: [Out] Speaker

Any ideas how to get the corret port name?

Last edited by sebastian-65 (2022-01-05 19:34:53)


I'm not the sharpest tool in the shed. Say it to me like I'm 5, please!

Arch Linux | ZFS | systemd | Xfce/X11/SDDM | ASUS S435 | Intel CPU 11th gen | Intel TigerLake-LP GT2 | 16GB RAM

Offline

#2 2022-01-05 19:09:57

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,223

Re: [SOLVED] Can't get port names for headphones / speaker

Ports:
		[Out] Speaker ...
		[Out] Headphones ...

these are your port names, you might have to escape the space i.e.

pactl set-sink-port 4 "[Out] Speaker"

. You'll also want to use the full sink name rather than rely on the index:  alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__hw_sofhdadsp__sink

That "weird" designation just means that your card is setup using ucm configuration files which I'm also not entirely sure as to the technical reason why these started to be used that way for newer cards, presumably to be more portable to different systems/APIs than the standard designation pulse would do.

Last edited by V1del (2022-01-05 19:15:50)

Offline

#3 2022-01-05 19:34:39

sebastian-65
Member
Registered: 2021-11-08
Posts: 40

Re: [SOLVED] Can't get port names for headphones / speaker

Oh gosh, I do feel dumb, I've tried many combinations but not most forward one.

You're my saviour! Thank you, V1del, have a great day!


I'm not the sharpest tool in the shed. Say it to me like I'm 5, please!

Arch Linux | ZFS | systemd | Xfce/X11/SDDM | ASUS S435 | Intel CPU 11th gen | Intel TigerLake-LP GT2 | 16GB RAM

Offline

Board footer

Powered by FluxBB