diff --git a/config_webrx.py b/config_webrx.py index 37e87a7..4c57408 100644 --- a/config_webrx.py +++ b/config_webrx.py @@ -284,8 +284,6 @@ Note: if you experience audio underruns while CPU usage is 100%, you can: # using the auto squelch. #squelch_auto_margin = 10 # in dB -nmux_memory = 50 # in megabytes. This sets the approximate size of the circular buffer used by nmux. - #google_maps_api_key = "" # how long should positions be visible on the map? diff --git a/owrx/config/defaults.py b/owrx/config/defaults.py index ef03de0..37a1ee9 100644 --- a/owrx/config/defaults.py +++ b/owrx/config/defaults.py @@ -146,7 +146,6 @@ defaultConfig = PropertyLayer( waterfall_auto_min_range=50, tuning_precision=2, squelch_auto_margin=10, - nmux_memory=50, google_maps_api_key="", map_position_retention_time=2 * 60 * 60, decoding_queue_workers=2, diff --git a/owrx/source/direct.py b/owrx/source/direct.py index e51f0b8..d11d83b 100644 --- a/owrx/source/direct.py +++ b/owrx/source/direct.py @@ -13,10 +13,9 @@ class DirectSource(SdrSource, metaclass=ABCMeta): self.sleepOnRestart() self.start() - def getEventNames(self): - return super().getEventNames() + [ - "nmux_memory", - ] + def nmux_memory(self): + # in megabytes. This sets the approximate size of the circular buffer used by nmux. + return 50 def getNmuxCommand(self): props = self.sdrProps @@ -24,13 +23,10 @@ class DirectSource(SdrSource, metaclass=ABCMeta): nmux_bufcnt = nmux_bufsize = 0 while nmux_bufsize < props["samp_rate"] / 4: nmux_bufsize += 4096 - while nmux_bufsize * nmux_bufcnt < props["nmux_memory"] * 1e6: + while nmux_bufsize * nmux_bufcnt < self.nmux_memory() * 1e6: nmux_bufcnt += 1 if nmux_bufcnt == 0 or nmux_bufsize == 0: - raise ValueError( - "Error: nmux_bufsize or nmux_bufcnt is zero. " - "These depend on nmux_memory and samp_rate options in config_webrx.py" - ) + raise ValueError("Error: unable to calculate nmux buffer parameters.") return [ "nmux --bufsize %d --bufcnt %d --port %d --address 127.0.0.1"