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:
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.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 }
2. set alsa default in /etc/libao.conf
done following entry (change existing entry if 1 exists already):
that make alsa compatible applications use alsa.code:default_driver=alsa09
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:
also,some programs rely on oss can still used oss wrapper tool provided alsa (aoss):code:blacklist snd_pcm_oss
used as:code:sudo apt-get install alsa-ossnotice: 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.code:aoss yourcommand
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
Post a Comment