From 017bbc3748aa86d60ba861d94b1d276992ebb7d8 Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Mon, 23 Nov 2020 01:00:25 +0100 Subject: [PATCH 1/9] attempt to include m17-demod (untested due to lack of signals) --- csdr/csdr.py | 11 ++++++++++- owrx/feature.py | 7 ++++++- owrx/modes.py | 1 + 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/csdr/csdr.py b/csdr/csdr.py index db7c2fc..c90c1b8 100644 --- a/csdr/csdr.py +++ b/csdr/csdr.py @@ -217,6 +217,15 @@ class dsp(object): "CSDR_FIXED_BUFSIZE=32 csdr agc_s16 --max 30 --initial 3", "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 - ", ] + # m17 + elif which == "m17": + chain += [ + "csdr limit_ff", + "csdr convert_f_s16", + "m17-demod", + "CSDR_FIXED_BUFSIZE=32 csdr agc_s16 --max 30 --initial 3", + "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 - ", + ] # digiham modes else: chain += ["rrc_filter", "gfsk_demodulator"] @@ -561,7 +570,7 @@ class dsp(object): def isDigitalVoice(self, demodulator=None): if demodulator is None: demodulator = self.get_demodulator() - return demodulator in ["dmr", "dstar", "nxdn", "ysf"] + return demodulator in ["dmr", "dstar", "nxdn", "ysf", "m17"] def isWsjtMode(self, demodulator=None): if demodulator is None: diff --git a/owrx/feature.py b/owrx/feature.py index c81d8c7..16e5b3d 100644 --- a/owrx/feature.py +++ b/owrx/feature.py @@ -73,6 +73,7 @@ class FeatureDetector(object): "digital_voice_digiham": ["digiham", "sox"], "digital_voice_dsd": ["dsd", "sox", "digiham"], "digital_voice_freedv": ["freedv_rx", "sox"], + "digital_voice_m17": ["m17_demod", "sox"], "wsjt-x": ["wsjtx", "sox"], "packet": ["direwolf", "sox"], "pocsag": ["digiham", "sox"], @@ -148,7 +149,7 @@ class FeatureDetector(object): # prevent X11 programs from opening windows if called from a GUI shell env.pop("DISPLAY", None) try: - process = subprocess.Popen(cmd, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, cwd=tmp_dir, env=env) + process = subprocess.Popen(cmd, stdin=subprocess.DEVNULL, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, cwd=tmp_dir, env=env) rc = process.wait() if expected_result is None: return rc != 32512 @@ -417,6 +418,10 @@ class FeatureDetector(object): """ return self.command_is_runnable("dsd") + def has_m17_demod(self): + # TODO: documentation + return self.command_is_runnable("m17-demod") + def has_sox(self): """ The sox audio library is used to convert between the typical 8 kHz audio sampling rate used by digital modes and diff --git a/owrx/modes.py b/owrx/modes.py index 166373c..09e79a3 100644 --- a/owrx/modes.py +++ b/owrx/modes.py @@ -49,6 +49,7 @@ class Modes(object): AnalogMode("dstar", "D-Star", bandpass=Bandpass(-3250, 3250), requirements=["digital_voice_dsd"], squelch=False), AnalogMode("nxdn", "NXDN", bandpass=Bandpass(-3250, 3250), requirements=["digital_voice_dsd"], squelch=False), AnalogMode("ysf", "YSF", bandpass=Bandpass(-4000, 4000), requirements=["digital_voice_digiham"], squelch=False), + AnalogMode("m17", "M17", bandpass=Bandpass(-4000, 4000), requirements=["digital_voice_m17"], squelch=False), AnalogMode("freedv", "FreeDV", bandpass=Bandpass(300, 3000), requirements=["digital_voice_freedv"], squelch=False), AnalogMode("drm", "DRM", bandpass=Bandpass(-5000, 5000), requirements=["drm"], squelch=False), DigitalMode("bpsk31", "BPSK31", underlying=["usb"]), From fb68ca3c66f297392054dc2ca38255ccfeea3c2c Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Tue, 8 Dec 2020 16:59:49 +0100 Subject: [PATCH 2/9] add documentation --- owrx/feature.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/owrx/feature.py b/owrx/feature.py index a9cfe5a..fbdb425 100644 --- a/owrx/feature.py +++ b/owrx/feature.py @@ -421,7 +421,11 @@ class FeatureDetector(object): return self.command_is_runnable("dsd") def has_m17_demod(self): - # TODO: documentation + """ + The `m17-demod` tool is used to demodulate M17 digital voice signals. + + You can find more information [here](https://github.com/mobilinkd/m17-cxx-demod) + """ return self.command_is_runnable("m17-demod") def has_sox(self): From cfb6fb5b30342a3300af48772bc3667414add564 Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Tue, 8 Dec 2020 17:01:04 +0100 Subject: [PATCH 3/9] add changelog message --- CHANGELOG.md | 1 + debian/changelog | 2 ++ 2 files changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8456653..4af0dc6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ - Introduced `squelch_auto_margin` config option that allows configuring the auto squelch level - Removed `port` configuration option; `rtltcp_compat` takes the port number with the new connectors - Added support for new WSJT-X modes FST4 and FST4W (only available with WSJT-X 2.3) +- Added support for demodulating M17 digital voice signals using m17-cxx-demod - New devices supported: - HPSDR devices (Hermes Lite 2) - BBRF103 / RX666 / RX888 devices supported by libsddc diff --git a/debian/changelog b/debian/changelog index c7dc727..b4f9544 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,8 @@ openwebrx (0.21.0) UNRELEASED; urgency=low with the new connectors * Added support for new WSJT-X modes FST4 and FST4W (only available with WSJT-X 2.3) + * Added support for demodulating M17 digital voice signals using + m17-cxx-demod * New devices supported: - HPSDR devices (Hermes Lite 2) (`"type": "hpsdr"`) - BBRF103 / RX666 / RX888 devices supported by libsddc (`"type": "sddc"`) From e8fcf05775548c210789d337d9ba86e954e35d25 Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Tue, 8 Dec 2020 19:43:50 +0100 Subject: [PATCH 4/9] add m17-demod to docker builds (preliminary) --- docker/scripts/install-dependencies.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docker/scripts/install-dependencies.sh b/docker/scripts/install-dependencies.sh index 338201c..9f87140 100755 --- a/docker/scripts/install-dependencies.sh +++ b/docker/scripts/install-dependencies.sh @@ -19,7 +19,7 @@ function cmakebuild() { cd /tmp STATIC_PACKAGES="sox libfftw3-bin python3 python3-setuptools netcat-openbsd libsndfile1 liblapack3 libusb-1.0-0 libqt5core5a libreadline7 libgfortran4 libgomp1 libasound2 libudev1 ca-certificates libqt5gui5 libqt5sql5 libqt5printsupport5 libpulse0 libfaad2 libopus0" -BUILD_PACKAGES="wget git libsndfile1-dev libfftw3-dev cmake make gcc g++ liblapack-dev texinfo gfortran libusb-1.0-0-dev qtbase5-dev qtmultimedia5-dev qttools5-dev libqt5serialport5-dev qttools5-dev-tools asciidoctor asciidoc libasound2-dev libudev-dev libhamlib-dev patch xsltproc qt5-default libfaad-dev libopus-dev" +BUILD_PACKAGES="wget git libsndfile1-dev libfftw3-dev cmake make gcc g++ liblapack-dev texinfo gfortran libusb-1.0-0-dev qtbase5-dev qtmultimedia5-dev qttools5-dev libqt5serialport5-dev qttools5-dev-tools asciidoctor asciidoc libasound2-dev libudev-dev libhamlib-dev patch xsltproc qt5-default libfaad-dev libopus-dev libgtest-dev" apt-get update apt-get -y install auto-apt-proxy apt-get -y install --no-install-recommends $STATIC_PACKAGES $BUILD_PACKAGES @@ -110,6 +110,10 @@ popd rm -rf dream rm dream-2.1.1-svn808.tar.gz +git clone https://github.com/jketterl/m17-cxx-demod.git +# compiler errors on debian buster; pull request pending. +cmakebuild m17-cxx-demod 2e27d6850c94bc72230bbd3145b19133d9c74a01 + git clone https://github.com/hessu/aprs-symbols /usr/share/aprs-symbols pushd /usr/share/aprs-symbols git checkout 5c2abe2658ee4d2563f3c73b90c6f59124839802 From ca9e9601abef53311f2a37dfc505747f95b29e5e Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Mon, 21 Dec 2020 19:42:15 +0100 Subject: [PATCH 5/9] update m17-cxx-demod and dependencies --- docker/scripts/install-dependencies.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docker/scripts/install-dependencies.sh b/docker/scripts/install-dependencies.sh index 9f87140..c67df74 100755 --- a/docker/scripts/install-dependencies.sh +++ b/docker/scripts/install-dependencies.sh @@ -18,8 +18,8 @@ function cmakebuild() { cd /tmp -STATIC_PACKAGES="sox libfftw3-bin python3 python3-setuptools netcat-openbsd libsndfile1 liblapack3 libusb-1.0-0 libqt5core5a libreadline7 libgfortran4 libgomp1 libasound2 libudev1 ca-certificates libqt5gui5 libqt5sql5 libqt5printsupport5 libpulse0 libfaad2 libopus0" -BUILD_PACKAGES="wget git libsndfile1-dev libfftw3-dev cmake make gcc g++ liblapack-dev texinfo gfortran libusb-1.0-0-dev qtbase5-dev qtmultimedia5-dev qttools5-dev libqt5serialport5-dev qttools5-dev-tools asciidoctor asciidoc libasound2-dev libudev-dev libhamlib-dev patch xsltproc qt5-default libfaad-dev libopus-dev libgtest-dev" +STATIC_PACKAGES="sox libfftw3-bin python3 python3-setuptools netcat-openbsd libsndfile1 liblapack3 libusb-1.0-0 libqt5core5a libreadline7 libgfortran4 libgomp1 libasound2 libudev1 ca-certificates libqt5gui5 libqt5sql5 libqt5printsupport5 libpulse0 libfaad2 libopus0 libboost-program-options1.67.0" +BUILD_PACKAGES="wget git libsndfile1-dev libfftw3-dev cmake make gcc g++ liblapack-dev texinfo gfortran libusb-1.0-0-dev qtbase5-dev qtmultimedia5-dev qttools5-dev libqt5serialport5-dev qttools5-dev-tools asciidoctor asciidoc libasound2-dev libudev-dev libhamlib-dev patch xsltproc qt5-default libfaad-dev libopus-dev libgtest-dev libboost-dev libboost-program-options-dev" apt-get update apt-get -y install auto-apt-proxy apt-get -y install --no-install-recommends $STATIC_PACKAGES $BUILD_PACKAGES @@ -110,9 +110,9 @@ popd rm -rf dream rm dream-2.1.1-svn808.tar.gz -git clone https://github.com/jketterl/m17-cxx-demod.git -# compiler errors on debian buster; pull request pending. -cmakebuild m17-cxx-demod 2e27d6850c94bc72230bbd3145b19133d9c74a01 +git clone https://github.com/mobilinkd/m17-cxx-demod.git +# latest master as of 2020-12-21 +cmakebuild m17-cxx-demod 4bb80cb69a68c3e96341953b2a0c508cbce807af git clone https://github.com/hessu/aprs-symbols /usr/share/aprs-symbols pushd /usr/share/aprs-symbols From 94575d2212385deed2a470e4ef6c062a3e47bdc2 Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Tue, 22 Dec 2020 12:51:36 +0100 Subject: [PATCH 6/9] update m17-cxx-demod --- docker/scripts/install-dependencies.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/scripts/install-dependencies.sh b/docker/scripts/install-dependencies.sh index c67df74..8c0e383 100755 --- a/docker/scripts/install-dependencies.sh +++ b/docker/scripts/install-dependencies.sh @@ -111,8 +111,8 @@ rm -rf dream rm dream-2.1.1-svn808.tar.gz git clone https://github.com/mobilinkd/m17-cxx-demod.git -# latest master as of 2020-12-21 -cmakebuild m17-cxx-demod 4bb80cb69a68c3e96341953b2a0c508cbce807af +# latest master as of 2020-12-22 (fixed m17-mod install) +cmakebuild m17-cxx-demod d2474532b811f97f2b8665c272bffdf88716d31c git clone https://github.com/hessu/aprs-symbols /usr/share/aprs-symbols pushd /usr/share/aprs-symbols From 686eeb706ba339ce23b8c1149220dfe027a7a06d Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Sun, 27 Dec 2020 13:52:49 +0100 Subject: [PATCH 7/9] add external reference control --- owrx/source/sdrplay.py | 1 + 1 file changed, 1 insertion(+) diff --git a/owrx/source/sdrplay.py b/owrx/source/sdrplay.py index da2398a..5fb2f4c 100644 --- a/owrx/source/sdrplay.py +++ b/owrx/source/sdrplay.py @@ -10,6 +10,7 @@ class SdrplaySource(SoapyConnectorSource): "rf_notch": "rfnotch_ctrl", "dab_notch": "dabnotch_ctrl", "if_mode": "if_mode", + "external_reference": "extref_ctrl", } ) return mappings From ecf934864a453bf6f515871b517ead34565d2191 Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Sun, 27 Dec 2020 19:49:59 +0100 Subject: [PATCH 8/9] move dc_block to individual chains since it interferes with m17 demod --- csdr/csdr.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/csdr/csdr.py b/csdr/csdr.py index 0c1d74a..95d3ca7 100644 --- a/csdr/csdr.py +++ b/csdr/csdr.py @@ -203,11 +203,11 @@ class dsp(object): "csdr convert_f_s16" ] elif self.isDigitalVoice(which): - chain += ["csdr fmdemod_quadri_cf", "dc_block "] + chain += ["csdr fmdemod_quadri_cf"] chain += last_decimation_block # dsd modes if which in ["dstar", "nxdn"]: - chain += ["csdr limit_ff", "csdr convert_f_s16"] + chain += ["dc_block", "csdr limit_ff", "csdr convert_f_s16"] if which == "dstar": chain += ["dsd -fd -i - -o - -u {unvoiced_quality} -g -1 "] elif which == "nxdn": @@ -228,7 +228,7 @@ class dsp(object): ] # digiham modes else: - chain += ["rrc_filter", "gfsk_demodulator"] + chain += ["dc_block", "rrc_filter", "gfsk_demodulator"] if which == "dmr": chain += [ "dmr_decoder --fifo {meta_pipe} --control-fifo {dmr_control_pipe}", From 71043d4305facec7d8a45c9e644c656a2418530c Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Sun, 27 Dec 2020 20:10:41 +0100 Subject: [PATCH 9/9] update m17-cxx-demod in docker --- docker/scripts/install-dependencies.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/scripts/install-dependencies.sh b/docker/scripts/install-dependencies.sh index 8c0e383..55a95e7 100755 --- a/docker/scripts/install-dependencies.sh +++ b/docker/scripts/install-dependencies.sh @@ -111,8 +111,8 @@ rm -rf dream rm dream-2.1.1-svn808.tar.gz git clone https://github.com/mobilinkd/m17-cxx-demod.git -# latest master as of 2020-12-22 (fixed m17-mod install) -cmakebuild m17-cxx-demod d2474532b811f97f2b8665c272bffdf88716d31c +# latest master as of 2020-12-27 (new sync words) +cmakebuild m17-cxx-demod 2b84657676efb3b07b33de3ab3d0a6218e9d88b5 git clone https://github.com/hessu/aprs-symbols /usr/share/aprs-symbols pushd /usr/share/aprs-symbols