0

I want to be able to output to a speaker from multiple applications at the same time, but currently it's only allowing me to output to the speaker from a single application.

I have the following ALSA config for my speaker and microphone:

pcm.!default {
  type asym
  capture.pcm "mic"
  playback.pcm "speaker"
}
pcm.mic {
  type plug
  slave {
    pcm "hw:2,0"
  }
}
pcm.speaker {
  type plug
  slave {
    pcm "hw:1,0"
  }
}

I know I need to somehow combine my config to enable dmix, I've tried adding:

pcm.dsp {
        type plug
        slave.pcm "dmix"
    }

But that doesn't work.

Any help would be much appreciated.

  • Have you tried to use pulseaudio? – Ingo Oct 9 '18 at 18:00
  • Have you tried using the device -D plug:dmix like mentioned here : alsa.opensrc.org/Dmix – Matt Oct 18 '18 at 22:37
0

If you can make each application use the dmix plugin, then it will work with no modifications to the asoundrc file. For example, you would need to alter the default alsa device in each application's configuration file or startup file.

If not, then you can make the default alsa device dmix. For example in your ~/.asoundrc file :

pcm.!default {
    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 4096
        rate 44100
    }
    bindings {
        0 0
        1 1
    }
}

ctl.dmixer {
    type hw
    card 0
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.