[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Two programs or more using the sound system [was: mplayer does not work]



On Thu, 2005-10-02 at 16:31 -0800, Ibrahim Mubarak wrote:
> Is there a way to have two or more programs sharing the sound system? 

ALSA provides the "dmix" plugin for hardware that does not support
hardware mixing. That's what I used to use before I got a SoundBlaster
Live 5.1 card. Here's what I wrote last year:


--------< cut and pasted from old email >---------- 

For hardware without built-in multi-stream playback, ALSA provides a
software emulation (sort of), but it requires you to
configure /etc/asoundrc.

Here's what mine looks like (see below). The "pcm.!default" directive
should cause ALSA-aware applications to use the dmixer plugin that
provides the software mixing.  Applications which supports only OSS can
participate also through the "aoss" application. "aoss <app>" should
redirect the OSS-output.


------------------ my /etc/asoundrc ----------------------

pcm.!default {
    type plug
    slave.pcm "dmixer"
}
 
pcm.dsp {
    type plug
    slave.pcm "dmixer"
}

pcm.dsp0 {
    type plug
    slave.pcm "dmixer"
}
 
pcm.dmixer  {
    type dmix
    ipc_key 1024
    slave {
        pcm "hw:0,0"
        period_time 0
        period_size 1024
        buffer_size 8192
        #periods 128
        rate 44100
    }
    bindings {
        0 0
        1 1
    }
}
 
ctl.mixer0 {
    type hw
    card 0
}


-- 
Steven Yap <syap@shaw.ca>



Reply to: