45

How cna I record any internal sound like mic in and speaker out from the same PC running Ubuntu, using Audacity or something else?

For example under Windows it can be done like this (I want to do something similar): Recording internal sound on Windows

EDIT:

I installed pavucontrol but in the record tab it does not show Monitor of <your soundcard>

enter image description here

3
  • 1
    @Takkat: i followed the answer, but it does not work, cause in my EDIT you can see i do not have similar like in the ANSWER was showing.
    – user25165
    Feb 1, 2013 at 7:52
  • 1
    @Takkat: YEs 1) i started Audacity 2) After that i started the pavucontrol but same. Record tab on Pavucontrol always shows like i have shown in my EDIT.
    – user25165
    Feb 1, 2013 at 11:41
  • 2
    YES - it works doing something with Configuration tab. Thank you. Also strange the recording tab shows only when Audacity is in live Record mode. But not before idle mode.
    – user25165
    Feb 1, 2013 at 12:20

5 Answers 5

37

To define the recording source for any recording application we may install pavucontrol.

As soon as we record any audio stream the name of the recording application and the source from where it records will be shown in the Recording tab. We then may be able to change the source to Monitor of <your soundcard> to record the output of our soundcard:

enter image description here

We may have to choose another audio profile in addition. This can be done from the "Configuration"-tab of pavucontrol, e.g. a "Duplex" sound profile for output of the microphone to our local audio sink:

4
  • 3
    Yeah but it shows "No application is currently recording audio". In fact that build in sound recorder doesn't work, either.
    – NoBugs
    Nov 6, 2019 at 4:35
  • 1
    For me, nothing appeared on the Recording tab until I opened Audacity and started recording.
    – bitinerant
    Jan 2, 2021 at 2:34
  • 1
    @bitinerant I believe this is the expected behaviour.
    – Takkat
    Jan 2, 2021 at 5:38
  • Doesn't work with wireless headphones (e.g. AirPodsPro, JBL).
    – littleguga
    Oct 13, 2021 at 1:53
16

Coming from Windows to Linux less than one month ago, I wanted to record a video that would capture game footage with audio from both my speakers (Nvidia HDMI output) and my headset microphone (Auzentech X-Fi Fore 7.1 PCI-E sound card) simultaneously.

I tried the above but could not get it to work. I tried Audacity, RecordMyDesktop, SimpleScreenRecorder. I realized that even if I managed to get one program to record the two audio sources together and a second program to capture the video, I would have to line them up in a video editor (OpenShot) which wouldn't be aligned to the millisecond.

Finally, I found a perfect solution with Open Broadcaster Software (OBS)

In Settings → Audio, I was able to select:

  • Desktop Audio Device - Monitor of GK106 HDMI Audio Controller Digital Stereo (HDMI 2)
  • Mic/Auxiliary Audio Device - EMU20k2 (X-Fi Titanium Series) Analog Stereo.

For Source, I selected Screen Capture (XSHM) to capture the entire desktop.

Works perfectly.

5
  • 2
    Thanks so much for this!! I can't believe there's actually an advanced piece of sound recording software for Linux that works correctly and easily! I can't find any way to record only audio, but a quick import into Audacity afterwards is pretty easy. Best of all, I don't risk permanently screwing up my sound by messing with Alsa settings :)
    – Tobias J
    Oct 25, 2016 at 17:22
  • In case anyone wanting to install in Ubuntu (recent versions): sudo apt install obs-studio.
    – sdlins
    Apr 29, 2018 at 11:03
  • This worked perfect. Thanks. With Audacity I faced a lot of issues and was unable to record both input and output audio. However, with obs-studio I was able to get it working with the first try.
    – Sparkzz
    Mar 24, 2022 at 21:32
  • This is great, but what if you don't want to use obs?!
    – DARKGuy
    Jul 13, 2022 at 22:12
  • @DARKGuy How about SimpleScreenRecorder? Required setting: Audio input -> Record audio -> Backend: PulseAudio -> Source: Monitor of ... (Note: 'Monitor' in this case is a term used in audio/sound engineering, not monitor as in display). Tested this successfully myself.
    – Fonic
    Aug 31, 2023 at 8:00
8

The only way I was able to do this on 12.04 was to load ALSA's module module-loopback as recommended by Charl Botha in this screen-cast.

The short story ( as explained there ):

  • Get PulseAudio Volume Control (pavucontrol)
  • On Input devices tab, see that you have "Monitor of Built-in Analog Stereo" -- this is a virtual recording device with which you can record whatever's coming out of your speakers.
  • UPDATED: Now we just need to route your microphone to your speakers too. Do this by typing pactl load-module module-loopback latency_msec=1 at the shell prompt.
  • If you now record with audacity, or recordmydesktop, from the "Monitor of Built-in Analogy Stereo" (see Recording tab of pavucontrol after you start recording), you'll get your microphone as well as whatever's coming out of the speakers. This means that you can now easily record Skype meetings or private Google+ Hangouts.
  • UPDATED: On the Recording tab, you can show all streams (combobox at the bottom) and then configure which microphone (if you have more than one) should loopback into the built-in analog stereo

I think this module load has the same effect as the "Duplex" config recommended by @Takkat, but did not work on my machine.

2
  • 1
    To apply load of loopback module automatically on startup, do sudo sh -c 'echo load-module module-loopback latency_msec=1 >> /etc/pulse/default.pa'.
    – Ruslan
    Feb 19, 2017 at 6:40
  • 2
    When you "route your microphone to your speakers" doesn't that cause feedback? There's no automatic noise cancellation, is there? (Unless you're using quiet headphones) Or does the 1 millisecond of latencey have an effect here?
    – Xen2050
    Mar 26, 2019 at 0:12
3

My favourite GUI audio recording tool is Audio Recorder which is able to capture audio from all of possible sources. I'm sure this software is must-have tool.

Install Audio Recorder:

sudo apt-add-repository ppa:audio-recorder/ppa
sudo apt update
sudo apt install audio-recorder

Run it (my system locale is Ukrainan): enter image description here

To record system sounds select "Built-in Audio Analog Stereo (output)" as Source.

enter image description here

It's possible to select many of audio sources including Skype or even define your own.

2

You may have to select Analog Stereo Input (unplugged) in PulseAudio Volume Control (pavucontrol), in order to make it work.

This was the only way I was able to record audio after trying everything else I could find on recording audio from the sound card. Unfortunately you can't listen to the output at the same time with this setting.

Also see screenshot:

enter image description here

You must log in to answer this question.