From d3cc867bd42759cb8e294d691354187984f96ff4 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Tue, 21 Feb 2017 16:54:55 -0800 Subject: Increase the default effect slot and send count The default number of auxiliary effect slots is now 64. This can still be raised by the config file without a hard maximum, but incurs processing cost for each effect slot generated by the app. The default number of source sends is now actually 2, as per the EFX docs. However, it can be raised up to 16 via ALC_MAX_AUXILIARY_SENDS attribute requests, rather than the previous 4. --- Alc/ALc.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'Alc') diff --git a/Alc/ALc.c b/Alc/ALc.c index e63323b4..e33f397b 100644 --- a/Alc/ALc.c +++ b/Alc/ALc.c @@ -1788,11 +1788,12 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList) GotType = 1<<2, GotAll = GotFreq|GotChans|GotType }; - ALCuint freq, numMono, numStereo, numSends; + ALCuint freq, numMono, numStereo; enum DevFmtChannels schans; enum DevFmtType stype; ALCuint attrIdx = 0; ALCint gotFmt = 0; + ALCsizei numSends; if(!attrList) { @@ -1894,13 +1895,14 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList) device->NumMonoSources = numMono; device->NumStereoSources = numStereo; - ConfigValueUInt(NULL, NULL, "sends", &numSends); - new_sends = clampi(numSends, 1, MAX_SENDS); + ConfigValueInt(NULL, NULL, "sends", &numSends); + new_sends = clampi(numSends, 0, MAX_SENDS); } else if(attrList && attrList[0]) { - ALCuint freq, numMono, numStereo, numSends; + ALCuint freq, numMono, numStereo; ALCuint attrIdx = 0; + ALCsizei numSends; /* If a context is already running on the device, stop playback so the * device attributes can be updated. */ @@ -1921,8 +1923,8 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList) if(attrList[attrIdx] == ALC_FREQUENCY) { freq = attrList[attrIdx + 1]; - device->Flags |= DEVICE_FREQUENCY_REQUEST; TRACE_ATTR(ALC_FREQUENCY, freq); + device->Flags |= DEVICE_FREQUENCY_REQUEST; } if(attrList[attrIdx] == ALC_STEREO_SOURCES) @@ -1975,8 +1977,8 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList) device->NumMonoSources = numMono; device->NumStereoSources = numStereo; - ConfigValueUInt(al_string_get_cstr(device->DeviceName), NULL, "sends", &numSends); - new_sends = clampi(numSends, 1, MAX_SENDS); + ConfigValueInt(al_string_get_cstr(device->DeviceName), NULL, "sends", &numSends); + new_sends = clampi(numSends, 0, MAX_SENDS); } if((device->Flags&DEVICE_RUNNING)) @@ -3620,8 +3622,8 @@ ALC_API ALCdevice* ALC_APIENTRY alcOpenDevice(const ALCchar *deviceName) device->SamplesDone = 0; device->SourcesMax = 256; - device->AuxiliaryEffectSlotMax = 4; - device->NumAuxSends = MAX_SENDS; + device->AuxiliaryEffectSlotMax = 64; + device->NumAuxSends = DEFAULT_SENDS; InitUIntMap(&device->BufferMap, ~0); InitUIntMap(&device->EffectMap, ~0); @@ -3732,7 +3734,7 @@ ALC_API ALCdevice* ALC_APIENTRY alcOpenDevice(const ALCchar *deviceName) if(device->SourcesMax == 0) device->SourcesMax = 256; ConfigValueUInt(deviceName, NULL, "slots", &device->AuxiliaryEffectSlotMax); - if(device->AuxiliaryEffectSlotMax == 0) device->AuxiliaryEffectSlotMax = 4; + if(device->AuxiliaryEffectSlotMax == 0) device->AuxiliaryEffectSlotMax = 64; ConfigValueInt(deviceName, NULL, "sends", &device->NumAuxSends); device->NumAuxSends = clampi(device->NumAuxSends, 0, MAX_SENDS); @@ -4107,8 +4109,8 @@ ALC_API ALCdevice* ALC_APIENTRY alcLoopbackOpenDeviceSOFT(const ALCchar *deviceN device->SamplesDone = 0; device->SourcesMax = 256; - device->AuxiliaryEffectSlotMax = 4; - device->NumAuxSends = MAX_SENDS; + device->AuxiliaryEffectSlotMax = 64; + device->NumAuxSends = DEFAULT_SENDS; InitUIntMap(&device->BufferMap, ~0); InitUIntMap(&device->EffectMap, ~0); @@ -4138,7 +4140,7 @@ ALC_API ALCdevice* ALC_APIENTRY alcLoopbackOpenDeviceSOFT(const ALCchar *deviceN if(device->SourcesMax == 0) device->SourcesMax = 256; ConfigValueUInt(NULL, NULL, "slots", &device->AuxiliaryEffectSlotMax); - if(device->AuxiliaryEffectSlotMax == 0) device->AuxiliaryEffectSlotMax = 4; + if(device->AuxiliaryEffectSlotMax == 0) device->AuxiliaryEffectSlotMax = 64; ConfigValueInt(NULL, NULL, "sends", &device->NumAuxSends); device->NumAuxSends = clampi(device->NumAuxSends, 0, MAX_SENDS); -- cgit v1.2.3