Different people have tried this in different ways. For me, configuring ALSA to capture from the "Mix" device didn't work since I don't have a "Mix" listed when I try the amixer command. I could however write the ALSA output to a file by configuring the PCM chain.
Have the following code in your ~/.asoundrc file: