Skip to content

Commit 6378ebb

Browse files
committed
0.32.3
1 parent dd33ab0 commit 6378ebb

56 files changed

Lines changed: 1863 additions & 1306 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,4 @@
2828

2929
!/lib
3030
!.vscode
31+
.vscode/settings.json

buildspec.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,6 @@
4747
"uuids": {
4848
"windowsApp": "ad885c58-5ca9-44de-8f4f-1c12676626a9"
4949
},
50-
"version": "0.32.2",
50+
"version": "0.32.3",
5151
"website": "https://www.atkaudio.com"
5252
}

linux-cross-compile.sh

100644100755
Lines changed: 42 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,23 @@ echo "Container architecture: $(uname -m)"
4242
# Configure environment
4343
export DEBIAN_FRONTEND=noninteractive
4444

45+
repair_dpkg_state() {
46+
if [ -d /var/lib/dpkg ] && [ -n "$(ls -A /var/lib/dpkg/updates 2>/dev/null)" ]; then
47+
echo "Detected interrupted dpkg state; repairing"
48+
fi
49+
50+
dpkg --configure -a || true
51+
apt-get -f install -y || true
52+
}
53+
54+
safe_apt_install() {
55+
repair_dpkg_state
56+
apt-get install -y --no-install-recommends "$@"
57+
}
58+
4559
# Install base packages
4660
apt-get update
47-
apt-get install -y --no-install-recommends git software-properties-common
61+
safe_apt_install git software-properties-common
4862
git config --global --add safe.directory /workspace
4963

5064
# Configure multi-arch for cross-compilation
@@ -97,7 +111,7 @@ OBS_DEPS=$(apply_arch_suffix "${OBS_DEPS[@]}")
97111
QT6_DEPS=$(apply_arch_suffix "${QT6_DEPS[@]}")
98112

99113
# Install build dependencies
100-
apt-get install -y --no-install-recommends ${BUILD_DEPS_BASE}
114+
safe_apt_install ${BUILD_DEPS_BASE}
101115

102116
# Install target architecture libraries
103117
if [ "${CROSS_COMPILE}" = "true" ]; then
@@ -117,15 +131,29 @@ Pin: release *
117131
Pin-Priority: -1
118132
EOF
119133

120-
apt-get install -y --no-install-recommends ${JUCE_DEPS} ${OBS_DEPS} ${QT6_DEPS}
121-
apt-get install -y --no-install-recommends ${QT6_TOOLS[@]} # x86_64 moc/uic/rcc
134+
safe_apt_install ${JUCE_DEPS} ${OBS_DEPS} ${QT6_DEPS}
135+
safe_apt_install ${QT6_TOOLS[@]} # x86_64 moc/uic/rcc
122136
else
123-
apt-get install -y --no-install-recommends ${JUCE_DEPS} ${OBS_DEPS} ${QT6_DEPS}
137+
safe_apt_install ${JUCE_DEPS} ${OBS_DEPS} ${QT6_DEPS}
124138
fi
125139

126140
# Configure CMake
127141
BUILD_CONFIG="${BUILD_CONFIG:-Release}"
128-
CMAKE_FLAGS="-B build_${TARGET_ARCH} -G Ninja -DCMAKE_BUILD_TYPE=${BUILD_CONFIG}"
142+
BUILD_DIR="build_${TARGET_ARCH}"
143+
144+
if [ -f "${BUILD_DIR}/CMakeCache.txt" ]; then
145+
CACHEFILE_DIR=$(sed -n 's/^CMAKE_CACHEFILE_DIR:INTERNAL=//p' "${BUILD_DIR}/CMakeCache.txt")
146+
CACHE_HOME_DIR=$(sed -n 's/^CMAKE_HOME_DIRECTORY:INTERNAL=//p' "${BUILD_DIR}/CMakeCache.txt")
147+
CURRENT_BUILD_DIR="$(pwd)/${BUILD_DIR}"
148+
CURRENT_SOURCE_DIR="$(pwd)"
149+
150+
if [ "${CACHEFILE_DIR}" != "${CURRENT_BUILD_DIR}" ] || [ "${CACHE_HOME_DIR}" != "${CURRENT_SOURCE_DIR}" ]; then
151+
echo "Removing stale ${BUILD_DIR} because it was configured for a different workspace path"
152+
rm -rf "${BUILD_DIR}"
153+
fi
154+
fi
155+
156+
CMAKE_FLAGS="-B ${BUILD_DIR} -G Ninja -DCMAKE_BUILD_TYPE=${BUILD_CONFIG}"
129157
CMAKE_FLAGS="${CMAKE_FLAGS} -DCMAKE_INSTALL_PREFIX=/usr"
130158

