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

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

Wyświetl plik

@ -30,4 +30,4 @@ target_link_libraries(fcdhid
${ICONV_LIBRARY}
)
install(TARGETS fcdhid DESTINATION lib)
install(TARGETS fcdhid DESTINATION lib)

Wyświetl plik

@ -49,4 +49,4 @@ target_link_libraries(demodbfm
qt5_use_modules(demodbfm Core Widgets OpenGL Multimedia)
install(TARGETS demodbfm DESTINATION lib/plugins/channel)
install(TARGETS demodbfm DESTINATION lib/plugins/channel)

Wyświetl plik

@ -526,15 +526,21 @@ void RDSParser::decode_type0(unsigned int *group, bool B)
if (af_1)
{
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;
// @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);
m_g0_af_updated = m_g0_af_updated || res.second;
#endif
no_af += 1;
}
if (af_2)
{
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;
// @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);
m_g0_af_updated = m_g0_af_updated || res.second;
#endif
no_af += 2;
}

Wyświetl plik

@ -21,7 +21,7 @@ set(hackrf_FORMS
)
include_directories(
.
.
${CMAKE_CURRENT_BINARY_DIR}
${LIBHACKRF_INCLUDE_DIR}
)

Wyświetl plik

@ -150,8 +150,12 @@ bool AudioOutput::open(OpenMode mode)
qint64 AudioOutput::readData(char* data, qint64 maxLen)
{
//qDebug("AudioOutput::readData: %lld", maxLen);
QMutexLocker mutexLocker(&m_mutex);
//qDebug("AudioOutput::readData: %lld", maxLen);
// @TODO: Study this mutex on OSX, for now deadlocks possible
#ifndef __APPLE__
QMutexLocker mutexLocker(&m_mutex);
#endif
unsigned int framesPerBuffer = maxLen / 4;
@ -183,7 +187,7 @@ qint64 AudioOutput::readData(char* data, qint64 maxLen)
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++)
@ -195,8 +199,7 @@ qint64 AudioOutput::readData(char* data, qint64 maxLen)
++src;
++dst;
}
}
}
// convert to int16
//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.
Real phase_err;
if (phasor_i > abs(phasor_q)) {
if (phasor_i > std::abs(phasor_q)) {
// We are within +/- 45 degrees from lock.
// Use simple linear approximation of arctan.
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.
Real phase_err;
if (phasor_i > abs(phasor_q)) {
if (phasor_i > std::abs(phasor_q)) {
// We are within +/- 45 degrees from lock.
// Use simple linear approximation of arctan.
phase_err = phasor_q / phasor_i;