From 50748ec042ec597e02d88fbfde67ac63cf6f13f8 Mon Sep 17 00:00:00 2001 From: ha7ilm Date: Thu, 4 May 2017 23:48:09 +0200 Subject: [PATCH] This version at least does not hang when selecting BPSK31. --- csdr.py | 25 ++++++++++++------------- htdocs/openwebrx.js | 2 +- openwebrx.py | 32 +++++++++++++++++++------------- 3 files changed, 32 insertions(+), 27 deletions(-) diff --git a/csdr.py b/csdr.py index 477e55f..9d02ea7 100755 --- a/csdr.py +++ b/csdr.py @@ -77,8 +77,8 @@ class dsp: return fft_chain_base chain_begin=any_chain_base+"csdr shift_addition_cc --fifo {shift_pipe} | csdr fir_decimate_cc {decimation} {ddc_transition_bw} HAMMING | csdr bandpass_fir_fft_cc --fifo {bpf_pipe} {bpf_transition_bw} HAMMING | csdr squelch_and_smeter_cc --fifo {squelch_pipe} --outfifo {smeter_pipe} 5 1 | " if self.secondary_demodulator: - chain_begin+="csdr tee {iqtee_pipe} | " - chain_begin+="csdr tee {iqtee2_pipe} | " + chain_begin+="tee {iqtee_pipe} | " + # chain_begin+="tee {iqtee2_pipe} | " #TODO digimodes chain_end = "" if self.audio_compression=="adpcm": chain_end = " | csdr encode_ima_adpcm_i16_u8" @@ -87,20 +87,19 @@ class dsp: elif which == "ssb": return chain_begin + "csdr realpart_cf | csdr old_fractional_decimator_ff {last_decimation} | csdr agc_ff | csdr limit_ff | csdr convert_f_s16"+chain_end def secondary_chain(self, which): + return "cat {input_pipe}" #TODO digimodes secondary_chain_base="cat {input_pipe} | " - if which == "fft": return secondary_chain_base+"csdr realpart_cf | csdr fft_fc {secondary_fft_size} {secondary_fft_block_size} | csdr logpower_cf -70 | csdr fft_one_side_ff {secondary_fft_size}" + (" | csdr compress_fft_adpcm_f_u8 {secondary_fft_size}" if self.fft_compression=="adpcm" else "") elif which == "bpsk31": - return secondary_chain_base+"""csdr shift_addition_cc {secondary_shift_pipe} | \ -csdr bandpass_fir_fft_cc -{secondary_bpf_cutoff} {secondary_bpf_cutoff} {secondary_bpf_transition_bw} HAMMING | \ -csdr simple_agc_cc 0.0001 0.5 | \ -csdr timing_recovery_cc EARLYLATE {secondary_samples_per_bits} --add_q | \ -CSDR_FIXED_BUFSIZE=1 csdr realpart_cf | \ -CSDR_FIXED_BUFSIZE=1 csdr binary_slicer_f_u8 | \ -CSDR_FIXED_BUFSIZE=1 csdr differential_decoder_u8_u8 | \ -CSDR_FIXED_BUFSIZE=1 csdr psk31_varicode_decoder_u8_u8 -""" + return secondary_chain_base + "csdr shift_addition_cc {secondary_shift_pipe} | " + \ + "csdr bandpass_fir_fft_cc -{secondary_bpf_cutoff} {secondary_bpf_cutoff} {secondary_bpf_transition_bw} HAMMING | " + \ + "csdr simple_agc_cc 0.0001 0.5 | " + \ + "csdr timing_recovery_cc EARLYLATE {secondary_samples_per_bits} --add_q | " + \ + "CSDR_FIXED_BUFSIZE=1 csdr realpart_cf | " + \ + "CSDR_FIXED_BUFSIZE=1 csdr binary_slicer_f_u8 | " + \ + "CSDR_FIXED_BUFSIZE=1 csdr differential_decoder_u8_u8 | " + \ + "CSDR_FIXED_BUFSIZE=1 csdr psk31_varicode_decoder_u8_u8" def set_secondary_demodulator(self, what): self.secondary_demodulator = what @@ -302,7 +301,7 @@ CSDR_FIXED_BUFSIZE=1 csdr psk31_varicode_decoder_u8_u8 pipe_path = getattr(self,pipe_name,None) if pipe_path: try: os.unlink(pipe_path) - except: print "[openwebrx-dsp-plugin:csdr] try_delete_pipes() :: unlink failed: " + pipe_path + except Exception as e: print "[openwebrx-dsp-plugin:csdr] try_delete_pipes() ::", e def set_pipe_nonblocking(self, pipe): flags = fcntl.fcntl(pipe, fcntl.F_GETFL) diff --git a/htdocs/openwebrx.js b/htdocs/openwebrx.js index 1075ba3..f725393 100644 --- a/htdocs/openwebrx.js +++ b/htdocs/openwebrx.js @@ -1165,7 +1165,7 @@ function on_ws_recv(evt) var waterfall_i16=fft_codec.decode(new Uint8Array(evt.data,4)); var waterfall_f32=new Float32Array(waterfall_i16.length-COMPRESS_FFT_PAD_N); for(var i=0;i