[lxc-users] Error in playing a sound using ALSA inside LXC container

manik sheeri sheeri185adidam at gmail.com
Wed Nov 2 00:51:26 UTC 2016


I am using host Ubuntu 16.0.4 system to run my lxc container. I uninstalled
pulseaudio as I wanted to use ALSA directly.

After uninstalling pulseaudio from the host machine, I was able to play
sounds using the command like one below(on host machine):

aplay /usr/share/sounds/alsa/Rear_Right.wav

Inside the lxc container, I have installed alsa libs and alsa utils. When I
use the same command as above inside the container, I get the following
errors:

ALSA lib confmisc.c:768:(parse_card) cannot find card '0'
ALSA lib conf.c:4248:(_snd_config_evaluate) function
snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4248:(_snd_config_evaluate) function snd_func_concat
returned error: No such file or directory
ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
ALSA lib conf.c:4248:(_snd_config_evaluate) function snd_func_refer
returned error: No such file or directory
ALSA lib conf.c:4727:(snd_config_expand) Evaluate error: No such file
or directory
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM default
aplay: main:654: audio open error: No such file or directory

The sound devices inside container are:

bash-4.2# ls -al /dev/snd/*
crw-rw---- 1 root   29 116,  5 Nov  1 17:21 /dev/snd/controlC0
crw-rw---- 1 root   29 116,  2 Nov  1 17:21 /dev/snd/controlC1
crw-rw---- 1 root   29 116, 10 Nov  1 17:21 /dev/snd/controlC2
crw-rw---- 1 root   29 116,  9 Nov  1 17:21 /dev/snd/hwC0D0
crw-rw---- 1 root   29 116, 13 Nov  1 17:21 /dev/snd/hwC2D0
crw-rw---- 1 root   29 116,  6 Nov  1 17:21 /dev/snd/pcmC0D3p
crw-rw---- 1 root   29 116,  7 Nov  1 17:21 /dev/snd/pcmC0D7p
crw-rw---- 1 root   29 116,  8 Nov  1 17:21 /dev/snd/pcmC0D8p
crw-rw---- 1 root   29 116,  4 Nov  1 17:21 /dev/snd/pcmC1D0c
crw-rw---- 1 root   29 116,  3 Nov  1 17:27 /dev/snd/pcmC1D0p
crw-rw---- 1 root   29 116, 11 Nov  1 17:21 /dev/snd/pcmC2D3p
crw-rw---- 1 root   29 116, 12 Nov  1 17:21 /dev/snd/pcmC2D7p
crw-rw---- 1 root   29 116,  1 Nov  1 17:21 /dev/snd/seq
crw-rw---- 1 root   29 116, 33 Nov  1 17:21 /dev/snd/timer

/dev/snd/by-id:
total 0
drwxr-xr-x 2 root root  60 Nov  1 17:21 .
drwxr-xr-x 4 root root 360 Nov  1 17:21 ..
lrwxrwxrwx 1 root root  12 Nov  1 17:21 usb-126c_4.1_amplifier-00 ->
../controlC1

/dev/snd/by-path:
total 0
drwxr-xr-x 2 root root 100 Nov  1 17:21 .
drwxr-xr-x 4 root root 360 Nov  1 17:21 ..
lrwxrwxrwx 1 root root  12 Nov  1 17:21 pci-0000:00:03.0 -> ../controlC0
lrwxrwxrwx 1 root root  12 Nov  1 17:21 pci-0000:00:14.0-usb-0:5:1.0
-> ../controlC1
lrwxrwxrwx 1 root root  12 Nov  1 17:21 pci-0000:01:00.1 -> ../controlC2
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20161101/ad2a8579/attachment.html>


More information about the lxc-users mailing list