mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-17 02:57:35 -05:00
Resolves #164 - USB time out while processing buffer transfers. Decreases periodicity of processing the LibUsb timeout handler from 9 milliseconds to 5 milliseconds to reduce chance that buffers are not being serviced in time.
This commit is contained in:
@@ -84,7 +84,7 @@ public class LibUSBTransferProcessor
|
|||||||
if(mRunning.compareAndSet(false, true))
|
if(mRunning.compareAndSet(false, true))
|
||||||
{
|
{
|
||||||
//Set periodicity to an odd multiple to avoid contention with transfer buffer receivers
|
//Set periodicity to an odd multiple to avoid contention with transfer buffer receivers
|
||||||
mProcessorFuture = ThreadPool.SCHEDULED.scheduleAtFixedRate(mProcessor, 0L, 9L, TimeUnit.MILLISECONDS);
|
mProcessorFuture = ThreadPool.SCHEDULED.scheduleAtFixedRate(mProcessor, 0L, 5L, TimeUnit.MILLISECONDS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -300,6 +300,7 @@ public class USBTransferProcessor implements TransferCallback
|
|||||||
{
|
{
|
||||||
case LibUsb.TRANSFER_COMPLETED:
|
case LibUsb.TRANSFER_COMPLETED:
|
||||||
case LibUsb.TRANSFER_STALL:
|
case LibUsb.TRANSFER_STALL:
|
||||||
|
case LibUsb.TRANSFER_TIMED_OUT:
|
||||||
if(transfer.actualLength() > 0)
|
if(transfer.actualLength() > 0)
|
||||||
{
|
{
|
||||||
ByteBuffer buffer = transfer.buffer();
|
ByteBuffer buffer = transfer.buffer();
|
||||||
|
|||||||
Reference in New Issue
Block a user