How to set the output port on the audio card

alsaaudiopulseaudio

My audio card has two ports; for clarity I'll call them the 'speaker' and 'headphone' port. In Windows, the audio control sees two separate ports, and I can switch back and forth between speaker and headphone at will.

In Linux, the audio will always come out the speaker port by default, and automatically switch to the headphone port if I plug headphones in.

How do I control this behaviour? I've tried using pacmd's "sink-set-port", and the "list-sinks" output suggests that the 'active port' has changed, but nothing actually happens.

Data from list-sinks:

properties:
    alsa.resolution_bits = "16"
    device.api = "alsa"
    device.class = "sound"
    alsa.class = "generic"
    alsa.subclass = "generic-mix"
    alsa.name = "ALC889 Analog"
    alsa.id = "ALC889 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 0xfbff8000 irq 60"
    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 = "1c20"
    device.product.name = "6 Series/C200 Series Chipset Family High Definition Audio Controller"
    device.form_factor = "internal"
    device.string = "front:0"
    device.buffering.buffer_size = "65536"
    device.buffering.fragment_size = "32768"
    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 ALC889"
    alsa.components = "HDA:10ec0889,1458a022,00100004"
    module-udev-detect.discovered = "1"
    device.icon_name = "audio-card-pci"
ports:
    analog-output: Analog Output (priority 9900, latency offset 0 usec, available: unknown)
        properties:
            
    analog-output-headphones: Headphones (priority 9000, latency offset 0 usec, available: yes)
        properties:
            device.icon_name = "audio-headphones"
active port: <analog-output>

Best Answer

Turns out ALSA will automatically mute my main speakers when something plugs in the headphone jack. I can disable that by disabling auto-mute mode in alsamixer. I can then control the levels of the headphone port and speaker port independently.

Related Question