Showing posts with label pulseaudio. Show all posts
Showing posts with label pulseaudio. Show all posts

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 :)

9 December 2012

Feeding baudline with the KX3's I/Q Output

After someone mentioned in ##rtlsdr that it was possible to pipe I/Q data into baudline via stdin, I wondered if I could do the same with I/Q data from the KX3.  As I'm already feeding the I/Q data from the KX3 into gr-kx3 using pulseaudio, I needed to use pulseaudio as the source for baudline but it isn't supported, so I used parec to pipe the I/Q signals into baudline.

#!/bin/sh
# blkx3 - a bash script to feed I/Q data from a pulse audio device into baudline
SAMPLE_RATE=48000
BL_BIN=~/bin/baudline_1.08_linux_x86_64/baudline

parec --format=s16le --channels=2 --rate=$SAMPLE_RATE --latency-msec=5 | \
$BL_BIN -scrollcontrol -record -stdin -channels 2 -quadrature -samplerate \
$SAMPLE_RATE -basefrequency $1

You may need to change the path to baudline in the script and maybe also the sample rates. The script takes the baseband centre frequency as its only parameter.


$ blkx3.sh 7184500