add airspy support (untested for now)
This commit is contained in:
parent
a85a6c694c
commit
e422ca4d9b
@ -93,7 +93,7 @@ Note: if you experience audio underruns while CPU usage is 100%, you can:
|
|||||||
# Check here: https://github.com/simonyiszk/openwebrx/wiki#guides-for-receiver-hardware-support #
|
# Check here: https://github.com/simonyiszk/openwebrx/wiki#guides-for-receiver-hardware-support #
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
# Currently supported types of sdr receivers: "rtl_sdr", "sdrplay", "hackrf"
|
# Currently supported types of sdr receivers: "rtl_sdr", "sdrplay", "hackrf", "airspy"
|
||||||
|
|
||||||
sdrs = {
|
sdrs = {
|
||||||
"rtlsdr": {
|
"rtlsdr": {
|
||||||
|
@ -12,7 +12,8 @@ class FeatureDetector(object):
|
|||||||
"core": [ "csdr", "nmux" ],
|
"core": [ "csdr", "nmux" ],
|
||||||
"rtl_sdr": [ "rtl_sdr" ],
|
"rtl_sdr": [ "rtl_sdr" ],
|
||||||
"sdrplay": [ "rx_tools" ],
|
"sdrplay": [ "rx_tools" ],
|
||||||
"hackrf": [ "hackrf_transfer" ]
|
"hackrf": [ "hackrf_transfer" ],
|
||||||
|
"airspy": [ "airspy_rx" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
def is_available(self, feature):
|
def is_available(self, feature):
|
||||||
@ -63,3 +64,6 @@ class FeatureDetector(object):
|
|||||||
# TODO i don't have a hackrf, so somebody doublecheck this.
|
# TODO i don't have a hackrf, so somebody doublecheck this.
|
||||||
# TODO also check if it has the stdout feature
|
# TODO also check if it has the stdout feature
|
||||||
return os.system("hackrf_transfer --help 2> /dev/null") != 32512
|
return os.system("hackrf_transfer --help 2> /dev/null") != 32512
|
||||||
|
|
||||||
|
def has_airspy_rx(self):
|
||||||
|
return os.system("airspy_rx --help 2> /dev/null") != 32512
|
||||||
|
@ -130,6 +130,7 @@ class SdrSource(object):
|
|||||||
start_sdr_command = self.command.format(
|
start_sdr_command = self.command.format(
|
||||||
samp_rate = props["samp_rate"],
|
samp_rate = props["samp_rate"],
|
||||||
center_freq = props["center_freq"],
|
center_freq = props["center_freq"],
|
||||||
|
center_freq_mhz = props["center_freq"]/1e6,
|
||||||
ppm = props["ppm"],
|
ppm = props["ppm"],
|
||||||
rf_gain = props["rf_gain"],
|
rf_gain = props["rf_gain"],
|
||||||
lna_gain = props["lna_gain"],
|
lna_gain = props["lna_gain"],
|
||||||
@ -249,6 +250,12 @@ class SdrplaySource(SdrSource):
|
|||||||
def sleepOnRestart(self):
|
def sleepOnRestart(self):
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
|
||||||
|
class AirspySource(SdrSource):
|
||||||
|
def __init__(self, props, port):
|
||||||
|
super().__init__(props, port)
|
||||||
|
self.command = "airspy_rx -f{center_freq_mhz} -r /dev/stdout -a{samp_rate} -g {rf_gain}"
|
||||||
|
self.format_conversion = "csdr convert_s16_f"
|
||||||
|
|
||||||
class SpectrumThread(threading.Thread):
|
class SpectrumThread(threading.Thread):
|
||||||
def __init__(self, sdrSource):
|
def __init__(self, sdrSource):
|
||||||
self.doRun = True
|
self.doRun = True
|
||||||
|
Loading…
Reference in New Issue
Block a user