mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 16:47:31 -05:00
Resolves #405
Adds 500 ms delay to initial registering for samples from all tuners to feed the spectral display/waterfall. The existing approach of immediately registering for samples was causing the airspy tuner to lockup aperiodically. Investigation via debugger didn't show any application thread locks ... usb master processor was continuing to service libusb timeouts. Unable to debug internal airspy processes. Adding the delay to startup seems to be a usable solution.
This commit is contained in:
@@ -71,6 +71,10 @@ public class TunerManager
|
||||
*/
|
||||
public void dispose()
|
||||
{
|
||||
mLog.info("Shutting down LibUsb timeout processor ...");
|
||||
|
||||
LIBUSB_TRANSFER_PROCESSOR.shutdown();
|
||||
|
||||
mLog.info("Shutting down LibUsb ...");
|
||||
try
|
||||
{
|
||||
|
||||
@@ -27,6 +27,7 @@ import io.github.dsheirer.source.tuner.channel.TunerChannelSource;
|
||||
import io.github.dsheirer.source.tuner.configuration.TunerConfiguration;
|
||||
import io.github.dsheirer.source.tuner.configuration.TunerConfigurationModel;
|
||||
import io.github.dsheirer.spectrum.SpectralDisplayPanel;
|
||||
import io.github.dsheirer.util.ThreadPool;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@@ -35,6 +36,7 @@ import java.text.DecimalFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public class TunerModel extends AbstractTableModel implements Listener<TunerEvent>
|
||||
{
|
||||
@@ -202,7 +204,17 @@ public class TunerModel extends AbstractTableModel implements Listener<TunerEven
|
||||
|
||||
if(enabled && mTuners.size() > 0)
|
||||
{
|
||||
broadcast(new TunerEvent(mTuners.get(0), Event.REQUEST_MAIN_SPECTRAL_DISPLAY));
|
||||
//Hack: the airspy tuner would lockup aperiodically and refuse to produce
|
||||
//transfer buffers ... delaying registering for buffers for 500 ms seems
|
||||
//to allow the airspy to stabilize before we start asking for samples.
|
||||
ThreadPool.SCHEDULED.schedule(new Runnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
broadcast(new TunerEvent(mTuners.get(0), Event.REQUEST_MAIN_SPECTRAL_DISPLAY));
|
||||
}
|
||||
}, 500, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -81,7 +81,7 @@ public class USBMasterProcessor
|
||||
if(mRunning.compareAndSet(false, true))
|
||||
{
|
||||
//Set periodicity to an odd multiple to avoid contention with transfer buffer receivers
|
||||
mProcessorFuture = ThreadPool.SCHEDULED.scheduleAtFixedRate(mProcessor, 0L, 5L, TimeUnit.MILLISECONDS);
|
||||
mProcessorFuture = ThreadPool.SCHEDULED.scheduleAtFixedRate(mProcessor, 0L, 9L, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,6 +100,14 @@ public class USBMasterProcessor
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Stops the libusb timeout processor and prepares for shutdown.
|
||||
*/
|
||||
public void shutdown()
|
||||
{
|
||||
stop();
|
||||
}
|
||||
|
||||
/**
|
||||
* Runnable to invoke LibUSB timeout handler. All downstream completed transfer processing will occur on this
|
||||
* thread instance.
|
||||
|
||||
Reference in New Issue
Block a user