#652 USB Tuner Error Handling Enhancements (#653)

-Separates USB timeout event processing to a dedicated thread
-Updates USB transfer buffer processor to better detect errors and auto-restart on error (max 3 times)
-Updates Tuner to add an error state and SourceManager to not select tuners with an error state
-Updates ChannelProcessingManager to auto-shutdown channels sourced from tuners set with error state
-Improves logging of USB related errors.
This commit is contained in:
Denny Sheirer
2020-02-09 05:40:04 -05:00
committed by GitHub
parent 2e942113c6
commit 2d71f5173a
22 changed files with 799 additions and 357 deletions

View File

@@ -1,7 +1,7 @@
/*
*
* * ******************************************************************************
* * Copyright (C) 2014-2019 Dennis Sheirer
* * Copyright (C) 2014-2020 Dennis Sheirer
* *
* * This program is free software: you can redistribute it and/or modify
* * it under the terms of the GNU General Public License as published by
@@ -115,14 +115,12 @@ public class ProcessingChain implements Listener<ChannelEvent>
private Broadcaster<SourceEvent> mSourceEventBroadcaster = new Broadcaster<>();
private Broadcaster<IMessage> mMessageBroadcaster = new Broadcaster<>();
private Broadcaster<SquelchStateEvent> mSquelchStateEventBroadcaster = new Broadcaster<>();
private AtomicBoolean mRunning = new AtomicBoolean();
protected Source mSource;
private List<Module> mModules = new ArrayList<>();
private DecodeEventModel mDecodeEventModel;
private AbstractChannelState mChannelState;
private MessageActivityModel mMessageActivityModel;
protected Source mSource;
/**
* Creates a processing chain for managing a set of modules
@@ -208,6 +206,14 @@ public class ProcessingChain implements Listener<ChannelEvent>
return mSource != null;
}
/**
* Indicates if this chain's source is the same as the source argument
*/
public boolean hasSource(Source source)
{
return mSource != null && mSource.equals(source);
}
/**
* Applies a sample source to this processing chain. Processing won't
* start until the start() method is invoked.
@@ -800,6 +806,14 @@ public class ProcessingChain implements Listener<ChannelEvent>
}
}
/**
* Adds a listener to receive source events from this processing chain
*/
public void addSourceEventListener(Listener<SourceEvent> listener)
{
mSourceEventBroadcaster.addListener(listener);
}
/**
* Removes the listener from receiving decoded messages from all decoders.
*/