SimpleFFT example on OSX asserts


#1

Hi, just pulled latest dev, build the SimpleFFT example and asserts at startup:

/** Remaps a value from a source range to a target range. */
template
Type jmap (Type sourceValue, Type sourceRangeMin, Type sourceRangeMax, Type targetRangeMin, Type targetRangeMax)
{
jassert (sourceRangeMax != sourceRangeMin); // mapping from a range of zero will produce NaN!
return targetRangeMin + ((targetRangeMax - targetRangeMin) * (sourceValue - sourceRangeMin)) / (sourceRangeMax - sourceRangeMin);
}


#2

Hmmm can’t seem to reproduce. Can you send a stack trace?


#3

#0 0x00000001000034bf in float juce::jmap(float, float, float, float, float) at /Users/lee/Development/JUCE/examples/SimpleFFTExample/Builds/MacOSX/…/…/…/…/modules/juce_core/maths/juce_MathsFunctions.h:128
#1 0x00000001000032fc in SpectrogramComponent::drawNextLineOfSpectrogram() at /Users/lee/Development/JUCE/examples/SimpleFFTExample/Source/SpectrogramComponent.h:127
#2 0x00000001000024aa in SpectrogramComponent::timerCallback() at /Users/lee/Development/JUCE/examples/SimpleFFTExample/Source/SpectrogramComponent.h:83
#3 0x000000010000264c in non-virtual thunk to SpectrogramComponent::timerCallback() ()
#4 0x00000001002c17be in juce::timer::TimerThread::callTimers() at /Users/lee/Development/JUCE/examples/SimpleFFTExample/Builds/MacOSX/…/…/…/…/modules/juce_events/timers/juce_Timer.cpp:110
#5 0x00000001002c16d6 in juce::timer::TimerThread::CallTimersMessage::messageCallback() at /Users/lee/Development/JUCE/examples/SimpleFFTExample/Builds/MacOSX/…/…/…/…/modules/juce_events/timers/juce_Timer.cpp:178
#6 0x00000001002c54a7 in juce::MessageQueue::deliverNextMessage() at /Users/lee/Development/JUCE/examples/SimpleFFTExample/Builds/MacOSX/…/…/…/…/modules/juce_events/native/juce_osx_MessageQueue.h:81
#7 0x00000001002c53f6 in juce::MessageQueue::runLoopCallback() at /Users/lee/Development/JUCE/examples/SimpleFFTExample/Builds/MacOSX/…/…/…/…/modules/juce_events/native/juce_osx_MessageQueue.h:92
#8 0x00000001002c52c5 in juce::MessageQueue::runLoopSourceCallback(void*) at /Users/lee/Development/JUCE/examples/SimpleFFTExample/Builds/MacOSX/…/…/…/…/modules/juce_events/native/juce_osx_MessageQueue.h:100
#9 0x00007fff97c5d321 in CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION ()
#10 0x00007fff97c3e21d in __CFRunLoopDoSources0 ()
#11 0x00007fff97c3d716 in __CFRunLoopRun ()
#12 0x00007fff97c3d114 in CFRunLoopRunSpecific ()
#13 0x00007fff9719debc in RunCurrentEventLoopInMode ()
#14 0x00007fff9719dcf1 in ReceiveNextEventCommon ()
#15 0x00007fff9719db26 in _BlockUntilNextEventMatchingListInModeWithFilter ()
#16 0x00007fff95736a54 in _DPSNextEvent ()
#17 0x00007fff95eb27ee in -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] ()
#18 0x00007fff9572b3db in -[NSApplication run] ()
#19 0x00000001002b6cd3 in juce::MessageManager::runDispatchLoop() at /Users/lee/Development/JUCE/examples/SimpleFFTExample/Builds/MacOSX/…/…/…/…/modules/juce_events/native/juce_mac_MessageManager.mm:247
#20 0x00000001002b6bc5 in juce::JUCEApplicationBase::main() at /Users/lee/Development/JUCE/examples/SimpleFFTExample/Builds/MacOSX/…/…/…/…/modules/juce_events/messages/juce_ApplicationBase.cpp:260
#21 0x00000001002b69dc in juce::JUCEApplicationBase::main(int, char const**) at /Users/lee/Development/JUCE/examples/SimpleFFTExample/Builds/MacOSX/…/…/…/…/modules/juce_events/messages/juce_ApplicationBase.cpp:238
#22 0x0000000100001413 in main at /Users/lee/Development/JUCE/examples/SimpleFFTExample/Source/Main.cpp:99
#23 0x00007fffad3bd235 in start ()


#4

I guess it’s because there’s no input - but I’m not sure where to set this…


#5

OK. A fix for the assertion is on develop with commit 8433b37. The demo will just use the default input device (however, it expects the default input to have at least two channels). It works with my default input on my mac.

Also, interesting how discourse replaced some of your stacktrace with clock emojis?!? :slight_smile:


#6

good now, thx.

quite appropriate that the clock emojis were on the timer thread