diff --git a/CMakeLists.txt b/CMakeLists.txt index b41eab3..51fa2e8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,13 +10,6 @@ SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake/") set(CURSES_NEED_NCURSES TRUE) set(CURSES_NEED_WIDE TRUE) -#use cmake option -DAERO=ON to enable Aero Builds (OSS support and specific tweaks) -option(AERO - "Build for Aero Environments (Cygwin)" OFF) -if (AERO) - add_definitions(-DAERO_BUILD) -endif () - #use cmake option -DCOLORS=OFF to disable color output option(COLORS "Build with Colors Enabled" ON) diff --git a/download-and-install-cygwin.sh b/download-and-install-cygwin.sh new file mode 100644 index 0000000..b482536 --- /dev/null +++ b/download-and-install-cygwin.sh @@ -0,0 +1,92 @@ +#! /bin/bash +# +#run cygwin installer with this to get all the packages +#use http://www.gtlib.gatech.edu mirror (seems relatively fast) +#.\setup-x86-64.exe --packages nano,libpulse-devel,libpulse-mainloop-glib0,libpulse-simple0,libpulse0,pulseaudio,pulseaudio-debuginfo,pulseaudio-equalizer,pulseaudio-module-x11,pulseaudio-module-zeroconf,pulseaudio-utils,sox-fmt-pulseaudio,libusb0,libusb1.0,libusb1.0-debuginfo,libusb1.0-devel,libncurses++w10,libncurses-devel,libncursesw10,ncurses,cmake,gcc-core,gcc-debuginfo,gcc-objc,git,make,socat,sox,sox-fmt-ao,unzip,wget,gcc-g++,libsndfile-devel +#Nurse the installer by clicking next and waiting for it to finish, etc +#Ignore the warning popup telling you to install libusb from sourceforge, it is NOT NEEDED and actually makes the dongle not work with DSD-FME + +cdir=$(pwd) +clear +printf "Digital Speech Decoder: Florida Man Edition - Auto Installer For Cygwin\n +This will install the required packages, clone, build, and install DSD-FME only. +This has been tested on Cygwin x86-64 as of 20250211. This may take a while!\n +MBELib is considered a requirement on this build. +You must view the Patent Notice prior to continuing. +The Patent Notice can be found at the site below. +https://github.com/lwvmobile/mbelib#readme +Please confirm that you have viewed the patent notice by entering y below.\n\n" +read -p "Have you viewed the patent notice? y/N " ANSWER +ANSWER=$(printf "$ANSWER"|tr '[:upper:]' '[:lower:]') +if [ "$ANSWER" = "y" ]; then + + #is this needed? + LD_LIBRARY_PATH=/usr/local/lib + export LD_LIBRARY_PATH + echo $LD_LIBRARY_PATH + + #ITPP + cd $cdir + printf "Installing itpp 4.3.1 from source http://sourceforge.net/projects/itpp/files/latest/download?source=files\n Please wait!\n" + wget -O itpp-latest.tar.bz2 http://sourceforge.net/projects/itpp/files/latest/download?source=files + tar xjf itpp-latest.tar.bz2 + cd itpp-4.3.1/ + mkdir build + cd build + cmake .. + make + make install + #can't remember if copying this to /bin is required or not + #cp cygitpp-8.dll /bin + + #MBELIB + cd $cdir + git clone https://github.com/lwvmobile/mbelib.git + cd mbelib + git checkout ambe_tones + mkdir build + cd build + cmake .. + make + make install + cp cygmbe-1.dll /bin + + #CODEC2 + cd $cdir + printf "Installing CODEC2\n Please wait!\n" + git clone https://github.com/drowe67/codec2.git + cd codec2 + mkdir build + cd build + cmake .. + make + make install + + #RTL-SDR + cd $cdir + printf "Installing RTL-SDR\n Please wait!\n" + git clone https://github.com/lwvmobile/rtl-sdr.git + cd rtl-sdr + mkdir build + cd build + cmake .. + make + make install + + #DSD-FME + cd $cdir + printf "Installing RTL-SDR\n Please wait!\n" + git clone https://github.com/lwvmobile/dsd-fme.git + cd dsd-fme + git checkout cygwin_fixes + mkdir build + cd build + cmake .. + make + make install + + printf "Any issues, Please report to either:\nhttps://github.com/lwvmobile/dsd-fme/issues or\nhttps://forums.radioreference.com/threads/dsd-fme.438137/\n\n" + +else + printf "Sorry, you cannot build DSD-FME without acknowledging the Patent Notice.\n\n" +fi \ No newline at end of file diff --git a/src/dsd_main.c b/src/dsd_main.c index 0cba257..a44cd92 100644 --- a/src/dsd_main.c +++ b/src/dsd_main.c @@ -107,12 +107,6 @@ void noCarrier (dsd_opts * opts, dsd_state * state) { -// #ifdef AERO_BUILD //NOTE: Blame seems to be synctest8 not being initialized (will continue to test) -// //TODO: Investigate why getSymbol needs to be run first in this context...truly confused here -// if(opts->frame_m17 == 1) //&& opts->audio_in_type == 5 -// for (int i = 0; i < 960; i++) getSymbol(opts, state, 1); //I think this is actually just framesync being a pain -// #endif - if (opts->floating_point == 1) { state->aout_gain = opts->audio_gain; @@ -569,7 +563,7 @@ initOpts (dsd_opts * opts) opts->p25status = 0; opts->p25tg = 0; opts->scoperate = 15; - #ifdef AERO_BUILD + #ifdef __CYGWIN__ sprintf (opts->audio_in_dev, "/dev/dsp"); sprintf (opts->audio_out_dev, "/dev/dsp"); #else @@ -690,7 +684,7 @@ initOpts (dsd_opts * opts) //this may not matter so much, since its already checked later on //but better safe than sorry I guess - #ifdef AERO_BUILD + #ifdef __CYGWIN__ opts->audio_in_type = 9; //only assign when configured opts->audio_out_type = 9; //only assign when configured #else @@ -774,7 +768,7 @@ initOpts (dsd_opts * opts) //slot preference is used during OSS audio playback to //prefer one tdma voice slot over another when both are playing back //this is a fix to OSS 48k/1 output - #ifdef AERO_BUILD + #ifdef __CYGWIN__ opts->slot_preference = 0; //default prefer slot 1 -- state->currentslot = 0; #else opts->slot_preference = 2; //use 2 since integrating the Stereo Channel Patch; @@ -790,7 +784,7 @@ initOpts (dsd_opts * opts) opts->use_hpf_d = 1; //this is a quick bugfix for issues with OSS and TDMA slot 1/2 audio level mismatch - #ifdef AERO_BUILD + #ifdef __CYGWIN__ opts->use_hpf_d = 0; #endif @@ -1275,7 +1269,7 @@ usage () printf (" -O List All Pulse Audio Input Sources and Output Sinks (devices).\n"); printf ("\n"); printf ("Input/Output options:\n"); - #ifdef AERO_BUILD + #ifdef __CYGWIN__ printf (" -i Audio input device (default is /dev/dsp)\n"); printf (" pulse for pulse audio (will require pactl running in Cygwin)\n"); #else @@ -1293,14 +1287,14 @@ usage () printf (" filename.bin for OP25/FME capture bin files\n"); printf (" filename.wav for 48K/1 wav files (SDR++, GQRX)\n"); printf (" filename.wav -s 96000 for 96K/1 wav files (DSDPlus)\n"); - #ifdef AERO_BUILD + #ifdef __CYGWIN__ printf (" (Use single quotes '\\directory\\audio file.wav' when directories/spaces are present)\n"); #else printf (" (Use single quotes '/directory/audio file.wav' when directories/spaces are present)\n"); #endif // printf (" (Windows - '\directory\audio file.wav' backslash, not forward slash)\n"); printf (" -s Sample Rate of wav input files (48000 or 96000) Mono only!\n"); - #ifdef AERO_BUILD + #ifdef __CYGWIN__ printf (" -o Audio output device (default is /dev/dsp)\n"); printf (" pulse for pulse audio (will require pactl running in Cygwin)\n"); #else @@ -1338,7 +1332,7 @@ usage () printf (" -c Output symbol capture to .bin file\n"); printf (" -q Reverse Mute - Mute Unencrypted Voice and Unmute Encrypted Voice\n"); printf (" -V Enable TDMA Voice Synthesis on Slot 1 (1), Slot 2 (2), or Both (3); Default is 3; \n"); - // #ifdef AERO_BUILD + // #ifdef __CYGWIN__ printf (" If using /dev/dsp input and output at 48k1, launch two instances of DSD-FME w -V 1 and -V 2 if needed"); // #endif // printf (" (Audio Smoothing is now disabled on all upsampled output by default -- fix crackle/buzz bug)\n"); @@ -1678,8 +1672,12 @@ int main (int argc, char **argv) { int c; + //optarg and optind already defined when using Cygwin, no need to do so again + #ifdef __CYGWIN__ + #else extern char *optarg; - extern int optind, opterr, optopt; + extern int optind; + #endif dsd_opts opts; dsd_state state; char versionstr[25]; @@ -1694,8 +1692,8 @@ main (int argc, char **argv) fprintf (stderr,"%s\n", FM_banner[i]); } - #ifdef AERO_BUILD - fprintf (stderr, "Build Version: AW (20231015) \n"); + #ifdef __CYGWIN__ + fprintf (stderr, "Build Version: AW %s (CYGWIN)\n", GIT_TAG); #else fprintf (stderr, "Build Version: AW %s \n", GIT_TAG); #endif @@ -1716,7 +1714,7 @@ main (int argc, char **argv) while ((c = getopt (argc, argv, "yhaepPqs:t:v:z:i:o:d:c:g:n:w:B:C:R:f:m:u:x:A:S:M:G:D:L:V:U:YK:b:H:X:NQ:WrlZTF01:2:345:6:7:89Ek:I:JO")) != -1) { - opterr = 0; + switch (c) { case 'h': @@ -3019,7 +3017,7 @@ main (int argc, char **argv) } else { - #ifdef AERO_BUILD + #ifdef __CYGWIN__ sprintf (opts.audio_in_dev, "%s", "/dev/dsp"); opts.audio_in_type = 5; #else @@ -3150,7 +3148,7 @@ main (int argc, char **argv) rtl_ok = 1; #endif - #ifdef AERO_BUILD + #ifdef __CYGWIN__ if (rtl_ok == 0) //not set, means rtl support isn't compiled/available { fprintf (stderr, "RTL Support not enabled/compiled, falling back to OSS /dev/dsp Audio Input.\n"); @@ -3205,7 +3203,7 @@ main (int argc, char **argv) if (err < 0) { fprintf (stderr, "Error Configuring UDP Socket for UDP Blaster Audio :( \n"); - #ifdef AERO_BUILD + #ifdef __CYGWIN__ sprintf (opts.audio_in_dev, "%s", "/dev/dsp"); opts.audio_in_type = 5; //since I can't determine what the configuration will be for 48k1 or 8k2 here(lazy), need to exit diff --git a/src/dsd_mbe.c b/src/dsd_mbe.c index ddf884e..ea361f6 100644 --- a/src/dsd_mbe.c +++ b/src/dsd_mbe.c @@ -917,7 +917,7 @@ processMbeFrame (dsd_opts * opts, dsd_state * state, char imbe_fr[8][23], char a { if ( opts->floating_point == 0 ) //opts->audio_out == 1 && //needed to remove for AERO OSS so we could still save wav files during dual voices { - #ifdef AERO_BUILD + #ifdef __CYGWIN__ if(opts->audio_out == 1 && opts->slot1_on == 1) //add conditional check here, otherwise some lag occurs on dual voices with OSS48k/1 input due to buffered audio #endif processAudio(opts, state); @@ -994,7 +994,7 @@ processMbeFrame (dsd_opts * opts, dsd_state * state, char imbe_fr[8][23], char a { if ( opts->floating_point == 0) //opts->audio_out == 1 && //needed to remove for AERO OSS so we could still save wav files during dual voices { - #ifdef AERO_BUILD + #ifdef __CYGWIN__ if(opts->audio_out == 1 && opts->slot2_on == 1) //add conditional check here, otherwise some lag occurs on dual voices with OSS48k/1 input due to buffered audio #endif processAudioR(opts, state); diff --git a/src/dsd_ncurses.c b/src/dsd_ncurses.c index aafe389..89ee7b3 100644 --- a/src/dsd_ncurses.c +++ b/src/dsd_ncurses.c @@ -2419,35 +2419,12 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state) //Start Printing Section erase(); -#ifdef AERO_BUILD - if (opts->ncurses_compact == 1) - { - printw ("------------------------------------------------------------------------------\n"); - printw ("| Digital Speech Decoder: Florida Man Edition - Aero %s \n", "AW (20231015)"); - printw ("------------------------------------------------------------------------------\n"); - } -#elif LIMAZULUTWEAKS - if (opts->ncurses_compact == 1) - { - printw ("------------------------------------------------------------------------------\n"); - printw ("| Digital Speech Decoder: LimaZulu Edition VI: Return of the Zulu \n"); - printw ("------------------------------------------------------------------------------\n"); - } -#elif ZDEV_BUILD - if (opts->ncurses_compact == 1) - { - printw ("------------------------------------------------------------------------------\n"); - printw ("| Digital Speech Decoder: Florida Man Edition - zDEV %s \n", GIT_TAG); - printw ("------------------------------------------------------------------------------\n"); - } -#else if (opts->ncurses_compact == 1) { printw ("------------------------------------------------------------------------------\n"); printw ("| Digital Speech Decoder: Florida Man Edition - AW %s \n", GIT_TAG); printw ("------------------------------------------------------------------------------\n"); } -#endif if (opts->ncurses_compact == 0) { attron(COLOR_PAIR(6)); @@ -2461,16 +2438,12 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state) #ifdef USE_CODEC2 if (i == 4 && opts->frame_m17 == 1) printw (" CODEC2"); #endif - #ifdef AERO_BUILD - if (i == 5) printw (" %s ", "Aero Build"); - if (i == 6) printw (" AW (20231015) \n"); - #elif ZDEV_BUILD - if (i == 5) printw (" %s ", "AW "); - if (i == 6) printw (" %s \n", GIT_TAG); + #ifdef __CYGWIN__ + if (i == 5) printw (" %s ", "AW (CYGWIN)"); #else if (i == 5) printw (" %s ", "AW "); - if (i == 6) printw (" %s \n", GIT_TAG); #endif + if (i == 6) printw (" %s \n", GIT_TAG); else printw ("\n"); } attroff(COLOR_PAIR(6)); //6 @@ -2865,12 +2838,12 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state) printw ("| Voice Error: [%X][%X] Slot 1 (1)", state->errs&0xF, state->errs2&0xF); if (opts->slot1_on == 0) printw (" OFF"); if (opts->slot1_on == 1) printw (" ON"); - if (opts->slot_preference == 0) printw (" *Preferred"); + if (opts->slot_preference == 0) printw (" *Preferred (3)"); printw ("\n"); printw ("| Voice Error: [%X][%X] Slot 2 (2)", state->errsR&0xF, state->errs2R&0xF); if (opts->slot2_on == 0) printw (" OFF"); if (opts->slot2_on == 1) printw (" ON"); - if (opts->slot_preference == 1) printw (" *Preferred"); + if (opts->slot_preference == 1) printw (" *Preferred (3)"); printw ("\n"); } printw ("------------------------------------------------------------------------------\n"); @@ -4421,7 +4394,7 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state) } } - #ifdef AERO_BUILD + #ifdef __CYGWIN__ //do nothing #else if (c == 32) //'space bar' replay last bin file (rework to do wav files too?) @@ -4475,7 +4448,7 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state) } // - #ifdef AERO_BUILD //this might be okay on Aero as well, will need to look into and/or test + #ifdef __CYGWIN__ //this might be okay on Aero as well, will need to look into and/or test // #else if (c == 115) //'s' key, stop playing wav or symbol in files diff --git a/src/dsd_symbol.c b/src/dsd_symbol.c index 9cb06db..74e6d9b 100644 --- a/src/dsd_symbol.c +++ b/src/dsd_symbol.c @@ -141,7 +141,7 @@ getSymbol (dsd_opts * opts, dsd_state * state, int have_sync) //tcp socket input from SDR++ -- now with 1 retry if connection is broken else if (opts->audio_in_type == 8) { - #ifdef AERO_BUILD + #ifdef __CYGWIN__ result = sf_read_short(opts->tcp_file_in, &sample, 1); if(result == 0) { fprintf (stderr, "\nConnection to TCP Server Interrupted. Trying again in 3 seconds.\n"); diff --git a/src/p25p2_frame.c b/src/p25p2_frame.c index 6c329af..4bacb1a 100644 --- a/src/p25p2_frame.c +++ b/src/p25p2_frame.c @@ -481,16 +481,6 @@ void process_4V (dsd_opts * opts, dsd_state * state) fprintf (stderr, "\n"); } - // #ifdef AERO_BUILD //FUN FACT: OSS stutters only on Cygwin, using padsp in linux, it actually opens two virtual /dev/dsp audio streams for output - // //Cygwin OSS Slot Preference Pre-emption shim - // if (opts->audio_out_type == 5) - // { - // //set to 21 for MBE OSS shim to preempt audio - // if (state->currentslot == 0) state->dmrburstL = 21; - // else state->dmrburstR = 21; - // } - // #endif - //unsure of the best location for these counter resets if (state->voice_counter[0] >= 18) state->voice_counter[0] = 0; @@ -778,16 +768,6 @@ void process_2V (dsd_opts * opts, dsd_state * state) fprintf (stderr, "\n"); } - // #ifdef AERO_BUILD //FUN FACT: OSS stutters only on Cygwin, using padsp in linux, it actually opens two virtual /dev/dsp audio streams for output - // //Cygwin OSS Slot Preference Pre-emption shim - // if (opts->audio_out_type == 5) - // { - // //set to 21 for MBE OSS shim to preempt audio - // if (state->currentslot == 0) state->dmrburstL = 21; - // else state->dmrburstR = 21; - // } - // #endif - //unsure of the best location for these counter resets if (state->voice_counter[0] >= 18) state->voice_counter[0] = 0; diff --git a/src/p25p2_xcch.c b/src/p25p2_xcch.c index efc23fd..bccd89b 100644 --- a/src/p25p2_xcch.c +++ b/src/p25p2_xcch.c @@ -395,7 +395,7 @@ void process_SACCH_MAC_PDU (dsd_opts * opts, dsd_state * state, int payload[180] if (opcode == 0x4 && err == 0) { //disable to prevent blinking in ncurses terminal due to OSS preemption shim - #ifdef AERO_BUILD + #ifdef __CYGWIN__ if (opts->audio_out_type != 5) { if (state->currentslot == 1) state->dmrburstL = 21; @@ -787,7 +787,7 @@ void process_FACCH_MAC_PDU (dsd_opts * opts, dsd_state * state, int payload[156] if (opcode == 0x4 && err == 0) { //disable to prevent blinking in ncurses terminal due to OSS preemption shim - #ifdef AERO_BUILD + #ifdef __CYGWIN__ if (opts->audio_out_type != 5) { if (state->currentslot == 0) state->dmrburstL = 21;