kopia lustrzana https://github.com/f4exb/sdrangel
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
rodzic
0df3427a3a
commit
08602c661b
|
@ -61,10 +61,7 @@ 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)
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
|
|
|
@ -30,4 +30,4 @@ target_link_libraries(fcdhid
|
||||||
${ICONV_LIBRARY}
|
${ICONV_LIBRARY}
|
||||||
)
|
)
|
||||||
|
|
||||||
install(TARGETS fcdhid DESTINATION lib)
|
install(TARGETS fcdhid DESTINATION lib)
|
||||||
|
|
|
@ -49,4 +49,4 @@ target_link_libraries(demodbfm
|
||||||
|
|
||||||
qt5_use_modules(demodbfm Core Widgets OpenGL Multimedia)
|
qt5_use_modules(demodbfm Core Widgets OpenGL Multimedia)
|
||||||
|
|
||||||
install(TARGETS demodbfm DESTINATION lib/plugins/channel)
|
install(TARGETS demodbfm DESTINATION lib/plugins/channel)
|
||||||
|
|
|
@ -526,15 +526,21 @@ void RDSParser::decode_type0(unsigned int *group, bool B)
|
||||||
|
|
||||||
if (af_1)
|
if (af_1)
|
||||||
{
|
{
|
||||||
std::pair<std::_Rb_tree_const_iterator<double>, bool> res = m_g0_alt_freq.insert(af_1/1e3);
|
// @TODO: Find proper header or STL on OSX
|
||||||
m_g0_af_updated = m_g0_af_updated || res.second;
|
#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;
|
no_af += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (af_2)
|
if (af_2)
|
||||||
{
|
{
|
||||||
std::pair<std::_Rb_tree_const_iterator<double>, bool> res = m_g0_alt_freq.insert(af_2/1e3);
|
// @TODO: Find proper header or STL on OSX
|
||||||
m_g0_af_updated = m_g0_af_updated || res.second;
|
#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;
|
no_af += 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ set(hackrf_FORMS
|
||||||
)
|
)
|
||||||
|
|
||||||
include_directories(
|
include_directories(
|
||||||
.
|
.
|
||||||
${CMAKE_CURRENT_BINARY_DIR}
|
${CMAKE_CURRENT_BINARY_DIR}
|
||||||
${LIBHACKRF_INCLUDE_DIR}
|
${LIBHACKRF_INCLUDE_DIR}
|
||||||
)
|
)
|
||||||
|
|
|
@ -150,8 +150,12 @@ 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);
|
||||||
QMutexLocker mutexLocker(&m_mutex);
|
|
||||||
|
// @TODO: Study this mutex on OSX, for now deadlocks possible
|
||||||
|
#ifndef __APPLE__
|
||||||
|
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++)
|
||||||
|
@ -195,8 +199,7 @@ qint64 AudioOutput::readData(char* data, qint64 maxLen)
|
||||||
++src;
|
++src;
|
||||||
++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
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Ładowanie…
Reference in New Issue