Skip to main content

Thread: Multiple users at one sound card with ALSA


there situations multiple xsessions running different users @ same time on 1 workstation. on environments without sound server pulseaudio or esd 1 user blocking 1 output device other users have work without sound. if music daemon mpd runs on own user, 1 user has exclusive access sound device rule "first come, first served".

possible three-steps solution using plain alsa based on dmix plugin:
dmix plugin known ability allow multiple processes use 1 sound device (which has no hardware mixing feature) simultaneously via software mixing. less known dmix makes possible share 1 sound output device between different users.

1. put dmix asound.conf

relevant part of /etc/asound.conf:


code:
pcm.!default {     type plug     slave.pcm "dmixer" }  pcm.dsp0 {     type plug     slave.pcm "dmixer" }  pcm.dmixer {     type dmix     ipc_key 1024                 # key must unique     ipc_key_add_uid 0     ipc_perm 0666                # permissions - octal notation     slave {         pcm "hw:0,0"         period_time 0         buffer_time 0         period_size 2048         buffer_size 32768         rate 44100     } }  ctl.dmixer {     type hw     card 0 }
ipc_key, ipc_key_add_uid , ipc_perm less popular options sharing of software mixer (dmix) between users. important if using several sound cards have choose unique ipc_keys.

2. set alsa default in /etc/libao.conf
done following entry (change existing entry if 1 exists already):
code:
default_driver=alsa09
that make alsa compatible applications use alsa.

3. deactivate & blacklist oss module

applications flash player in browsers use oss, not give damn asound.conf entries , block whole device. prevent deactivating , blacklisting oss module.

edit /etc/modprobe.d/blacklist.conf , type in:
code:
blacklist snd_pcm_oss
also,some programs rely on oss can still used oss wrapper tool provided alsa (aoss):
code:
sudo apt-get install alsa-oss
used as:
code:
aoss yourcommand
notice: make sure approach works have take care no application bypassing dmix plugin , using hardware device directly. in cases have set dmix device output device used application explicitly.

p.s.:
note, however, software mixing might/will cause quality loss of sound. @ everyday work common desktop speakers won't notice that. 1 of reasons quality loss example possibly required resampling of audio rate specified in asound.conf. serious working audio or playback on high-end speakers anyway have bought high-quality sound interface allows hardware mixing in conjunction jack (and doubtful need share device on serious work @ all).



Forum The Ubuntu Forum Community Ubuntu Official Flavours Support Multimedia Software [SOLVED] Multiple users at one sound card with ALSA


Ubuntu

Comments

Popular posts from this blog

Falang and too many redirects - Joomla! Forum - community, help and support

Infinite loop detected in JErrorInfinite loop detected in JError - Joomla! Forum - community, help and support

logged out from joomla! - Joomla! Forum - community, help and support