Browse Source

Pass amount of frames to bridge process call

tags/v1.9.11
falkTX FilipeCSnuk 6 years ago
parent
commit
bdeb87acb7
5 changed files with 12 additions and 3 deletions
  1. +3
    -1
      source/backend/engine/CarlaEngineBridge.cpp
  2. +1
    -0
      source/backend/plugin/CarlaPluginBridge.cpp
  3. +1
    -0
      source/backend/plugin/CarlaPluginJack.cpp
  4. +5
    -0
      source/libjack/libjack.cpp
  5. +2
    -2
      source/utils/CarlaBridgeDefines.hpp

+ 3
- 1
source/backend/engine/CarlaEngineBridge.cpp View File

@@ -1190,6 +1190,8 @@ protected:
}

case kPluginBridgeRtClientProcess: {
const uint32_t frames(fShmRtClientControl.readUInt());

CARLA_SAFE_ASSERT_BREAK(fShmAudioPool.data != nullptr);

if (plugin != nullptr && plugin->isEnabled() && plugin->tryLock(fIsOffline))
@@ -1240,7 +1242,7 @@ protected:
}

plugin->initBuffers();
plugin->process(audioIn, audioOut, cvIn, cvOut, pData->bufferSize);
plugin->process(audioIn, audioOut, cvIn, cvOut, frames);
plugin->unlock();
}



+ 1
- 0
source/backend/plugin/CarlaPluginBridge.cpp View File

@@ -1494,6 +1494,7 @@ public:

{
fShmRtClientControl.writeOpcode(kPluginBridgeRtClientProcess);
fShmRtClientControl.writeUInt(frames);
fShmRtClientControl.commitWrite();
}



+ 1
- 0
source/backend/plugin/CarlaPluginJack.cpp View File

@@ -967,6 +967,7 @@ public:

{
fShmRtClientControl.writeOpcode(kPluginBridgeRtClientProcess);
fShmRtClientControl.writeUInt(frames);
fShmRtClientControl.commitWrite();
}



+ 5
- 0
source/libjack/libjack.cpp View File

@@ -571,6 +571,11 @@ bool CarlaJackAppClient::handleRtData()
}

case kPluginBridgeRtClientProcess: {
const uint32_t frames(fShmRtClientControl.readUInt());
CARLA_SAFE_ASSERT_UINT2_BREAK(frames == fServer.bufferSize, frames, fServer.bufferSize);

// TODO tell client of xrun in case buffersize does not match

// FIXME - lock if offline
const CarlaMutexTryLocker cmtl(fRealtimeThreadMutex);



+ 2
- 2
source/utils/CarlaBridgeDefines.hpp View File

@@ -20,7 +20,7 @@

#include "CarlaRingBuffer.hpp"

#define CARLA_PLUGIN_BRIDGE_API_VERSION 4
#define CARLA_PLUGIN_BRIDGE_API_VERSION 5

// -------------------------------------------------------------------------------------------------------------------

@@ -37,7 +37,7 @@ enum PluginBridgeRtClientOpcode {
kPluginBridgeRtClientControlEventAllSoundOff, // uint/frame, byte/chan
kPluginBridgeRtClientControlEventAllNotesOff, // uint/frame, byte/chan
kPluginBridgeRtClientMidiEvent, // uint/frame, byte/port, byte/size, byte[]/data
kPluginBridgeRtClientProcess,
kPluginBridgeRtClientProcess, // uint/frames
kPluginBridgeRtClientQuit
};



Loading…
Cancel
Save