36

I am reading about pulseaudio, how it works and how I can configure it. I am encountering two keywords a lot: SINK, SOURCE. At first I thought SINK meant OUTPUT and SOURCE meant INPUT, but it seems that this is not the case.

Could someone explain what SINK and SOURCE mean in simple English?

Stephen Kitt
  • 434,908
Shnd
  • 587

4 Answers4

47

As per the project description:

PulseAudio clients can send audio to "sinks" and receive audio from "sources".

So sinks are outputs (audio goes there), sources are inputs (audio comes from there).

Stephen Kitt
  • 434,908
  • 1
    Audio is output there rather than goes there a little more intuitive. – RichieHH Nov 24 '18 at 09:29
  • PulseAudio also has something called source output (e.g. pacmd list-source-outputs) – what on earth is that supposed to mean? – Mikko Rantalainen Nov 22 '21 at 20:21
  • 1
    Perhaps think of it this way: sink and source refer to flow of audio data between PulseAudio and the outside world, while input and output refer to flow of audio data between PulseAudio and other programs. – telcoM Nov 30 '21 at 06:22
15

Sink = speakers, headphones

Source = microphone

VasyaNovikov
  • 1,246
7

I can't comment to Mikko because I'm new so I make this message. As said sinks are outputs, sources are inputs, ok, but then I wondered as Mikko does about what sink-input and source-output mean, so I have done some experiment with pactl:

  1. pactl list sinks -> I see my realtek (alc892) and nvidia audio, ok these are my sinks fair enough.
  2. pactl list sources -> there I have seen my mic, good, but also monitoring to previous sinks, fair enough since they are like microphones to my outputs.
  3. pactl list sink-inputs with no apps running-> nothing.
  4. pactl list source-output with no apps running -> nothing.
  5. I have opened youtube video on firefox and it appeared as a sink-input! So I think it means that it is an input to a sink hence sink-input.
  6. I thought that OBS would have helped with source-outputs and I was right. I'm recording my mic and desktop audio, they appearead as source-outputs, the audio captured is the output from some source hence source-output.
AdminBee
  • 22,803
  • say source-outputs (mind the s at the end).

    stackexchange unfortunately does not allow me such a small edit (less than 6 characters)

    – village Aug 11 '22 at 13:26
5

Here's a summary of all the PulseAudio specific terms (note that the words that PulseAudio uses do not match the typical use of that word):

  • input: digital audio stream from an application to PulseAudio (e.g. audio from Youtube video playing in your web browser). Note that this has nothing to do with any physical connector that your system has.
  • output: digital audio stream from PulseAudio to application (e.g. recorded microphone audio to be sent to video conference by your browser). Note that this has nothing to do with any physical connector that your system has.
  • source: device that can emit digital audio stream to PulseAudio (typically microphone, line input, HDMI capture card or something similar; may or may not be backed by actual audio hardware but PulseAudio will treat it as if it was real hardware)
  • sink: device that can output digital audio stream from PulseAudio (typically speaker signal, headphone output, HDMI output, line out; may or may not be backed by actual audio hardware but PulseAudio will treat it as if it was real hardware)

PulseAudio will then create combinations of these. For example, pacmd list-source-outputs will list digital streams from some source to some output, basically the connections between source devices (hardware) and software outputs (applications).

If no application is currently taking digital streams, there are no connections even though applications that support PulseAudio are running and hardware that's able to generate audio streams are available (that is, connection exists only when application actively captures audio). I personally think that it would make more sense to call these as recording-streams or something like that but PulseAudio authors call these source-outputs instead.

It may help to think PulseAudio as a virtual mixing desk that has applications (input and output) and hardware (source and sink) connected to it and it will route streams/connections between different things.