mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 16:47:31 -05:00
Adds airspy USB tuner support and updates the spectral display
component. -Airspy supported with 10 and 2.5 MSps sample rates. Additional decimation may be added later. -Spectral display updated to include smoothing and filtering options. Note: the decimated output of a tuner channel from the airspy is 48,076.9 samples per second, versus the normal 48 kHz decimated rate. This is 1.0015 times the normal rate and doesn't appear to impact the decoders or audio processing. Therefore, no fractional resampling has been added.
This commit is contained in:
@@ -20,7 +20,6 @@ package source.tuner.hackrf;
|
||||
import java.util.concurrent.RejectedExecutionException;
|
||||
|
||||
import javax.swing.JPanel;
|
||||
import javax.usb.UsbException;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -35,7 +34,6 @@ import source.tuner.TunerClass;
|
||||
import source.tuner.TunerConfiguration;
|
||||
import source.tuner.TunerType;
|
||||
import source.tuner.hackrf.HackRFTunerController.BoardID;
|
||||
import source.tuner.hackrf.HackRFTunerController.Serial;
|
||||
import controller.ResourceManager;
|
||||
import controller.ThreadPoolManager;
|
||||
|
||||
@@ -53,23 +51,6 @@ public class HackRFTuner extends Tuner
|
||||
|
||||
/* Register for frequency/sample rate changes */
|
||||
mController.addListener( this );
|
||||
|
||||
try
|
||||
{
|
||||
BoardID id = mController.getBoardID();
|
||||
super.setName( id.getLabel() );
|
||||
|
||||
String version = mController.getFirmwareVersion();
|
||||
mLog.info( "HackRF firmware: " + version );
|
||||
|
||||
Serial serial = mController.getSerial();
|
||||
mLog.info( "HackRF Part ID: " + serial.getPartID() );
|
||||
mLog.info( "HackRF Serial Number: " + serial.getSerialNumber() );
|
||||
}
|
||||
catch( UsbException e )
|
||||
{
|
||||
mLog.error( "couldn't read HackRF board id", e );
|
||||
}
|
||||
}
|
||||
|
||||
public void dispose()
|
||||
@@ -112,6 +93,12 @@ public class HackRFTuner extends Tuner
|
||||
return mController.getSampleRate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getSampleSize()
|
||||
{
|
||||
return 8.0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getFrequency() throws SourceException
|
||||
{
|
||||
|
||||
@@ -142,8 +142,21 @@ public class HackRFTunerController extends TunerController
|
||||
{
|
||||
mDeviceHandle = new DeviceHandle();
|
||||
|
||||
LibUsb.open( mDevice, mDeviceHandle );
|
||||
int result = LibUsb.open( mDevice, mDeviceHandle );
|
||||
|
||||
if( result != 0 )
|
||||
{
|
||||
if( result == LibUsb.ERROR_ACCESS )
|
||||
{
|
||||
mLog.error( "Unable to access HackRF - insufficient permissions. "
|
||||
+ "If you are running a Linux OS, have you installed the "
|
||||
+ "hackRF rules file in \\etc\\udev\\rules.d ??" );
|
||||
}
|
||||
|
||||
throw new SourceException( "Couldn't open hackrf device - " +
|
||||
LibUsb.strError( result ) );
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
claimInterface();
|
||||
@@ -298,7 +311,7 @@ public class HackRFTunerController extends TunerController
|
||||
*/
|
||||
public long getTunedFrequency() throws SourceException
|
||||
{
|
||||
return 0;
|
||||
return mFrequencyController.getTunedFrequency();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user