Updated CMake files for QTEditor cmake style.

AudioOutput had previously stalled, mutex temporary removed(Q&D workaround, need for study OSX Audio Concurency).
Removed some part of code in DemodBFM for OSX compilations.
Code runs and was tested with HackRF.
Note: There is need have investigate two potencial problems(DemodBFM bug and AudioOutput deadlocking?).
pull/6/head
Ziga S 2016-06-29 10:00:38 +02:00
rodzic 0df3427a3a
commit 08602c661b
7 zmienionych plików z 24 dodań i 18 usunięć

Wyświetl plik

@ -62,9 +62,6 @@ ENDIF()
# MacOS Compatibility # MacOS Compatibility
if(APPLE) if(APPLE)
find_package(ICONV) find_package(ICONV)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++ -lc++abi")
endif(APPLE) endif(APPLE)
############################################################################## ##############################################################################

Wyświetl plik

@ -526,15 +526,21 @@ void RDSParser::decode_type0(unsigned int *group, bool B)
if (af_1) if (af_1)
{ {
// @TODO: Find proper header or STL on OSX
#ifndef __APPLE__
std::pair<std::_Rb_tree_const_iterator<double>, bool> res = m_g0_alt_freq.insert(af_1/1e3); std::pair<std::_Rb_tree_const_iterator<double>, bool> res = m_g0_alt_freq.insert(af_1/1e3);
m_g0_af_updated = m_g0_af_updated || res.second; m_g0_af_updated = m_g0_af_updated || res.second;
#endif
no_af += 1; no_af += 1;
} }
if (af_2) if (af_2)
{ {
// @TODO: Find proper header or STL on OSX
#ifndef __APPLE__
std::pair<std::_Rb_tree_const_iterator<double>, bool> res = m_g0_alt_freq.insert(af_2/1e3); std::pair<std::_Rb_tree_const_iterator<double>, bool> res = m_g0_alt_freq.insert(af_2/1e3);
m_g0_af_updated = m_g0_af_updated || res.second; m_g0_af_updated = m_g0_af_updated || res.second;
#endif
no_af += 2; no_af += 2;
} }

Wyświetl plik

@ -151,7 +151,11 @@ bool AudioOutput::open(OpenMode mode)
qint64 AudioOutput::readData(char* data, qint64 maxLen) qint64 AudioOutput::readData(char* data, qint64 maxLen)
{ {
//qDebug("AudioOutput::readData: %lld", maxLen); //qDebug("AudioOutput::readData: %lld", maxLen);
// @TODO: Study this mutex on OSX, for now deadlocks possible
#ifndef __APPLE__
QMutexLocker mutexLocker(&m_mutex); QMutexLocker mutexLocker(&m_mutex);
#endif
unsigned int framesPerBuffer = maxLen / 4; unsigned int framesPerBuffer = maxLen / 4;
@ -183,7 +187,7 @@ qint64 AudioOutput::readData(char* data, qint64 maxLen)
if (samples != framesPerBuffer) if (samples != framesPerBuffer)
{ {
//qDebug("AudioOutput::readData: read %d samples vs %d requested", samples, framesPerBuffer); qDebug("AudioOutput::readData: read %d samples vs %d requested", samples, framesPerBuffer);
} }
for (uint i = 0; i < samples; i++) for (uint i = 0; i < samples; i++)
@ -196,7 +200,6 @@ qint64 AudioOutput::readData(char* data, qint64 maxLen)
++dst; ++dst;
} }
} }
// convert to int16 // convert to int16
//std::vector<qint32>::const_iterator src = m_mixBuffer.begin(); // Valgrind optim //std::vector<qint32>::const_iterator src = m_mixBuffer.begin(); // Valgrind optim

Wyświetl plik

@ -182,7 +182,7 @@ void PhaseLock::process(const std::vector<Real>& samples_in, std::vector<Real>&
// Convert I/Q ratio to estimate of phase error. // Convert I/Q ratio to estimate of phase error.
Real phase_err; Real phase_err;
if (phasor_i > abs(phasor_q)) { if (phasor_i > std::abs(phasor_q)) {
// We are within +/- 45 degrees from lock. // We are within +/- 45 degrees from lock.
// Use simple linear approximation of arctan. // Use simple linear approximation of arctan.
phase_err = phasor_q / phasor_i; phase_err = phasor_q / phasor_i;
@ -278,7 +278,7 @@ void PhaseLock::process(const Real& sample_in, Real *samples_out)
// Convert I/Q ratio to estimate of phase error. // Convert I/Q ratio to estimate of phase error.
Real phase_err; Real phase_err;
if (phasor_i > abs(phasor_q)) { if (phasor_i > std::abs(phasor_q)) {
// We are within +/- 45 degrees from lock. // We are within +/- 45 degrees from lock.
// Use simple linear approximation of arctan. // Use simple linear approximation of arctan.
phase_err = phasor_q / phasor_i; phase_err = phasor_q / phasor_i;