Ubuntu – xvidcap: Error accessing sound input from /dev/dsp

11.10devicessound

I'm running Ubuntu 11.10 and I'm trying xvidcap to record a screencast with audio from the microphone, however it can't record any sound:

$ xvidcap --file appo.avi --cap_geometry 700x500-0+0 
Error accessing sound input from /dev/dsp
Sound disabled!

Sure enough /dev/dsp doesn't even exist:

$ sudo ls -lh /dev/dsp
ls: cannot access /dev/dsp: No such file or directory

I found a blog post about fixing xvidcap sound input, however if I try the suggestion I get:

$ sudo modprobe snd-pcm-oss
FATAL: Module snd_pcm_oss not found.

So the question is, how can I create /dev/dsp?

The problem behind the problem is: how can I record sound from the microphone with xvidcap? So workarounds are welcome too.

UPDATE: I've followed the suggestion of James, and something has improved.

The error accessing /dev/dsp is gone, however now I get:

[oss @ 0x8e0c120] Estimating duration from bitrate, this may be inaccurate
xtoffmpeg.c add_audio_stream(): Can't initialize fifo for audio recording

Now when I record xvidcap appears in the recording tab of pavucontrol and I can choose Audio stream from Internal Audio Analog Stereo or Monitor of Internal Audio Analog Stereo, I tried both just in case, but the video is still mute.

UPDATE 2: I found that "Monitor of" is the one to record application sounds, while for microphone, I should choose "Internal Audio Analog Stereo". To rule out other problems, such as with the microphone, I tried with gnome-sound-recorder and it works. Actually I jumped on my chair, since the volume was too high! 🙂

Best Answer

The /dev/dsp device is part of the obsolete OSS sound API, which has since been replaced by the ALSA API. The OSS API was removed from the kernel last year (see bug #579300)

Assuming the application doesn't have an option to use the ALSA API, one option that might fix your problem would be to run the application under padsp, which will redirect OSS API calls to the Pulse Audio daemon. That is, instead of running xvidcap, run padsp xvidcap.

Related Question