1

I'm trying to to redirect the sound that's being inputted into my microphone jack out into my headphone jack, is there any easy way to do this?

I've tried doing the following command:

pactl load-module module-loopback latency_msec=1 

But I'm trying to hear the sound in real time, and it has a latency even if I set it as "latency_msec=0"

Any ideas?

2
  • 1
    "easy" is relative. IMO it is best to use Ubuntu studio with jack and LMMS or Ardour. What applications are you using ? See also wiki.linuxaudio.org/wiki/system_configuration
    – Panther
    Jan 15, 2016 at 0:28
  • 1
    Please update your question providing details on the sound hardware in question, and how you are configuring the loopback in Windows where you say there is no latency.
    – dobey
    Jan 15, 2016 at 17:52

3 Answers 3

2

Tested in Ubuntu 16.04 64bit

In a Terminal, type:

alsamixer

Then hit F6 to choose your onboard sound card. Then F4 and set "capture" on 50%, for example. Hit F3, go to the track "loopback" and set it on "enable". Go to track "Mic" and set it on 100%, or any value so you can hear something. If you still hear nothing from your microphone, stay on the track "Mic" and hit the key "m" to unmute the track. That's it!

Works perfectly with my HDA Intel PCH.

3
  • "loopback" does not exist in that menu. Can you please correct your answer? Nov 25, 2020 at 18:06
  • In my configuration I have "loopback mixing" and it works... on channel right, so it's pretty annoying to hear yourself on only one ear.
    – apetrelli
    Jan 21, 2021 at 8:47
  • Well I have to contradict myself, now I hear myself on both channels, so yay thanks!
    – apetrelli
    Jan 21, 2021 at 8:52
1

Unless your hardware has a direct monitoring feature and can completely avoid processing the sound through software, there is going to be latency.

It sounds like you are trying to do this on standard built-in audio hardware, which requires software processing to redirect audio, therefore no, there is no way to get rid of the latency.

3
  • I don't think it's a hardware issue as I've been able to achieve no latency when using windows.
    – eyebouti
    Jan 15, 2016 at 4:35
  • Although there will always be some latency, there are many causes and as the OP stated s/he can get the results on other OS, so it is likely a matter of configuration and applications. The problem is the default desktop is not configured for audio, see Ubuntu Studio, KXStudio - kxstudio.linuxaudio.org or similar (Fedora Jam) and wiki.linuxaudio.org/wiki/system_configuration#the_kernel . We really can not offer more specific advice without additional information.
    – Panther
    Jan 15, 2016 at 12:28
  • No, it is not a matter of configuration and applications. I'm not sure what was done under Windows, but I guarantee it was not zero latency, as Windows is not RT (not even the poorly named Windows RT). If one wants to make a comparison to Windows, then one should explain the configuration in Windows, in the question, and also clarify what exact hardware is being used.
    – dobey
    Jan 15, 2016 at 15:09
0

You can install the lowlatency kernel to achieve this type of performance.

I use this kernel and the latency is so low I get realtime microphone feedback noise when the microphone is too loud without any echo, just straight-up high pitched noise like it is supposed to be.

Run the following commands to install:

sudo apt-get update
sudo apt-get install linux-lowlatency

Reboot for the changes to take effect and don't forget to select the lowlatency kernel from the grub menu.

Also, as mentioned by bodhi.zazen, you should really consider checking out Ubuntustudio as it comes pre-configured with the lowlatency kernel and all that stuff. You can always install the ubuntu-desktop after installation if you prefer the unity desktop environment.


Additionally, installing ubuntustudio through apt-get usually doesn't result in a system that has the full configuration that normally comes with ubuntustudio.

You can, however, get the full configuration that comes along with Ubuntustudio by running tasksel and choosing the "pro audio" and "audio recording" tools.

sudo tasksel

NOTE: because of a bug in tasksel, DO NOT use tasksel to uninstall packages. ONLY use tasksel to install.

10
  • The low latency kernel is for the most part outdated with anything resembling a modern CPU with multiple cores and a modern kernel ( > 2.6.31) . See wiki.linuxaudio.org/wiki/system_configuration#the_kernel . Ubuntu studio or KXStudio have many modifications other then a low latency kernel and the latency the OP is noticing is unlikely due to the kernel. If you have made ALL the adjustments on the page I linked, and still have a problem, then try the lowlatency kernel patch.
    – Panther
    Jan 15, 2016 at 12:25
  • @bodhi.zazen What are you talking about? The lowlatency image is not outdated. It's not a preempt-rt kernel, but the preempt support is still a patch and not part of mainline. The lowlatency kernel is built using options in the mainline kernel only (minus the backport patches that every Ubuntu kernel gets).
    – dobey
    Jan 15, 2016 at 15:06
  • @dobey - see the link I gave for details. the rt patch is not accepted into mainline as it has potential for instability. In the old days, processors were slower and single core. Modern processors are multicore and 100-1000 x faster then the sampling rate, so rt patch is rarely needed. It may sound coll "real time" , but modern kernels + mulitcore can keep up just fine.
    – Panther
    Jan 15, 2016 at 15:48
  • @bodhi.zazen You are misunderstanding the meaning of realtime, and what is or isn't needed for audio production. It's not all about the CPU itself. Anyway, it is irrelevant to the question, because we don't know what hardware is being used.
    – dobey
    Jan 15, 2016 at 17:51
  • @dobey yea, I am familiar with the RT patch. It is not needed as processors are faster.
    – Panther
    Jan 15, 2016 at 18:28

You must log in to answer this question.

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