1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-13 20:01:46 -05:00

SDRPlay support: source plugin interim state (3) MIR stream init fails

This commit is contained in:
f4exb 2016-11-14 02:24:44 +01:00
parent 13d01f48c6
commit c9216f2093
4 changed files with 49 additions and 3 deletions

View File

@ -701,6 +701,37 @@ void SDRPlayGui::on_gr_valueChanged(int value)
sendSettings();
}
void SDRPlayGui::on_startStop_toggled(bool checked)
{
if (checked)
{
if (m_deviceAPI->initAcquisition())
{
m_deviceAPI->startAcquisition();
DSPEngine::instance()->startAudio();
}
}
else
{
m_deviceAPI->stopAcquisition();
DSPEngine::instance()->stopAudio();
}
}
void SDRPlayGui::on_record_toggled(bool checked)
{
if (checked)
{
ui->record->setStyleSheet("QToolButton { background-color : red; }");
m_fileSink->startRecording();
}
else
{
ui->record->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
m_fileSink->stopRecording();
}
}
// ====================================================================
unsigned int SDRPlaySampleRates::m_rates[m_nb_rates] = {

View File

@ -89,6 +89,8 @@ private slots:
void on_decim_currentIndexChanged(int index);
void on_fcPos_currentIndexChanged(int index);
void on_gr_valueChanged(int value);
void on_startStop_toggled(bool checked);
void on_record_toggled(bool checked);
};

View File

@ -73,8 +73,19 @@ bool SDRPlayInput::start(int device)
double frequencyMHz = m_settings.m_centerFrequency / 1e6;
int infoOverallGr;
mir_sdr_DCoffsetIQimbalanceControl(1, 0);
mir_sdr_AgcControl(mir_sdr_AGC_DISABLE, agcSetPoint, 0, 0, 0, 0, 1);
r = mir_sdr_DCoffsetIQimbalanceControl(1, 0);
if (r != mir_sdr_Success)
{
qCritical("SDRPlayInput::start: mir_sdr_DCoffsetIQimbalanceControl failed with code %d", (int) r);
}
r = mir_sdr_AgcControl(mir_sdr_AGC_DISABLE, agcSetPoint, 0, 0, 0, 0, 1);
if (r != mir_sdr_Success)
{
qCritical("SDRPlayInput::start: mir_sdr_AgcControl failed with code %d", (int) r);
}
qDebug("SDRPlayInput::start: sampleRateMHz: %lf frequencyMHz: %lf", sampleRateMHz, frequencyMHz);
r = mir_sdr_StreamInit(
&agcSetPoint,
@ -92,7 +103,7 @@ bool SDRPlayInput::start(int device)
if (r != mir_sdr_Success)
{
qCritical("SDRPlayInput::start: Mir stream init failed with code %d", (int) r);
qCritical("SDRPlayInput::start: mir_sdr_StreamInit failed with code %d", (int) r);
}
else
{

View File

@ -74,11 +74,13 @@ void SDRPlayThread::streamCallback(
unsigned int reset,
void *cbContext)
{
qDebug("SDRPlayThread::streamCallback");
m_this->callback(xi, xq, numSamples);
}
void SDRPlayThread::callback(short *xi, short *xq, unsigned int numSamples)
{
qDebug("SDRPlayThread::callback");
if (m_convertBuffer.size() < numSamples)
{
m_convertBuffer.resize(numSamples);