Record What you Hear in Linux (stereo mix)

Post fully complete "how to" guides and tutorials here. This is a great place to get feedback on stuff you might put in the wiki.

Moderators: MattKingUSA, khz

Post Reply
Cymurai2000
Established Member
Posts: 7
Joined: Wed Apr 29, 2015 9:26 am

Record What you Hear in Linux (stereo mix)

Post by Cymurai2000 »

I know in windows 7 and above, in the sound recording devices menu, there is an option called "stereo mix" and that essentially allows you to record everything you hear. Sometimes it's called "Record What U Hear", on my particular windows box, it just states "Stereo Mix". Whenever you hear anything coming through the headphones or speakers, it gets picked up and recorded as a file.

I wanted to know if there is a way to set this up in Jack for recording in Linux. I currently use Ubuntu Studio v.14.04 plan on using an external USB box from Presonus or Focusrite or an internal card from RME or another company. I want plug in 2 -4 XLR mics to record all at the same time in Ardour on 2- 4 separate channels. I asked what equipment to use here http://linuxmusicians.com/viewtopic.php?f=6&t=13726 . Which is why I am leaning towards the Presonus or Focusrite solution.

My main question is would Jack allow me to use the USB device and "record what U hear" all at the same to be output into Adour for multi-track recording? If not would I have to come up with some weird way of doing it through cabling and hardware? My first thought would be to get a cable that does headphone plug to TRS 1/4" plug and go from the headphone or line out of the computer into a line in on the USB device. I would attempt to monitor myself and another monitor themselves via the monitor out on the USB device, so there won't be any echoing if I attempt to monitor through Ardour. A long time ago I remember I was able to do something close to this in Jack and Ardour, but I think it was application specific, so I setup Jack to route the sound from the firefox browser to Ardour to record. I am not sure if both can be done, because I have not played with the external boxes at all in Linux. I know this is a simple concept but can be complex in execution, because of timings, synch, etc.

I wanted to do this, because on top of recording a podcast with 2 - 4 people all in the same physical location all at the same time on separate channels, I wanted to record some of the stuff played my computer, like soundboards on the internet or just different sound files on my computer. Or would it just be wise to record computer sounds from another computer and connect that output to one of the in's on the USB device? I would rather use a software solution to record both what I hear and the mics.
emarsk
Established Member
Posts: 96
Joined: Wed Jul 27, 2011 3:50 pm

Re: Record What you Hear in Linux (stereo mix)

Post by emarsk »

With Jack, you can route the audio from one application to another as you see fit. No need to do it with physical audio cables (it would be very stupid). Just route all the audio you want to record to Ardour or whatever.
Instead of Ardour, you could use timemachine, for example, or jack_capture, that seems to do exactly what you want by default (I never used it, though).

I don't understand why you want to "record what you hear", though. You're already routing the mics into Ardour, why don't you just record those tracks and mix when you're done?
Please, avoid some common spelling errors:
http://theoatmeal.com/comics/misspelling
Cymurai2000
Established Member
Posts: 7
Joined: Wed Apr 29, 2015 9:26 am

Re: Record What you Hear in Linux (stereo mix)

Post by Cymurai2000 »

I wanted to have the ability to record any audio from websites at the same time we are talking; so we all could comment on it as it goes. I also wanted to just have the ability to add a soundboard, so I can play and record stupid noises as we are speaking as well.
emarsk
Established Member
Posts: 96
Joined: Wed Jul 27, 2011 3:50 pm

Re: Record What you Hear in Linux (stereo mix)

Post by emarsk »

Cymurai2000 wrote:I wanted to have the ability to record any audio from websites at the same time we are talking; so we all could comment on it as it goes. I also wanted to just have the ability to add a soundboard, so I can play and record stupid noises as we are speaking as well.
Just route them to Ardour (you may want to set up Qjackctl's patchbay to automatically make the connections).

Here is my ~/.asoundrc, it allows non-jack software (like Firefox) to send audio though Jack:

Code: Select all

## ALSA JACK PCM PLUGIN
## http://jackaudio.org/faq/routing_alsa.html
## http://www.alsa-project.org/main/index.php/Asoundrc
pcm.jackplug {
        type plug
        slave { pcm "rawjack" }
}
pcm.rawjack {
        type jack
        playback_ports {
                0 system:playback_1
                1 system:playback_2
        }
        capture_ports {
                0 system:capture_1
                1 system:capture_2
        }
}
pcm.!default { type plug; slave { pcm "rawjack" } }
Please, avoid some common spelling errors:
http://theoatmeal.com/comics/misspelling
Koniec12
Established Member
Posts: 3
Joined: Mon May 25, 2015 1:00 pm

Re: Record What you Hear in Linux (stereo mix)

Post by Koniec12 »

Hmm, interesting thought. I have never tried it. I will give it a shot.
emarsk
Established Member
Posts: 96
Joined: Wed Jul 27, 2011 3:50 pm

Re: Record What you Hear in Linux (stereo mix)

Post by emarsk »

I forgot to say: it requires "/usr/lib/alsa-lib/libasound_module_pcm_jack.so" (or a similar path, it depends on your distro) to work.
In Debian and Ubuntu, it's in the "libasound2-plugins" package, in Gentoo, it's in "media-plugins/alsa-plugins" with USE=jack.
Please, avoid some common spelling errors:
http://theoatmeal.com/comics/misspelling
rghvdberg
Established Member
Posts: 1067
Joined: Mon May 12, 2014 7:11 am
Has thanked: 15 times
Been thanked: 36 times

Re: Record What you Hear in Linux (stereo mix)

Post by rghvdberg »

User avatar
unfa
Established Member
Posts: 129
Joined: Tue May 17, 2011 10:43 am
Location: Warsaw, Poland
Has thanked: 1 time
Been thanked: 19 times
Contact:

Re: Record What you Hear in Linux (stereo mix)

Post by unfa »

When using jack, you can just run

Code: Select all

jack_capture
It'll automatically connect to all ports that feed the system output and save the audio to ~/ in 32-bit float WAV file.

Code: Select all

man jack_capture
Will tell you all the rest you need to know.
Post Reply