From 73c43b030ead062b634bdd2452f639cd2f55a1fa Mon Sep 17 00:00:00 2001 From: lwvmobile Date: Sat, 29 Jul 2023 00:02:17 -0400 Subject: [PATCH] Rename XDMA to AUTO; Disable Legacy Auto; --- src/dsd_main.c | 57 ++++++++++++++++++----------------------------- src/dsd_ncurses.c | 53 ++++++++++--------------------------------- 2 files changed, 34 insertions(+), 76 deletions(-) diff --git a/src/dsd_main.c b/src/dsd_main.c index 08f3094..84c0bd0 100644 --- a/src/dsd_main.c +++ b/src/dsd_main.c @@ -621,13 +621,13 @@ initOpts (dsd_opts * opts) opts->pulse_raw_in_channels = 1; opts->pulse_raw_out_channels = 1; opts->pulse_digi_in_channels = 1; //2 - opts->pulse_digi_out_channels = 2; //new default for XDMA + opts->pulse_digi_out_channels = 2; //new default for AUTO opts->wav_sample_rate = 48000; //default value (DSDPlus uses 96000 on raw signal wav files) opts->wav_interpolator = 1; //default factor of 1 on 48000; 2 on 96000; sample rate / decimator opts->wav_decimator = 48000; //maybe for future use? - sprintf (opts->output_name, "XDMA"); + sprintf (opts->output_name, "AUTO"); opts->pulse_flush = 1; //set 0 to flush, 1 for flushed opts->use_ncurses_terminal = 0; opts->ncurses_compact = 0; @@ -1193,7 +1193,7 @@ usage () printf (" -w Output synthesized speech to a .wav file, FDMA modes only.\n"); printf (" -7 Create/Use Custom directory for Per Call decoded .wav file saving.\n"); printf (" (Single Nested Directory Only! Use Before the -P option!)\n"); - printf (" -P Enable Per Call WAV file saving in XDMA and NXDN decoding classes\n"); + printf (" -P Enable Per Call WAV file saving in AUTO and NXDN decoding classes\n"); printf (" (Per Call can only be used in Ncurses Terminal!)\n"); printf (" (Running in console will use static wav files)\n"); printf (" -a Enable Call Alert Beep (NCurses Terminal Only)\n"); @@ -1224,8 +1224,8 @@ usage () printf (" Example: dsd-fme -fp -i rtl:0:851.375M:22:-2:24:0:6021\n"); printf ("\n"); printf ("Decoder options:\n"); - printf (" -fa Legacy Auto Detection (old methods default)\n"); - printf (" -ft XDMA P25 and DMR BS/MS frame types (new default)\n"); + printf (" -fa Auto Detection\n"); + printf (" -ft AUTO P25, YSF, and DMR BS/MS frame types (new default)\n"); printf (" -fs DMR Stereo BS and MS Simplex\n"); printf (" -f1 Decode only P25 Phase 1\n"); printf (" -f2 Decode only P25 Phase 2 (6000 sps) **\n"); @@ -1852,7 +1852,7 @@ main (int argc, char **argv) fprintf (stderr, "Creating directory %s to save decoded wav files\n", wav_file_directory); mkdir(wav_file_directory, 0700); //user read write execute, needs execute for some reason or segfault } - fprintf (stderr,"XDMA and NXDN Per Call Wav File Saving Enabled. (NCurses Terminal Only)\n"); + fprintf (stderr,"AUTO and NXDN Per Call Wav File Saving Enabled. (NCurses Terminal Only)\n"); sprintf (opts.wav_out_file, "./%s/DSD-FME-X1.wav", opts.wav_out_dir); sprintf (opts.wav_out_fileR, "./%s/DSD-FME-X2.wav", opts.wav_out_dir); opts.dmr_stereo_wav = 1; @@ -1860,23 +1860,6 @@ main (int argc, char **argv) openWavOutFileR (&opts, &state); break; - // case 'P': //TDMA/NXDN Per Call - was T, now is P - // sprintf (wav_file_directory, "./WAV"); - // wav_file_directory[1023] = '\0'; - // if (stat(wav_file_directory, &st) == -1) - // { - // fprintf (stderr, "-P %s WAV file directory does not exist\n", wav_file_directory); - // fprintf (stderr, "Creating directory %s to save decoded wav files\n", wav_file_directory); - // mkdir(wav_file_directory, 0700); //user read write execute, needs execute for some reason or segfault - // } - // fprintf (stderr,"XDMA and NXDN Per Call Wav File Saving Enabled. (NCurses Terminal Only)\n"); - // sprintf (opts.wav_out_file, "./WAV/DSD-FME-X1.wav"); - // sprintf (opts.wav_out_fileR, "./WAV/DSD-FME-X2.wav"); - // opts.dmr_stereo_wav = 1; - // openWavOutFileL (&opts, &state); - // openWavOutFileR (&opts, &state); - // break; - case 'F': opts.aggressive_framesync = 0; fprintf (stderr, "%s", KYEL); @@ -1947,12 +1930,13 @@ main (int argc, char **argv) break; case 'f': - if (optarg[0] == 'a') + if (optarg[0] == 'a') // { - opts.frame_dstar = 1; + opts.frame_dstar = 0; opts.frame_x2tdma = 1; opts.frame_p25p1 = 1; - opts.frame_p25p2 = 0; + opts.frame_p25p2 = 1; + opts.inverted_p2 = 0; opts.frame_nxdn48 = 0; opts.frame_nxdn96 = 0; opts.frame_dmr = 1; @@ -1960,13 +1944,16 @@ main (int argc, char **argv) opts.frame_provoice = 0; opts.frame_ysf = 1; opts.frame_m17 = 0; + opts.mod_c4fm = 1; + opts.mod_qpsk = 0; + state.rf_mod = 0; + opts.dmr_stereo = 1; + opts.dmr_mono = 0; + // opts.setmod_bw = 12000; //safe default on both DMR and P25 opts.pulse_digi_rate_out = 8000; - opts.pulse_digi_out_channels = 1; - opts.dmr_stereo = 0; //switching in 'stereo' for 'mono' - opts.dmr_mono = 1; - state.dmr_stereo = 0; - //opts.setmod_bw = 7000; - sprintf (opts.output_name, "Legacy Auto"); + opts.pulse_digi_out_channels = 2; + sprintf (opts.output_name, "AUTO"); + fprintf (stderr,"Decoding AUTO P25, YSF, and DMR\n"); } else if (optarg[0] == 'd') { @@ -2206,9 +2193,9 @@ main (int argc, char **argv) // opts.setmod_bw = 12000; //safe default on both DMR and P25 opts.pulse_digi_rate_out = 8000; opts.pulse_digi_out_channels = 2; - sprintf (opts.output_name, "XDMA"); - fprintf (stderr,"Decoding XDMA P25 and DMR\n"); - } + sprintf (opts.output_name, "AUTO"); + fprintf (stderr,"Decoding AUTO P25, YSF, and DMR\n"); + } else if (optarg[0] == 'n') { opts.frame_dstar = 0; diff --git a/src/dsd_ncurses.c b/src/dsd_ncurses.c index ac88201..83939fd 100644 --- a/src/dsd_ncurses.c +++ b/src/dsd_ncurses.c @@ -314,7 +314,7 @@ char *choicesc[] = { "Save Decoded Audio WAV (Legacy Mode)", "Save Signal to Symbol Capture Bin", "Toggle Muting Encrypted Traffic ", - "Save Per Call Decoded WAV (XDMA and NXDN)", + "Save Per Call Decoded WAV (AUTO and NXDN)", "Setup and Start RTL Input ", "Retune RTL Dongle ", "Toggle C4FM/QPSK (P2 TDMA CC)", @@ -332,10 +332,10 @@ char *choicesc[] = { char *choices[] = { "Resume Decoding", - "Decode Legacy Auto**", - "Decode XDMA (P25 and DMR BS/MS)", - "Decode D-STAR*", - "Decode P25p1*", + "Decode AUTO", + "Decode M17", + "Decode D-STAR", + "Decode P25p1", "Decode EDACS/PV", "Decode P25p2 ", "Decode dPMR", @@ -378,26 +378,6 @@ void print_menu(WINDOW *menu_win, int highlight) wrefresh(menu_win); } -// void print_menub(WINDOW *menu_win, int highlight) -// { -// int x, y, i; -// -// x = 2; -// y = 2; -// box(menu_win, 0, 0); -// for(i = 0; i < n_choicesb; ++i) -// { if(highlight == i + 1) /* High light the present choice */ -// { wattron(menu_win, A_REVERSE); -// mvwprintw(menu_win, y, x, "%s", choicesb[i]); -// wattroff(menu_win, A_REVERSE); -// } -// else -// mvwprintw(menu_win, y, x, "%s", choicesb[i]); -// ++y; -// } -// wrefresh(menu_win); -// } - void print_menuc(WINDOW *menu_win, int highlight) { int x, y, i; @@ -545,21 +525,12 @@ void ncursesMenu (dsd_opts * opts, dsd_state * state) print_menu(menu_win, highlight); - //test print info boxes on side of certain options - if (highlight == 2) - { - info_win = newwin(6, WIDTH+18, starty, startx+20); - box (info_win, 0, 0); - mvwprintw(info_win, 2, 2, " Legacy Auto can only detect the following:"); - mvwprintw(info_win, 3, 2, " P25p1, D-STAR, DMR Mono, YSF, and X2-TDMA"); - wrefresh(info_win); - } - if (highlight == 3) + if (highlight == 2) { info_win = newwin(7, WIDTH+18, starty, startx+20); box (info_win, 0, 0); - mvwprintw(info_win, 2, 2, " XDMA Decoding Class Supports the following:"); + mvwprintw(info_win, 2, 2, " AUTO Decoding Class Supports the following:"); mvwprintw(info_win, 3, 2, " P25p1, P25p2, YSF, and DMR BS/MS"); mvwprintw(info_win, 4, 2, " C4FM, FSK4, QPSK only (no H8D-QPSK)"); wrefresh(info_win); @@ -1236,7 +1207,7 @@ void ncursesMenu (dsd_opts * opts, dsd_state * state) break; } - if (choice == 2) + if (choice == 99) { //setup Auto parameters--default ones // resetState (state); //use sparingly, may cause memory leak @@ -1366,9 +1337,9 @@ void ncursesMenu (dsd_opts * opts, dsd_state * state) break; } - if (choice == 3) + if (choice == 2) { - //XDMA Stereo P25 1, 2, and DMR + //AUTO Stereo P25 1, 2, and DMR // resetState (state); //use sparingly, seems to cause issue when switching back to other formats if (opts->use_heuristics == 1) { @@ -1380,7 +1351,7 @@ void ncursesMenu (dsd_opts * opts, dsd_state * state) state->samplesPerSymbol = 10; state->symbolCenter = 4; state->rf_mod = 0; - sprintf (opts->output_name, "XDMA"); + sprintf (opts->output_name, "AUTO"); opts->dmr_mono = 0; opts->dmr_stereo = 1; //this value is the end user option state->dmr_stereo = 0; //this values toggles on and off depending on voice or data handling @@ -1573,7 +1544,7 @@ void ncursesMenu (dsd_opts * opts, dsd_state * state) opts->mod_gfsk = 0; state->rf_mod = 0; } - if (choice == 99) //TODO: Slot this into the menu choices, and maybe rearrange them into the correct order as well + if (choice == 3) { //Decode M17 // resetState (state); //use sparingly, may cause memory leak