Out of memory fixes and updates to the P25 decoder.

Memory Fixes
Decreased the decimation process repeat timing so that it runs smaller work chunks more often
Decreased scheduled thread pool to 2 hot threads
Wrapped all scheduled thread pool runnables in try/catch blocks so that an exception doesn't kill the sample buffer processing thread and cause the buffer to grow unbounded.

P25 updates
Moved TSBK crc checks into the message framer so that message corrections don't occur after the message is constructed.
Added more functionality to the channel state for handling registrations and call events.
This commit is contained in:
dennis.sheirer
2014-12-19 23:59:38 +00:00
parent 63eaef664b
commit ba053457bd
18 changed files with 758 additions and 214 deletions

View File

@@ -682,26 +682,33 @@ public class ProcessingChain implements Listener<Message>
@Override
public void run()
{
List<RealBuffer> sampleBuffers = new ArrayList<RealBuffer>();
mRealQueue.drainTo( sampleBuffers, 4 );
for( RealBuffer sampleBuffer: sampleBuffers )
try
{
if( mDecoder != null )
List<RealBuffer> sampleBuffers = new ArrayList<RealBuffer>();
mRealQueue.drainTo( sampleBuffers, 4 );
for( RealBuffer sampleBuffer: sampleBuffers )
{
float[] samples = sampleBuffer.getSamples();
for( float sample: samples )
if( mDecoder != null )
{
mDecoder.getRealReceiver().receive( sample );
float[] samples = sampleBuffer.getSamples();
for( float sample: samples )
{
mDecoder.getRealReceiver().receive( sample );
}
}
sampleBuffer.dispose();
}
sampleBuffer.dispose();
sampleBuffers.clear();
}
catch( Exception e )
{
mLog.error( "error during processing chain real processor run", e );
}
sampleBuffers.clear();
}
}
@@ -713,25 +720,32 @@ public class ProcessingChain implements Listener<Message>
@Override
public void run()
{
List<List<ComplexSample>> sampleSets =
new ArrayList<List<ComplexSample>>();
mComplexQueue.drainTo( sampleSets, 16 );
for( List<ComplexSample> samples: sampleSets )
try
{
for( ComplexSample sample: samples )
List<List<ComplexSample>> sampleSets =
new ArrayList<List<ComplexSample>>();
mComplexQueue.drainTo( sampleSets, 16 );
for( List<ComplexSample> samples: sampleSets )
{
if( sample != null && mDecoder != null )
for( ComplexSample sample: samples )
{
mDecoder.getComplexReceiver().receive( sample );
if( sample != null && mDecoder != null )
{
mDecoder.getComplexReceiver().receive( sample );
}
}
samples.clear();
}
samples.clear();
sampleSets.clear();
}
catch( Exception e )
{
mLog.error( "error during processing chain complex processor run", e );
}
sampleSets.clear();
}
}