diff options
author | Chris Robinson <[email protected]> | 2020-02-26 09:53:06 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2020-02-26 09:53:06 -0800 |
commit | b42d241da58eb4dbe949c8b6ba5c0fd80ee021a9 (patch) | |
tree | 7c7fae5033177dfbe82008324772e5b4ae220245 | |
parent | eb49290dabd5ca317337663ff7e8b25a311b83a8 (diff) |
Use real-time priority by default
-rw-r--r-- | alc/alc.cpp | 11 | ||||
-rw-r--r-- | alsoftrc.sample | 6 |
2 files changed, 6 insertions, 11 deletions
diff --git a/alc/alc.cpp b/alc/alc.cpp index 59739e04..42d586c7 100644 --- a/alc/alc.cpp +++ b/alc/alc.cpp @@ -1062,13 +1062,8 @@ void alc_initconfig(void) } FillCPUCaps(capfilter); -#ifdef _WIN32 -#define DEF_MIXER_PRIO 1 -#else -#define DEF_MIXER_PRIO 0 -#endif - RTPrioLevel = ConfigValueInt(nullptr, nullptr, "rt-prio").value_or(DEF_MIXER_PRIO); -#undef DEF_MIXER_PRIO + if(auto priopt = ConfigValueInt(nullptr, nullptr, "rt-prio")) + RTPrioLevel = *priopt; aluInit(); aluInitMixer(); @@ -1244,7 +1239,7 @@ void ProbeCaptureDeviceList() } // namespace /* Mixing thread piority level */ -ALint RTPrioLevel; +ALint RTPrioLevel{1}; FILE *gLogFile{stderr}; #ifdef _DEBUG diff --git a/alsoftrc.sample b/alsoftrc.sample index 2a95c7a9..42ebd7ca 100644 --- a/alsoftrc.sample +++ b/alsoftrc.sample @@ -186,9 +186,9 @@ # (eg. PortAudio) as they already control the priority of the mixing thread. # 0 and negative values will disable it. Note that this may constitute a # security risk since a real-time priority thread can indefinitely block -# normal-priority threads if it fails to wait. As such, the default is -# disabled. -#rt-prio = 0 +# normal-priority threads if it fails to wait. Disable this if it turns out to +# be a problem. +#rt-prio = 1 ## sources: # Sets the maximum number of allocatable sources. Lower values may help for |