Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
JvanKatwijk committed Feb 7, 2017
1 parent 83b1de7 commit 3632cbb
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 34 deletions.
Binary file modified linux-bin/qt-dab-0.998
Binary file not shown.
9 changes: 4 additions & 5 deletions qt-dab.pro
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
######################################################################

TEMPLATE = app
TARGET = qt-dab-0.998
TARGET = qt-dab-0.998-s
QT += widgets network xml
CONFIG += console
QMAKE_CFLAGS += -flto -ffast-math
Expand Down Expand Up @@ -181,7 +181,6 @@ CONFIG += airspy
CONFIG += spectrum
#CONFIG += tcp-streamer # use for remote listening
DEFINES += TECHNICAL_DATA
DEFINES += MOT_BASICS__ # use at your own risk
DEFINES += MSC_DATA__ # use at your own risk
DEFINES += TRY_EPG
}
Expand All @@ -204,16 +203,16 @@ LIBS += -lws2_32
LIBS += -lfaad
LIBS += -lusb-1.0
LIBS += -lz
FORMS += ./radio.ui
FORMS += ./technical_data.ui
FORMS += ./forms/dabradio.ui
FORMS += ./forms/technical_data.ui
CONFIG += extio
CONFIG += airspy
CONFIG += rtl_tcp
CONFIG += dabstick
CONFIG += sdrplay-exp
#CONFIG += tcp-streamer # use for remote listening
CONFIG += spectrum
DEFINES += TECHNICAL_DATA
DEFINES += MOT_BASICS__ # use at your own risk
DEFINES += MSC_DATA__ # use at your own risk
}

