You are not logged in.

#1 2014-12-15 02:02:15

emacsomancer
Member
Registered: 2014-09-20
Posts: 211

Pulseaudio - how specify default port for analogue stereo?

Whenever I reboot, Pulseaudio defaults my Built-In Audio Analogue Stereo port specification to "Headphones (unplugged)" and I have to open pavucontrol to set it to "Line Out (unplugged)" [aside: I don't know why it say "unplugged" when it isn't]. 

Is there any way to set "Line Out" as the default?

Offline

#2 2014-12-21 16:24:00

Knute
Member
From: Minot, ND
Registered: 2009-03-17
Posts: 604

Re: Pulseaudio - how specify default port for analogue stereo?

Yes.

In your default.pa file you can use the set-default-source or set-default-sink and choose your line out.  You can set it either globally in /etc/pulse or per user in ~/.config/pulse.

The other option is that you can define what source or sink to use in your shell.
I use zsh so in my .zshrc file I have the following lines:

export PULSE_SINK=0
export PULSE_SOURCE=1

You can get the numbers that you need from pactl list sinks/sources short.
As you are looking for redirecting the sound, you want the sink.

HTH smile


Knute

Offline

#3 2014-12-21 20:04:01

emacsomancer
Member
Registered: 2014-09-20
Posts: 211

Re: Pulseaudio - how specify default port for analogue stereo?

Knute wrote:

Yes.

In your default.pa file you can use the set-default-source or set-default-sink and choose your line out.  You can set it either globally in /etc/pulse or per user in ~/.config/pulse.

The other option is that you can define what source or sink to use in your shell.
I use zsh so in my .zshrc file I have the following lines:

export PULSE_SINK=0
export PULSE_SOURCE=1

You can get the numbers that you need from pactl list sinks/sources short.
As you are looking for redirecting the sound, you want the sink.

HTH smile


I can see the basic sources via pactl list .., but I'm not being able to see where I can specify for a particular source (in this case the analog source) whether to use the headphone or line out. 

In the info for Sink #1, I can see

	Ports:
		analog-output-lineout: Line Out (priority: 9900, not available)
		analog-output-headphones: Headphones (priority: 9000, not available)

So I'm trying to figure out how to set the default port.

Offline

#4 2014-12-21 20:06:56

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,600
Website

Re: Pulseaudio - how specify default port for analogue stereo?

pavucontrol is a GUI you can use as well.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#5 2014-12-21 20:21:21

Knute
Member
From: Minot, ND
Registered: 2009-03-17
Posts: 604

Re: Pulseaudio - how specify default port for analogue stereo?

if you use pactl list sinks short you get output that has 2 columns.
The first column is the output number, and the second is the name.

This information is just step one.
In order to use this information you would put an entry into your shells rc file to export PULSE_SOURCE=(output number)

I use zsh, so I would put the export in my ~/.zshrc file.  If you use bash, it would go into your ~/.bashrc file.
After you put this info in, you will need to log out and log back in.


Knute

Offline

#6 2014-12-21 20:45:39

emacsomancer
Member
Registered: 2014-09-20
Posts: 211

Re: Pulseaudio - how specify default port for analogue stereo?

graysky wrote:

pavucontrol is a GUI you can use as well.

I have been using pavucontrol, but it doesn't seem to store the selected port.

Offline

#7 2014-12-21 20:47:46

emacsomancer
Member
Registered: 2014-09-20
Posts: 211

Re: Pulseaudio - how specify default port for analogue stereo?

Knute wrote:

if you use pactl list sinks short you get output that has 2 columns.
The first column is the output number, and the second is the name.

This information is just step one.
In order to use this information you would put an entry into your shells rc file to export PULSE_SOURCE=(output number)

I use zsh, so I would put the export in my ~/.zshrc file.  If you use bash, it would go into your ~/.bashrc file.
After you put this info in, you will need to log out and log back in.

Right, when I do pactl list sinks short, I see 3 sinks/sources:

0	alsa_output.hw_1_9	module-alsa-sink.c	s16le 2ch 44100Hz	RUNNING
1	alsa_output.pci-0000_00_1b.0.analog-stereo	module-alsa-card.c	s16le 2ch 44100Hz	RUNNING
2	combined	module-combine-sink.c	s16le 2ch 44100Hz	RUNNING

0 is my HDMI-connected monitor, 1 is my analog output, 2 is the combined module I've created to run both at once.  None of this seems to let me set the actual port for the analogue output (i.e. "line out" vs "headphones").

Offline

#8 2014-12-21 21:16:30

Knute
Member
From: Minot, ND
Registered: 2009-03-17
Posts: 604

Re: Pulseaudio - how specify default port for analogue stereo?

What does your client.conf look like?

There are settings in there for default-sink, which uses the hw:# notation.


Knute

Offline

#9 2014-12-21 23:03:29

emacsomancer
Member
Registered: 2014-09-20
Posts: 211

Re: Pulseaudio - how specify default port for analogue stereo?

Knute wrote:

What does your client.conf look like?

There are settings in there for default-sink, which uses the hw:# notation.

My client.conf file looks uninteresting:

; default-sink =
; default-source =
; default-server =
; default-dbus-server =

; autospawn = yes
; daemon-binary = /usr/bin/pulseaudio
; extra-arguments = --log-target=syslog

; cookie-file =

; enable-shm = yes
; shm-size-bytes = 0 # setting this 0 will use the system-default, usually 64 MiB

; auto-connect-localhost = no
; auto-connect-display = no

[I used paprefs to get dual-source audio to work. In case that's relevant.]

Offline

#10 2014-12-21 23:25:22

Knute
Member
From: Minot, ND
Registered: 2009-03-17
Posts: 604

Re: Pulseaudio - how specify default port for analogue stereo?

Not sure if this will help you or not, but I hope it does.
http://www.freedesktop.org/wiki/Softwar … ultDevice/


Knute

Offline

#11 2014-12-22 02:49:48

emacsomancer
Member
Registered: 2014-09-20
Posts: 211

Re: Pulseaudio - how specify default port for analogue stereo?

Knute wrote:

Not sure if this will help you or not, but I hope it does.
http://www.freedesktop.org/wiki/Softwar … ultDevice/

As far as I can tell, the defaults discussed there seem to be defaults for sinks/sources, and I need to set the default for a port, which seems to be a level down from sink/source.

When I do pactl list sinks (the non-"short" version), I get some additional information which is suggestive:

Ports:
		analog-output-lineout: Line Out (priority: 9900, not available)
		analog-output-headphones: Headphones (priority: 9000, not available)

The priority specifications I suspect have something to do with which port is default.  I'm not sure how to set priority for ports though, nor do I know whether higher or lower takes more priority.

Offline

#12 2014-12-23 20:18:45

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,841

Re: Pulseaudio - how specify default port for analogue stereo?

You can set the card profile with a setting in default.pa

Offline

Board footer

Powered by FluxBB