Switch between speakers and headphones with PulseAudio (was Re: HDA jack retasking)

Raman Gupta rocketraman at gmail.com
Mon Aug 19 22:27:19 UTC 2013


On 08/19/2013 01:10 AM, Raman Gupta wrote:
> Next problem: getting PulseAudio to recognize that I have both
> headphones plugged in (to the retasked jack) as well as regular
> speakers, and switch between them at command.
> 
> PulseAudio shows two output Ports: "Analog Output" as well as
> "Headphones", but both ports output to my headphones. Without the
> retasking, both ports output to my speakers. Frustrating.

Just to follow up on this, as per the nice folks on #pulseaudio, it
doesn't seem pulseaudio is capable of this yet, so I created:

https://bugs.freedesktop.org/show_bug.cgi?id=68286

It can be worked around by using amixer to modify the hardware
controls directly. For my card (HDA Intel PCH with Realtek ALC898
chipset), here are the scripts I use:

1) enable speakers:

#!/bin/sh
amixer -c 0 sset "Auto-Mute Mode" Disabled
amixer -c 0 sset "Headphone,1" mute

2) enable headphones:

#!/bin/sh
amixer -c 0 sset "Auto-Mute Mode" Enabled
amixer -c 0 sset "Headphone,1" unmute

Regards,
Raman


More information about the users mailing list