ALSA and PulseAudio - recording multiple input devices?
Hello. I have an Intel HDA audio card, and would like to record both my soundcard output and my microphone input at the same time.
Getting to record my soundcard output (aka "Stereo Mix" or "What-U-Hear") is impossible for my soundcard without using the PulseAudio monitor, so I've set that up. Now I can record either the PulseAudio monitor for my soundcard, or the microphone input, but I don't know how to record both at the same time. Currently, my .asoundrc looks like this: Code:
pcm.pulse { So now I can choose either "pulse" as an input channel in, for example, Audacity or RecordMyDesktop applications (and then set in the PA volume control the actual channel which I want recorded), or choose "pulse_monitor" or "pulse_mic", in order to record either the PA monitor or the microphone, respectively. I've read through the ALSA plugins reference, as well as the Asym and Dmix pages on ALSA wiki, but I'm still not sure how to put this together. I figured there should be a way either to route the microphone input into the ALSA output, and thus make the PA monitor "hear" what I speak into the microphone, or to make a completely new channel with both ALSA output and microphone input as "slaves", and then use that for recording. If anyone could help me accomplish this (or suggest a different solution), I'd be very grateful. Thanks in advance! :) |
Quickest might be to just wire your mic to your sound card, module-loopback will do it:
Code:
$ pacmd load-module module-loopback latency_msec=5 # or whatever, the default 200 is way too high I've found variations on this sed Code:
pacmd list-sources | sed -nr '/^ |\tname:/H;${g;s/\n\t/\t/g;s/\n//p' To stop the loopback, unload the module (pacmd list-modules will tell you its number). |
What is it exactly that you're trying to do? I might suggest using Jack for all types of low latency routing, and most applications now use native jack output, so you might be able to use it with whatever programs you were using earlier to record via what u hear. Again, it depends on what you're trying to do.
Tip: Why not record narration or whatever you are recording from the mic after you record what you are recording from what u hear? You can then mix it up using something like audacity, and use better editing and effects and what not. |
Okay, I got what I needed. Thanks to @jthill and this article (more precisely the comments) I managed to get both monitor and microphone input into one sink, and then record it.
Basically, what I did was as follows: 1. open /etc/pulse/default.pa, and uncomment the line: Code:
load-module module-null-sink Code:
load-module module-null-sink sink_name=rmd 3. added two more loopback sinks for rmd Code:
load-module module-loopback latency_msec=5 sink=rmd Code:
pcm.pulse { 6. Fired up qt-recordmydesktop, started recording, fired up pavucontrol, started recording with qt-recordmydesktop 7. In pavucontrol's Recording tab, set the application [recordmydesktop] to capture "Monitor of Null Output", and the two Loopbacks to Null Outptut set one from "Monitor of Internal Audio", and the other one just "Internal Audio". Voila! It works perfectly now :) I'm absolutely thrilled to have achieved this, because it's not really something my soundcard was even meant to be able to do, and I'm absolutely positive that it's impossible to achieve under W*****s. Many thanks to everyone for your help, it is much appreciated. |
Thank you!
I had no idea the null sink provides a monitor. That was the piece I was missing. |
All times are GMT -5. The time now is 03:54 PM. |