[Lxc-users] ALSA in a container

lxc at jelmail.com lxc at jelmail.com
Tue Sep 7 22:07:44 UTC 2010


Hi Jon,

Apologies for late reply but an Arch update borked my sytem on Saturday ;)

I am not running PulseAudio. I was hoping to get away without that but I
fear that may be the only way I can get this to work. At the moment I am
trying with just ALSA on a test machine with very little else.

Here is a transcript showing how I set up a container with ALSA: 
http://starfry.pastebin.com/yjDMLppn

If ALSA is not in use everything works:

[root at mycontainer ~]# aplay /usr/share/sounds/alsa/Front_Center.wav
Playing WAVE '/usr/share/sounds/alsa/Front_Center.wav' : Signed 16 bit
Little Endian, Rate 48000 Hz, Mono

If I have something on the host using ALSA then the guest complains:

[root at mycontainer ~]# aplay /usr/share/sounds/alsa/Front_Center.wav
ALSA lib pcm_dmix.c:1018:(snd_pcm_dmix_open) unable to open slave
aplay: main:654: audio open error: Device or resource busy

Likwise, if the container has ALSA in use nothing else can use it. The
setup uses Dmix. Note that two users on one "machine" can use Alsa
concrrently (i.e. two users on the host or in the same container).

I don't know if any of that helps at all? I think the problem is to do with
dmix not being "seen" across container/host boundary. I think the host's
dmix needs to be exposed in the container but I am not sure how to do that.


--------------------------------------------------------------------
mail2web.com – Enhanced email for the mobile individual based on Microsoft®
Exchange - http://link.mail2web.com/Personal/EnhancedEmail






More information about the lxc-users mailing list