1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-23 10:05:46 -05:00

SoapySDR support: set a minimum read or write timeout of 250ms

This commit is contained in:
f4exb 2018-11-27 23:44:11 +01:00
parent a79cfbfb4e
commit 468fab5c5e
2 changed files with 8 additions and 4 deletions

View File

@ -124,9 +124,11 @@ void SoapySDROutputThread::run()
int flags(0); int flags(0);
long long timeNs(0); long long timeNs(0);
float blockTime = ((float) numElems) / (m_sampleRate <= 0 ? 1024000 : m_sampleRate); float blockTime = ((float) numElems) / (m_sampleRate <= 0 ? 1024000 : m_sampleRate);
long timeoutUs = 10000000 * blockTime; // 10 times the block time long initialTtimeoutUs = 10000000 * blockTime; // 10 times the block time
long timeoutUs = initialTtimeoutUs < 250000 ? 250000 : initialTtimeoutUs; // 250ms minimum
qDebug("SoapySDROutputThread::run: numElems: %u elemSize: %u timeoutUs: %ld", numElems, elemSize, timeoutUs); qDebug("SoapySDROutputThread::run: numElems: %u elemSize: %u initialTtimeoutUs: %ld timeoutUs: %ld",
numElems, elemSize, initialTtimeoutUs, timeoutUs);
qDebug("SoapySDROutputThread::run: start running loop"); qDebug("SoapySDROutputThread::run: start running loop");
while (m_running) while (m_running)

View File

@ -129,9 +129,11 @@ void SoapySDRInputThread::run()
int flags(0); int flags(0);
long long timeNs(0); long long timeNs(0);
float blockTime = ((float) numElems) / (m_sampleRate <= 0 ? 1024000 : m_sampleRate); float blockTime = ((float) numElems) / (m_sampleRate <= 0 ? 1024000 : m_sampleRate);
long timeoutUs = 10000000 * blockTime; // 10 times the block time long initialTtimeoutUs = 10000000 * blockTime; // 10 times the block time
long timeoutUs = initialTtimeoutUs < 250000 ? 250000 : initialTtimeoutUs; // 250ms minimum
qDebug("SoapySDRInputThread::run: numElems: %u elemSize: %u timeoutUs: %ld", numElems, elemSize, timeoutUs); qDebug("SoapySDRInputThread::run: numElems: %u elemSize: %u initialTtimeoutUs: %ld timeoutUs: %ld",
numElems, elemSize, initialTtimeoutUs, timeoutUs);
qDebug("SoapySDRInputThread::run: start running loop"); qDebug("SoapySDRInputThread::run: start running loop");
while (m_running) while (m_running)