20

I have connected a console to the line-in of my computer. How can I make it so that the sound comes out of the speakers?

I've tried alsamixer and it didnt help

Im using Ubuntu 12.04

4
  • computer / model / os version ? Nov 2, 2012 at 21:21
  • Im using Ubuntu 12.04. Not sure about the other info. Would it help if I list my lspci? Nov 2, 2012 at 22:10
  • which computer vendor is it (e.g. Dell / Asus / Toshiba)? and which model (e.g. Dell XPS / Asus ZenBook / Toshiba Satellite)? Nov 3, 2012 at 13:58
  • Its a custom computer. The parts were chosen individually. Nov 4, 2012 at 18:53

4 Answers 4

29
+25

Try use the pulse audio: module-loopback, this module loops all incoming audio back through your outputs ,that isn’t enabled in Ubuntu by default.

# Manually start the module-loopback.
pactl load-module module-loopback

# Configure your system to load module-loopback on startup.
# This places load-module module-loopback at the end of
# the /etc/pulse/default.pa pulseaudio configuration file.
sudo sh -c ' echo "load-module module-loopback" >>  /etc/pulse/default.pa '

This solution is copied from PulseAudio: Monitoring your Line-In Interface .

5
  • worked for me :), and the "couter-spell" to stop it again? Mar 18, 2013 at 5:28
  • 1
    the "counter-spell" is pactl unload-module module-loopback #and counter-spell to stop loading module-loopback on system startup is sudo sh -c 'sed -i "/load-module module-loopback/d" /etc/pulse/default.pa'
    – xranby
    Mar 18, 2013 at 11:24
  • Thx, it seems so simple. I have in the meanwhile checked myself and it must be quite similar this pactl unload-module <ID of the modul> so the module name would not work in this case, which is counterintuitive... pactl list modules can yield the necessary <ID>. Thanks for responding. Mar 19, 2013 at 5:31
  • What is the incremented return value whenever the module is loaded? Feb 10, 2016 at 2:12
  • hmm, I did this, and my audio out become from music to a weird buzzing with slowly decreasing pitch o.o
    – Neinstein
    Aug 7, 2018 at 19:32
4

modification to xranby's answer:

I was having a problem with latency where there was quite a noticeable amount of lag between my button-press and the "immediate" sound.

This fixes that: pactl load-module module-loopback latency_msec=1

source of fix: http://thelinuxexperiment.com/fix-pulseaudio-loopback-delay/comment-page-1/#comment-2762

3

In the end I entered into "alsamixer" and rised the level of the Line-in, which was at 0 and it worked (in Ubuntu 10.13)

0

I tried to do this using xranby's answer, and I found it quite confusing and time-consuming to figure out, for several reasons.

The loopback module is designed so that by default, it doesn't take input from the mic. This is meant so that you won't get feedback. However, my mics are USB mics, and therefore they're not automatically excluded. For this reason, it's necessary to use source=... when loading the loopback module.

If you don't successfully shut off the mics as inputs to the loopback, then it's also possible to get confused because you think everything is working, but actually it's not the line-in that's working, it's input going through the air from your stereo speakers to your mics.

To figure out which source you need, do "pacmd list-sources | grep name:" (note the colon at the end). On my system, the first two on the list were my USB mics, while the fourth was "alsa_input.pci-0000_00_1b.0.analog-stereo" and the third was like that but with ".monitor" on the end of the name. This told me that the source I wanted was number 4.

So to start up the loopback:

pactl load-module module-loopback source=4

To turn it off:

pactl unload-module module-loopback

If you want to make these settings permanent, see xranby's answer.

There turned out to be three different volume controls that I had to find and set appropriately. On my hardware, I had a volume knob on my computer's speakers/headphones. Also, there are two different volume controls in pavucontrol. There's one under the input devices tab, and once you start up the loopback module there will also be a separate control in the playback tab saying something like Built-in Audio Analog Stereo; Port: Line in. If any one of these three is all the way down, then you get nothing. If either of the software ones is too high, you can get distortion.

1
  • I was trying to do this with an electric guitar on 20.04 I got crazy results No control of the line-in level through alsamixer and there was a long delay between the time I vibrated the guitar strings and the sound reached the speaker Seemed enabled and disabling loopback in alsamixer didn't have any effect and I had to toggle loopback mixing on and off through the command line pactl load-module module-loopback and the same using unload instead of load to turn it off (the buzz) Anyone can help? I think I should plug the guitar into mic instead maybe
    – fugee ohu
    Dec 17, 2023 at 6:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .