[pulseaudio-discuss] Recipe: recording sound card input and output

Chris Keller xylo04 at gmail.com
Fri Oct 15 01:25:17 UTC 2021

Hi folks,

I just spent a while figuring out how to solve a particular need and want
to save it in the mailing list for posterity.

I'm an amateur radio operator, and we make extensive use of external sound
cards for interfacing computers with radios for digital communication
modes. I was experiencing a problem where I really wanted to record
received audio (RX) to the left channel of a file, and transmitted audio
(TX) to the right channel. Doing so would let me hear exactly what the
modem program heard and sent.

After much fussing, I found an arrangement that worked: set up a null-sink
to represent the rx-tx stream I wanted, then use two loopbacks, one each
for RX and TX. Once that was set up, recording the file was simple.

# BurrBrown chipset used in SignaLink USB
RADIO_RX=$(pacmd list-sources | egrep "input.*$SOUND_CARD" | grep -oP
"<\K[^ >]+")
RADIO_TX=$(pacmd list-sources | egrep "output.*$SOUND_CARD.*monitor" | grep
-oP "<\K[^ >]+")
pactl load-module module-null-sink sink_name=rxtx
pactl load-module module-loopback source=$RADIO_RX sink=rxtx channels=1
pactl load-module module-loopback source=$RADIO_TX sink=rxtx channels=1

[image: Radio Interface Source_Sink.jpg]

Hopefully this will help someone in the future looking to record both the
input and output to a sound card!

Chris Keller, K0SWE
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20211014/062f2fc9/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Radio Interface Source_Sink.jpg
Type: image/jpeg
Size: 23449 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20211014/062f2fc9/attachment-0001.jpg>

More information about the pulseaudio-discuss mailing list