diff --git a/config_webrx.py b/config_webrx.py index f156d0f..47ebe0d 100644 --- a/config_webrx.py +++ b/config_webrx.py @@ -77,6 +77,10 @@ fft_compression="adpcm" #valid values: "adpcm", "none" digimodes_enable=True #Decoding digimodes come with higher CPU usage. digimodes_fft_size=1024 +# determines the quality, and thus the cpu usage, for the ambe codec used by digital voice modes +# if you're running on a Raspi (up to 3B+) you'll want to leave this on 1 +digital_voice_unvoiced_quality = 1 + """ Note: if you experience audio underruns while CPU usage is 100%, you can: - decrease `samp_rate`, diff --git a/csdr.py b/csdr.py index 6ce0ea8..f2aa9df 100755 --- a/csdr.py +++ b/csdr.py @@ -70,6 +70,7 @@ class dsp(object): self.pipe_names=["bpf_pipe", "shift_pipe", "squelch_pipe", "smeter_pipe", "meta_pipe", "iqtee_pipe", "iqtee2_pipe"] self.secondary_pipe_names=["secondary_shift_pipe"] self.secondary_offset_freq = 1000 + self.unvoiced_quality = 1 self.modification_lock = threading.Lock() self.output = output @@ -105,11 +106,11 @@ class dsp(object): chain += "dsd -fd" elif which == "nxdn": chain += "dsd -fi" - chain += " -i - -o - -u 2 -g 10 | " + chain += " -i - -o - -u {unvoiced_quality} -g 10 | " elif which == "dmr": - chain += "rrc_filter | gfsk_demodulator | dmr_decoder --fifo {meta_pipe} | mbe_synthesizer | " + chain += "rrc_filter | gfsk_demodulator | dmr_decoder --fifo {meta_pipe} | mbe_synthesizer -u {unvoiced_quality} | " elif which == "ysf": - chain += "rrc_filter | gfsk_demodulator | ysf_decoder --fifo {meta_pipe} | mbe_synthesizer -y | " + chain += "rrc_filter | gfsk_demodulator | ysf_decoder --fifo {meta_pipe} | mbe_synthesizer -y -u {unvoiced_quality} | " chain += "sox -t raw -r 8000 -e signed-integer -b 16 -c 1 --buffer 32 - -t raw -r {output_rate} -e signed-integer -b 16 -c 1 - " elif which == "am": chain += "csdr amdemod_cf | csdr fastdcblock_ff | " @@ -347,6 +348,13 @@ class dsp(object): self.squelch_pipe_file.flush() self.modification_lock.release() + def set_unvoiced_quality(self, q): + self.unvoiced_quality = q + self.restart() + + def get_unvoiced_quality(self): + return self.unvoiced_quality + def mkfifo(self,path): try: os.unlink(path) @@ -393,7 +401,8 @@ class dsp(object): bpf_transition_bw=float(self.bpf_transition_bw)/self.if_samp_rate(), ddc_transition_bw=self.ddc_transition_bw(), flowcontrol=int(self.samp_rate*2), start_bufsize=self.base_bufsize*self.decimation, nc_port=self.nc_port, squelch_pipe=self.squelch_pipe, smeter_pipe=self.smeter_pipe, meta_pipe=self.meta_pipe, iqtee_pipe=self.iqtee_pipe, iqtee2_pipe=self.iqtee2_pipe, - output_rate = self.get_output_rate(), smeter_report_every = int(self.if_samp_rate()/6000) ) + output_rate = self.get_output_rate(), smeter_report_every = int(self.if_samp_rate()/6000), + unvoiced_quality = self.get_unvoiced_quality()) logger.debug("[openwebrx-dsp-plugin:csdr] Command = %s", command) my_env=os.environ.copy() diff --git a/owrx/source.py b/owrx/source.py index b5264b0..d75e650 100644 --- a/owrx/source.py +++ b/owrx/source.py @@ -355,7 +355,8 @@ class DspManager(csdr.output): self.localProps.getProperty("squelch_level").wire(self.dsp.set_squelch_level), self.localProps.getProperty("low_cut").wire(set_low_cut), self.localProps.getProperty("high_cut").wire(set_high_cut), - self.localProps.getProperty("mod").wire(self.dsp.set_demodulator) + self.localProps.getProperty("mod").wire(self.dsp.set_demodulator), + self.localProps.getProperty("digital_voice_unvoiced_quality").wire(self.dsp.set_unvoiced_quality) ] self.dsp.set_offset_freq(0)