inline nmux_memory since i've never seen the need to change it

This commit is contained in:
Jakob Ketterl 2021-03-31 00:23:36 +02:00
parent 5a7c12dfac
commit 3696272ef7
3 changed files with 5 additions and 12 deletions

View File

@ -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?

View File

@ -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,

View File

@ -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"