From 44db94a955d74ccfa9af7a8ae461f9a38f817435 Mon Sep 17 00:00:00 2001 From: "Robin E.R. Davies" Date: Wed, 6 May 2026 14:37:17 -0400 Subject: [PATCH] Sync --- run.sh | 2 ++ src/main.cpp | 33 +++++++++++++++++++++++++-------- src/profilePluginMain.cpp | 2 +- 3 files changed, 28 insertions(+), 9 deletions(-) create mode 100755 run.sh diff --git a/run.sh b/run.sh new file mode 100755 index 0000000..5c83330 --- /dev/null +++ b/run.sh @@ -0,0 +1,2 @@ +#!/bin/bash +build/src/pipedald "/etc/pipedal/config" "/etc/pipedal/react" "-port" "0.0.0.0:8080" diff --git a/src/main.cpp b/src/main.cpp index feb8481..7f264cd 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -83,7 +83,7 @@ static bool isJackServiceRunning() return std::filesystem::exists(path); } -#if 0 && ENABLE_BACKTRACE +#if 0 && ENABLE_BACKTRACE // void segvHandler(int sig) // { // void *array[10]; @@ -107,12 +107,15 @@ static bool isJackServiceRunning() #endif #define ENABLE_SEGV_DEBUG 0 +#define ENABLE_SIGXCPU_DEBUG 1 + #if ENABLE_SEGV_DEBUG void debug_segvHandler(int sig) { // Print out all the frames to stderr const char *message = "Error: SEGV signal received.\n"; auto _ = write(STDERR_FILENO, message, strlen(message)); + flush(STD_ERR_FILENO); _exit(EXIT_FAILURE); } @@ -126,6 +129,17 @@ static void EnableDebugSevHandler() #endif +#if ENABLE_SIGXCPU_DEBUG + +void debug_XSigXcpuHandler(int sig) +{ +} + +static void EnableSigXcpuHandler() +{ + signal(SIGXCPU, debug_XSigXcpuHandler); +} +#endif static bool TryGetLogLevel(const std::string &strLogLevel, LogLevel *result) { @@ -153,7 +167,6 @@ static bool TryGetLogLevel(const std::string &strLogLevel, LogLevel *result) return false; } - int main(int argc, char *argv[]) { @@ -277,11 +290,13 @@ int main(int argc, char *argv[]) const std::filesystem::path webTempDirectory = "/var/pipedal/web_temp"; if (!webTempDirectory.empty()) { - try { + try + { std::filesystem::remove_all(webTempDirectory); //// user must belong to the pipedald grop when debugging. std::filesystem::create_directories(webTempDirectory); } - catch (const std::exception e) { + catch (const std::exception e) + { Lv2Log::warning(e.what()); } } @@ -317,7 +332,6 @@ int main(int argc, char *argv[]) return EXIT_SUCCESS; // indiate to systemd that we don't want a restart. } - try { { @@ -340,7 +354,7 @@ int main(int argc, char *argv[]) sigset_t sigSet; int s; sigemptyset(&sigSet); - + sigaddset(&sigSet, SIGINT); sigaddset(&sigSet, SIGTERM); sigaddset(&sigSet, SIGUSR1); @@ -354,16 +368,19 @@ int main(int argc, char *argv[]) // Clear any pending signals before waiting struct timespec timeout = {0, 0}; - while (sigtimedwait(&sigSet, NULL, &timeout) > 0) { + while (sigtimedwait(&sigSet, NULL, &timeout) > 0) + { // Consume any pending signals } #if ENABLE_SEGV_DEBUG EnableDebugSevHandler(); #endif +#if ENABLE_SIGXCPU_DEBUG + EnableSigXcpuHandler(); +#endif PiPedalModel model; - model.SetNetworkChangedListener( [&server]() mutable { diff --git a/src/profilePluginMain.cpp b/src/profilePluginMain.cpp index 1a86944..215db9d 100644 --- a/src/profilePluginMain.cpp +++ b/src/profilePluginMain.cpp @@ -202,7 +202,7 @@ void profilePlugin(const ProfileOptions &profileOptions) reader.read(&bankFile); if (bankFile.presets().size() != 1) { - throw new std::runtime_error(SS("Invalid preset file. Expection one preset, but " << bankFile.presets().size() << " presets were found.")); + throw new std::runtime_error(SS("Invalid preset file. Expecting one preset, but " << bankFile.presets().size() << " presets were found.")); } Pedalboard pedalboard = (bankFile.presets()[0]->preset()); model.SetPedalboard(-1, pedalboard);