3 November 2013

Using null-sinks with pulseaudio

I've been running multiple instances of gqrx recently. Up until now, I have used an unconnected soundcard output as a sink for a gqrx receiver audio that I've no interest in listening to myself, then selecting that same output's monitor channel in Pulse Audio Volume Controller as an input for fldigi or multimon-ng, for example.

Then I ran out of unused soundcard outputs to use, but fortunately discovered pulseaudio's null-sink facility.  Now I can create a null sink specifically for each SDR receiver that I have and hook them all up to different modem programmes.

To create a null sink with a meaningful name, use a command like this:

$ pactl load-module module-null-sink sink_name=fcdv1op \ sink_properties=device.description="fcdv1op"

To monitor the audio stream that is being routed to the null sink, create a loop-back:

$ pactl load-module module-loopback latency_msec=1
I let gqrx send audio to the default output in its configuration, then use Pulse Audio Volume Controller (pavucontrol) to reassign it to the null sink.  I can then set, for example multimon-ng, to listen to the monitor of the null-sink (on the Recording tab of pavucontrol) and set up a loopback monitor to my default output (on the Playback tab of pavucontrol).

This lets me control the audio levels fed to each audio 'decoder' and the level coming out of my speakers independently. You can add a named null sink for each SDR device you have and a separate loopback device for each of them also, which you can mute and mix accordingly and route to different audio outputs if you so desire.

Edit: If you are paying attention, you may notice that the null sink name in the screen-shots is different to the one used in the command line. Oh, well, let's call that a continuity error and move on :)

No comments: