From: drowe67 Date: Sat, 13 Oct 2012 07:25:50 +0000 (+0000) Subject: temp. disabled timer and rx callback to stabilise, can start/stop without crashing now X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=af6beb84279e30617ab0536dd3f97dbb0637135a;p=freetel-svn-tracking.git temp. disabled timer and rx callback to stabilise, can start/stop without crashing now git-svn-id: https://svn.code.sf.net/p/freetel/code@747 01035d8c-6547-0410-b346-abe4f91aad63 --- diff --git a/fdmdv2/src/Makefile b/fdmdv2/src/Makefile index f726ab51..954acb1f 100644 --- a/fdmdv2/src/Makefile +++ b/fdmdv2/src/Makefile @@ -42,11 +42,11 @@ CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = ${SHELL} /p/Radio/fdmdv2/missing --run aclocal-1.11 -AMTAR = ${SHELL} /p/Radio/fdmdv2/missing --run tar -AUTOCONF = ${SHELL} /p/Radio/fdmdv2/missing --run autoconf -AUTOHEADER = ${SHELL} /p/Radio/fdmdv2/missing --run autoheader -AUTOMAKE = ${SHELL} /p/Radio/fdmdv2/missing --run automake-1.11 +ACLOCAL = ${SHELL} /home/david/fdmdv2/missing --run aclocal-1.11 +AMTAR = ${SHELL} /home/david/fdmdv2/missing --run tar +AUTOCONF = ${SHELL} /home/david/fdmdv2/missing --run autoconf +AUTOHEADER = ${SHELL} /home/david/fdmdv2/missing --run autoheader +AUTOMAKE = ${SHELL} /home/david/fdmdv2/missing --run automake-1.11 AWK = gawk CC = gcc CCDEPMODE = depmode=none @@ -60,9 +60,9 @@ ECHO_C = ECHO_N = -n ECHO_T = EGREP = /bin/grep -E -EXEEXT = .exe +EXEEXT = GREP = /bin/grep -INSTALL = /bin/install -c +INSTALL = /usr/bin/install -c INSTALL_DATA = ${INSTALL} -m 644 INSTALL_PROGRAM = ${INSTALL} INSTALL_SCRIPT = ${INSTALL} @@ -105,7 +105,7 @@ LIBS = -lsndfile-1 \ -lwsock32 LTLIBOBJS = -MAKEINFO = ${SHELL} /p/Radio/fdmdv2/missing --run makeinfo +MAKEINFO = ${SHELL} /home/david/fdmdv2/missing --run makeinfo MKDIR_P = /bin/mkdir -p OBJEXT = o PACKAGE = fdmdv2 @@ -117,13 +117,13 @@ PACKAGE_URL = PACKAGE_VERSION = 0.2 PATH_SEPARATOR = : SET_MAKE = -SHELL = /bin/sh +SHELL = /bin/bash STRIP = VERSION = 0.2 -abs_builddir = /p/Radio/fdmdv2/src -abs_srcdir = /p/Radio/fdmdv2/src -abs_top_builddir = /p/Radio/fdmdv2 -abs_top_srcdir = /p/Radio/fdmdv2 +abs_builddir = /home/david/fdmdv2/src +abs_srcdir = /home/david/fdmdv2/src +abs_top_builddir = /home/david/fdmdv2 +abs_top_srcdir = /home/david/fdmdv2 ac_ct_CC = gcc am__include = include am__leading_dot = . @@ -142,7 +142,7 @@ host_alias = htmldir = ${docdir} includedir = ${prefix}/include infodir = ${datarootdir}/info -install_sh = ${SHELL} /p/Radio/fdmdv2/install-sh +install_sh = ${SHELL} /home/david/fdmdv2/install-sh libdir = ${exec_prefix}/lib libexecdir = ${exec_prefix}/libexec localedir = ${datarootdir}/locale diff --git a/fdmdv2/src/Makefile.linux b/fdmdv2/src/Makefile.linux index 5a497523..9b0da6ea 100644 --- a/fdmdv2/src/Makefile.linux +++ b/fdmdv2/src/Makefile.linux @@ -1,6 +1,9 @@ # src/Makefile.linux # David Rowe 10 Oct 2012 -# test Makefile to help David R get up to speed +# +# Makefile for Linux to help David R get up to speed +# +# $ make -f Makefile.linux WX_GTK_PATH=/home/david/Desktop/wxWidgets-2.9.4/build_gtk CODEC2_PATH=/home/david/codec2-dev diff --git a/fdmdv2/src/fdmdv2_main.cpp b/fdmdv2/src/fdmdv2_main.cpp index 69523019..b6d2ce18 100644 --- a/fdmdv2/src/fdmdv2_main.cpp +++ b/fdmdv2/src/fdmdv2_main.cpp @@ -750,13 +750,20 @@ void MainFrame::OnTogBtnOnOffUI(wxUpdateUIEvent& event) wxUnusedVar(event); } +//---------------------------------------------------------- +// Global Codec2 thingys - just one reqd for tx & rx +//---------------------------------------------------------- +struct CODEC2 *g_pCodec2; +struct FDMDV *g_pFDMDV; + //------------------------------------------------------------------------- // OnTogBtnOnOff() //------------------------------------------------------------------------- void MainFrame::OnTogBtnOnOff(wxCommandEvent& event) { - if((!m_TxRunning) || (!m_RxRunning)) + if((!m_RxRunning)) { + printf("starting ...\n"); m_togBtnSplit->Enable(); m_togRxID->Enable(); m_togTxID->Enable(); @@ -764,8 +771,12 @@ void MainFrame::OnTogBtnOnOff(wxCommandEvent& event) m_togBtnALC->Enable(); m_btnTogTX->Enable(); + g_pFDMDV = fdmdv_create(); + g_pCodec2 = codec2_create(CODEC2_MODE_1400); + #ifdef _USE_TIMER - m_plotTimer.Start(500, wxTIMER_CONTINUOUS); + // DR: disable this puppy for now as it's causing a lot of error messages + //m_plotTimer.Start(500, wxTIMER_CONTINUOUS); #endif // _USE_TIMER startRxStream(); // startTxStream(); @@ -773,6 +784,7 @@ void MainFrame::OnTogBtnOnOff(wxCommandEvent& event) } else { + printf("stopping ...\n"); m_togBtnSplit->Disable(); m_togRxID->Disable(); m_togTxID->Disable(); @@ -780,7 +792,7 @@ void MainFrame::OnTogBtnOnOff(wxCommandEvent& event) m_togBtnALC->Disable(); m_btnTogTX->Disable(); #ifdef _USE_TIMER - m_plotTimer.Stop(); + //m_plotTimer.Stop(); #endif // _USE_TIMER stopRxStream(); // stopTxStream(); @@ -819,13 +831,6 @@ int g_State = 0; float g_avmag[FDMDV_NSPEC]; -//---------------------------------------------------------- -// Global Codec2 thingys. -//---------------------------------------------------------- -struct CODEC2 *g_pRxCodec2; -struct CODEC2 *g_pTxCodec2; -struct FDMDV *g_pRxFDMDV; -struct FDMDV *g_pTxFDMDV; //------------------------------------------------------------------------- // startRxStream() @@ -851,9 +856,7 @@ void MainFrame::startRxStream() } #endif // _DUMMY_DATA - g_pRxFDMDV = fdmdv_create(); - g_pRxCodec2 = codec2_create(CODEC2_MODE_1400); - g_pRxOutBuf = (short*)malloc(2 * sizeof(short) * codec2_samples_per_frame(g_pRxCodec2)); + g_pRxOutBuf = (short*)malloc(2 * sizeof(short) * codec2_samples_per_frame(g_pCodec2)); m_rxDevIn = m_rxPa->getDefaultInputDevice(); // default input device if(m_rxDevIn == paNoDevice) @@ -925,8 +928,8 @@ void MainFrame::stopRxStream() m_RxRunning = false; m_rxPa->stop(); m_rxPa->streamClose(); - fdmdv_destroy(g_pTxFDMDV); - codec2_destroy(g_pTxCodec2); + fdmdv_destroy(g_pFDMDV); + codec2_destroy(g_pCodec2); // delete g_RxInBuf; delete m_rxUserdata; } @@ -973,9 +976,7 @@ void MainFrame::startTxStream() return; } - g_pTxFDMDV = fdmdv_create(); - g_pTxCodec2 = codec2_create(CODEC2_MODE_1400); - g_pTxOutBuf = (short*)malloc(2*sizeof(short)*codec2_samples_per_frame(g_pTxCodec2)); + g_pTxOutBuf = (short*)malloc(2*sizeof(short)*codec2_samples_per_frame(g_pCodec2)); m_txErr = m_txPa->setInputDevice(m_txDevIn); m_txErr = m_txPa->setInputChannelCount(2); // stereo input @@ -1101,6 +1102,7 @@ int MainFrame::rxCallback( assert(inputBuffer != NULL); +#ifdef RX_CB // Convert input model samples from 48 to 8 kHz // just use left channel for(i = 0; i < framesPerBuffer; i++, rptr += 2) @@ -1121,7 +1123,7 @@ int MainFrame::rxCallback( g_RxInBuf[g_nInputBuf + i] = (short)out8k[i]; } g_nInputBuf += FDMDV_NOM_SAMPLES_PER_FRAME; - per_frame_rx_processing(g_pRxOutBuf, &g_nInputBuf, g_CodecBits, g_RxInBuf, &g_nOutputBuf, &g_nRxIn, &g_State, g_pRxCodec2); + per_frame_rx_processing(g_pRxOutBuf, &g_nInputBuf, g_CodecBits, g_RxInBuf, &g_nOutputBuf, &g_nRxIn, &g_State, g_pCodec2); cbData->pWFPanel->m_newdata = true; cbData->pSPPanel->m_newdata = true; // if demod out of sync copy input audio from A/D to aid in tuning @@ -1167,6 +1169,7 @@ int MainFrame::rxCallback( wptr[0] = out48k_short[i]; wptr[1] = out48k_short[i]; } +#endif return paContinue; } @@ -1222,7 +1225,7 @@ int MainFrame::rxCallback( rx_fdm[i] = (float)input_buf[i] / FDMDV_SCALE; } nin_prev = *nin; - fdmdv_demod(g_pRxFDMDV, rx_bits, &sync_bit, rx_fdm, nin); + fdmdv_demod(g_pFDMDV, rx_bits, &sync_bit, rx_fdm, nin); *n_input_buf -= nin_prev; assert(*n_input_buf >= 0); @@ -1233,8 +1236,8 @@ int MainFrame::rxCallback( } // compute rx spectrum & get demod stats, and update GUI plot data - fdmdv_get_rx_spectrum(g_pRxFDMDV, rx_spec, rx_fdm, nin_prev); - fdmdv_get_demod_stats(g_pRxFDMDV, &stats); + fdmdv_get_rx_spectrum(g_pFDMDV, rx_spec, rx_fdm, nin_prev); + fdmdv_get_demod_stats(g_pFDMDV, &stats); // Average Data // averageData(rx_spec); for(i = 0; i < FDMDV_NSPEC; i++)