Tips & Tricks for Technologists & System Administrators | About & Contact

Enable/Disable Output of Audio Input in Ubuntu


Posted 3rd September in Ubuntu. 2 Comments

After hooking up my old-school turntable to the input jack on my desktop PC, I thought I’d be easily able to output the sound from my speakers. I could even see the audio playing as an input and could record it using Audacity, but not output it directly.

By default Ubuntu does not load the loopback module for Pulse, the audio manager for Ubuntu. You need to load this module to get the input audio to play out to your speakers. To enable this feature run the following command:

1
pactl unload-module module-loopback

This will load it one time, and when you reboot it will again be unloaded. To make it ‘stick’ and load on every boot, run this command:

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

If you want to undo the loopback module, run this command:

1
pactl unload-module module-loopback

and to disable it from running on startup:

1
sudo sh -c 'sed -i "/load-module module-loopback/d" /etc/pulse/default.pa'

This was tested in Ubuntu 13.04.

If you start getting weird audio feedback after running this command, you might want to check that you didn’t accidentally load the loopback adapter twice!


Originally posted 20130903 and last touched 20130903
Dave Drager+ is the Chief Technology Officer at XDA-Developers, where he keeps the server farm running efficiently for millions of visitors per day. He has written previously for the technology blogs Lifehacker and MakeUseOf.