131159
# Cross-compilation configuration
@@ -176,12 +204,17 @@ fi
176204

177205
# Build
178206
cmake ${CMAKE_FLAGS}
179-
cmake --build build_${TARGET_ARCH} --config ${BUILD_CONFIG} --parallel
207+
cmake --build ${BUILD_DIR} --config ${BUILD_CONFIG} --parallel
180208

181209
# Verify and strip (only strip for Release builds, keep debug symbols for RelWithDebInfo)
182-
echo "Built binary: $(file build_${TARGET_ARCH}/${BUILD_CONFIG}/*.so || file build_${TARGET_ARCH}/obs-plugins/64bit/*.so || echo 'Not found')"
210+
BUILT_BINARY=$(find "${BUILD_DIR}" -name '*.so' | head -n 1)
211+
if [ -n "${BUILT_BINARY}" ]; then
212+
echo "Built binary: $(file "${BUILT_BINARY}")"
213+
else
214+
echo "Built binary: Not found"
215+
fi
183216
if [ "${CROSS_COMPILE}" = "true" ] && [ "${BUILD_CONFIG}" = "Release" ]; then
184-
find build_${TARGET_ARCH} -name '*.so' -exec ${CROSS_TRIPLE}-strip --strip-debug {} \; 2>/dev/null || true
217+
find ${BUILD_DIR} -name '*.so' -exec ${CROSS_TRIPLE}-strip --strip-debug {} \; 2>/dev/null || true
185218
fi
186219

187220

