You are not logged in.

#1 2017-05-28 05:14:05

guihkx
Member
Registered: 2013-03-22
Posts: 34

PulseAudio: How do I switch between Headphones and Speakers?

On Windows 10 I can easily switch between my devices like this:

https://i.imgur.com/gfKkQcS.png

With PavuControl is very easy as well, but for some reason that I am not aware, I can't switch between them if they're both plugged in:

https://i.imgur.com/dgXbTsZ.png

I have unplug one of them for other one to work... That's very annoying. I'm using the default configuration of PulseAudio:

$ pacmd list-sinks
1 sink(s) available.
  * index: 0
	name: <alsa_output.pci-0000_00_1b.0.analog-stereo>
	driver: <module-alsa-card.c>
	flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
	state: IDLE
	suspend cause: 
	priority: 9959
	volume: front-left: 58409 /  89% / -3,00 dB,   front-right: 58409 /  89% / -3,00 dB
	        balance 0,00
	base volume: 65536 / 100% / 0,00 dB
	volume steps: 65537
	muted: no
	current latency: 40,60 ms
	max request: 15 KiB
	max rewind: 750 KiB
	monitor source: 0
	sample spec: s16le 2ch 96000Hz
	channel map: front-left,front-right
	             Stereo
	used by: 0
	linked by: 3
	configured latency: 40,00 ms; range is 0,50 .. 2000,00 ms
	card: 1 <alsa_card.pci-0000_00_1b.0>
	module: 7
	properties:
		alsa.resolution_bits = "16"
		device.api = "alsa"
		device.class = "sound"
		alsa.class = "generic"
		alsa.subclass = "generic-mix"
		alsa.name = "ALC662 rev1 Analog"
		alsa.id = "ALC662 rev1 Analog"
		alsa.subdevice = "0"
		alsa.subdevice_name = "subdevice #0"
		alsa.device = "0"
		alsa.card = "0"
		alsa.card_name = "HDA Intel PCH"
		alsa.long_card_name = "HDA Intel PCH at 0xf7110000 irq 28"
		alsa.driver_name = "snd_hda_intel"
		device.bus_path = "pci-0000:00:1b.0"
		sysfs.path = "/devices/pci0000:00/0000:00:1b.0/sound/card0"
		device.bus = "pci"
		device.vendor.id = "8086"
		device.vendor.name = "Intel Corporation"
		device.product.id = "1e20"
		device.product.name = "7 Series/C216 Chipset Family High Definition Audio Controller"
		device.form_factor = "internal"
		device.string = "front:0"
		device.buffering.buffer_size = "768000"
		device.buffering.fragment_size = "384000"
		device.access_mode = "mmap+timer"
		device.profile.name = "analog-stereo"
		device.profile.description = "Analog Stereo"
		device.description = "Built-in Audio Analog Stereo"
		alsa.mixer_name = "Realtek ALC662 rev1"
		alsa.components = "HDA:10ec0662,18497662,00100101"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-pci"
	ports:
		analog-output-lineout: Line Out (priority 9900, latency offset 0 usec, available: no)
			properties:
				
		analog-output-headphones: Headphones (priority 9000, latency offset 0 usec, available: yes)
			properties:
				device.icon_name = "audio-headphones"
	active port: <analog-output-headphones>

Any help is appreciated. Thank you!

Last edited by guihkx (2017-05-28 13:06:49)

Offline

#2 2017-05-28 06:00:10

HiImTye
Member
From: Halifax, NS, Canada
Registered: 2012-05-09
Posts: 1,072

Re: PulseAudio: How do I switch between Headphones and Speakers?

have you looked at this?

Offline

#3 2017-05-28 11:21:28

robg
Member
Registered: 2015-03-05
Posts: 218

Re: PulseAudio: How do I switch between Headphones and Speakers?

On an unrelated note: Please resize your screenshots.

Offline

#4 2017-05-28 12:26:43

guihkx
Member
Registered: 2013-03-22
Posts: 34

Re: PulseAudio: How do I switch between Headphones and Speakers?

HiImTye wrote:

have you looked at this?

Thank you, it almost worked... The audio output from my headphones gets cut off when I switch to my speakers, but when I switch back to my headphones, I can still hear the audio coming from my speakers. hmm

I also had to change section [Jack Headphone Front] instead of [Jack Headphone]. I'd suggest anyone reading this to close any program being used by pulseaudio before following those steps. I made the mistake of leaving them open, so after I restarted pulseaudio, maybe it tried to restore the sinks being used by those programs, but it ended up messing all my input/output devices instead... Anyway, they're fine now.

Another thing is that the Noise Cancellation feature from pulseaudio doesn't work anymore. Any tips to make it work again? Here's the log for pulseaudio -v --log-level=4:

https://pastebin.com/44Lb94gK (error is at line 2246)

robg wrote:

On an unrelated note: Please resize your screenshots.

My bad, I've removed them!

Last edited by guihkx (2017-05-28 13:08:20)

Offline

#5 2017-05-29 13:07:29

guihkx
Member
Registered: 2013-03-22
Posts: 34

Re: PulseAudio: How do I switch between Headphones and Speakers?

https://bbs.archlinux.org/viewtopic.php?id=187828
https://bbs.archlinux.org/viewtopic.php?id=161296

I should probably give up as well

Last edited by guihkx (2017-05-29 13:11:08)

Offline

Board footer

Powered by FluxBB