added file player source
See “file_player” in config. Requires updated csdr with —bigendian option to convert_s16_f and iq_swap_ff. Also requires xzcat to be installed. Sample files in new samples/ subdirectory. If larger sample file is too big for distro remove it and reconfigure to use smaller one (which will wrap around more quickly).
This commit is contained in:
@ -12,6 +12,7 @@ class CommandMapper(object):
|
||||
args = [a for a in args if a != ""]
|
||||
options = " ".join(args)
|
||||
command = "{0} {1}".format(self.base, options)
|
||||
command = command.format(p=values)
|
||||
if self.static is not None:
|
||||
command += " " + self.static
|
||||
return command
|
||||
|
@ -30,6 +30,7 @@ class FeatureDetector(object):
|
||||
"airspyhf": ["soapy_connector", "soapy_airspyhf"],
|
||||
"lime_sdr": ["soapy_connector", "soapy_lime_sdr"],
|
||||
"fifi_sdr": ["alsa", "rockprog"],
|
||||
"file_player": ["xzcat"],
|
||||
"pluto_sdr": ["soapy_connector", "soapy_pluto_sdr"],
|
||||
"soapy_remote": ["soapy_connector", "soapy_remote"],
|
||||
"uhd": ["soapy_connector", "soapy_uhd"],
|
||||
@ -392,3 +393,11 @@ class FeatureDetector(object):
|
||||
You can find instructions and downloads [here](https://o28.sischa.net/fifisdr/trac/wiki/De%3Arockprog).
|
||||
"""
|
||||
return self.command_is_runnable("rockprog")
|
||||
|
||||
def has_xzcat(self):
|
||||
"""
|
||||
The "xzcat" executable is required to use the file player. It needs to be installed separately.
|
||||
|
||||
Install it from a system package manager, e.g. "sudo apt-get install xz-utils".
|
||||
"""
|
||||
return self.command_is_runnable("xzcat")
|
||||
|
9
owrx/source/file_player.py
Normal file
9
owrx/source/file_player.py
Normal file
@ -0,0 +1,9 @@
|
||||
from .direct import DirectSource
|
||||
|
||||
class FilePlayerSource(DirectSource):
|
||||
def getCommandMapper(self):
|
||||
cmd = "(while true; do xzcat {p[file]}; done) | csdr flowcontrol $(csdr ={p[samp_rate]}*{p[bytes_per_sample]}*1.05) 20 | {p[format_conversion]}"
|
||||
return super().getCommandMapper().setBase(cmd)
|
||||
|
||||
def getEventNames(self):
|
||||
return super().getEventNames() + ["file", "bytes_per_sample", "format_conversion"]
|
Reference in New Issue
Block a user