29 10 2005

nForce 3 and ALSA

Category: Hardware, Linux

ALSA provides the nice dmix plugin for mixing multiple audio streams together so that more than one program can access a single audio device simultaneously. This is all fine and well, but unfortunately the sound card (intel8×0) on my nForce 3 board doesn’t have a supported hardware volume mixer. This means that to have a working global volume control you need to use the softvol plugin, a software volume mixer.

The idea is to first run the sound through softvol to adjust the global volume of all audio streams. After this the sound is fed into dmix for mixing, and finally the result is routed into the sound card.

Application #1 > softvol > dmix > sound card
Application #2 > softvol >
Application #3 > softvol >

Here’s an asoundrd configuration that brings it all together:

# A softvol mixer is assigned as the default audio device
pcm.!default {
  type softvol
  slave {
    pcm "dmixer"
  }
  control {
    name "PCM Volume"
    card 0
  }
}
# The dmixer device mixes multiple audio streams together
pcm.dmixer {
  type dmix
  ipc_key 12345678
  slave {
    # Change the following to "hw:0,0" to use the analog output jack
    pcm "hw:0,2"
    period_time 0
    period_size 512
    buffer_size 4096
    rate 48000
  }
  bindings {
    0 0   # from 0 => to 0
    1 1   # from 1 => to 1
  }
}

No Comments

Leave a comment