We have a headless linux server (Debian 5) we use for running integration tests of our web-page code. Among these tests are ones implemented using Selenium, which practically simulates a user browsing our pages and clicking on things. One of these tests is failing now, because it involves starting a flash-based audio player and checking to see whether the progress bar gets displayed properly. The reason this test fails is that there is no way to play the audio, and no sound card on the machine, which has simple webserver hardware.

So, my question would be: Is there a simple way of giving a program the impression that its audio output is being processed, and playback is taking place? I don't have to record the playback, or redirect it or anything like that, just a dummy soundcard, like the dummy X-server we are using, which actually does not need to display stuff.

I have tried using JACK, but it's too complicated, and the documentation does not even answer this very simple question. I also installed alsa on the server; it 'pretends' to run, but when a program tries to play audio, just spews error and debug information having to do with the non-existence of a soundcard.

It would be really awesome if one of you has a simple answer to this question.


up vote 1 down vote accepted

Have you tried the snd-dummy module?

$ modinfo snd-dummy
filename:       /lib/modules/2.6.28-11-generic/kernel/sound/drivers/snd-dummy.ko
license:        GPL
description:    Dummy soundcard (/dev/null)
author:         Jaroslav Kysela <perex@perex.cz>
srcversion:     AFF1C8B79BA4E7C29AE9874
depends:        snd-pcm,snd
vermagic:       2.6.28-11-generic SMP mod_unload modversions 586 
parm:           index:Index value for dummy soundcard. (array of int)
parm:           id:ID string for dummy soundcard. (array of charp)
parm:           enable:Enable this dummy soundcard. (array of bool)
parm:           pcm_devs:PCM devices # (0-4) for dummy driver. (array of int)
parm:           pcm_substreams:PCM substreams # (1-16) for dummy driver. (array of int)
  • That did it, thanks a ton mate. – Ulas Turkmen Jun 9 '10 at 15:11

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.