From 179aa8f406ebd8dfe2fdefbd33f348b9593e23c3 Mon Sep 17 00:00:00 2001 From: Kevin <68612569+diyelectromusic@users.noreply.github.com> Date: Thu, 20 Jul 2023 11:45:52 -0700 Subject: [PATCH] Prototype for running 16 TGs on a RPi 4 --- src/config.h | 6 ++++++ src/minidexed.cpp | 10 +++++----- src/minidexed.h | 2 +- src/uimenu.cpp | 8 ++++++++ 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/src/config.h b/src/config.h index a316be8..c602ca8 100644 --- a/src/config.h +++ b/src/config.h @@ -33,11 +33,17 @@ class CConfig // Configuration for MiniDexed public: #ifndef ARM_ALLOW_MULTI_CORE static const unsigned ToneGenerators = 1; +#else +#if RASPPI == 4 + static const unsigned TGsCore1 = 4; // process 4 TGs on core 1 + static const unsigned TGsCore23 = 6; // process 6 TGs on core 2 and 3 each + static const unsigned ToneGenerators = TGsCore1 + 2*TGsCore23; #else static const unsigned TGsCore1 = 2; // process 2 TGs on core 1 static const unsigned TGsCore23 = 3; // process 3 TGs on core 2 and 3 each static const unsigned ToneGenerators = TGsCore1 + 2*TGsCore23; #endif +#endif #if RASPPI == 1 static const unsigned MaxNotes = 8; // polyphony diff --git a/src/minidexed.cpp b/src/minidexed.cpp index fafeff8..e42a998 100644 --- a/src/minidexed.cpp +++ b/src/minidexed.cpp @@ -45,7 +45,7 @@ CMiniDexed::CMiniDexed (CConfig *pConfig, CInterruptSystem *pInterrupt, m_pSoundDevice (0), m_bChannelsSwapped (pConfig->GetChannelsSwapped ()), #ifdef ARM_ALLOW_MULTI_CORE - m_nActiveTGsLog2 (0), + //m_nActiveTGsLog2 (0), #endif m_GetChunkTimer ("GetChunk", 1000000U * pConfig->GetChunkSize ()/2 / pConfig->GetSampleRate ()), @@ -567,9 +567,9 @@ void CMiniDexed::SetMIDIChannel (uint8_t uchChannel, unsigned nTG) } } - assert (nActiveTGs <= 8); - static const unsigned Log2[] = {0, 0, 1, 2, 2, 3, 3, 3, 3}; - m_nActiveTGsLog2 = Log2[nActiveTGs]; + //assert (nActiveTGs <= 16); + //static const unsigned Log2[] = {0, 0, 1, 2, 2, 3, 3, 3, 3}; + //m_nActiveTGsLog2 = Log2[nActiveTGs]; #endif m_UI.ParameterChanged (); @@ -1018,7 +1018,7 @@ void CMiniDexed::ProcessSound (void) // Audio signal path after tone generators starts here // - assert (CConfig::ToneGenerators == 8); + assert (CConfig::ToneGenerators == 16); uint8_t indexL=0, indexR=1; diff --git a/src/minidexed.h b/src/minidexed.h index e49e7de..a8938e1 100644 --- a/src/minidexed.h +++ b/src/minidexed.h @@ -282,7 +282,7 @@ private: unsigned m_nQueueSizeFrames; #ifdef ARM_ALLOW_MULTI_CORE - unsigned m_nActiveTGsLog2; + //unsigned m_nActiveTGsLog2; volatile TCoreStatus m_CoreStatus[CORES]; volatile unsigned m_nFramesToProcess; float32_t m_OutputLevel[CConfig::ToneGenerators][CConfig::MaxChunkSize]; diff --git a/src/uimenu.cpp b/src/uimenu.cpp index 360a5b0..aaccf32 100644 --- a/src/uimenu.cpp +++ b/src/uimenu.cpp @@ -50,6 +50,14 @@ const CUIMenu::TMenuItem CUIMenu::s_MainMenu[] = {"TG6", MenuHandler, s_TGMenu, 5}, {"TG7", MenuHandler, s_TGMenu, 6}, {"TG8", MenuHandler, s_TGMenu, 7}, + {"TG9", MenuHandler, s_TGMenu, 8}, + {"TG10", MenuHandler, s_TGMenu, 9}, + {"TG11", MenuHandler, s_TGMenu, 10}, + {"TG12", MenuHandler, s_TGMenu, 11}, + {"TG13", MenuHandler, s_TGMenu, 12}, + {"TG14", MenuHandler, s_TGMenu, 13}, + {"TG15", MenuHandler, s_TGMenu, 14}, + {"TG16", MenuHandler, s_TGMenu, 15}, #endif {"Effects", MenuHandler, s_EffectsMenu}, {"Performance", MenuHandler, s_PerformanceMenu},