From 440f85e1d1d90a97e91e047e0360ddc5fa16565c Mon Sep 17 00:00:00 2001 From: Robin Davies Date: Thu, 5 Sep 2024 13:31:09 -0400 Subject: [PATCH] pipedald uses service.conf instead of a commandline option. --- docs/ReleaseNotes.md | 19 +++++++++++++++++++ src/AlsaDriver.cpp | 2 +- src/AudioDriver.hpp | 2 +- src/ConfigMain.cpp | 2 +- src/PiPedalAlsa.cpp | 36 ++++++++++++++++++------------------ src/SetWifiConfig.cpp | 8 +------- src/WebServer.cpp | 7 ++++++- todo.txt | 10 ++++++---- 8 files changed, 53 insertions(+), 33 deletions(-) diff --git a/docs/ReleaseNotes.md b/docs/ReleaseNotes.md index d97743c..93b9d2e 100644 --- a/docs/ReleaseNotes.md +++ b/docs/ReleaseNotes.md @@ -1,4 +1,23 @@ # Release Notes +## PiPedal 1.2.49 Release + +The theme for this release: fixing big, embarassing bugs. + +URGENT: PiPedal 1.2.47 fixed a significant and dangerous defect that may cause loss of presets, banks or configuration data if you remove power from your Raspberry Pi within up to five minutes of last saving data instead of performing an orderly shutdown or reboot. Users of PiPedal should upgrade to at least version 1.2.47 immediately, if they have not alread done so. + +In addition, a bug in the Auto Update code prevents PiPedal from seeing PiPedal Release or Beta builds if the most recent build is a Development or Experimental build. If you want to stay in sync with Release or Beta update streams, please install this version right away. + +Bug fixes: +- Unable to configure Wi-Fi direct connections. +- Update checks do not see Release or Beta updates if there is a later Development build. +- Unable to configure audio buffers properly for devices with minBufferSize=256. +- Ongoing improvements to TooB Neural Amp Modeler. + +Known issues: +- TooB Neural Amp Modeler runs 5% slower than Mike Oliphant's Neural Amp Modeler, despite running virtually identical code from Steven Atkins' NeuralAmpModelerCore project. Investigation continues. + + + ## PiPedal 1.2.47 Release This version fixes a significant and dangerous defect that may cause loss of presets, banks or configuration data if you remove power from your Raspberry Pi within up to five minutes of last saving data instead of performing an orderly shutdown or reboot. Users of PiPedal should upgrade immediately. diff --git a/src/AlsaDriver.cpp b/src/AlsaDriver.cpp index 56d257a..682a21b 100644 --- a/src/AlsaDriver.cpp +++ b/src/AlsaDriver.cpp @@ -1315,7 +1315,7 @@ namespace pipedal throw PiPedalStateException(SS("ALSA error:" << snd_strerror(err))); } - std::jthread *audioThread; + std::jthread *audioThread = nullptr; bool audioRunning; bool block = false; diff --git a/src/AudioDriver.hpp b/src/AudioDriver.hpp index 6d8baae..7e051b2 100644 --- a/src/AudioDriver.hpp +++ b/src/AudioDriver.hpp @@ -1,7 +1,7 @@ /* * MIT License * - * Copyright (c) 2022 Robin E. R. Davies +* Copyright (c) 2022 Robin E. R. Davies * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in diff --git a/src/ConfigMain.cpp b/src/ConfigMain.cpp index d330149..e090b30 100644 --- a/src/ConfigMain.cpp +++ b/src/ConfigMain.cpp @@ -951,7 +951,7 @@ void Install(const fs::path &programPrefix, const std::string endpointAddress) } s << (programPrefix / "sbin" / PIPEDALD_SERVICE).string() - << " /etc/pipedal/config /etc/pipedal/react -port " << endpointAddress << " -systemd"; + << " /etc/pipedal/config /etc/pipedal/react -systemd"; map["COMMAND"] = s.str(); } diff --git a/src/PiPedalAlsa.cpp b/src/PiPedalAlsa.cpp index c8ec346..63e200a 100644 --- a/src/PiPedalAlsa.cpp +++ b/src/PiPedalAlsa.cpp @@ -118,7 +118,7 @@ std::vector PiPedalAlsaDevices::GetAlsaDevices() if (err == 0) { unsigned int minRate = 0, maxRate = 0; - snd_pcm_uframes_t minBufferSize, maxBufferSize; + snd_pcm_uframes_t minBufferSize = 0, maxBufferSize = 0; int dir; err = snd_pcm_hw_params_get_rate_min(params, &minRate, &dir); if (err == 0) @@ -143,6 +143,10 @@ std::vector PiPedalAlsaDevices::GetAlsaDevices() info.sampleRates_.push_back(rate); } } + if (minBufferSize < 16) { + minBufferSize = 16; + } + info.minBufferSize_ = (uint32_t)minBufferSize; info.maxBufferSize_ = (uint32_t)maxBufferSize; cacheDevice(info.name_, info); @@ -169,15 +173,14 @@ std::vector PiPedalAlsaDevices::GetAlsaDevices() snd_config_update_free_global(); Lv2Log::debug("GetAlsaDevices --"); - for (auto& device: result) + for (auto &device : result) { Lv2Log::debug(SS(" " << device.name_ << " " << device.longName_ << " " << device.cardId_)); } return result; } - -static std::vector GetAlsaDevices(const char*devname, const char*direction) +static std::vector GetAlsaDevices(const char *devname, const char *direction) { std::vector result; { @@ -206,9 +209,9 @@ static std::vector GetAlsaDevices(const char*devname, const if (desc != nullptr) // skip virtual device { - if (ioid == nullptr || strcmp(ioid,direction) == 0) + if (ioid == nullptr || strcmp(ioid, direction) == 0) { - result.push_back(AlsaMidiDeviceInfo(name,desc)); + result.push_back(AlsaMidiDeviceInfo(name, desc)); } } if (name && strcmp("null", name) != 0) @@ -226,40 +229,37 @@ static std::vector GetAlsaDevices(const char*devname, const return result; } - std::vector pipedal::GetAlsaMidiInputDevices() { - return GetAlsaDevices("rawmidi","Input"); + return GetAlsaDevices("rawmidi", "Input"); } std::vector pipedal::GetAlsaMidiOutputDevices() { - return GetAlsaDevices("rawmidi","Output"); + return GetAlsaDevices("rawmidi", "Output"); } -AlsaMidiDeviceInfo::AlsaMidiDeviceInfo(const char*name, const char*description) -:name_(name) +AlsaMidiDeviceInfo::AlsaMidiDeviceInfo(const char *name, const char *description) + : name_(name) { // extract just the display name from description. // undocumented but e.g.: M2, M2\nM2 Raw Midi const char *p = description; const char *pEnd = p; // undocumented but e.g.: M2, M2\nM2 Raw Midi - while (pEnd != nullptr && *pEnd != 0 - && *pEnd != ',' - && *pEnd != '\n' - ) + while (pEnd != nullptr && *pEnd != 0 && *pEnd != ',' && *pEnd != '\n') { ++pEnd; } if (p != pEnd) { - description_ = std::string(p,pEnd); - } else { + description_ = std::string(p, pEnd); + } + else + { description = name; } } - JSON_MAP_BEGIN(AlsaDeviceInfo) JSON_MAP_REFERENCE(AlsaDeviceInfo, cardId) JSON_MAP_REFERENCE(AlsaDeviceInfo, id) diff --git a/src/SetWifiConfig.cpp b/src/SetWifiConfig.cpp index 04f1d62..9a73245 100644 --- a/src/SetWifiConfig.cpp +++ b/src/SetWifiConfig.cpp @@ -559,11 +559,6 @@ void UninstallP2p() } - WifiDirectConfigSettings wifiDirectConfigSettings; - wifiDirectConfigSettings.Load(); - wifiDirectConfigSettings.enable_ = false; - SetWifiDirectConfig(wifiDirectConfigSettings); - } ::sync(); } @@ -655,7 +650,7 @@ static void ConfigDhcpcdForP2p() } void pipedal::SetWifiDirectConfig(const WifiDirectConfigSettings &settings) { - + settings.Save(); try { char band; @@ -675,7 +670,6 @@ void pipedal::SetWifiDirectConfig(const WifiDirectConfigSettings &settings) else { InstallP2p(settings); - sysExec(SYSTEMCTL_BIN " restart pipedald"); } } catch (const std::exception &e) diff --git a/src/WebServer.cpp b/src/WebServer.cpp index 551d39d..f815102 100644 --- a/src/WebServer.cpp +++ b/src/WebServer.cpp @@ -1252,7 +1252,12 @@ namespace pipedal for (auto it = m_connections.begin(); it != m_connections.end(); ++it) { - m_endpoint.close(*it, websocketpp::close::status::normal, ""); + try { + m_endpoint.close(*it, websocketpp::close::status::normal, ""); + } catch (const std::exception&ignored) + { + + } } } } diff --git a/todo.txt b/todo.txt index b68f42a..044a1e0 100644 --- a/todo.txt +++ b/todo.txt @@ -1,7 +1,9 @@ -- feature: redo ./makepackage so that it runs without sudo. -- Bug: text Cursor hovering over the breadcrumb bar in file property dialog. -- Bug: Turning off wifi-direct sould re-enable NetworkManager. -- ToobML save/restore state. +- Back button after reloads on Android. +- pidedal_nm_p2p2 service not started from web ui. +- pipedal_nm_p2pd connection not visible. +- hdcpcd spurious ipv6 error messages. +- also stopping on startup, even with big buffers. + - make app use the same theme settings as the website.