I figured out the initial part of things. First, having any .asoundrc
file present regardless of the existence of the buffer or period settings overrides any settings that exist in /etc/asound.conf
. That at least makes sense as far as the documentation is concerned.
It took some digging but apparently what I need is called mixing and there is no mixing happening by default. Fortunately, the ALSA documentation has a working example.
From alsa-project.org
pcm.!default {
type plug
slave.pcm "dmixer"
}
pcm.dmixer {
type dmix
ipc_key 1024
slave {
pcm "hw:1,0"
period_time 0
period_size 1024
buffer_size 4096
rate 44100
}
bindings {
0 0
1 1
}
}
ctl.dmixer {
type hw
card 0
}
I put this into a .asoundrc
file and changed hw:1,0
to hw:0,0
because my default sound card is 0. Voila! I'm now able to play multiple QSoundEffect
s simultaneously.
I'm still getting buffer underrun notices so there's likely some work left to do to figure out the settings for period size and buffer size.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…