diff --git a/CHANGELOG.md b/CHANGELOG.md index dd450b4..745fb3b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ **unreleased** +**1.2.1** +- FifiSDR support fixed (pipeline formats now line up correctly) +- Added "Device" input for FifiSDR devices for sound card selection + **1.2.0** - Major rewrite of all demodulation components to make use of the new csdr/pycsdr and digiham/pydigiham demodulator modules diff --git a/debian/changelog b/debian/changelog index 430bfef..92ffe46 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,13 @@ openwebrx (1.3.0) UNRELEASED; urgency=low - -- Jakob Ketterl Thu, 16 Jun 2022 21:47:00 +0000 + -- Jakob Ketterl Fri, 30 Sep 2022 16:47:00 +0000 + +openwebrx (1.2.1) bullseye jammy; urgency=low + + * FifiSDR support fixed (pipeline formats now line up correctly) + * Added "Device" input for FifiSDR devices for sound card selection + + -- Jakob Ketterl Tue, 20 Sep 2022 16:01:00 +0000 openwebrx (1.2.0) bullseye jammy; urgency=low diff --git a/docker/scripts/install-connectors.sh b/docker/scripts/install-connectors.sh index 2564668..ee3c7ca 100755 --- a/docker/scripts/install-connectors.sh +++ b/docker/scripts/install-connectors.sh @@ -24,7 +24,7 @@ apt-get update apt-get -y install --no-install-recommends $BUILD_PACKAGES git clone https://github.com/jketterl/owrx_connector.git -cmakebuild owrx_connector 0.6.0 +cmakebuild owrx_connector 0.6.1 apt-get -y purge --autoremove $BUILD_PACKAGES apt-get clean diff --git a/docker/scripts/install-dependencies-runds.sh b/docker/scripts/install-dependencies-runds.sh index 32c6c9a..6fc5410 100755 --- a/docker/scripts/install-dependencies-runds.sh +++ b/docker/scripts/install-dependencies-runds.sh @@ -25,7 +25,7 @@ apt-get update apt-get -y install --no-install-recommends $STATIC_PACKAGES $BUILD_PACKAGES git clone https://github.com/jketterl/runds_connector.git -cmakebuild runds_connector 0.2.1 +cmakebuild runds_connector 0.2.2 apt-get -y purge --autoremove $BUILD_PACKAGES apt-get clean diff --git a/docker/scripts/install-owrx-tools.sh b/docker/scripts/install-owrx-tools.sh index 7292a50..947cd7c 100755 --- a/docker/scripts/install-owrx-tools.sh +++ b/docker/scripts/install-owrx-tools.sh @@ -31,11 +31,11 @@ popd rm -rf js8py git clone https://github.com/jketterl/csdr.git -cmakebuild csdr 0.18.0 +cmakebuild csdr 0.18.1 git clone https://github.com/jketterl/pycsdr.git cd pycsdr -git checkout 0.18.0 +git checkout 0.18.1 ./setup.py install install_headers cd .. rm -rf pycsdr @@ -46,11 +46,11 @@ cp codecserver/conf/codecserver.conf /usr/local/etc/codecserver cmakebuild codecserver 0.2.0 git clone https://github.com/jketterl/digiham.git -cmakebuild digiham 0.6.0 +cmakebuild digiham 0.6.1 git clone https://github.com/jketterl/pydigiham.git cd pydigiham -git checkout 0.6.0 +git checkout 0.6.1 ./setup.py install cd .. rm -rf pydigiham diff --git a/htdocs/map.js b/htdocs/map.js index 8c9ea8c..3a0c0a8 100644 --- a/htdocs/map.js +++ b/htdocs/map.js @@ -342,17 +342,34 @@ $(function(){ delete infowindow.locator; delete infowindow.callsign; return infowindow; - } + }; var linkifyCallsign = function(callsign) { if ((callsign_url == null) || (callsign_url == '')) return callsign; else return '' + callsign + ''; }; + var distanceKm = function(p1, p2) { + // Earth radius in km + var R = 6371.0; + // Convert degrees to radians + var rlat1 = p1.lat() * (Math.PI/180); + var rlat2 = p2.lat() * (Math.PI/180); + // Compute difference in radians + var difflat = rlat2-rlat1; + var difflon = (p2.lng()-p1.lng()) * (Math.PI/180); + // Compute distance + d = 2 * R * Math.asin(Math.sqrt( + Math.sin(difflat/2) * Math.sin(difflat/2) + + Math.cos(rlat1) * Math.cos(rlat2) * Math.sin(difflon/2) * Math.sin(difflon/2) + )); + return Math.round(d); + }; + var infowindow; var showLocatorInfoWindow = function(locator, pos) { var infowindow = getInfoWindow(); @@ -364,8 +381,10 @@ $(function(){ }).sort(function(a, b){ return b.lastseen - a.lastseen; }); + var distance = receiverMarker? + " at " + distanceKm(receiverMarker.position, pos) + " km" : ""; infowindow.setContent( - '

