How to play music, coming from the microphone jack?

I have a USB device attached, which enumerates as a microphone. It streams some music, and I can easily record it with e.g. Audacity.

However, I want not to record it, but jsut listen on my headphones.

I have ALSA and Pulse Audio installed as usual. What is the best way to route the audio to my wishes?


I've picked this up some time ago. I hope it still works.

How to load a loopback device in PulseAudio

Open a terminal with Ctrl + Alt + T. Then enter

pactl load-module module-loopback

(without sudo or any special root rights). Now you should hear what is coming from your AUX-in. If not then open your audio settings dialog and try to change your settings from there. You will find the additional loopback-device.

If this works good and you want to have it on each boot, do this

sudo sh -c 'echo "load-module module-loopback" >> /etc/pulse/default.pa'

If for some reason you want to mute the device

pactl set-source-mute 1 1

To un-mute it

pactl set-source-mute 1 0

I've used this guide.

Related

  • Question: Pulseaudio loopback unload audio output devices

First, open a terminal. You want to use module-loopback to send input from a source right back to a sink. @MadMike's answer is alright if you just have one sink and one source, but you'll most likely have more.

First, find the source you want to use, type pactl list sources to get a list of your sources. Then, find the sink you want to loop back the same way, using pactl list sinks. Remember the names, on a default setup (using module-udev-detect) these will look like alsa_input.pci-0000_00_1b.0.analog-stereo

Next, you want to actually load module-loopback. This works the way @MadMike explained it, just be sure to include the sink and source names like this:

load-module module-loopback sink=alsa_output.pci-0000_00_1b.0.analog-stereo source=alsa_input.pci-0000_00_1b.0.analog-stereo

If you put this into your system-wide configuration (default.pa), put it at the end and wrap it into .fail and .nofail, so Pulse will still start even when the device is unplugged.

.nofail
load-module module-loopback sink=alsa_output.pci-0000_00_1b.0.analog-stereo source=alsa_input.pci-0000_00_1b.0.analog-stereo
.fail

When replugging the device, you'll also need to restart pulseaudio with pulseaudio -K (breaks active streams, restarts pulse immediately when autospawn is on)