Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

16 TGs on RPi 4 #557

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions src/minidexed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was this doing? Can it just be commented out?

#endif
m_GetChunkTimer ("GetChunk",
1000000U * pConfig->GetChunkSize ()/2 / pConfig->GetSampleRate ()),
Expand Down Expand Up @@ -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};
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was this doing? Can it just be commented out?

//m_nActiveTGsLog2 = Log2[nActiveTGs];
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was this doing? Can it just be commented out?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know why any of this code was in there - I can only assume it was relevant at some point and then no longer required. It certainly isn't used at the moment anywhere I could find, hence taking it out.

Kevin

#endif

m_UI.ParameterChanged ();
Expand Down Expand Up @@ -1018,7 +1018,7 @@ void CMiniDexed::ProcessSound (void)
// Audio signal path after tone generators starts here
//

assert (CConfig::ToneGenerators == 8);
assert (CConfig::ToneGenerators == 16);
Copy link
Owner Author

@probonopd probonopd Nov 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't we need an ifdef to check for 16 on RPi 4 and later only?


uint8_t indexL=0, indexR=1;

Expand Down
2 changes: 1 addition & 1 deletion src/minidexed.h
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ class CMiniDexed
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];
Expand Down
8 changes: 8 additions & 0 deletions src/uimenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
Loading