Expand Down
35 changes: 16 additions & 19 deletions radio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
#include <QDir>
#include "dab-constants.h"
#include "radio.h"
#include "fic-handler.h"
#include "msc-handler.h"
#include "audiosink.h"
#include "fft.h"
Expand Down Expand Up @@ -74,7 +73,9 @@
*/
RadioInterface::RadioInterface (QSettings *Si,
uint8_t freqsyncMethod,
QWidget *parent): QMainWindow (parent) {
QWidget *parent):
QMainWindow (parent),
my_ficHandler (this) {
int16_t latency;
int16_t k;

Expand All @@ -86,7 +87,7 @@ int16_t k;
connect (showProgramData, SIGNAL (clicked (void)),
this, SLOT (toggle_show_data (void)));
#else
showProgramData -> hide ();
showProgramData -> hide (); // do not show the button
#endif
dabSettings = Si;
//
Expand All @@ -111,7 +112,7 @@ int16_t k;
// latency is used to allow different settings for different
// situations wrt the output buffering
latency =
dabSettings -> value ("latency", 1). toInt ();
dabSettings -> value ("latency", 3). toInt ();

audioBuffer = new RingBuffer<int16_t>(16 * 32768);
ipAddress = dabSettings -> value ("ipAddress", "127.0.0.1"). toString ();
Expand Down Expand Up @@ -169,15 +170,12 @@ int16_t k;
* The actual work is done elsewhere: in ofdmProcessor
* and ofdmDecoder for the ofdm related part, ficHandler
* for the FIC's and mscHandler for the MSC.
* The ficHandler shares information with the mscHandler
* but the handlers do not change each others modes.
*/
this -> freqsyncMethod = freqsyncMethod;
my_mscHandler = new mscHandler (this,
&dabModeParameters,
audioBuffer,
show_crcErrors);
my_ficHandler = new ficHandler (this);
//
/**
* The default for the ofdmProcessor depends on
Expand All @@ -188,7 +186,7 @@ int16_t k;
inputDevice,
&dabModeParameters,
my_mscHandler,
my_ficHandler,
&my_ficHandler,
threshold,
freqsyncMethod
#ifdef HAVE_SPECTRUM
Expand Down Expand Up @@ -730,7 +728,7 @@ void RadioInterface::clearEnsemble (void) {
//
// it obviously means: stop processing
my_mscHandler -> stopProcessing ();
my_ficHandler -> clearEnsemble ();
my_ficHandler. clearEnsemble ();
my_ofdmProcessor -> coarseCorrectorOn ();
my_ofdmProcessor -> reset ();

Expand Down Expand Up @@ -923,7 +921,7 @@ void RadioInterface::clear_showElements (void) {
Services = QStringList ();
ensemble. setStringList (Services);
ensembleDisplay -> setModel (&ensemble);
my_ficHandler -> clearEnsemble ();
my_ficHandler. clearEnsemble ();

ensembleLabel = QString ();
ensembleName -> setText (ensembleLabel);
Expand Down Expand Up @@ -1017,8 +1015,8 @@ void RadioInterface::TerminateProcess (void) {
#endif
// everything should be halted by now
dumpControlState (dabSettings);
fprintf (stderr, "going to delete components now\n");
delete my_ofdmProcessor;
delete my_ficHandler;
delete my_mscHandler;
delete soundOut;
soundOut = NULL; // signals may be pending, so careful
Expand All @@ -1031,7 +1029,6 @@ void RadioInterface::TerminateProcess (void) {
pictureLabel = NULL; // signals may be pending, so careful
fprintf (stderr, "Termination started\n");
delete inputDevice;
fprintf (stderr, "input device deleted\n");
close ();
fprintf (stderr, "closed\n");
}
Expand Down Expand Up @@ -1102,7 +1099,7 @@ void RadioInterface::updateTimeDisplay (void) {
void RadioInterface::autoCorrector_on (void) {
// first the real stuff
clear_showElements ();
my_ficHandler -> clearEnsemble ();
my_ficHandler. clearEnsemble ();
my_ofdmProcessor -> coarseCorrectorOn ();
my_ofdmProcessor -> reset ();
my_mscHandler -> stopProcessing ();
Expand Down Expand Up @@ -1139,7 +1136,7 @@ uint8_t Mode = s. toInt ();
// settings of the parameters.
delete my_mscHandler;
setModeParameters (Mode);
my_ficHandler -> setBitsperBlock (2 * dabModeParameters. K);
my_ficHandler. setBitsperBlock (2 * dabModeParameters. K);
my_mscHandler = new mscHandler (this,
&dabModeParameters,
audioBuffer,
Expand All @@ -1149,7 +1146,7 @@ uint8_t Mode = s. toInt ();
inputDevice,
&dabModeParameters,
my_mscHandler,
my_ficHandler,
&my_ficHandler,
threshold,
freqsyncMethod
#ifdef HAVE_SPECTRUM
Expand Down Expand Up @@ -1346,7 +1343,7 @@ QString file;
inputDevice,
&dabModeParameters,
my_mscHandler,
my_ficHandler,
&my_ficHandler,
threshold,
freqsyncMethod
#ifdef HAVE_SPECTRUM
Expand All @@ -1367,10 +1364,10 @@ QString a = ensemble. data (s, Qt::DisplayRole). toString ();
techData. rsError_display -> hide ();
techData. aacError_display -> hide ();
#endif
switch (my_ficHandler -> kindofService (a)) {
switch (my_ficHandler. kindofService (a)) {
case AUDIO_SERVICE:
{ audiodata d;
my_ficHandler -> dataforAudioService (a, &d);
my_ficHandler. dataforAudioService (a, &d);
if ((d. bitRate == 0) || (d. protLevel == 0)) {
QMessageBox::warning (this, tr ("sdr"),
tr ("still insufficient data for this program\n"));
Expand Down Expand Up @@ -1420,7 +1417,7 @@ QString a = ensemble. data (s, Qt::DisplayRole). toString ();

case PACKET_SERVICE:
{ packetdata d;
my_ficHandler -> dataforDataService (a, &d);
my_ficHandler. dataforDataService (a, &d);
if ((d. DSCTy == 0) || (d. bitRate == 0)) {
QMessageBox::warning (this, tr ("sdr"),
tr ("still insufficient data for this service\n"));
Expand Down
6 changes: 3 additions & 3 deletions radio.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@
#include <QUdpSocket>
#include <QComboBox>
#include <QLabel>
#include <QTimer>
#include <sndfile.h>
#include "ui_dabradio.h"
#include <QTimer>
#include "fic-handler.h"
#include "ofdm-processor.h"
#include "ringbuffer.h"

Expand All @@ -45,7 +46,6 @@ class virtualInput;
class audioBase;

class mscHandler;
class ficHandler;

class common_fft;

Expand Down Expand Up @@ -100,7 +100,7 @@ private slots:
int32_t tunedFrequency;

ofdmProcessor *my_ofdmProcessor;
ficHandler *my_ficHandler;
ficHandler my_ficHandler;
mscHandler *my_mscHandler;
audioBase *soundOut;
RingBuffer<int16_t> *audioBuffer;
Expand Down
6 changes: 3 additions & 3 deletions src/backend/fic-handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ int16_t viterbiBlock [3072 + 24];

for (i = 0; i < 21; i ++) {
for (k = 0; k < 32 * 4; k ++) {
if (PI_16 [k % 32] == 1)
if (PI_16 [k % 32] != 0)
viterbiBlock [local] = ficblock [input_counter ++];
local ++;
}
Expand All @@ -181,7 +181,7 @@ int16_t viterbiBlock [3072 + 24];
*/
for (i = 0; i < 3; i ++) {
for (k = 0; k < 32 * 4; k ++) {
if (PI_15 [k % 32] == 1)
if (PI_15 [k % 32] != 0)
viterbiBlock [local] = ficblock [input_counter ++];
local ++;
}
Expand All @@ -192,7 +192,7 @@ int16_t viterbiBlock [3072 + 24];
* This block constitues the 6 * 4 bits of the register itself.
*/
for (k = 0; k < 24; k ++) {
if (PI_X [k] == 1)
if (PI_X [k] != 0)
viterbiBlock [local] = ficblock [input_counter ++];
local ++;
}
Expand Down
6 changes: 3 additions & 3 deletions src/backend/viterbi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,11 @@ int polys [RATE] = POLYS;
int16_t i, state;
#ifdef __MINGW32__
uint32_t size;
size = ((wordlength + (K - 1)) / 8 + 1 + 16) & ~0x0F;
size = 2 * ((wordlength + (K - 1)) / 8 + 1 + 16) & ~0x0F;
data = (uint8_t *)_aligned_malloc (size, 16);
size = (RATE * (wordlength + (K - 1)) * sizeof (int16_t) + 1 + 16) & 0x0F;
size = 2 * (RATE * (wordlength + (K - 1)) * sizeof (int16_t) + 1 + 16) & ~0x0F;
symbols = (int16_t *)_aligned_malloc (size, 16);
size = ((wordlength + (K - 1)) * sizeof (decision_t) + 16) & ~0x0F;
size = 2 * ((wordlength + (K - 1)) * sizeof (decision_t) + 16) & ~0x0F;
vp. decisions = (decision_t *)_aligned_malloc (size, 16);
#else
if (posix_memalign ((void**)&data, 16,
Expand Down
2 changes: 1 addition & 1 deletion src/ofdm/ofdm-decoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ int16_t i;
ibits [i] = - real (r1) / ab1 * 127.0;
ibits [carriers + i] = - imag (r1) / ab1 * 127.0;
}
handlerLabel:
handlerLabel:;
my_mscHandler -> process_mscBlock (ibits, blkno);
}

Expand Down

0 comments on commit 3632cbb

Please sign in to comment.