inline nmux_memory since i've never seen the need to change it
This commit is contained in:
parent
5a7c12dfac
commit
3696272ef7
@ -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?
|
||||
|
@ -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,
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user