44 m_blnNeedConfigUpdate(false),
45 m_deviceAPI(deviceAPI),
46 m_objRegisteredTVScreen(0),
47 m_objRegisteredVideoRender(0),
48 m_objVideoStream(
nullptr),
49 m_udpStream(
leansdr::tspacket::SIZE),
50 m_objRenderThread(
nullptr),
52 m_blnRenderingVideo(false),
53 m_blnStartStopVideo(false),
54 m_cstlnSetByModcod(false),
55 m_modcodModulation(-1),
58 m_sampleRate(1024000),
59 m_objSettingsMutex(QMutex::NonRecursive)
61 setObjectName(
"DATVDemod");
67 m_blnInitialized=
false;
68 CleanUpDATVFramework(
false);
76 m_deviceAPI->addChannelSink(m_threadedChannelizer);
77 m_deviceAPI->addChannelSinkAPI(
this);
181 if (blnStartStop ==
true) {
187 if (blnStartStop ==
true) {
207 if (blnRelease ==
true)
233 if (
p_cnr !=
nullptr) {
236 if (
r_cnr !=
nullptr) {
264 if (
p_ss !=
nullptr) {
267 if (
p_mer !=
nullptr) {
547 qDebug() <<
"DATVDemod::InitDATVFramework:" 722 qCritical(
"DATVDemod::InitDATVFramework: Interpolator not implemented");
741 qWarning(
"DATVDemod::InitDATVFramework: non-standard constellation for DVB-S");
749 qDebug(
"DATVDemod::InitDATVFramework: DVB-S2: Testing symbol sampler only.");
788 qDebug(
"DATVDemod::InitDATVFramework: Register DVBSTVSCREEN");
877 qDebug() <<
"DATVDemod::InitDATVS2Framework:" 1044 qCritical(
"DATVDemod::InitDATVS2Framework: Interpolator not implemented");
1094 qDebug(
"DATVDemod::InitDATVS2Framework: Register DVBS 2 TVSCREEN");
1154 void DATVDemod::feed(
const SampleVector::const_iterator& begin,
const SampleVector::const_iterator& end,
bool firstOfBurst)
1156 (void) firstOfBurst;
1169 #ifdef EXTENDED_DIRECT_SAMPLE 1176 SampleVector::const_iterator it = begin;
1177 intLen = it->intLen;
1178 ptrBuffer = it->ptrBuffer;
1179 ptrBufferToRelease = ptrBuffer;
1182 for(qint32 intInd=0; intInd<intLen-1; intInd +=2)
1185 fltI= ((qint32) (*ptrBuffer)) << 4;
1187 fltQ= ((qint32) (*ptrBuffer)) << 4;
1192 for (SampleVector::const_iterator it = begin; it != end; ++it )
1210 printf(
"SWITCHING TO DVBS-2\r\n");
1215 printf(
"SWITCHING TO DVBS\r\n");
1231 for (
int intI = 0 ; intI < intRFOut; intI++)
1233 objIQ.
re = objRF->real();
1234 objIQ.
im = objRF->imag();
1235 magSq = objIQ.
re*objIQ.
re + objIQ.
im*objIQ.
im;
1271 qDebug(
"DATVDemod::feed: change by MODCOD detected");
1309 qDebug() <<
"DATVDemod::handleMessage: MsgChannelizerNotification:" 1337 qDebug() <<
"DATVDemod::handleMessage: MsgConfigureDATVDemod";
1345 qDebug(
"DATVDemod::handleMessage: DSPSignalNotification: sent sample rate: %d",
m_sampleRate);
1358 qDebug() <<
"DATVDemod::applyChannelSettings:" 1359 <<
" inputSampleRate: " << inputSampleRate
1360 <<
" inputFrequencyOffset: " << inputFrequencyOffset;
1362 bool callApplySettings =
false;
1367 m_objNCO.
setFreq(-(
float) inputFrequencyOffset, (
float) inputSampleRate);
1368 qDebug(
"DATVDemod::applyChannelSettings: NCO: IF: %d <> TF: %d ISR: %d",
1370 callApplySettings =
true;
1384 if (callApplySettings) {
1391 QString msg = tr(
"DATVDemod::applySettings: force: %1").arg(force);
1392 settings.
debug(msg);
1394 qDebug(
"DATVDemod::applySettings: m_sampleRate: %d",
m_sampleRate);
1503 return DATVDemodSettings::DATVCodeRate::RATE_UNSET;
1509 if (leanDVBModulation == leansdr::cstln_base::predef::APSK16) {
1510 return DATVDemodSettings::DATVModulation::APSK16;
1511 }
else if (leanDVBModulation == leansdr::cstln_base::predef::APSK32) {
1512 return DATVDemodSettings::DATVModulation::APSK32;
1513 }
else if (leanDVBModulation == leansdr::cstln_base::predef::APSK64E) {
1514 return DATVDemodSettings::DATVModulation::APSK64E;
1515 }
else if (leanDVBModulation == leansdr::cstln_base::predef::BPSK) {
1516 return DATVDemodSettings::DATVModulation::BPSK;
1517 }
else if (leanDVBModulation == leansdr::cstln_base::predef::PSK8) {
1518 return DATVDemodSettings::DATVModulation::PSK8;
1519 }
else if (leanDVBModulation == leansdr::cstln_base::predef::QAM16) {
1520 return DATVDemodSettings::DATVModulation::QAM16;
1521 }
else if (leanDVBModulation == leansdr::cstln_base::predef::QAM64) {
1522 return DATVDemodSettings::DATVModulation::QAM64;
1523 }
else if (leanDVBModulation == leansdr::cstln_base::predef::QAM256) {
1524 return DATVDemodSettings::DATVModulation::QAM256;
1525 }
else if (leanDVBModulation == leansdr::cstln_base::predef::QPSK) {
1526 return DATVDemodSettings::DATVModulation::QPSK;
1528 return DATVDemodSettings::DATVModulation::MOD_UNSET;
1567 if (datvModulation == DATVDemodSettings::DATVModulation::APSK16) {
1568 return (
int) leansdr::cstln_base::predef::APSK16;
1569 }
else if (datvModulation == DATVDemodSettings::DATVModulation::APSK32) {
1570 return (
int) leansdr::cstln_base::predef::APSK32;
1571 }
else if (datvModulation == DATVDemodSettings::DATVModulation::APSK64E) {
1572 return (
int) leansdr::cstln_base::predef::APSK64E;
1573 }
else if (datvModulation == DATVDemodSettings::DATVModulation::BPSK) {
1574 return (
int) leansdr::cstln_base::predef::BPSK;
1575 }
else if (datvModulation == DATVDemodSettings::DATVModulation::PSK8) {
1576 return (
int) leansdr::cstln_base::predef::PSK8;
1577 }
else if (datvModulation == DATVDemodSettings::DATVModulation::QAM16) {
1578 return (
int) leansdr::cstln_base::predef::QAM16;
1579 }
else if (datvModulation == DATVDemodSettings::DATVModulation::QAM64) {
1580 return (
int) leansdr::cstln_base::predef::QAM64;
1581 }
else if (datvModulation == DATVDemodSettings::DATVModulation::QAM256) {
1582 return (
int) leansdr::cstln_base::predef::QAM256;
1583 }
else if (datvModulation == DATVDemodSettings::DATVModulation::QPSK) {
1584 return (
int) leansdr::cstln_base::predef::QPSK;
leansdr::pipebuf< leansdr::u8 > * p_bytes
leansdr::pipebuf< leansdr::f32 > * p_ss
bool isDifferent(const DATVDemodSettings &other)
leansdr::pipebuf< int > * p_lock
leansdr::rs_decoder< leansdr::u8, 0 > * r_rsdec
void addAudioSink(AudioFifo *audioFifo, MessageQueue *sampleSinkMessageQueue, int outputDeviceIndex=-1)
Add the audio sink.
leansdr::pipebuf< leansdr::u32 > * p_locktime
cstln_lut< eucl_ss, 256 > ** cstln
leansdr::pipebuf< leansdr::u8 > * p_mpegbytes
leansdr::pipebuf< leansdr::tspacket > * p_rtspackets
cstln_lut< SOFTSYMB, 256 > * cstln
leansdr::pipebuf< int > * p_vbitcount
Complex nextIQ()
Return next complex sample.
void configure(MessageQueue *messageQueue, int sampleRate, int centerFrequency)
leansdr::pipebuf< leansdr::rspacket< leansdr::u8 > > * p_rspackets
void push(Message *message, bool emitSignal=true)
Push message onto queue.
leansdr::rotator< leansdr::f32 > * r_derot
unsigned long BUF_PACKETS
void removeChannelSinkAPI(ChannelAPI *channelAPI, int streamIndex=0)
void * m_objDemodulatorDVBS2
deconvol_sync_simple * make_deconvol_sync_simple(scheduler *sch, pipebuf< eucl_ss > &_in, pipebuf< u8 > &_out, enum code_rate rate)
leansdr::datvdvbs2constellation< leansdr::f32 > * r_scope_symbols_dvbs2
void applyChannelSettings(int inputSampleRate, int inputFrequencyOffset, bool force=false)
leansdr::pipebuf< leansdr::f32 > * p_cnr
leansdr::pipewriter< leansdr::cf32 > * p_rawiq_writer
int decimation(float Fin, float Fout)
MessageQueue * getInputMessageQueue()
Get the queue for asynchronous inbound communication.
leansdr::pipebuf< leansdr::u8 > * p_descrambled
unsigned long BUF_MPEGBYTES
DATVModulation m_modulation
leansdr::pipebuf< leansdr::f32 > * p_freq
leansdr::pipebuf< leansdr::eucl_ss > * p_symbols
leansdr::datvvideoplayer< leansdr::tspacket > * r_videoplayer
DATVideostream * SetVideoRender(DATVideoRender *objScreen)
leansdr::decimator< leansdr::cf32 > * p_decim
void setPort(quint16 port)
bool m_blnNeedConfigUpdate
int getOutputDeviceIndex(const QString &deviceName) const
static const QString m_channelIdURI
int runFilt(const cmplx &in, cmplx **out)
int getSampleRate() const
void removeAudioSink(AudioFifo *audioFifo)
Remove the audio sink.
static const int MAX_SLOTS_PER_FRAME
leansdr::pipebuf< leansdr::cf32 > * p_autonotched
leansdr::cnr_fft< leansdr::f32 > * r_cnr
static const QString m_channelId
bool setAddress(const QString &address)
leansdr::mpeg_sync< leansdr::u8, 0 > * r_sync_mpeg
static int getLeanDVBModulationFromDATV(DATVDemodSettings::DATVModulation datvModulation)
DATVDemodSettings::dvb_sampler sampler
unsigned long meas_decimation
void debug(const QString &msg) const
int getVideoStreamIndex() const
DATVideoRender * m_objRegisteredVideoRender
leansdr::viterbi_sync * r
leansdr::etr192_descrambler * r_etr192_descrambler
leansdr::deinterleaver< leansdr::u8 > * r_deinter
bool getAudioDecodeOK() const
static DATVDemodSettings::DATVModulation getModulationFromLeanDVBCode(int leanDVBModulation)
void resizeTVScreen(int intCols, int intRows)
std::complex< float > cmplx
QString m_audioDeviceName
void applySettings(const DATVDemodSettings &settings, bool force=false)
leansdr::pipebuf< int > * p_framelock
leansdr::auto_notch< leansdr::f32 > * r_auto_notch
leansdr::pipebuf< leansdr::cf32 > * p_rawiq
leansdr::deconvol_sync_simple * r_deconv
unsigned long BUF_SYMBOLS
void set_allow_drift(bool d)
virtual bool handleMessage(const Message &cmd)
Processing of a message. Returns true if message has actually been processed.
#define MESSAGE_CLASS_DEFINITION(Name, BaseClass)
void create_filter(float f1, float f2)
void InitDATVS2Framework()
leansdr::file_writer< leansdr::cf32 > * r_ppout
static DSPEngine * instance()
cstln_lut< SOFTSYMB, 256 > * cstln
unsigned long S2_MAX_SYMBOLS
DATVUDPStream m_udpStream
leansdr::pipebuf< leansdr::cf32 > * p_cstln
leansdr::datvconstellation< leansdr::f32 > * r_scope_symbols
static DATVDemodSettings::DATVCodeRate getCodeRateFromLeanDVBCode(int leanDVBCodeRate)
QMutex m_objSettingsMutex
void * p_s2_deinterleaver
unsigned long BUF_BASEBAND
void setAudioMute(bool audioMute)
unsigned long m_lngExpectedReadIQ
leansdr::pipebuf< float > * p_vber
leansdr::rate_estimator< float > * r_vber
leansdr::pipebuf< int > * p_verrcount
static bool match(const Message *message)
virtual void feed(const SampleVector::const_iterator &begin, const SampleVector::const_iterator &end, bool po)
int getInputSampleRate() const
void setFreq(Real freq, Real sampleRate)
static MsgReportModcodCstlnChange * create(const DATVDemodSettings::DATVModulation &modulation, const DATVDemodSettings::DATVCodeRate &codeRate)
leansdr::scheduler * m_objScheduler
void removeChannelSink(ThreadedBasebandSampleSink *sink, int streamIndex=0)
Remove a channel sink (Rx)
DATVideostream * m_objVideoStream
void set_omega(float _omega, float tol=10e-6)
leansdr::cstln_lut< leansdr::eucl_ss, 256 >::predef constellation
MessageQueue * getMessageQueueToGUI()
leansdr::pipebuf< leansdr::cf32 > * p_resampled
DATVideoRenderThread * m_objRenderThread
MovingAverageUtil< double, double, 32 > m_objMagSqAverage
leansdr::hdlc_sync * r_sync
leansdr::pipebuf< leansdr::u8 > * p_frames
void setAudioVolume(int audioVolume)
void calculate_cstln_points()
static int getLeanDVBCodeRateFromDATV(DATVDemodSettings::DATVCodeRate datvCodeRate)
AudioDeviceManager * getAudioDeviceManager()
DownChannelizer * m_channelizer
bool SetTVScreen(TVScreen *objScreen)
virtual qint64 bytesAvailable() const
DATVDemodSettings::dvb_version standard
leansdr::pipebuf< leansdr::cf32 > * p_preprocessed
void calculate_cstln_points()
leansdr::pipebuf< leansdr::tspacket > * p_tspackets
bool PlayVideo(bool blnStartStop)
leansdr::pipebuf< leansdr::cf32 > * p_cstln_pls
unsigned long BUF_S2PACKETS
void CleanUpDATVFramework(bool blnRelease)
leansdr::file_writer< leansdr::tspacket > * r_stdout
int root_raised_cosine(int order, float Fs, float rolloff, T **coeffs)
void setAudioFIFO(AudioFifo *fifo)
leansdr::sampler_interface< leansdr::f32 > * sampler
ThreadedBasebandSampleSink * m_threadedChannelizer
void setActive(bool active)
bool getVideoDecodeOK() const
DATVDemodSettings m_settings
leansdr::derandomizer * r_derand
void setVideoMute(bool videoMute)
TVScreen * m_objRegisteredTVScreen
leansdr::pipebuf< leansdr::f32 > * p_mer
leansdr::fir_filter< leansdr::cf32, float > * r_resample
leansdr::pipebuf< leansdr::cf32 > * p_decimated
void setStreamAndRenderer(DATVideoRender *renderer, DATVideostream *stream)
std::complex< Real > Complex
#define rfFilterFftLength
qint64 getFrequencyOffset() const
leansdr::cstln_receiver< leansdr::f32, leansdr::eucl_ss > * m_objDemodulator
leansdr::pipebuf< leansdr::cf32 > * p_sampled
T max(const T &x, const T &y)
leansdr::pipebuf< leansdr::cf32 > * p_derot
int m_inputFrequencyOffset
int getAudioStreamIndex() const