skip to Main Content

SimpleScreenRecorder: Record audio with ALSA only (no Pulseaudio, no JACK)

I’ve started recording video game sessions a while ago, since I think they’re fun. Needless to say that I don’t want to just see the screen, but also hear and record the game.

The problem with this is: A screen recording application always takes control of the sound card. Using ALSAs default settings, I can either hear the audio of the game or record it. So in order to record the audio stream, I would have to play muted.

First, I’ve tried different approaches:

glc. As it seems, this program is not being developed anymore and it just works with OpenGL. Ancient DirectDraw games can not be recorded with this.

PulseAudio. Yeah, I really installed this junk on my computer, hoping that the system was improved in the last years. I was very wrong. The attempt to access my internal sound card (VT1705) resulted in PulseAudio crashing. Granted, it could access my external one (CM6206), but I already had enough of it. Thanks Lennart Poettering, your software is making the Linux world way more complicated than it should be.

Finally, I found SimpleScreenRecorder. Although it is listing ALSA devices in the interface, they didn’t work. All of them. Of course, this program has been written with Pulseaudio in mind, too…

But I was lucky, because ALSA has a loopback interface. This is basically a virtual sound card. It creates to devices, Loopback 1 and Loopback 2. I can throw everything I want into one side and it comes out at the other.

The virtual devices can be created with this command:

modprobe snd_aloop pcm_substreams=1

So I took my original .asoundrc as a base and put this code at the bottom:

pcm.loopsnoop {
 type dsnoop
 ipc_key 321456 # any unique value
 hint { show on
 description "(Loopback-Aufnahme)"
 }
 slave {
 pcm "hw:3,1,0" #Loopback.2
 channels 2
 #rate 48000
 }
}
pcm.split {
 type plug
 slave {
 pcm {
 type multi
 slaves {
 a { channels 2 pcm "upmix" } #sound card (default/hw:x,x)
 b { channels 2 pcm "hw:3,0,0" } #Loopback.1
 }
 bindings {
 0 { slave a channel 0 } # Left
 1 { slave a channel 1 } # Right
 2 { slave b channel 0 } # left
 3 { slave b channel 1 } # right
 }
 }
 #rate 48000
 }
 ttable [
[ 1 0 1 0 ] # left
[ 0 1 0 1 ] # right
]
}

After that, I changed the segment pcm.softvol in a way, that every audio is routed through the split device by default:

pcm.softvol {
 type softvol
 slave {
 pcm "split"
 }

Done! Now the SimpleScreenRecorder has a new device in the list, called ” (Loopback-Aufnahme)”. Using this, I can record the audio of my games while playing them.

sss

This Post Has One Comment

  1. Would you describe a simpler configuration for those of us who only want to record what is coming out of a single dmix or hw device?

Leave a Reply

Your email address will not be published. Required fields are marked *

Back To Top