This manual shows how to record the output of Windows applications using wine, the snd-aloop kernel module and recordMyDesktop. [1]

The snd-aloop module is very useful when you need to record other sound sources then your microphone. Simply connect the “noisi” application to the first sound loopback devices provided by snd-aloop and the screen recorder to the second.

[1]Tested with Debian 7 wheezy.

1. Load the kernel module

By hand (as root):

sudo modprobe snd-aloop

Make it reboot persistent:

sudo echo 'snd-aloop' >> /etc/modules

Check if the module is loaded and initialized:

aplay -l

**** List of PLAYBACK Hardware Devices **\**
card 0: PCH [HDA Intel PCH], device 0: CX20590 Analog [CX20590 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 8: HDMI 2 [HDMI 2]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Loopback [Loopback], device 0: Loopback PCM [Loopback PCM]
  Subdevices: 8/8
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
...
  Subdevice #7: subdevice #7
card 1: Loopback [Loopback], device 1: Loopback PCM [Loopback PCM]
  Subdevices: 8/8
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
...
  Subdevice #7: subdevice #7

Note

snd-aloop provides 2 pass-through devices:
card 1, device 0 and
card 1, device 1.

2. Redirect your application sound into the first loop-back device

Card 1, device 0
Input device: redirect the output of the program you want to record into this device.

2.1. Example aplay

aplay -D hw:1,0,0 play.wav

2.2. Example wine application

winecfg

Audio > Output device > Out:Loopback - Loopback PCM (choose first)

winecfg

3. Connect your recorder input to the second loop-back device

Card 1, device 1
Output device: everything pumped into the first loop-back device will be sent out here.

3.1. Example arecord

Example: aplay

arecord -D hw:1,1,0 record.wav

3.2. Example RecordMyDesktop

Device: hw:1,1,0

Advanced > Sound > Device > hw:1,1,0

RecordMyDesktop

4. Complete example: Record a virtual machine using pulse audio

  1. Install package recordmydesktop

    sudo apt-get install recordmydesktop
    
  2. Load loopback kernal module

    sudo modprobe snd-aloop
    
  3. Start virtual machine

  4. Redirect output of virtual machine in loop-back device using _p

    pavucontrol
    

    redirect VM output in loopback device

    For other examples see: section_title.

  5. Start player in virtual machine

  6. Record virtual machine

    recordmydesktop --device hw:1,1,0 -x 284 -y 42 --width=1349 --h
    

    Adjust coordinates to your need. You can mesure with xev the cu coordinates of your mouse.

  7. Type Cntl-C to stop recording. Transcoding starts automatical You should see a file out.ogv in your working directory.

    For how to connect other recorders see: section_title