Skip to contentSkip to conversation

Question about dmix?

DISCUSSION cee1 3 participants 4 messages Mar 20, 2010 – Mar 22, 2010

lore
Share & tools
lore

cee1

author
#0 lore raw

Hi all,
I know alsa support userspace software multi-playback by dmix plugin. How does it realize? I expected a daemon accepting multi-streams which then mixes these streams to a single one -- it seems not the case.

Regards,

#1 lore raw

'Twas brillig, and cee1 at 20/03/10 14:05 did gyre and gimble:

Quoted 4 lines

Hi all,
I know alsa support userspace software multi-playback by dmix plugin. How does it realize? I expected a daemon accepting multi-streams which then mixes these streams to a single one -- it seems not the case.

I believe an older version of dmix used to act like a daemon, but the current version no longer does this and instead uses some magic spells that I don't even being to know about.

As far as userspace mixing goes, most linux distros and a lot of embedded systems (e.g. smartphones) now use PulseAudio which does run as a stand alone daemon and opens a single stream to alsa. It does much more than just mixing, but it fits in with your paradigms :)

See http://pulseaudio.org for more info.

Col

Signature · 10 lines
Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mandriva Linux Contributor [http://www.mandriva.com/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]
author
#2 lore raw

2010/3/20 Colin Guthrie <[email protected]>:

Quoted 9 lines

'Twas brillig, and cee1 at 20/03/10 14:05 did gyre and gimble:

Quoted 4 lines

Hi all,
I know alsa support userspace software multi-playback by dmix plugin. How does it realize? I expected a daemon accepting multi-streams which then mixes these streams to a single one -- it seems not the case.

I believe an older version of dmix used to act like a daemon, but the current version no longer does this and instead uses some magic spells that I don't even being to know about.

My soundcard is driven by an experimental alsa driver, it seems always underrun the buffer and causes bad quality in playback. Disable dmix will improve playback quality a little. I'm curious about what does dmix do internally.

Regards,

#3 lore raw
In reply to cee1
Quoted 3 lines · cee1 wrote:

I know alsa support userspace software multi-playback by dmix plugin. How does it realize? I expected a daemon accepting multi-streams which then mixes these streams to a single one -- it seems not the case.

The kernel maps the device's DMA buffer into all userspace processes; the processes then cooperate in adding samples to the buffer.

Regards,
Clemens