2011-01-19

Using jack to record telcos and screen

At my job we use VOIP regularly when making conferences or simply calling a colleague. We also have a screen sharing tool that we use to share the screen to remote participants. This is also used to make remote training sessions. What I've been missing is a way to record both the shared screen and sound for later viewing. I hacked jack a little in the past but didn't manage to get it working. I've been having some free time so I decided to hack it today and I finally got it working. So, from the start.

Gentoo's JACK guide on the wiki is not bad but I honestly didn't pay much attention to it. I have the jack use flag enabled globally so it was time to get it going.

First I emerged qjackctl. It is nice program that sits on the tray area (I have it default to hidden) that starts the jack daemon and that allows you to control what is connected to where. I also emerged alsa-plugins to get the alsa-jack plugin. Finally I emerge jamin. I need it just to be able to get the output back in :-)

I configured also to use the jack plug by default. This can be done by creating a ".asoundrc" file in your home folder with the following content:
pcm.!default {
        type plug
        slave { pcm "jack" }
}

pcm.jack {
        type jack
        playback_ports {
                0 system:playback_1
                1 system:playback_2
        }
        capture_ports {
                0 system:capture_1
                1 system:capture_2
        }
}
I also keep a ".asound_nojack" file that has the jackplug but doesn't turn it to the default audio output for alsa.
pcm.jackplug {
        type plug
        slave { pcm "jack" }
}

pcm.jack {
        type jack
        playback_ports {
                0 system:playback_1
                1 system:playback_2
        }
        capture_ports {
                0 system:capture_1
                1 system:capture_2
        }
}
With that in place any application that does not support jack but support alsa will still work.

qjackctl has several windows, one of them is the Connections. I use it to reroute sound before recording.

What I do is start jamin, redirect all the bits I want to record to jasmin and disconnect them from the system output. Then start qt-recordmydesktop and point it to use the jamin output as audio source when recording. Here are screenshots of the important bits.


Importante Note: recordmydesktop has a bug that makes it complain that it has no jack support, even though the use flag is turned on. This is fixed upstream and available in Gentoo as a backport but you will have to unmask the package (0.3.8.1-r4 works at the time I wrote this).

NOTE: This isn't working very well... see here

No comments:

Post a Comment