src/CMakeLists.txt

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@
22
file(GLOB_RECURSE OBS_PLUGIN_SOURCES CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp")
33
list(FILTER OBS_PLUGIN_SOURCES EXCLUDE REGEX [[.*/scanner/.*]])
44

5-
target_sources(
6-
${PROJECT_NAME}
7-
PRIVATE
8-
${OBS_PLUGIN_SOURCES}
9-
)
5+
target_sources(${PROJECT_NAME} PRIVATE ${OBS_PLUGIN_SOURCES})
106

117
target_include_directories(
128
${PROJECT_NAME}
@@ -26,8 +22,9 @@ FetchContent_Declare(
2622
juce
2723
EXCLUDE_FROM_ALL
2824
GIT_REPOSITORY https://github.com/juce-framework/JUCE.git
29-
GIT_TAG 8.0.12
30-
PATCH_COMMAND ${CMAKE_COMMAND} -P "${CMAKE_SOURCE_DIR}/cmake/patches/apply-juce-patches.cmake"
25+
GIT_TAG 8.0.13
26+
PATCH_COMMAND
27+
${CMAKE_COMMAND} -P "${CMAKE_SOURCE_DIR}/cmake/patches/apply-juce-patches.cmake"
3128
)
3229
FetchContent_MakeAvailable(juce)
3330

@@ -53,15 +50,19 @@ target_compile_definitions(
5350
JUCE_USE_CURL=1
5451
JUCE_WEB_BROWSER=0
5552
JUCE_MODAL_LOOPS_PERMITTED=1
53+
$<$<OR:$<BOOL:$ENV{CI}>,$<BOOL:$ENV{GITHUB_ACTIONS}>>:ATKAUDIO_CI_BUILD=1>
5654
$<$<AND:$<CONFIG:RelWithDebInfo>,$<OR:$<BOOL:$ENV{CI}>,$<BOOL:$ENV{GITHUB_ACTIONS}>>>:JUCE_DISABLE_ASSERTIONS>
5755
)
5856

5957
set_target_properties(
6058
${PROJECT_NAME}
6159
PROPERTIES
62-
JUCE_NEEDS_WEB_BROWSER FALSE
63-
JUCE_NEEDS_CURL TRUE
64-
JUCE_IS_PLUGIN TRUE
60+
JUCE_NEEDS_WEB_BROWSER
61+
FALSE
62+
JUCE_NEEDS_CURL
63+
TRUE
64+
JUCE_IS_PLUGIN
65+
TRUE
6566
)
6667

6768
if(UNIX AND NOT APPLE)
@@ -76,7 +77,13 @@ endif()
7677
if(MSVC)
7778
# This target does not use C++ modules. Disabling MSVC's module scan avoids
7879
# spurious `*.module.json` warnings when multiple sources share a basename.
79-
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_SCAN_FOR_MODULES OFF)
80+
set_property(
81+
TARGET
82+
${PROJECT_NAME}
83+
PROPERTY
84+
CXX_SCAN_FOR_MODULES
85+
OFF
86+
)
8087

8188
target_compile_options(
8289
${PROJECT_NAME}
@@ -100,8 +107,17 @@ if(NOT WIN32)
100107
endif()
101108

102109
if(WIN32)
103-
file(TO_CMAKE_PATH "${CMAKE_INSTALL_PREFIX}" _sanitized_prefix)
104-
string(REGEX REPLACE "/$" "" _sanitized_prefix "${_sanitized_prefix}")
110+
file(
111+
TO_CMAKE_PATH
112+
"${CMAKE_INSTALL_PREFIX}"
113+
_sanitized_prefix
114+
)
115+
string(
116+
REGEX REPLACE "/$"
117+
""
118+
_sanitized_prefix
119+
"${_sanitized_prefix}"
120+
)
105121
set(CMAKE_INSTALL_PREFIX "${_sanitized_prefix}" CACHE PATH "Sanitized install prefix" FORCE)
106122
endif()
107123

src/core/atkaudio.cpp

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include "core/atkaudio/atkaudio.h"
22

33
#include <atkaudio/AudioProcessorGraphMT/RealtimeThreadPool.h>
4+
#include <atkaudio/Logging.h>
45
#include <atkaudio/LookAndFeel.h>
56
#include <atkaudio/ModuleInfrastructure/AudioServer/AudioServer.h>
67
#include <atkaudio/ModuleInfrastructure/MidiServer/MidiServer.h>
@@ -54,10 +55,12 @@ juce::File atk::getSettingsFile(const juce::String& name)
5455

5556
bool atk::create()
5657
{
58+
atk::logging::info("LIFECYCLE", "atk::create begin");
59+
5760
auto& lifecycle = atk::ObsJucePluginFormatLifecycle::getInstance();
5861
if (!lifecycle.initialize())
5962
{
60-
DBG("create: failed to initialize OBS JUCE format lifecycle");
63+
atk::logging::error("LIFECYCLE", "atk::create failed to initialize OBS JUCE lifecycle");
6164
return false;
6265
}
6366

@@ -83,6 +86,8 @@ bool atk::create()
8386
if (auto* threadPool = atk::RealtimeThreadPool::getInstance())
8487
threadPool->initialize();
8588

89+
atk::logging::info("LIFECYCLE", "atk::create completed");
90+
8691
return true;
8792
}
8893

@@ -96,10 +101,12 @@ bool atk::startMessagePump(QObject* qtParent)
96101
auto& lifecycle = atk::ObsJucePluginFormatLifecycle::getInstance();
97102
if (!lifecycle.startMessagePump(qtParent))
98103
{
99-
DBG("startMessagePump: failed to start OBS JUCE format message pump");
104+
atk::logging::error("LIFECYCLE", "atk::startMessagePump failed");
100105
return false;
101106
}
102107

108+
atk::logging::info("LIFECYCLE", "atk::startMessagePump completed");
109+
103110
return true;
104111
}
105112

@@ -115,6 +122,8 @@ bool atk::isShuttingDown()
115122

116123
void atk::destroy()
117124
{
125+
atk::logging::info("LIFECYCLE", "atk::destroy begin");
126+
118127
auto& lifecycle = atk::ObsJucePluginFormatLifecycle::getInstance();
119128

120129
if (auto* midiServer = atk::MidiServer::getInstance())
@@ -136,6 +145,8 @@ void atk::destroy()
136145
}
137146

138147
lifecycle.shutdown();
148+
149+
atk::logging::info("LIFECYCLE", "atk::destroy completed");
139150
}
140151

141152
void atk::update()
@@ -156,7 +167,7 @@ void* atk::getQtMainWindowHandle()
156167
QWidget* mainQWidget = (QWidget*)obs_frontend_get_main_window();
157168
if (!mainQWidget)
158169
{
159-
DBG("getQtMainWindowHandle: obs_frontend_get_main_window() returned null");
170+
atk::logging::warning("UI", "getQtMainWindowHandle: obs_frontend_get_main_window returned null");
160171
return nullptr;
161172
}
162173

@@ -174,12 +185,11 @@ void* atk::getQtMainWindowHandle()
174185
if (nativeHandle)
175186
{
176187
g_qtMainWindowHandle = nativeHandle;
177-
DBG("getQtMainWindowHandle: Extracted native handle on first access");
178-
DBG(" Native handle: " + juce::String::toHexString((juce::pointer_sized_int)nativeHandle));
188+
atk::logging::debug("UI", "getQtMainWindowHandle: extracted native handle");
179189
}
180190
else
181191
{
182-
DBG("getQtMainWindowHandle: Failed to extract native handle");
192+
atk::logging::warning("UI", "getQtMainWindowHandle: failed to extract native handle");
183193
}
184194

185195
// Apply OBS theme colors to JUCE
@@ -191,7 +201,7 @@ void* atk::getQtMainWindowHandle()
191201
auto fgColour = juce::Colour(fgColor.red(), fgColor.green(), fgColor.blue());
192202
atk::LookAndFeel::applyColorsToInstance(bgColour, fgColour);
193203

