vsnd implements a Linux device driver that introduces a virtual soundcard.
Typically, a sound card is a hardware component that enables computers to play
audio files. This virtual soundcard, however, is designed to transmit audio
PCM data received from various programs directly into a FIFO file.
The following packages must be installed before building vsnd.
To compile the kernel driver successfully, package versions of currently used kernel, kernel-devel and kernel-headers need to be matched.
$ sudo apt install linux-headers-$(uname -r)Additional packages are required for verification purpose.
$ sudo apt install alsa-utils ffmpegAfter running make, you should be able to generate the file vsnd.ko.
Before loading this kernel module, you have to satisfy its dependency:
$ sudo modprobe snd_pcmA FIFO file is required during kernel module initialization and is used for transmitting audio PCM data.
$ mkfifo /tmp/audio.pcmThe module can be loaded to Linux kernel by runnning the command:
$ sudo insmod vsnd.ko out_fifo_name=/tmp/audio.pcmThen, use aplay to check the soundcard device
provided by vsnd.
$ aplay -lReference output:
card 0: vsnd [vsnd], device 0: vsnd PCM [vsnd PCM]
Subdevices: 1/1
Subdevice #0: subdevice #0
See scripts/verify.sh for automated test.
If your system uses PulseAudio to control the sound ouput
device (i.e., sink), you may undergo
with the following error when you select the sink
as vsnd from PulseAudio then you try to remove vsnd:
$ sudo rmmod vsnd
rmmod: ERROR: Module vsnd is in useThe reason is that PulseAudio occupies vsnd. Though you can
tell PulseAudio to disable vsnd so that you can remove vsnd,
we suggest you to disable temporarily when using vsnd by the following
command:
$ systemctl --user stop pulseaudio.socket
$ systemctl --user stop pulseaudio.serviceAfter using vsnd, you can execute the following command to bring
back PulseAudio:
$ systemctl --user start pulseaudio.service
$ systemctl --user start pulseaudio.socketIn systems use the PipeWire (e.g., Ubuntu 24.04 LTS), you might also encounter the problem that you are not able to remove the vsnd module.
To solve this problem, you need to stop the PipeWire with:
$ systemctl --user stop pipewire.socket
$ systemctl --user stop pipewireAnd after removing the module, restart it with:
$ systemctl --user start pipewirevsndis released under the MIT license. Use of this source code is governed by
a MIT-style license that can be found in the LICENSE file.