diff --git a/src/dpmr_voice.c b/src/dpmr_voice.c index 53e1c91..47988c4 100644 --- a/src/dpmr_voice.c +++ b/src/dpmr_voice.c @@ -428,7 +428,7 @@ void processdPMRvoice (dsd_opts * opts, dsd_state * state) if (state->R != 0) { fprintf (stderr, "%s", KYEL); - fprintf (stderr, " KEY VALUE: [%05lld] ", state->R ); + fprintf (stderr, " Key %05lld ", state->R ); fprintf (stderr, "%s", KNRM); } } diff --git a/src/dsd_main.c b/src/dsd_main.c index 182b62c..68d5eb5 100644 --- a/src/dsd_main.c +++ b/src/dsd_main.c @@ -52,7 +52,7 @@ char * FM_banner[9] = { " ██║ ██║ ╚═══██╗██║ ██║   ██╔══╝ ██║╚██╔╝██║██╔══╝ ", " ██████╔╝██████╔╝██████╔╝   ██║ ██║ ╚═╝ ██║███████╗", " ╚═════╝ ╚═════╝ ╚═════╝    ╚═╝ ╚═╝ ╚═╝╚══════╝", - " 'Lite' Edition v2.0.0-8-g235eeed Windows 32-bit RC2 " + " 'Lite' Edition v2.0.0-9-g9b8a382 Windows 32-bit RC2a " }; int diff --git a/src/dsd_ncurses.c b/src/dsd_ncurses.c index e468463..f785429 100644 --- a/src/dsd_ncurses.c +++ b/src/dsd_ncurses.c @@ -840,8 +840,13 @@ void ncursesMenu (dsd_opts * opts, dsd_state * state) if(opts->tcp_file_in == NULL) { fprintf(stderr, "Error, couldn't open TCP with libsndfile: %s\n", sf_strerror(NULL)); - sprintf (opts->audio_in_dev, "%s", "pulse"); - opts->audio_in_type = 0; + if (opts->audio_out_type == 0) + { + sprintf (opts->audio_in_dev, "%s", "pulse"); + opts->audio_in_type = 0; + } + else opts->audio_in_type = 5; + } state->audio_smoothing = 0; //disable smoothing to prevent random crackling/buzzing @@ -971,7 +976,8 @@ void ncursesMenu (dsd_opts * opts, dsd_state * state) } } - opts->audio_in_type = 0; //set after closing to prevent above crash condition + if (opts->audio_out_type == 0) opts->audio_in_type = 0; //set after closing to prevent above crash condition + else (opts->audio_in_type = 5); choicec = 18; //exit } @@ -1688,31 +1694,17 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state) c = getch(); } - //testing sending UDP commands to the socket inside of rtl_sdr_fm.cpp - //this works, but we will want to make an init func open one time, and have sendto here + //use rtl_udp_tune #ifdef USE_RTLSDR if (temp_freq == opts->rtlsdr_center_freq) { - handle = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); - - memset((char * ) & address, 0, sizeof(address)); - address.sin_family = AF_INET; - address.sin_addr.s_addr = inet_addr(SRV_IP); //address of host - address.sin_port = htons(udp_port); - sendto(handle, data, UDP_BUFLEN, 0, (const struct sockaddr * ) & address, sizeof(struct sockaddr_in)); - + rtl_udp_tune (opts, state, temp_freq); temp_freq = -1; } #endif //Variable reset/set section - //carrier reset - // if (state->carrier == 0) //reset these to 0 when no carrier - // { - // sprintf(state->dmr_branding, "%s", ""); - // } - //set lls sync types if (state->synctype >= 0 && state->synctype < 39) { @@ -2061,7 +2053,7 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state) if (opts->ncurses_compact == 1) { printw ("------------------------------------------------------------------------------\n"); - printw ("| Digital Speech Decoder: Florida Man Edition - Win32 %s \n", "v2.0.0-8-g235eeed RC2"); + printw ("| Digital Speech Decoder: Florida Man Edition - Win32 %s \n", "v2.0.0-9-g9b8a382 RC2a"); } if (opts->ncurses_compact == 0) { @@ -2072,8 +2064,8 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state) if (i == 1) printw (" ESC to Menu"); if (i == 2) printw (" 'q' to Quit "); if (i == 4) printw (" MBElib %s", versionstr); - if (i == 5) printw (" %s ", "Win32 RC2"); //printw (" %s \n", GIT_TAG); - if (i == 6) printw (" %s \n", "v2.0.0-8-g235eeed"); //printw (" %s \n", GIT_TAG); + if (i == 5) printw (" %s ", "Win32 RC2a"); //printw (" %s \n", GIT_TAG); + if (i == 6) printw (" %s \n", "v2.0.0-9-g9b8a382"); //printw (" %s \n", GIT_TAG); else printw ("\n"); } attroff(COLOR_PAIR(6)); //6 @@ -3185,8 +3177,13 @@ if (c == 115) //'s' key, stop playing wav or symbol in files sf_close(opts->audio_in_file); } - opts->audio_in_type = 0; - openPulseInput(opts); + if (opts->audio_out_type == 0) + { + opts->audio_in_type = 0; + openPulseInput(opts); + } + else opts->audio_in_type = 5;//cleanupAndExit(opts, state); + } //Lockout bug in EDACS prevents any group from tuning when using this, not sure why yet diff --git a/src/dsd_rigctl.c b/src/dsd_rigctl.c index c4288eb..b1a921d 100644 --- a/src/dsd_rigctl.c +++ b/src/dsd_rigctl.c @@ -273,4 +273,9 @@ void rtl_udp_tune(dsd_opts * opts, dsd_state * state, long int frequency) address.sin_addr.s_addr = inet_addr("127.0.0.1"); //make user configurable later address.sin_port = htons(udp_port); sendto(handle, data, 5, 0, (const struct sockaddr * ) & address, sizeof(struct sockaddr_in)); + + //BUGFIX: This was causing an indefinite number of UDP sockets to stay open on each tune request + //we open a new socket with each request, so we need to close the socket after writing to it + //this would cause the tuning to stop after x number of tune attempts (few hours? on a busy system) + close (handle); //close socket after sending. } \ No newline at end of file