Sounds frequently do not play / fix sound issues
I’m using Windows 8 Pro, and have confirmed this bug in both the 2.70rc1 client and the latest build. An SMG fired by someone else will often only make a noise for some of the shots. It might make a noise for three shots, then be silent for three shots, and then repeat. (This can be extremely disorienting.)
I can "fix" the issue by editing snd_dma.c, lines 614 and 618. That seems to only allow 4 sounds to play at a time, or 8 in some cases, by setting a variable named 'allowed’ to either 4 or 8. I changed these values to 8 and 16, respectively. But I do not understand how this fits into the big picture, so it is possible that it should be revised in some other way.
I asked for confirmation in the IRC channel, but nobody else (whether using Windows or not) could confirm the bug. I do not think the OS would matter, but maybe it does not affect other operating systems if they use OpenAL instead of DMA.
client: don’t play the silence - skipping dummy blank sound in
SOUNDSYSTEM_StartSoundEx() FIXME: activate for openAL refs #159
client: increased the limit of 'external’ same sound at same time to
16. This is about 20% of MAX_CHANNELS and not the final fix refs #159
client: don’t play the silence - skipping dummy blank sound for openAL
too refs #159
#2 Updated by IR4T4 over 6 years ago
- Status changed from New to Feedback
- Assignee set to IR4T4
- Target version set to 2.71rc1
- % Done changed from 0 to 50
Bill, thank you for reporting. I’ve increased the limit to 8.
The big picture is drawn by an older quake3 sound code merge ... and ET is not q3 #-)
Actually I couldn’t find such a limit (allowed) in snd_dma.c of the GPL code. However the limit of 4 equal sounds at same time is by far to low for ET when the entnum is not listener_number → enemies/world.
#5 Updated by Bill over 6 years ago
Ah yes, I see this function is basically identical to the snd_dma in the original Q3 source, not ET!
Also, I noticed 8 is not quite enough. I specifically noticed some FG42 sounds being dropped. And getting more into the "big picture" ... I guess the limit is just there because MAX_CHANNELS is 96. With allowed = 8, that means you might run out of channels with more than 12 people nearby. (And then fewer people if we increase it some more.)
But looking at the GPL code it looks like they used a different fix for ET. There are added code blocks starting on lines 753, 772, 818, and 837, plus some other stuff sprinkled in here and there. These basically have the engine make more of an effort to re-use sound channels allocated earlier, when there are a bunch of sounds coming from one entity (which apparently happens when shooting an smg).