diff --git a/csdr.py b/csdr.py index ee007f2..249605f 100644 --- a/csdr.py +++ b/csdr.py @@ -150,7 +150,13 @@ class dsp(object): if which == "nfm": chain += ["csdr fmdemod_quadri_cf", "csdr limit_ff"] chain += last_decimation_block - chain += ["csdr deemphasis_nfm_ff {output_rate}", "csdr convert_f_s16"] + chain += ["csdr deemphasis_nfm_ff {output_rate}"] + if self.get_audio_rate() != self.get_output_rate(): + chain += [ + "sox -t raw -r {audio_rate} -e floating-point -b 32 -c 1 --buffer 32 - -t raw -r {output_rate} -e signed-integer -b 16 -c 1 - " + ] + else: + chain += ["csdr convert_f_s16"] elif self.isDigitalVoice(which): chain += ["csdr fmdemod_quadri_cf", "dc_block "] chain += last_decimation_block @@ -179,13 +185,6 @@ class dsp(object): "CSDR_FIXED_BUFSIZE=32 csdr agc_ff 160000 0.8 1 0.0000001 {max_gain}".format(max_gain=max_gain), "sox -t raw -r 8000 -e floating-point -b 32 -c 1 --buffer 32 - -t raw -r {output_rate} -e signed-integer -b 16 -c 1 - ", ] - elif which == "packet": - chain += ["csdr fmdemod_quadri_cf"] - chain += last_decimation_block - chain += [ - "csdr convert_f_s16", - "direwolf -r {audio_rate} -t 0 - 1>&2" - ] elif which == "am": chain += ["csdr amdemod_cf", "csdr fastdcblock_ff"] chain += last_decimation_block @@ -195,7 +194,7 @@ class dsp(object): chain += last_decimation_block chain += ["csdr agc_ff", "csdr limit_ff"] # fixed sample rate necessary for the wsjt-x tools. fix with sox... - if self.isWsjtMode() and self.get_audio_rate() != self.get_output_rate(): + if self.get_audio_rate() != self.get_output_rate(): chain += [ "sox -t raw -r {audio_rate} -e floating-point -b 32 -c 1 --buffer 32 - -t raw -r {output_rate} -e signed-integer -b 16 -c 1 - " ] @@ -230,6 +229,12 @@ class dsp(object): chain += "csdr fractional_decimator_ff {last_decimation} | " chain += "csdr agc_ff | csdr limit_ff | csdr convert_f_s16" return chain + elif which == "packet": + chain = secondary_chain_base + "csdr fmdemod_quadri_cf | " + if self.last_decimation != 1.0: + chain += "csdr fractional_decimator_ff {last_decimation} | " + chain += "csdr convert_f_s16 | direwolf -r {audio_rate} -t 0 -" + return chain def set_secondary_demodulator(self, what): if self.get_secondary_demodulator() == what: @@ -281,6 +286,7 @@ class dsp(object): secondary_bpf_transition_bw=self.secondary_bpf_transition_bw(), if_samp_rate=self.if_samp_rate(), last_decimation=self.last_decimation, + audio_rate=self.get_audio_rate(), ) logger.debug("secondary command (demod) = %s", secondary_command_demod) diff --git a/htdocs/css/openwebrx.css b/htdocs/css/openwebrx.css index cd1498b..5266bde 100644 --- a/htdocs/css/openwebrx.css +++ b/htdocs/css/openwebrx.css @@ -698,11 +698,6 @@ img.openwebrx-mirror-img transform-origin: 0% 50%; } -#openwebrx-digimode-content .part .subpart -{ -} - - @keyframes new-digimode-data { 0%{ opacity: 0; } @@ -862,7 +857,8 @@ img.openwebrx-mirror-img #openwebrx-panel-digimodes[data-mode="wspr"] #openwebrx-digimode-select-channel, #openwebrx-panel-digimodes[data-mode="jt65"] #openwebrx-digimode-select-channel, #openwebrx-panel-digimodes[data-mode="jt9"] #openwebrx-digimode-select-channel, -#openwebrx-panel-digimodes[data-mode="ft4"] #openwebrx-digimode-select-channel +#openwebrx-panel-digimodes[data-mode="ft4"] #openwebrx-digimode-select-channel, +#openwebrx-panel-digimodes[data-mode="packet"] #openwebrx-digimode-select-channel { display: none; } @@ -876,3 +872,7 @@ img.openwebrx-mirror-img height: 200px; margin: -10px; } + +#openwebrx-panel-digimodes[data-mode="packet"] #openwebrx-digimode-content-container { + height: 250px; +} diff --git a/htdocs/index.html b/htdocs/index.html index 2629614..328735c 100644 --- a/htdocs/index.html +++ b/htdocs/index.html @@ -74,9 +74,6 @@ -
DIG
@@ -88,6 +85,7 @@ +
diff --git a/htdocs/openwebrx.js b/htdocs/openwebrx.js index 400fa89..0819105 100644 --- a/htdocs/openwebrx.js +++ b/htdocs/openwebrx.js @@ -444,11 +444,6 @@ function demodulator_default_analog(offset_frequency,subtype) { this.low_cut=-3250; this.high_cut=3250; - } - else if(subtype=="packet") - { - this.low_cut=-4000; - this.high_cut=4000; } else if(subtype=="am") { @@ -2748,6 +2743,11 @@ function demodulator_digital_replace(subtype) demodulator_analog_replace('usb', true); demodulator_buttons_update(); break; + case "packet": + secondary_demod_start(subtype); + demodulator_analog_replace('nfm', true); + demodulator_buttons_update(); + break; } $('#openwebrx-panel-digimodes').attr('data-mode', subtype); toggle_panel("openwebrx-panel-digimodes", true); @@ -2848,19 +2848,20 @@ function secondary_demod_push_binary_data(x) function secondary_demod_push_data(x) { - x=Array.from(x).map((y)=>{ + x=Array.from(x).filter((y) => { var c=y.charCodeAt(0); - if(y=="\r") return " "; - if(y=="\n") return " "; - //if(y=="\n") return "
"; - if(c<32||c>126) return ""; + return (c == 10 || (c >= 32 && c <= 126)); + }).map((y) => { if(y=="&") return "&"; if(y=="<") return "<"; if(y==">") return ">"; if(y==" ") return " "; return y; + }).map((y) => { + if (y == "\n") return "
"; + return ""+y+""; }).join(""); - $("#openwebrx-cursor-blink").before(""+x+""); + $("#openwebrx-cursor-blink").before(x); } function secondary_demod_data_clear() @@ -2915,19 +2916,10 @@ function secondary_demod_listbox_changed() { if (secondary_demod_listbox_updating) return; var sdm = $("#openwebrx-secondary-demod-listbox")[0].value; - switch (sdm) { - case "none": - demodulator_analog_replace_last(); - break; - case "bpsk31": - case "rtty": - case "ft8": - case "wspr": - case "jt65": - case "jt9": - case "ft4": - demodulator_digital_replace(sdm); - break; + if (sdm == "none") { + demodulator_analog_replace_last(); + } else { + demodulator_digital_replace(sdm); } update_dial_button(); }