Ubuntu – Changing in pavucontrols tab “Recording” via command line

command linepavucontrolpulseaudiosound

I'm using pavucontrol to make changes in the "Recording". I'm changing the source (??) of a Loopback to Null-Output from "Internes Audio Analog Stereo" to "Monitor of Internes Audio Analog Stereo"
see the screenshot http://picpaste.de/Bildschirmfoto_vom_2013-10-26_11_32_03-z0KwnFDE.png
I'm now looking for a possibility to do this via command line.

So far I've done the following:

pactl load-module module-null-sink

→ creates a new sink

pactl load-module module-loopback

→ creates a new sink input

pactl load-module module-loopback

→ creates another sink input

pacmd move-sink-input 0 1

→ changes the sink of the sink-input (to Null-Output); this is like changing manually in the pacucontrol tab "Playback".

It's just the last part (making the change like shown in the screenshot) via command line that I'm not able to do.

I'd be very happy for any advice or suggestions.
Thanks already!

Best Answer

The command to change the default input source of pulseaudio is pacmd set-default-source. By this we can also define a monitor of an output sink as a source by adding .monitor at the end of the sink name.

This will then give us the following command:

pacmd set-default-source <name_of_sink>.monitor

We may also have to move an active stream to the new source using move-sink-input.

Related Question