This commit is contained in:
Robin E.R. Davies
2026-05-06 14:37:17 -04:00
parent d217af035d
commit 44db94a955
3 changed files with 28 additions and 9 deletions
Executable
+2
View File
@@ -0,0 +1,2 @@
#!/bin/bash
build/src/pipedald "/etc/pipedal/config" "/etc/pipedal/react" "-port" "0.0.0.0:8080"
+25 -8
View File
@@ -83,7 +83,7 @@ static bool isJackServiceRunning()
return std::filesystem::exists(path); return std::filesystem::exists(path);
} }
#if 0 && ENABLE_BACKTRACE #if 0 && ENABLE_BACKTRACE
// void segvHandler(int sig) // void segvHandler(int sig)
// { // {
// void *array[10]; // void *array[10];
@@ -107,12 +107,15 @@ static bool isJackServiceRunning()
#endif #endif
#define ENABLE_SEGV_DEBUG 0 #define ENABLE_SEGV_DEBUG 0
#define ENABLE_SIGXCPU_DEBUG 1
#if ENABLE_SEGV_DEBUG #if ENABLE_SEGV_DEBUG
void debug_segvHandler(int sig) void debug_segvHandler(int sig)
{ {
// Print out all the frames to stderr // Print out all the frames to stderr
const char *message = "Error: SEGV signal received.\n"; const char *message = "Error: SEGV signal received.\n";
auto _ = write(STDERR_FILENO, message, strlen(message)); auto _ = write(STDERR_FILENO, message, strlen(message));
flush(STD_ERR_FILENO);
_exit(EXIT_FAILURE); _exit(EXIT_FAILURE);
} }
@@ -126,6 +129,17 @@ static void EnableDebugSevHandler()
#endif #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) static bool TryGetLogLevel(const std::string &strLogLevel, LogLevel *result)
{ {
@@ -153,7 +167,6 @@ static bool TryGetLogLevel(const std::string &strLogLevel, LogLevel *result)
return false; return false;
} }
int main(int argc, char *argv[]) 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"; const std::filesystem::path webTempDirectory = "/var/pipedal/web_temp";
if (!webTempDirectory.empty()) if (!webTempDirectory.empty())
{ {
try { try
{
std::filesystem::remove_all(webTempDirectory); //// user must belong to the pipedald grop when debugging. std::filesystem::remove_all(webTempDirectory); //// user must belong to the pipedald grop when debugging.
std::filesystem::create_directories(webTempDirectory); std::filesystem::create_directories(webTempDirectory);
} }
catch (const std::exception e) { catch (const std::exception e)
{
Lv2Log::warning(e.what()); 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. return EXIT_SUCCESS; // indiate to systemd that we don't want a restart.
} }
try try
{ {
{ {
@@ -340,7 +354,7 @@ int main(int argc, char *argv[])
sigset_t sigSet; sigset_t sigSet;
int s; int s;
sigemptyset(&sigSet); sigemptyset(&sigSet);
sigaddset(&sigSet, SIGINT); sigaddset(&sigSet, SIGINT);
sigaddset(&sigSet, SIGTERM); sigaddset(&sigSet, SIGTERM);
sigaddset(&sigSet, SIGUSR1); sigaddset(&sigSet, SIGUSR1);
@@ -354,16 +368,19 @@ int main(int argc, char *argv[])
// Clear any pending signals before waiting // Clear any pending signals before waiting
struct timespec timeout = {0, 0}; struct timespec timeout = {0, 0};
while (sigtimedwait(&sigSet, NULL, &timeout) > 0) { while (sigtimedwait(&sigSet, NULL, &timeout) > 0)
{
// Consume any pending signals // Consume any pending signals
} }
#if ENABLE_SEGV_DEBUG #if ENABLE_SEGV_DEBUG
EnableDebugSevHandler(); EnableDebugSevHandler();
#endif #endif
#if ENABLE_SIGXCPU_DEBUG
EnableSigXcpuHandler();
#endif
PiPedalModel model; PiPedalModel model;
model.SetNetworkChangedListener( model.SetNetworkChangedListener(
[&server]() mutable [&server]() mutable
{ {
+1 -1
View File
@@ -202,7 +202,7 @@ void profilePlugin(const ProfileOptions &profileOptions)
reader.read(&bankFile); reader.read(&bankFile);
if (bankFile.presets().size() != 1) 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()); Pedalboard pedalboard = (bankFile.presets()[0]->preset());
model.SetPedalboard(-1, pedalboard); model.SetPedalboard(-1, pedalboard);