I just found out about this new dmix thing in ALSA. It's not working exactly the way I would like it to work however. One user can mix as many different audio "tracks" as he wants. But if one user is already playing audio then another user cannot start any audio, with the exception of root who can play audio whenever he wants.
I get this error when trying to play audio as one user when another user is already playing audio:
ALSA lib pcm_dmix.c:773: (snd_pcm_dmix_open) unable to create IPC semaphore
aplay: main:533: audio open error: Permission denied
Is there a way to let users share the audio device.