19

When I boot, PulseAudio defaults to sending output to Headphones. I'd like it to default to sending output to Line Out. How do I do that?

I can manually change where the output is current sent as follows: launch the Pulseaudio Volume Control application, go to the Output Devices tab, and next to Port, select the Line Out option instead of Headphones. However, I have to do this after each time I boot the machine -- after a reboot, Pulseaudio resets itself back to Headphones. That's a bit annoying. How do I make my selection stick and persist across reboots?

Here's a screenshot of how the Volume Control application looks after a reboot, with Headphones selected:

Volume Control, immediately after boot

If I click on the chooser next to Port, I get the following two options:

Choices for output port

Selecting Line Out makes sound work. (Notice that both Headphones and Line Out are marked as "unplugged", but actually I do have something plugged into the Line Out port.)

Comments: I'm not looking for a way to change the default output device. I have only one sound card. pacmd list-sinks shows only one sink. Therefore, pacmd set-default-sink is not helpful. (This doesn't help either.) Here what I need to set is the "Port", not the output device. If it's relevant, I'm using Fedora 20 and pulseaudio-5.0-25.fc21.x86_64.

D.W.
  • 4,070

2 Answers2

32

I had the same problem (for at least a year now), and the following seemed to work:

Taken from: https://bbs.archlinux.org/viewtopic.php?id=164868

Use pavucontrol to change the port to your desired one. Then find the internal name of the port with this command:

$ pacmd list | grep "active port"
    active port: <hdmi-output-0>
    active port: <analog-output-lineout>
    active port: <analog-input-linein>

Using this information about the internal name of the port, we can change it with the command:

pacmd set-sink-port 0 analog-output-lineout

If you (or someone else with the problem) has multiple cards, try changing the 0 to a 1.

If this works, you can put:

set-sink-port 0 analog-output-lineout

in your /etc/pulse/default.pa file to have it across reboots.

  • 1
    When I try to set-sink-port etc... I get [No PulseAudio daemon running, or not running as session daemon.], how do I change this? – aSystemOverload Apr 19 '15 at 21:43
  • @aSystemOverload: Which Fedora version? You could also try to to start it manually with pulseaudio --start and see if the pacmd command works. – maxauthority Apr 22 '15 at 16:17
  • Apologies for not specifying, but Debian Jessie. The Pulse Audio 'Volume Control' shown by the original poster is working, does that mean a daemon is running, but maybe but a season daemon? – aSystemOverload Apr 22 '15 at 16:36
  • After so much time at 2:57 AM you saved my life ... –  Jun 26 '18 at 21:02
  • Thanks for the answer. This helped me to configure my headphones as default in Linux Mint 18.3! – smiddy84 Aug 17 '18 at 04:32
  • I'm trying to adapt this for use with Ubuntu 22.04. The output of pacmd list | grep "active port" shows five active output ports, which all look like active port: <[Out] HDMI3> though HDMI3 changes in decreasing priority through HDMI2, HDMI1, Headphones, Speaker. I'm trying to make Speaker the highest priority but pacmd set-sink-port 0 Speaker results in No sink found by this name or index. I can't use pacmd set-sink-port 0 [Out] Speaker because of the space so how can I change the priority? My goal is to have the volume keys on my keyboard control the speaker when it is being used. – JJGabe Dec 10 '22 at 09:56
  • Found buggy behavior with both pacmd and the default.pa config file directives: set-default-sink and set-card-profile. This is on a system with two sound cards (HDA NVidia HDMI on GFX card, & HDA Intel PCH HDMI on motherboard integrated Intel i915 GFX) where both use snd_hda_intel kernel module driver. Symptoms: pulseaudio fails to set default sink to primary GFX card (Nvidia HDMI), defaulting to onboard SPDIF Intel HDA, ignores both directives set-default-sink and set-card-profile when given full card name (alsa_output.pci-0000_01_00.1.hdmi-stereo-extra3) – TrinitronX May 12 '23 at 23:20
  • Workarounds for pulseaudio ignoring set-default-sink and set-card-profile were: 1) Reboot & hope it works (sometimes it fixed the issue, only to arise frequently again next time (maybe some strange race condition with gdm3 ? ).
    2) Try using pacmd set-default-sink with numeric card ID numbers rather than PCIe-bus full names (e.g.: Find card ID with: pacmd list-sinks | grep -e 'name:' -e 'index:' ... Then set default with: pacmd set-default-sink 0 output:hdmi-stereo-extra3). When the kernel & cards are in that state, pulseaudio only responded to numeric ID-based commands.
    – TrinitronX May 12 '23 at 23:26
-1

When you opened pavucontrol, is your Line Out output uplugged?

Line Out (unplugged)

  • Yes: You have your speakers in wrong connector.
  • No or didn't help: Good luck, I have no idea what is wrong.

Explanation: Only plugged in port is used as default, if all are unplugged who knows why it's headphones. PulseAudio tests only one connector (Front speakers / green) but outputs stereo in all of them (if you have more than stereo capable card but your PulseAudio is set to stereo only).

  • 4
    I'm afraid this doesn't seem to help. To answer your question: As I described in the question, Volume Control thinks Line Out is unplugged, but there is actually something plugged in. As I wrote in the question, "Notice that both Headphones and Line Out are marked as "unplugged", but actually I do have something plugged into the Line Out port." It seems that the "plugged/unplugged" detection has gone awry. – D.W. Sep 20 '15 at 05:58