Closed srcejon closed 1 month ago
AM/NFM demods both delete the baseband object when stop() is called, the BFM Demod doesn't.
DSPEngine::instance()->getAudioDeviceManager()->removeAudioSink(m_sink.getAudioFifo());
is in the destructor for each of these basebands. This isn't therefore getting called for the BFM demod when stop() is called.
Actually, it seems the AM and NFM demods do have a problem, it just manifests in a different way. If you just start one device, without having started the other, then wait a few seconds, you'll eventually get AudioFIFO::write overflows.
The problem with the AM & NFM demods, appears to relate to the fact they call start() from within the Demod's constructor. If I remove those calls to start(), so start() is only called when the device starts, the problem appears to go away.
So it looks like the problem will occur if we have an audio sink connected to the AudioDeviceManager, when the corresponding device isn't running.
If on Windows we have two SDRs each with a BFM Demod, it seems stopping the second can interfere with playback of the first. To recreate:
Problem doesn't seem to happen if we stop first device rather than the second. Doesn't seem to be a problem on Linux. Doesn't seem to be a problem for NFM or AM Demods.