How do redirect microphone audio output to headphone output?

237

Solution 1

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.

Solution 2

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.

Share:
237

Related videos on Youtube

Robert
Author by

Robert

Updated on September 18, 2022

Comments

  • Robert
    Robert over 1 year

    Context: I'm developing a new resource for my TF Provider.

    This foo resource has a name and associated config: a list of key value pairs (both sensitive and non-sensitive).

    There're 3 options I've identified:

    resource "foo" "option1" {
      name = "option1"
      config = {
        "name"            = "option1"
        "errors.length"   = 3
        "tasks.type"      = "FOO"
      }
      config_sensitive = {
        "jira.key"         = "..."
        "credentials.json" = "..."
      }
    }
    
    resource "foo" "option2" {
      name = "option2"
      config = {
        "name"            = "option1"
        "errors.length"   = 3
        "tasks.type"      = "FOO"
        "jira.key"         = "..."
        "credentials.json" = "..."
      }
    }
    
    resource "foo" "option3" {
      name = "option3"
      config = file("config.json")
    }
    

    The advantage of option #3 is it looks very readable but requires a user to store an extra json file (with secrets) in the same folder (I'm not sure how acceptable that setup is). Option #2 looks tempting but foo should accept updates and if we mark the whole block as sensitive (since it may contain secret key-value pairs), the update functionality will suffer (user won't see the expected change). So Option #1 is the winner in my eyes since it's the most explicit one and allows us to distinguish between sensitive and non-sensitive attributes (while allowing updates for non-sensitive ones). Reading from file the whole config is probably not ideal since it doesn't really allow an engineer to see how the config looks like without opening another file.

    There's also this weird duplicated name attribute but let's ignore it for now.

    What configuration is the most acceptable and used by other TF Providers?

    • Panther
      Panther over 8 years
      "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
    • dobey
      dobey over 8 years
      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.
  • eyebouti
    eyebouti over 8 years
    I don't think it's a hardware issue as I've been able to achieve no latency when using windows.
  • Panther
    Panther over 8 years
    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
    Panther over 8 years
    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.
  • dobey
    dobey over 8 years
    @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
    dobey over 8 years
    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.
  • Panther
    Panther over 8 years
    @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.
  • dobey
    dobey over 8 years
    @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.
  • Panther
    Panther over 8 years
    @dobey yea, I am familiar with the RT patch. It is not needed as processors are faster.
  • Panther
    Panther over 8 years
    @dobey - you know as well as I do that there are many configuration differences other then a rt kernel between ubuntu and Ubuntu studio as well as many factors to xrun errors. If the rt kernel is the only thing that is different, then sure go ahead and use it. But, in general, it is a old kernel patch and is not necessary as documented at linux musicians and by the fact the the patch is rejected upstream. wiki.linuxaudio.org/wiki/system_configuration#the_kernel
  • Panther
    Panther over 8 years
    "Kernels >= 2.6.31 seem to work pretty good without RT patch, also for real-time pro audio usage. It's not strictly necessary anymore to install a real-time ('rt') kernel to get good results." so sure if for some reason you have better results with the RT kernel patch use it, but in general it is not necessary for most people most of the time.
  • dobey
    dobey over 8 years
    @bodhi.zazen Again, that patch is completely irrelevant, because the lowlatency kernel doesn't use it, nor does UbuntuStudio ship it. It has never been relevant to this question, nor was it relevant to this answer to the question.
  • mchid
    mchid over 8 years
    This explains the differences a little bit help.ubuntu.com/community/UbuntuStudio/…. All I know is that I use L.L. on Ubuntustudio with alsa and pulseaudio and I have really good results. I only get latency if I set latency_msec to > 0.
  • Luís de Sousa
    Luís de Sousa over 3 years
    "loopback" does not exist in that menu. Can you please correct your answer?
  • apetrelli
    apetrelli over 3 years
    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
    apetrelli over 3 years
    Well I have to contradict myself, now I hear myself on both channels, so yay thanks!