From fcc5e813a4279384b6d2fe8ae70a875adc5bc6ac Mon Sep 17 00:00:00 2001 From: Robin Davies Date: Sun, 11 Aug 2024 16:17:29 -0400 Subject: [PATCH] opening slow audio devices on boot --- CMakeLists.txt | 4 ++-- react/public/var/config.json | 2 +- react/src/PluginOutputControl.tsx | 2 +- src/AlsaDriver.cpp | 2 +- src/ConfigMain.cpp | 17 ++++++++++------- src/JackServerSettings.hpp | 2 +- src/main.cpp | 8 +++++++- todo.txt | 8 ++++---- 8 files changed, 27 insertions(+), 18 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fca0ed8..4bf9f02 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,10 +1,10 @@ cmake_minimum_required(VERSION 3.16.0) project(pipedal - VERSION 1.2.34 + VERSION 1.2.35 DESCRIPTION "PiPedal Guitar Effect Pedal For Raspberry Pi" HOMEPAGE_URL "https://rerdavies.github.io/pipedal" ) -set (DISPLAY_VERSION "v1.2.34beta2") +set (DISPLAY_VERSION "v1.2.35beta2") set (CMAKE_INSTALL_PREFIX "/usr/") diff --git a/react/public/var/config.json b/react/public/var/config.json index bf8d4ce..80d344a 100644 --- a/react/public/var/config.json +++ b/react/public/var/config.json @@ -1,5 +1,5 @@ { - "socket_server_port": 8080, + "socket_server_port": 80, "socket_server_address": "*", "debug": true, "max_upload_size": 1048576, diff --git a/react/src/PluginOutputControl.tsx b/react/src/PluginOutputControl.tsx index 3b5e8ab..2ed160a 100644 --- a/react/src/PluginOutputControl.tsx +++ b/react/src/PluginOutputControl.tsx @@ -353,7 +353,7 @@ const PluginOutputControl =
-
+
diff --git a/src/AlsaDriver.cpp b/src/AlsaDriver.cpp index f08e725..09a7966 100644 --- a/src/AlsaDriver.cpp +++ b/src/AlsaDriver.cpp @@ -1961,7 +1961,7 @@ namespace pipedal for (int retry = 0; retry < 15; ++retry) { err = snd_pcm_open(&playbackHandle, alsaDeviceName.c_str(), SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK); - if (err == -EBUSY) + if (err < 0) // field report of a device that is present, but won't immediately open. { sleep(1); continue; diff --git a/src/ConfigMain.cpp b/src/ConfigMain.cpp index cf4fd77..13c1d7f 100644 --- a/src/ConfigMain.cpp +++ b/src/ConfigMain.cpp @@ -603,12 +603,19 @@ void SetVarPermissions( using namespace std::filesystem; try { if (fs::exists(path)) { - + chown(path.c_str(),uid,gid); if (fs::is_directory(path)) { fs::permissions(path, directoryPermissions, fs::perm_options::replace); for (const auto& entry : fs::recursive_directory_iterator(path)) { + cout << " " << entry.path() << endl; + + if (chown(entry.path().c_str(),uid,gid) != 0) + { + std::cout << "Error: failed to set ownership of file " << entry.path() << std::endl; + } + try { - if (fs::is_directory(entry)) + if (fs::is_directory(entry.path())) { fs::permissions(entry.path(), directoryPermissions, fs::perm_options::replace); } else { @@ -618,15 +625,11 @@ void SetVarPermissions( { std::cout << "Error: failed to set permissions on file " << entry.path() << std::endl; } - if (chown(path.c_str(),uid,gid) != 0) - { - std::cout << "Error: failed to set ownership of file " << entry.path() << std::endl; - } } } else { fs::permissions(path,filePermissions, fs::perm_options::replace); - chown(path.c_str(),uid,gid); + } } else { std::cout << "Error: Path does not exist: " << path << std::endl; diff --git a/src/JackServerSettings.hpp b/src/JackServerSettings.hpp index 50ee49c..6d27282 100644 --- a/src/JackServerSettings.hpp +++ b/src/JackServerSettings.hpp @@ -34,7 +34,7 @@ namespace pipedal std::string alsaDevice_; uint64_t sampleRate_ = 0; uint32_t bufferSize_ = 64; - uint32_t numberOfBuffers_ = 2; + uint32_t numberOfBuffers_ = 3; public: JackServerSettings(); diff --git a/src/main.cpp b/src/main.cpp index 2f9b44e..9b865fa 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -701,7 +701,10 @@ int main(int argc, char *argv[]) // wait up to 15 seconds for the midi device to come online. auto devices = model.GetAlsaDevices(); bool found = false; - if (!HasAlsaDevice(devices, serverSettings.GetAlsaInputDevice())) + if (HasAlsaDevice(devices, serverSettings.GetAlsaInputDevice())) + { + Lv2Log::info(SS("Found ALSA device " << serverSettings.GetAlsaInputDevice() << ".")); + } else { for (int i = 0; i < 5; ++i) { @@ -727,6 +730,9 @@ int main(int argc, char *argv[]) Lv2Log::info(SS("ALSA device " << serverSettings.GetAlsaInputDevice() << " not found.")); } } + } else { + Lv2Log::info("No ALSA device selected."); + } // pre-cache device info before we let audio services run. diff --git a/todo.txt b/todo.txt index 385b5a9..10d2d63 100644 --- a/todo.txt +++ b/todo.txt @@ -1,8 +1,8 @@ -x group EQ congrols on Toob Preamp. +- chmod not working +- x TooB NAM: dbVu telltale is zero0. +- x TooB NAM: bass [] mid trebble. -x Bug with FLAC libs in debian package. --x check default presets. --x check Toob power stage is installed. -X check FLAC decode. +- X check FLAC decode. - make app use the same theme settings as the website. - BUG: gcs when we have an animated output control - Shutdown/reboot midi bindings