Locator: ' + locator + '

' + + '

Locator: ' + locator + distance + '

' + '
Active Callsigns:
' + '
    ' + inLocator.map(function(i){ @@ -387,16 +406,20 @@ $(function(){ var marker = markers[callsign]; var timestring = moment(marker.lastseen).fromNow(); var commentString = ""; + var distance = ""; if (marker.comment) { commentString = '
    ' + marker.comment + '
    '; } + if (receiverMarker) { + distance = " at " + distanceKm(receiverMarker.position, marker.position) + " km"; + } infowindow.setContent( - '

    ' + linkifyCallsign(callsign) + '

    ' + + '

    ' + linkifyCallsign(callsign) + distance + '

    ' + '
    ' + timestring + ' using ' + marker.mode + ( marker.band ? ' on ' + marker.band : '' ) + '
    ' + commentString ); infowindow.open(map, marker); - } + }; var showReceiverInfoWindow = function(marker) { var infowindow = getInfoWindow() @@ -405,7 +428,7 @@ $(function(){ '
    Receiver location
    ' ); infowindow.open(map, marker); - } + }; var getScale = function(lastseen) { var age = new Date().getTime() - lastseen; diff --git a/owrx/source/__init__.py b/owrx/source/__init__.py index ae790be..618d773 100644 --- a/owrx/source/__init__.py +++ b/owrx/source/__init__.py @@ -249,10 +249,13 @@ class SdrSource(ABC): def getPort(self): return self.port + def _getTcpSourceFormat(self): + return Format.COMPLEX_FLOAT + def _getTcpSource(self): with self.modificationLock: if self.tcpSource is None: - self.tcpSource = TcpSource(self.port, Format.COMPLEX_FLOAT) + self.tcpSource = TcpSource(self.port, self._getTcpSourceFormat()) return self.tcpSource def getBuffer(self): diff --git a/owrx/source/direct.py b/owrx/source/direct.py index e4a5eaf..e8c2025 100644 --- a/owrx/source/direct.py +++ b/owrx/source/direct.py @@ -11,6 +11,10 @@ logger = logging.getLogger(__name__) class DirectSource(SdrSource, metaclass=ABCMeta): + def __init__(self, id, props): + self._conversion = None + super().__init__(id, props) + def onPropertyChange(self, changes): logger.debug("restarting sdr source due to property changes: {0}".format(changes)) self.stop() @@ -48,6 +52,10 @@ class DirectSource(SdrSource, metaclass=ABCMeta): def getFormatConversion(self) -> Optional[Chain]: return None + def _getTcpSourceFormat(self): + conversion = self.getFormatConversion() + return Format.COMPLEX_FLOAT if conversion is None else conversion.getInputFormat() + # override this in subclasses, if necessary def sleepOnRestart(self): pass @@ -57,12 +65,12 @@ class DirectSource(SdrSource, metaclass=ABCMeta): source = self._getTcpSource() buffer = Buffer(source.getOutputFormat()) source.setWriter(buffer) - conversion = self.getFormatConversion() - if conversion is not None: - conversion.setReader(buffer.getReader()) + self._conversion = self.getFormatConversion() + if self._conversion is not None: + self._conversion.setReader(buffer.getReader()) # this one must be COMPLEX_FLOAT buffer = Buffer(Format.COMPLEX_FLOAT) - conversion.setWriter(buffer) + self._conversion.setWriter(buffer) self.buffer = buffer return self.buffer diff --git a/owrx/source/fifi_sdr.py b/owrx/source/fifi_sdr.py index 660c65f..e3999b3 100644 --- a/owrx/source/fifi_sdr.py +++ b/owrx/source/fifi_sdr.py @@ -4,6 +4,8 @@ from subprocess import Popen from csdr.chain import Chain from pycsdr.modules import Convert, Gain from pycsdr.types import Format +from typing import List +from owrx.form.input import Input, TextInput import logging @@ -49,3 +51,15 @@ class FifiSdrDeviceDescription(DirectSourceDeviceDescription): def supportsPpm(self): # not currently mapped, and it's unclear how this should be sent to the device return False + + def getInputs(self) -> List[Input]: + return super().getInputs() + [ + TextInput( + "device", + "Device identifier", + infotext="Alsa audio device identifier", + ), + ] + + def getDeviceOptionalKeys(self): + return super().getDeviceOptionalKeys() + ["device"]