Browse Source

Test quick trick to always load custom libjack on jack apps start

tags/1.9.8
falkTX 7 years ago
parent
commit
fa6cd00b63
3 changed files with 20 additions and 3 deletions
  1. +1
    -1
      source/backend/plugin/CarlaPluginDSSI.cpp
  2. +10
    -2
      source/backend/plugin/CarlaPluginJack.cpp
  3. +9
    -0
      source/interposer/interposer-x11.cpp

+ 1
- 1
source/backend/plugin/CarlaPluginDSSI.cpp View File

@@ -162,7 +162,7 @@ public:
{ {
std::snprintf(winIdStr, STR_MAX, P_UINTPTR, winId); std::snprintf(winIdStr, STR_MAX, P_UINTPTR, winId);
ldPreloadValue = (CarlaString(kEngine->getOptions().binaryDir) ldPreloadValue = (CarlaString(kEngine->getOptions().binaryDir)
+ CARLA_OS_SEP_STR "libcarla_interposer-x11.so");
+ "/libcarla_interposer-x11.so");
} }
else else
{ {


+ 10
- 2
source/backend/plugin/CarlaPluginJack.cpp View File

@@ -119,14 +119,22 @@ protected:
CarlaString libjackdir(options.binaryDir); CarlaString libjackdir(options.binaryDir);
libjackdir += "/jack"; libjackdir += "/jack";


CarlaString ldpreload;

if (options.frontendWinId != 0)
{
ldpreload = (CarlaString(options.binaryDir)
+ "/libcarla_interposer-x11.so");
}

const ScopedEngineEnvironmentLocker _seel(kEngine); const ScopedEngineEnvironmentLocker _seel(kEngine);


const ScopedEnvVar sev1("LD_PRELOAD", nullptr);
const ScopedEnvVar sev2("LD_LIBRARY_PATH", libjackdir.buffer()); const ScopedEnvVar sev2("LD_LIBRARY_PATH", libjackdir.buffer());
const ScopedEnvVar sev1("LD_PRELOAD", ldpreload.isNotEmpty() ? ldpreload.buffer() : nullptr);


carla_setenv("CARLA_FRONTEND_WIN_ID", strBuf); carla_setenv("CARLA_FRONTEND_WIN_ID", strBuf);
carla_setenv("CARLA_SHM_IDS", fShmIds.buffer());
carla_setenv("CARLA_LIBJACK_SETUP", fNumPorts.buffer()); carla_setenv("CARLA_LIBJACK_SETUP", fNumPorts.buffer());
carla_setenv("CARLA_SHM_IDS", fShmIds.buffer());


started = fProcess->start(arguments); started = fProcess->start(arguments);
} }


+ 9
- 0
source/interposer/interposer-x11.cpp View File

@@ -63,6 +63,15 @@ int XMapWindow(Display* display, Window w)
if (++sMapWindowCounter != 1) if (++sMapWindowCounter != 1)
break; break;


static bool libjackopen = false;

if (! libjackopen && std::getenv("CARLA_LIBJACK_SETUP") != nullptr)
{
libjackopen = true;
dlopen("libjack.so.0", RTLD_NOW|RTLD_LOCAL);
carla_stdout("------------------------------- libjack opened");
}

if (const char* const winIdStr = std::getenv("CARLA_ENGINE_OPTION_FRONTEND_WIN_ID")) if (const char* const winIdStr = std::getenv("CARLA_ENGINE_OPTION_FRONTEND_WIN_ID"))
{ {
CARLA_SAFE_ASSERT_BREAK(winIdStr[0] != '\0'); CARLA_SAFE_ASSERT_BREAK(winIdStr[0] != '\0');


Loading…
Cancel
Save