Disk Streaming(DFD) cannot catch CPU in offline bounce


#1

Hi there,

For sampling instruments, DFD/disk streaming is indispensable since the samples are large in size to read entirely into memory.

Here the problem comes. Sometimes in offline bouncing/exporting, the hosts(e.g. cubase, I am debugging in this right now) are rendering super fast, therefore the disk reading thread is not finished reading a portion of the sample when that very portion of the sample is required to be played. Thus ending in crackling voices.

In real time playing and real time bouncing/exporting, this rarely happens (of course).

I currently have no idea how to deal with this issue, any advice could be helpful.

(Though this question is not directly related to juce but this forum has many gurus in audio developing.)

Thanks in advance.


#2

Check bool AudioProcessor::isNonRealtime()
and block the processing until you have enough data to read from in that case


#3

I’d highly recommend looking at the MemoryMappedAudioFormatReader class if you’re streaming from disk - we’ve started using memory-mapping for playback in tracktion and it’s super-fast.


#4

Hi otristan,

Thanks for the tips! I have tried blocking the audio thread yesterday and it really helps.

Hi jules,

I will try that class.


#5

[quote=“otristan”]Check bool AudioProcessor::isNonRealtime()
and block the processing until you have enough data to read from in that case[/quote]

Hi otristan,

I called this method in prepareToPlay(). But in cubase, it always returns false even when the offline export started.
Have you met this before?

thx

EDIT:
just tried to call this method in the process block function(audio) to check it lively, now the isNonRealtime() returns true when offline exporting.


#6

I think you have answered your own question then.
Probably because it’s not available beforehand in VST format.
Now you just have to deal with it.