Resolved minor issue with LTR channel state threading conflict. Added additional error handling/logging for R820T tuner startup, possibly related to reading the EEPROM contents on startup.

This commit is contained in:
dennis.sheirer
2014-09-19 12:31:02 +00:00
parent fe8612b68f
commit 5a4fc6690a
2 changed files with 40 additions and 20 deletions

View File

@@ -111,17 +111,7 @@ public class LTRChannelState extends ChannelState
* new call event, so close out the old one. */
if( current != null && !current.addMessage( ltr ) )
{
if( current.isValid() )
{
mCallEventModel.setEnd( current );
}
else
{
mCallEventModel.remove( current );
}
setCallEventModel( null );
current = null;
setState( State.FADE );
}
if( current == null )

View File

@@ -142,7 +142,7 @@ public abstract class RTL2832TunerController extends TunerController
private Descriptor mDescriptor;
public static final int sTWO_TO_22_POWER = 4194304;
public static final SampleRate sDEFAULT_SAMPLE_RATE = SampleRate.RATE_1_200MHZ;
public static final SampleRate sDEFAULT_SAMPLE_RATE = SampleRate.RATE_0_960MHZ;
private SampleRate mSampleRate = sDEFAULT_SAMPLE_RATE;
@@ -208,17 +208,40 @@ public abstract class RTL2832TunerController extends TunerController
try
{
setSampleRate( sDEFAULT_SAMPLE_RATE );
/* Read the contents of the 256-byte EEPROM */
byte[] eeprom = readEEPROM( mUSBDevice, (short)0, 256 );
/* Create the descriptor with the contents from the EEPROM */
mDescriptor = new Descriptor( eeprom );
}
catch( Exception e )
{
throw new SourceException( "RTL2832 Tuner Controller - couldn't "
+ "set default sample rate or read EEPROM descriptor", e );
+ "set default sample rate", e );
}
byte[] eeprom;
try
{
/* Read the contents of the 256-byte EEPROM */
eeprom = readEEPROM( mUSBDevice, (short)0, 256 );
}
catch( Exception e )
{
throw new SourceException( "RTL2832 Tuner Controller - couldn't "
+ "read EEPROM descriptor byte array", e );
}
try
{
mDescriptor = new Descriptor( eeprom );
if( eeprom == null )
{
Log.error( "RTL2832 Tuner Controller - eeprom byte array was "
+ "null - constructed empty descriptor object" );
}
}
catch( Exception e )
{
throw new SourceException( "RTL2832 Tuner Controller - error "
+ "constructing descriptor object from eeprom byte array", e );
}
}
@@ -1705,7 +1728,14 @@ public abstract class RTL2832TunerController extends TunerController
public Descriptor( byte[] data )
{
mData = data;
if( data != null )
{
mData = data;
}
else
{
data = new byte[ 256 ];
}
getLabels();
}