Browse Source

Skip discovery checks when using discovery APIs, reduce timeout

Signed-off-by: falkTX <falktx@falktx.com>
pull/1658/merge
falkTX 2 years ago
parent
commit
78cff15740
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
3 changed files with 19 additions and 11 deletions
  1. +6
    -4
      source/backend/utils/PluginDiscovery.cpp
  2. +9
    -4
      source/utils/CarlaPipeUtils.cpp
  3. +4
    -3
      source/utils/CarlaPipeUtils.hpp

+ 6
- 4
source/backend/utils/PluginDiscovery.cpp View File

@@ -458,6 +458,8 @@ private:
const CarlaScopedEnvVar sev2("WINEPREFIX", winePrefix.toRawUTF8());
#endif

const CarlaScopedEnvVar sev3("CARLA_DISCOVERY_NO_PROCESSING_CHECKS", "1");

if (fBinaries.empty())
{
if (fBinaryType == CB::BINARY_NATIVE)
@@ -522,10 +524,10 @@ private:

#ifndef CARLA_OS_WIN
if (helperTool.isNotEmpty())
startPipeServer(helperTool.toRawUTF8(), fDiscoveryTool, getPluginTypeAsString(fPluginType), ":all");
startPipeServer(helperTool.toRawUTF8(), fDiscoveryTool, getPluginTypeAsString(fPluginType), ":all", -1, 2000);
else
#endif
startPipeServer(fDiscoveryTool, getPluginTypeAsString(fPluginType), ":all");
startPipeServer(fDiscoveryTool, getPluginTypeAsString(fPluginType), ":all", -1, 2000);
}
else
{
@@ -548,10 +550,10 @@ private:

#ifndef CARLA_OS_WIN
if (helperTool.isNotEmpty())
startPipeServer(helperTool.toRawUTF8(), fDiscoveryTool, getPluginTypeAsString(fPluginType), filename.toRawUTF8());
startPipeServer(helperTool.toRawUTF8(), fDiscoveryTool, getPluginTypeAsString(fPluginType), filename.toRawUTF8(), -1, 2000);
else
#endif
startPipeServer(fDiscoveryTool, getPluginTypeAsString(fPluginType), filename.toRawUTF8());
startPipeServer(fDiscoveryTool, getPluginTypeAsString(fPluginType), filename.toRawUTF8(), -1, 2000);
}
}



+ 9
- 4
source/utils/CarlaPipeUtils.cpp View File

@@ -1497,7 +1497,8 @@ bool CarlaPipeServer::startPipeServer(const char* const helperTool,
const char* const filename,
const char* const arg1,
const char* const arg2,
const int size) noexcept
const int size,
int timeOutMilliseconds) noexcept
{
CARLA_SAFE_ASSERT_RETURN(pData->pipeRecv == INVALID_PIPE_VALUE, false);
CARLA_SAFE_ASSERT_RETURN(pData->pipeSend == INVALID_PIPE_VALUE, false);
@@ -1512,6 +1513,9 @@ bool CarlaPipeServer::startPipeServer(const char* const helperTool,
CARLA_SAFE_ASSERT_RETURN(arg2 != nullptr, false);
carla_debug("CarlaPipeServer::startPipeServer(\"%s\", \"%s\", \"%s\")", filename, arg1, arg2);

if (timeOutMilliseconds < 0)
timeOutMilliseconds = 10 * 1000;

char pipeRecvServerStr[100+1];
char pipeSendServerStr[100+1];
char pipeRecvClientStr[100+1];
@@ -1714,7 +1718,7 @@ bool CarlaPipeServer::startPipeServer(const char* const helperTool,
void* const process = nullptr;
#endif

if (waitForClientFirstMessage(pipeRecvClient, ovRecv, process, 10*1000 /* 10 secs */))
if (waitForClientFirstMessage(pipeRecvClient, ovRecv, process, timeOutMilliseconds))
{
pData->pipeRecv = pipeRecvClient;
pData->pipeSend = pipeSendClient;
@@ -1768,9 +1772,10 @@ bool CarlaPipeServer::startPipeServer(const char* const helperTool,
bool CarlaPipeServer::startPipeServer(const char* const filename,
const char* const arg1,
const char* const arg2,
const int size) noexcept
const int size,
const int timeOutMilliseconds) noexcept
{
return startPipeServer(nullptr, filename, arg1, arg2, size);
return startPipeServer(nullptr, filename, arg1, arg2, size, timeOutMilliseconds);
}

void CarlaPipeServer::stopPipeServer(const uint32_t timeOutMilliseconds) noexcept


+ 4
- 3
source/utils/CarlaPipeUtils.hpp View File

@@ -285,14 +285,15 @@ public:
* Start the pipe server using @a filename with 2 arguments.
* @see fail()
*/
bool startPipeServer(const char* helperTool,
const char* filename, const char* arg1, const char* arg2, int size = -1) noexcept;
bool startPipeServer(const char* helperTool, const char* filename, const char* arg1, const char* arg2,
int size = -1, int timeOutMilliseconds = -1) noexcept;

/*!
* Start the pipe server using @a filename with 2 arguments.
* @see fail()
*/
bool startPipeServer(const char* filename, const char* arg1, const char* arg2, int size = -1) noexcept;
bool startPipeServer(const char* filename, const char* arg1, const char* arg2,
int size = -1, int timeOutMilliseconds = -1) noexcept;

/*!
* Stop the pipe server.


Loading…
Cancel
Save