September, 2008


15
Sep 08

Beware of bugs… yarrr!

Beware of bugs in the above code; I have only proven it correct,
not tried it.

—Donald E. Knuth.

As long as you keep administering machines, you may have found that updating critical systems can be tedious if you do your job carefully: manually checking whether packages (either new or upgraded) have known issues which may affect your machines can be tedious and error prone. Fortunately there is some tools which automate such tests, and one of those is available for Debian and derived systems (in general I think it will work with nearly every APT-based distro out there): apt-listbugs. After installing the package, which is readily available from your Usual Sources™, the installed APT hook will check the package against the bug tracker for your distribution and ask you what to do in the presence of existing open bugs:

Retrieving bug reports... Done
Parsing Found/Fixed information... Done
serious bugs of python-babel (-> 0.9.1-5)

 #493742 - Python namespace conflict with python-pybabel
Summary:
 python-babel(1 bug)
Are you sure you want to install/upgrade the above packages? [Y/n/?/...]

You can tap ? at the prompt to see the list of available actions: you can stop installing, pin packages… If you also install reportbug you will be able of typing the bug number at the prompt to see bug details.

I hope this makes you life a little bit happier :)


2
Sep 08

Recipe: How to record a Skype videoconference

This recipe could also be entitled “How to realize that Linux audio can be improved”, or even better “2008: A sound odyssey”. One of my colleagues at work needed to record audio and video out of Skype conferences under GNU/Linux. Getting to record the desktop is not as hard as one could think, thanks to utilities like RecordMyDesktop (or even other available options). The hard part has to do with sound. Period.

Today the recipe comes with a rant, but let’s find out how to record audio first (tested with Ubuntu 8.04). You will need to:

  1. Install packages:
    • libjack-dev
    • libasound2-dev
    • jackd
    • make
  2. Manually build the ALSA plugins package (Ubuntu does not include the JACK plugin). Grab alsa-plugins-X.Y.Z.tar.bz2 and do:
     cd alsa-plugins-*
     ./configure --prefix=/usr
     make
     cp jack/.libs/libasound_module_pcm_jack.so /usr/lib/alsa-lib
  3. Edit (or create) ~/.asoundrc and make sure it has the following contents:
    pcm.!default {
        type plug
        slave { pcm "jack" }
    }
    
    pcm.jack {
        type jack
        playback_ports {
            0 alsa_pcm:playback_1
            1 alsa_pcm:playback_2
        }
        capture_ports {
            0 alsa_pcm:capture_1
            1 alsa_pcm:capture_2
        }
    }
    
    ctl.mixer0 {
        type hw
        card 0
    }
  4. Run the JACK daemon with monitoring enabled:
    jackd -d alsa -d hw:0,0 -r 44100 -S -m
  5. Launch Skype, open the options screen and select jack as input and output device.
  6. In the RecordMyDesktop preferences screen, select JACK as audio source and use Ctrl-Click to mark the system:capture_1 and alsa_pcm:monitor_1 plugs. Names may vary, just make sure you choose both the left channel of the playback monitor and the left channel of the input source.
  7. Now you are ready to record both audio and video with RecordMyDesktop.

Let’s face it: the amount of sound-related systems is a growing problem of the FLOSS community. Of course we do need a low-level interface for hardware, and ALSA settled a high-quality standard, providing both good performance and hardware support. The problem is when audio reaches user space: there is a plethora of interfaces for audio which do not more than add complexity and exhacerbate users. In just two seconds I can recall about Esound, Pulseaudio, JACK, ALSA dmix, aRts, NAS, libao, Portaudio, OpenAL, YIFF… In short: a true mess. (Side note: I spent more time finding webpages than remembering about them.)

I wish some day this situation gets fixed and some Audio System To Rule the Others™ (ASTRO) is the one only interface for audio in the open source world. Ideally it would blend the nice routing capabilities of JACK with the wide adoption and desktop oriented feature set that Pulseaudio is getting lately. Volunteers, anyone?

Update, 2008-09-04: Fix library names, reordered steps. (Kudos go to Andrés Maneiro for spotting those issues.)