Solved Recording from two inputs to separate files

In short: Can I record audio from Line-In, and at the same time, record audio from the Mic In. Each recording going to a different file? Is this possible?

For some context:
I can record playing a game (or my desktop) using x11grab via ffmpeg and the audio from Line-In also via ffmpeg. I managed that by putting a splitter on my Speaker Out, and then a cable from that to the Line-In. The other port on the splitter goes to my headphones. [I couldn't figure out how to record the gameplay and Speaker Out with software alone]

Hey, it works. :-D

Now what I'm trying next, is to record my gameplay with sound [as I did before], but also want to record my narration at the same time. I want to keep my narration as a separate file, or separate audio stream in the video. I don't want it mixed-in with the game audio. I tried running Audacity at the same time as what I'm recording my gameplay. I then set Audacity to Mic In, but that seems to override the global mixer's "rec" source.
 
that seems to override the global mixer's "rec" source.
There's no "global" mixer, there's one per device (which typically only offers a single ADC, hence you have to pick a source).

So, obvious solution, get a second audio device ("sound card").
 
Thank you - I guess that is the easier solution for sure. I've been following some Linux guides and YouTube videos with OBS, where it seems possible. So I'll assume it's not something supported in FreeBSD's sound implementation. Not a big deal - a second sound card should do the trick for sure.
 
Well, wait, not so fast. Your "sound card" could have sub devices, like mine:
Code:
$ cat /dev/sndstat 
Installed devices:
pcm0: <ATI R6xx (HDMI)> (play)
pcm1: <Realtek ALC892 (Rear Analog 5.1/2.0)> (play/rec)
pcm2: <Realtek ALC892 (Front Analog)> (play/rec) default
pcm3: <Realtek ALC892 (Rear Digital)> (play)
pcm4: <USB audio> (rec)
No devices installed from userspace.
pcm1 to pcm3 are all sub devices of my on-board sound chip, and as you can see, two of them can also record. So it really depends on your hardware whether you need to use another audio device.
 
Ha, my onboard sound card also seems to have multiple sub devices. So I should then be able to record gameplay, as usual, on pcm4 (aka /dev/dsp4), and then rather than trying to use pcm4's Mic, use pcm5 (aka /dev/dsp5) for the voice-over/narration recording. I'll give that a try now.

Code:
$ cat /dev/sndstat
Installed devices:
pcm0: <NVIDIA (0x0084) (HDMI/DP 8ch)> (play)
pcm1: <NVIDIA (0x0084) (HDMI/DP 8ch)> (play)
pcm2: <NVIDIA (0x0084) (HDMI/DP 8ch)> (play)
pcm3: <NVIDIA (0x0084) (HDMI/DP 8ch)> (play)
pcm4: <Realtek ALC1220 (Rear Analog 5.1/2.0)> (play/rec) default
pcm5: <Realtek ALC1220 (Front Analog)> (play/rec)
pcm6: <Realtek ALC1220 (Rear Digital)> (play)
No devices installed from userspace.
 
🎉Awesome, it worked! Thank you so much Zirias. The mic audio is still very low, but I'll play with the mixer settings.

I've also figured out how to use ffmpeg to record both audio inputs into the same video recording, as separate tracks. So I don't need to run Audacity while recording the gameplay.

Code:
ffmpeg -video_size 1920x1080 \
     -framerate 60 \
     -thread_queue_size 512 -f x11grab -i :0.0+5,24 \
     -thread_queue_size 512 -f oss -i /dev/dsp4 \
     -thread_queue_size 512 -f oss -i /dev/dsp5 \
     -map 0 -map 1 -map 2 \
     ...
 
Back
Top