mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-25 17:28:50 -05:00
Race condition.
This commit is contained in:
parent
3ec45e00ad
commit
9d18a9a1e9
@ -93,8 +93,8 @@ bool FCDInput::startInput(int device)
|
|||||||
|
|
||||||
m_deviceDescription = QString("Funcube Dongle");
|
m_deviceDescription = QString("Funcube Dongle");
|
||||||
|
|
||||||
if (!applySettings(m_generalSettings, m_settings, true))
|
// if (!applySettings(m_generalSettings, m_settings, true))
|
||||||
qCritical("FCD: Unable to set config at start");
|
// qCritical("FCD: Unable to set config at start");
|
||||||
|
|
||||||
qDebug("FCDInput: start");
|
qDebug("FCDInput: start");
|
||||||
return true;
|
return true;
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
|
|
||||||
bool FCDThread::OpenSource(const char* cardname)
|
bool FCDThread::OpenSource(const char* cardname)
|
||||||
{
|
{
|
||||||
|
bool fail = false;
|
||||||
snd_pcm_hw_params_t* params;
|
snd_pcm_hw_params_t* params;
|
||||||
//fcd_rate = FCDPP_RATE;
|
//fcd_rate = FCDPP_RATE;
|
||||||
//fcd_channels =2;
|
//fcd_channels =2;
|
||||||
@ -28,14 +29,21 @@ bool FCDThread::OpenSource(const char* cardname)
|
|||||||
|
|
||||||
snd_pcm_hw_params_alloca(¶ms);
|
snd_pcm_hw_params_alloca(¶ms);
|
||||||
if ( snd_pcm_hw_params_any(fcd_handle, params) < 0 )
|
if ( snd_pcm_hw_params_any(fcd_handle, params) < 0 )
|
||||||
qCritical("Funcube Dongle read settings failed");
|
fail = true;
|
||||||
else if ( snd_pcm_hw_params(fcd_handle, params) < 0 )
|
else if ( snd_pcm_hw_params(fcd_handle, params) < 0 ) {
|
||||||
qCritical("Funcube Dongle write settings failed");
|
fail = true;
|
||||||
// TODO: check actual samplerate, may be crippled firmware
|
// TODO: check actual samplerate, may be crippled firmware
|
||||||
|
} else {
|
||||||
if ( snd_pcm_start(fcd_handle) < 0 )
|
if ( snd_pcm_start(fcd_handle) < 0 )
|
||||||
|
fail = true;
|
||||||
|
}
|
||||||
|
if (fail) {
|
||||||
qCritical("Funcube Dongle stream start failed");
|
qCritical("Funcube Dongle stream start failed");
|
||||||
else qDebug("Funcube stream started");
|
snd_pcm_close( fcd_handle );
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
qDebug("Funcube stream started");
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
FCDThread::FCDThread(SampleFifo* sampleFifo, QObject* parent) :
|
FCDThread::FCDThread(SampleFifo* sampleFifo, QObject* parent) :
|
||||||
QThread(parent),
|
QThread(parent),
|
||||||
|
fcd_handle(NULL),
|
||||||
m_running(false),
|
m_running(false),
|
||||||
m_convertBuffer(BLOCKSIZE),
|
m_convertBuffer(BLOCKSIZE),
|
||||||
m_sampleFifo(sampleFifo)
|
m_sampleFifo(sampleFifo)
|
||||||
|
@ -44,7 +44,7 @@ public:
|
|||||||
int work(int n_items);
|
int work(int n_items);
|
||||||
private:
|
private:
|
||||||
snd_pcm_format_t fcd_format;
|
snd_pcm_format_t fcd_format;
|
||||||
snd_pcm_t* fcd_handle = NULL;
|
snd_pcm_t* fcd_handle;
|
||||||
|
|
||||||
QMutex m_startWaitMutex;
|
QMutex m_startWaitMutex;
|
||||||
QWaitCondition m_startWaiter;
|
QWaitCondition m_startWaiter;
|
||||||
|
@ -96,7 +96,7 @@ bool V4LInput::startInput(int device)
|
|||||||
|
|
||||||
qDebug("V4LInput: start");
|
qDebug("V4LInput: start");
|
||||||
MsgReportV4L::create(m_gains)->submit(m_guiMessageQueue);
|
MsgReportV4L::create(m_gains)->submit(m_guiMessageQueue);
|
||||||
applySettings(m_generalSettings, m_settings, true);
|
// applySettings(m_generalSettings, m_settings, true);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user