194-
DBG("getQtMainWindowHandle: Applied OBS theme colors");
204+
atk::logging::debug("UI", "getQtMainWindowHandle: applied OBS theme colors");
195205
#endif
196206
}
197207

@@ -216,5 +226,5 @@ void atk::applyColors(uint8_t bgR, uint8_t bgG, uint8_t bgB, uint8_t fgR, uint8_
216226

217227
void atk::logMessage(const juce::String& message)
218228
{
219-
DBG(message);
229+
atk::logging::info("ATK", message);
220230
}

src/core/atkaudio/AudioProcessorGraphMT/AudioProcessorGraphMT.cpp

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "AudioProcessorGraphMT.h"
22

3+
#include <atkaudio/Logging.h>
34
#include "SubgraphExtractor.h"
45
#include "RealtimeThreadPool.h"
56
#include "DependencyTaskGraph.h"
@@ -156,15 +157,13 @@ class Connections
156157
+ String((int)c.destination.nodeID.uid)
157158
+ "."
158159
+ String(c.destination.channelIndex);
159-
DBG(msg);
160-
Logger::writeToLog(msg);
160+
atk::logging::debug("AudioProcessorGraphMT::Connections", msg);
161161
#endif
162162

163163
if (!canConnect(n, c))
164164
{
165165
#ifdef ATK_DEBUG
166-
DBG(" canConnect returned FALSE");
167-
Logger::writeToLog(" canConnect returned FALSE");
166+
atk::logging::warning("AudioProcessorGraphMT::Connections", "rejected illegal graph connection");
168167
#endif
169168
return false;
170169
}
@@ -173,8 +172,7 @@ class Connections
173172

174173
#ifdef ATK_DEBUG
175174
String countMsg = " Connection added. Total connections: " + String(getConnections().size());
176-
DBG(countMsg);
177-
Logger::writeToLog(countMsg);
175+
atk::logging::debug("AudioProcessorGraphMT::Connections", countMsg);
178176
#endif
179177
jassert(isConnected(c));
180178
return true;
@@ -3134,17 +3132,7 @@ class ParallelRenderSequence
31343132
}
31353133

31363134
if (currentLatencySum != chain->latencySum)
3137-
{
3138-
#ifdef ATK_DEBUG
3139-
DBG("[PARALLEL] Latency changed in subgraph "
3140-
<< i
3141-
<< ": expected "
3142-
<< chain->latencySum
3143-
<< ", current "
3144-
<< currentLatencySum);
3145-
#endif
31463135
return true;
3147-
}
31483136
}
31493137
return false;
31503138
}
@@ -3730,11 +3718,6 @@ void AudioProcessorGraphMT::setStateInformation(const void*, int)
37303718

37313719
void AudioProcessorGraphMT::processBlock(AudioBuffer<float>& audio, MidiBuffer& midi)
37323720
{
3733-
#ifdef ATK_DEBUG
3734-
if (!midi.isEmpty())
3735-
DBG("[AudioProcessorGraphMT::processBlock] Received MIDI: " << midi.getNumEvents() << " events");
3736-
#endif
3737-
37383721
return pimpl->processBlock(audio, midi, getPlayHead());
37393722
}
37403723

@@ -4401,7 +4384,6 @@ class AudioProcessorGraphTests final : public UnitTest
44014384

44024385
// No test here, but older versions of the graph would take forever to complete building
44034386
// this graph, so we just want to make sure that we finish the test without timing out.
4404-
DBG("render sequence built in " + String(duration) + " ms");
44054387
}
44064388
}
44074389

src/core/atkaudio/AudioProcessorGraphMT/RealtimeThreadPool.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#pragma once
44

55
#include "../CpuInfo.h"
6+
#include <atkaudio/Logging.h>
67
#include "../RealtimeThread.h"
78
#include "DependencyTaskGraph.h"
89

@@ -155,8 +156,14 @@ class RealtimeThreadPool
155156
auto physicalCores = getPhysicalCoreMapping();
156157
const int numPhysical = static_cast<int>(physicalCores.size());
157158

158-
DBG("[RealtimeThreadPool] Initializing with " << numWorkers << " workers");
159-
159+
atk::logging::info(
160+
"RealtimeThreadPool::initialize",
161+
juce::String::formatted(
162+
"initializing worker pool with %d workers (physical cores: %d)",
163+
numWorkers,
164+
numPhysical
165+
)
166+
);
160167
for (int i = 0; i < numWorkers; ++i)
161168
{
162169
int coreId = -1;

0 commit comments

Comments
 (0)