Thursday, January 23, 2014

No monitor device on USB sound card? No problem.

My USB sound card doesn't have a "monitor" mixer device. In other words, in order to listen to audio that is being recorded through my speakers or headphones, I need to record and play back that audio.

PulseAudio makes this somewhat easy using module-loopback, although the method is esoteric, so here are the applicable commands.

In order to figure out what input and output devices to use,
pactl list | grep -1 State
You should see a number of sources and sinks. The key piece of information is the Name: field, which allows us to specify which device to use in the loopback chain.

In my case, my source device is oss_input.dsp2, and my sink device is oss_output.dsp2. Therefore, I can load the appropriate module:

pactl load-module module-loopback source="oss_input.dsp2" sink="oss_output.dsp2" latency_msec=1
An ID number, corresponding to the module ID, is returned on the command line. When you want to unload the loopback module, supply this argument to This is the argument to pactl unload-module

There is a bit of latency using this method, but at least I don't have to involve a hardware mixer in my set-up.

No comments: