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.
This commit is contained in:
parent
864d5387dd
commit
d3cc867bd4
28
Alc/ALc.c
28
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);
|
||||
|
@ -1,7 +1,8 @@
|
||||
#ifndef _AL_SOURCE_H_
|
||||
#define _AL_SOURCE_H_
|
||||
|
||||
#define MAX_SENDS 4
|
||||
#define MAX_SENDS 16
|
||||
#define DEFAULT_SENDS 2
|
||||
|
||||
#include "alMain.h"
|
||||
#include "alu.h"
|
||||
|
@ -173,12 +173,12 @@
|
||||
# can use a non-negligible amount of CPU time if an effect is set on it even
|
||||
# if no sources are feeding it, so this may help when apps use more than the
|
||||
# system can handle.
|
||||
#slots = 4
|
||||
#slots = 64
|
||||
|
||||
## sends:
|
||||
# Sets the number of auxiliary sends per source. When not specified (default),
|
||||
# it allows the app to request how many it wants. The maximum value currently
|
||||
# possible is 4.
|
||||
# possible is 16.
|
||||
#sends =
|
||||
|
||||
## volume-adjust:
|
||||
|
@ -295,9 +295,9 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
|
||||
mSourceCountValidator = new QIntValidator(0, 4096, this);
|
||||
ui->srcCountLineEdit->setValidator(mSourceCountValidator);
|
||||
mEffectSlotValidator = new QIntValidator(0, 16, this);
|
||||
mEffectSlotValidator = new QIntValidator(0, 64, this);
|
||||
ui->effectSlotLineEdit->setValidator(mEffectSlotValidator);
|
||||
mSourceSendValidator = new QIntValidator(0, 4, this);
|
||||
mSourceSendValidator = new QIntValidator(0, 16, this);
|
||||
ui->srcSendLineEdit->setValidator(mSourceSendValidator);
|
||||
mSampleRateValidator = new QIntValidator(8000, 192000, this);
|
||||
ui->sampleRateCombo->lineEdit()->setValidator(mSampleRateValidator);
|
||||
|
@ -1649,13 +1649,13 @@ may help when apps use more than the system can handle.</string>
|
||||
<string/>
|
||||
</property>
|
||||
<property name="maxLength">
|
||||
<number>1</number>
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="frame">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>4</string>
|
||||
<string>64</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_8">
|
||||
@ -1686,7 +1686,7 @@ may help when apps use more than the system can handle.</string>
|
||||
<property name="toolTip">
|
||||
<string>The number of auxiliary sends per source. When not specified,
|
||||
it allows the app to request how many it wants. The maximum
|
||||
value currently possible is 4.</string>
|
||||
value currently possible is 16.</string>
|
||||
</property>
|
||||
<property name="maxLength">
|
||||
<number>1</number>
|
||||
|
Loading…
x
Reference in New Issue
Block a user