mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 08:37:25 -05:00
Resolves issue with NPE in 3/4 rate decoder.
This commit is contained in:
@@ -21,7 +21,7 @@ import io.github.dsheirer.source.ISourceEventProcessor;
|
||||
import io.github.dsheirer.source.SourceEvent;
|
||||
import io.github.dsheirer.source.tuner.TunerEvent.Event;
|
||||
import io.github.dsheirer.source.tuner.manager.ChannelSourceManager;
|
||||
import io.github.dsheirer.source.tuner.manager.HeterodyneChannelSourceManager;
|
||||
import io.github.dsheirer.source.tuner.manager.PolyphaseChannelSourceManager;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@@ -51,8 +51,8 @@ public abstract class Tuner implements ISourceEventProcessor
|
||||
//Register to receive frequency and sample rate change notifications
|
||||
mTunerController.addListener(this::process);
|
||||
|
||||
// mChannelSourceManager = new PolyphaseChannelSourceManager(mTunerController);
|
||||
mChannelSourceManager = new HeterodyneChannelSourceManager(mTunerController);
|
||||
mChannelSourceManager = new PolyphaseChannelSourceManager(mTunerController);
|
||||
// mChannelSourceManager = new HeterodyneChannelSourceManager(mTunerController);
|
||||
|
||||
//Register to receive channel count change notifications
|
||||
mChannelSourceManager.addSourceEventListener(this::process);
|
||||
|
||||
@@ -18,7 +18,7 @@ package io.github.dsheirer.source.tuner.channel;
|
||||
import io.github.dsheirer.dsp.filter.cic.ComplexPrimeCICDecimate;
|
||||
import io.github.dsheirer.dsp.filter.design.FilterDesignException;
|
||||
import io.github.dsheirer.dsp.mixer.IOscillator;
|
||||
import io.github.dsheirer.dsp.mixer.Oscillator;
|
||||
import io.github.dsheirer.dsp.mixer.LowPhaseNoiseOscillator;
|
||||
import io.github.dsheirer.sample.IOverflowListener;
|
||||
import io.github.dsheirer.sample.Listener;
|
||||
import io.github.dsheirer.sample.buffer.OverflowableReusableBufferTransferQueue;
|
||||
@@ -81,7 +81,7 @@ public class CICTunerChannelSource extends TunerChannelSource implements Listene
|
||||
mTunerFrequency = tunerChannel.getFrequency();
|
||||
long frequencyOffset = mTunerFrequency - getTunerChannel().getFrequency();
|
||||
|
||||
mFrequencyCorrectionMixer = new Oscillator(frequencyOffset, sampleRate);
|
||||
mFrequencyCorrectionMixer = new LowPhaseNoiseOscillator(frequencyOffset, sampleRate);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -294,6 +294,10 @@ public abstract class TunerChannelSource extends ComplexSource implements ISourc
|
||||
{
|
||||
mLog.error("Error while sending heartbeat", t);
|
||||
}
|
||||
}
|
||||
|
||||
if(!mStopped)
|
||||
{
|
||||
try
|
||||
{
|
||||
processSamples();
|
||||
|
||||
@@ -393,11 +393,6 @@ public class PolyphaseChannelSourceManager extends ChannelSourceManager
|
||||
@Override
|
||||
public TunerChannelSource getSource(TunerChannel tunerChannel, ChannelSpecification channelSpecification)
|
||||
{
|
||||
if(channelSpecification != null)
|
||||
{
|
||||
throw new IllegalArgumentException("Update polyphase source manager to support channel specifications");
|
||||
}
|
||||
|
||||
if(isTunable(tunerChannel))
|
||||
{
|
||||
//Get a new set of currently tuned channels
|
||||
@@ -422,7 +417,7 @@ public class PolyphaseChannelSourceManager extends ChannelSourceManager
|
||||
}
|
||||
|
||||
//If we're successful to here, allocate the channel
|
||||
return mPolyphaseChannelManager.getChannel(tunerChannel);
|
||||
return mPolyphaseChannelManager.getChannel(tunerChannel, channelSpecification);
|
||||
}
|
||||
catch(SourceException se)
|
||||
{
|
||||
|
||||
@@ -32,7 +32,7 @@ public class TestTunerController extends TunerController
|
||||
|
||||
public static final long MINIMUM_FREQUENCY = 1l;
|
||||
public static final long MAXIMUM_FREQUENCY = 1000000000l;
|
||||
public static final int SAMPLE_RATE = 50000;
|
||||
public static final int SAMPLE_RATE = 10000000;
|
||||
public static final int DC_NOISE_BANDWIDTH = 0;
|
||||
public static final double USABLE_BANDWIDTH_PERCENTAGE = 1.00;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user