Page MenuHomeFeedback Tracker

Sound: No new sounds are created when the maximum number of "voices" is reached
New, NormalPublic

Description

Problem:
In the current configuration, it seems that the playBack of new soundSets (be it soundSetShot/Explosion/for vehicles) is stopped while the maximum amount of "voices" is reached.
This leads to situations in which firing sounds, bullet cracks etc. become silent due to the amount of sounds currently played back.

Suggestion:
If raising the voice count further is no option, it'd be a step forward to implement a system that deletes the oldest sound source rather than preventing a new sound from playing.

Details

Severity
Minor
Resolution
Open
Reproducibility
Always
Operating System
Windows 7
Category
Sound
Steps To Reproduce
  1. Load up a scenario with lots of action going on
  2. Listen closely and notice that many sounds simply don't play when all "voices" are used up

(Especially prominent when creating mods that use more soundSets per asset than vanilla does)

This is a video example of bulletCrack sounds stopping to play back once the maximum amount of voices is reached, using a fast-firing mod weapon:
https://www.youtube.com/watch?v=BwwVkg0Zxhw

Event Timeline

Laxemann created this task.Jan 12 2019, 4:35 PM
GSTAVO added a subscriber: GSTAVO.Jan 15 2019, 6:59 PM
dedmen added a project: Restricted Project.Jun 7 2020, 3:21 PM
dedmen set Ref Ticket to AIII-53009.
dedmen moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.
dedmen added a subscriber: dedmen.EditedSun, Aug 30, 8:14 AM

I checked the code, we don't impose any limit on voice count, we leave it to XAudio2 to decide, specifically https://docs.microsoft.com/en-us/windows/win32/api/xaudio2/nf-xaudio2-ixaudio2-createsourcevoice and as far as I can see, XAudio2 isn't supposed to impose a limit on the number of voices.
We do however preallocate 128 voices for mono/stereo 3D sounds, but that's not a limit, if more is needed they will be created dynamically.
So without repro, I can't see the problem here, there shouldn't be one

There will be performance drops at >128, >256, >512 sounds, but thats about it.

dedmen claimed this task.Sun, Aug 30, 8:14 AM
dedmen moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.

You can probably check Wave/Sound diag mode in diag binary yourself, it should display the count of active/existing voices

Ah found it.
So there are different sound categories and they all have limits. SonicCracks has a limit of 16 sounds to be played every frame. But they are sorted by intensity, which for your case should be fine.

If you're using CfgSoundCategories the limit is max of 4.

If you're using CfgSoundCategories the limit is max of 4.

How about we remove that limit, then you can use your own CfgSoundCategories for your sonicCracks, and define your own limit?

class CfgSoundCategories
	class limit1
		limit = 1;
	class limit2
		limit = 2;
	class limit3
		limit = 3;
	class Limit4
		limit = 4;
	class Limit5
		limit = 5;
	class Limit6
		limit = 6;
	class limit10
		limit = 10;
	class Limit15
		limit = 15;
	class Limit20
		limit = 20;
	class Limit30
		limit = 30;

@dedmen can you please more context what this class and its setup is about

dedmen added a comment.Tue, Sep 1, 9:03 AM

They define the limit of how many sounds in this category can be played at once, see usages of Limit15 for cluster bombs for example.
It means that of all spawned clusterBomb sound effects, only 15 sounds in the category can be played at once, it will chose the 15 most intense (as heard by the player) sounds to then play, and play the others muted.

Currently these limits are "fake" though as engine hardcoded limit is 4, so all these get clamped to a max of 4 sounds.

Cheers!

Usage:

	class Mk20_Tail_SoundSet
	{
		...
		customCategory = "limit2";
		...
	};

@dedmen

  1. When asking to remove the limit, do you mean the hardcoded limit of 4?
  2. It might be worth checking if cfgSoundCategories still applies to stuff that uses the "new" soundSet/soundShaders stuff. This kinda sounds like a pre-sound update config entry and SoundSet/SoundShader tech usually overrides everything.
h- added a subscriber: h-.Tue, Sep 1, 4:36 PM

CfgSoundCategories will get max limit of 64 (instead of 4), probably. Might be reverted if we notice issues in QA