# HG changeset patch # User Chris Cannam # Date 1567614662 -3600 # Node ID e3db163e3f50d4c2da8e32f470d0c0eff81d6758 # Parent f19711ab707488418e353ef74615846414163c52 Some debug tweaks diff -r f19711ab7074 -r e3db163e3f50 transform/FeatureExtractionModelTransformer.cpp --- a/transform/FeatureExtractionModelTransformer.cpp Thu Aug 15 18:18:03 2019 +0100 +++ b/transform/FeatureExtractionModelTransformer.cpp Wed Sep 04 17:31:02 2019 +0100 @@ -639,10 +639,12 @@ Transform primaryTransform = m_transforms[0]; + ModelId inputId = getInputModel(); + bool ready = false; while (!ready && !m_abandoned) { { // scope so as to release input shared_ptr before sleeping - auto input = ModelById::getAs(getInputModel()); + auto input = ModelById::getAs(inputId); if (!input) { abandon(); return; @@ -650,13 +652,17 @@ ready = input->isReady(); } if (!ready) { - SVDEBUG << "FeatureExtractionModelTransformer::run: Waiting for input model to be ready..." << endl; + SVDEBUG << "FeatureExtractionModelTransformer::run: Waiting for input model " + << inputId << " to be ready..." << endl; usleep(500000); } } if (m_abandoned) return; - ModelId inputId = getInputModel(); +#ifdef DEBUG_FEATURE_EXTRACTION_TRANSFORMER_RUN + SVDEBUG << "FeatureExtractionModelTransformer::run: Input model " + << inputId << " is ready, going ahead" << endl; +#endif sv_samplerate_t sampleRate; int channelCount; @@ -696,6 +702,9 @@ std::vector fftModels; if (frequencyDomain) { +#ifdef DEBUG_FEATURE_EXTRACTION_TRANSFORMER_RUN + SVDEBUG << "FeatureExtractionModelTransformer::run: Input is frequency-domain" << endl; +#endif for (int ch = 0; ch < channelCount; ++ch) { FFTModel *model = new FFTModel (inputId, @@ -711,10 +720,14 @@ setCompletion(j, 100); } //!!! need a better way to handle this -- previously we were using a QMessageBox but that isn't an appropriate thing to do here either + SVDEBUG << "FeatureExtractionModelTransformer::run: Failed to create FFT model for input model " << inputId << ": " << err << endl; throw AllocationFailed("Failed to create the FFT model for this feature extraction model transformer: error is: " + err); } fftModels.push_back(model); } +#ifdef DEBUG_FEATURE_EXTRACTION_TRANSFORMER_RUN + SVDEBUG << "FeatureExtractionModelTransformer::run: Created FFT model(s) for frequency-domain input" << endl; +#endif } RealTime contextStartRT = primaryTransform.getStartTime();