From 6d5d77dc6caa269c99999f6ed6c62d8f5bfaa0ea Mon Sep 17 00:00:00 2001 From: f4exb Date: Fri, 10 May 2019 00:34:35 +0200 Subject: [PATCH] Channel local source (1) --- plugins/channelrx/localsink/localsink.cpp | 3 -- plugins/channelrx/localsink/localsink.h | 12 ++--- plugins/channeltx/remotesource/remotesource.h | 4 +- .../bladerf1output/bladerf1output.h | 1 + .../bladerf2output/bladerf2output.h | 1 + plugins/samplesink/filesink/filesinkoutput.h | 1 + .../samplesink/hackrfoutput/hackrfoutput.h | 1 + .../samplesink/limesdroutput/limesdroutput.h | 1 + .../plutosdroutput/plutosdroutput.h | 1 + .../samplesink/remoteoutput/remoteoutput.h | 1 + .../soapysdroutput/soapysdroutput.h | 1 + plugins/samplesink/xtrxoutput/xtrxoutput.h | 1 + sdrbase/dsp/devicesamplesink.h | 1 + sdrbase/dsp/upchannelizer.cpp | 30 ++++++++++--- sdrbase/dsp/upchannelizer.h | 16 ++++--- sdrbase/resources/res.qrc | 1 + sdrbase/resources/webapi/doc/html2/index.html | 44 ++++++++++++++++++- .../resources/webapi/doc/swagger/swagger.yaml | 4 +- sdrbase/webapi/webapirequestmapper.cpp | 14 ++++++ swagger/sdrangel/api/swagger/swagger.yaml | 4 +- swagger/sdrangel/code/html2/index.html | 44 ++++++++++++++++++- .../code/qt5/client/SWGAMDemodReport.cpp | 2 +- .../code/qt5/client/SWGAMDemodReport.h | 2 +- .../code/qt5/client/SWGAMDemodSettings.cpp | 2 +- .../code/qt5/client/SWGAMDemodSettings.h | 2 +- .../code/qt5/client/SWGAMModReport.cpp | 2 +- .../sdrangel/code/qt5/client/SWGAMModReport.h | 2 +- .../code/qt5/client/SWGAMModSettings.cpp | 2 +- .../code/qt5/client/SWGAMModSettings.h | 2 +- .../code/qt5/client/SWGATVModReport.cpp | 2 +- .../code/qt5/client/SWGATVModReport.h | 2 +- .../code/qt5/client/SWGATVModSettings.cpp | 2 +- .../code/qt5/client/SWGATVModSettings.h | 2 +- .../code/qt5/client/SWGAirspyHFReport.cpp | 2 +- .../code/qt5/client/SWGAirspyHFReport.h | 2 +- .../code/qt5/client/SWGAirspyHFSettings.cpp | 2 +- .../code/qt5/client/SWGAirspyHFSettings.h | 2 +- .../code/qt5/client/SWGAirspyReport.cpp | 2 +- .../code/qt5/client/SWGAirspyReport.h | 2 +- .../code/qt5/client/SWGAirspySettings.cpp | 2 +- .../code/qt5/client/SWGAirspySettings.h | 2 +- .../sdrangel/code/qt5/client/SWGArgInfo.cpp | 2 +- swagger/sdrangel/code/qt5/client/SWGArgInfo.h | 2 +- .../sdrangel/code/qt5/client/SWGArgValue.cpp | 2 +- .../sdrangel/code/qt5/client/SWGArgValue.h | 2 +- .../code/qt5/client/SWGAudioDevices.cpp | 2 +- .../code/qt5/client/SWGAudioDevices.h | 2 +- .../code/qt5/client/SWGAudioInputDevice.cpp | 2 +- .../code/qt5/client/SWGAudioInputDevice.h | 2 +- .../code/qt5/client/SWGAudioOutputDevice.cpp | 2 +- .../code/qt5/client/SWGAudioOutputDevice.h | 2 +- .../code/qt5/client/SWGBFMDemodReport.cpp | 2 +- .../code/qt5/client/SWGBFMDemodReport.h | 2 +- .../code/qt5/client/SWGBFMDemodSettings.cpp | 2 +- .../code/qt5/client/SWGBFMDemodSettings.h | 2 +- .../sdrangel/code/qt5/client/SWGBandwidth.cpp | 2 +- .../sdrangel/code/qt5/client/SWGBandwidth.h | 2 +- .../qt5/client/SWGBladeRF1InputSettings.cpp | 2 +- .../qt5/client/SWGBladeRF1InputSettings.h | 2 +- .../qt5/client/SWGBladeRF1OutputSettings.cpp | 2 +- .../qt5/client/SWGBladeRF1OutputSettings.h | 2 +- .../qt5/client/SWGBladeRF2InputReport.cpp | 2 +- .../code/qt5/client/SWGBladeRF2InputReport.h | 2 +- .../qt5/client/SWGBladeRF2InputSettings.cpp | 2 +- .../qt5/client/SWGBladeRF2InputSettings.h | 2 +- .../qt5/client/SWGBladeRF2OutputReport.cpp | 2 +- .../code/qt5/client/SWGBladeRF2OutputReport.h | 2 +- .../qt5/client/SWGBladeRF2OutputSettings.cpp | 2 +- .../qt5/client/SWGBladeRF2OutputSettings.h | 2 +- .../code/qt5/client/SWGCWKeyerSettings.cpp | 2 +- .../code/qt5/client/SWGCWKeyerSettings.h | 2 +- .../sdrangel/code/qt5/client/SWGChannel.cpp | 2 +- swagger/sdrangel/code/qt5/client/SWGChannel.h | 2 +- .../code/qt5/client/SWGChannelListItem.cpp | 2 +- .../code/qt5/client/SWGChannelListItem.h | 2 +- .../code/qt5/client/SWGChannelReport.cpp | 2 +- .../code/qt5/client/SWGChannelReport.h | 2 +- .../code/qt5/client/SWGChannelSettings.cpp | 25 ++++++++++- .../code/qt5/client/SWGChannelSettings.h | 9 +++- .../code/qt5/client/SWGChannelsDetail.cpp | 2 +- .../code/qt5/client/SWGChannelsDetail.h | 2 +- .../sdrangel/code/qt5/client/SWGComplex.cpp | 2 +- swagger/sdrangel/code/qt5/client/SWGComplex.h | 2 +- .../code/qt5/client/SWGDSDDemodReport.cpp | 2 +- .../code/qt5/client/SWGDSDDemodReport.h | 2 +- .../code/qt5/client/SWGDSDDemodSettings.cpp | 2 +- .../code/qt5/client/SWGDSDDemodSettings.h | 2 +- .../code/qt5/client/SWGDVSeralDevices.cpp | 2 +- .../code/qt5/client/SWGDVSeralDevices.h | 2 +- .../code/qt5/client/SWGDVSerialDevice.cpp | 2 +- .../code/qt5/client/SWGDVSerialDevice.h | 2 +- .../code/qt5/client/SWGDeviceListItem.cpp | 2 +- .../code/qt5/client/SWGDeviceListItem.h | 2 +- .../code/qt5/client/SWGDeviceReport.cpp | 2 +- .../code/qt5/client/SWGDeviceReport.h | 2 +- .../sdrangel/code/qt5/client/SWGDeviceSet.cpp | 2 +- .../sdrangel/code/qt5/client/SWGDeviceSet.h | 2 +- .../code/qt5/client/SWGDeviceSetApi.cpp | 2 +- .../code/qt5/client/SWGDeviceSetApi.h | 2 +- .../code/qt5/client/SWGDeviceSetList.cpp | 2 +- .../code/qt5/client/SWGDeviceSetList.h | 2 +- .../code/qt5/client/SWGDeviceSettings.cpp | 2 +- .../code/qt5/client/SWGDeviceSettings.h | 2 +- .../code/qt5/client/SWGDeviceState.cpp | 2 +- .../sdrangel/code/qt5/client/SWGDeviceState.h | 2 +- .../code/qt5/client/SWGErrorResponse.cpp | 2 +- .../code/qt5/client/SWGErrorResponse.h | 2 +- .../code/qt5/client/SWGFCDProPlusSettings.cpp | 2 +- .../code/qt5/client/SWGFCDProPlusSettings.h | 2 +- .../code/qt5/client/SWGFCDProSettings.cpp | 2 +- .../code/qt5/client/SWGFCDProSettings.h | 2 +- .../code/qt5/client/SWGFileSourceReport.cpp | 2 +- .../code/qt5/client/SWGFileSourceReport.h | 2 +- .../code/qt5/client/SWGFileSourceSettings.cpp | 2 +- .../code/qt5/client/SWGFileSourceSettings.h | 2 +- .../code/qt5/client/SWGFreeDVDemodReport.cpp | 2 +- .../code/qt5/client/SWGFreeDVDemodReport.h | 2 +- .../qt5/client/SWGFreeDVDemodSettings.cpp | 2 +- .../code/qt5/client/SWGFreeDVDemodSettings.h | 2 +- .../code/qt5/client/SWGFreeDVModReport.cpp | 2 +- .../code/qt5/client/SWGFreeDVModReport.h | 2 +- .../code/qt5/client/SWGFreeDVModSettings.cpp | 2 +- .../code/qt5/client/SWGFreeDVModSettings.h | 2 +- .../code/qt5/client/SWGFreqTrackerReport.cpp | 2 +- .../code/qt5/client/SWGFreqTrackerReport.h | 2 +- .../qt5/client/SWGFreqTrackerSettings.cpp | 2 +- .../code/qt5/client/SWGFreqTrackerSettings.h | 2 +- .../sdrangel/code/qt5/client/SWGFrequency.cpp | 2 +- .../sdrangel/code/qt5/client/SWGFrequency.h | 2 +- .../code/qt5/client/SWGFrequencyBand.cpp | 2 +- .../code/qt5/client/SWGFrequencyBand.h | 2 +- .../code/qt5/client/SWGFrequencyRange.cpp | 2 +- .../code/qt5/client/SWGFrequencyRange.h | 2 +- swagger/sdrangel/code/qt5/client/SWGGain.cpp | 2 +- swagger/sdrangel/code/qt5/client/SWGGain.h | 2 +- .../qt5/client/SWGHackRFInputSettings.cpp | 2 +- .../code/qt5/client/SWGHackRFInputSettings.h | 2 +- .../qt5/client/SWGHackRFOutputSettings.cpp | 2 +- .../code/qt5/client/SWGHackRFOutputSettings.h | 2 +- .../sdrangel/code/qt5/client/SWGHelpers.cpp | 2 +- swagger/sdrangel/code/qt5/client/SWGHelpers.h | 2 +- .../code/qt5/client/SWGHttpRequest.cpp | 2 +- .../sdrangel/code/qt5/client/SWGHttpRequest.h | 2 +- .../code/qt5/client/SWGInstanceApi.cpp | 2 +- .../sdrangel/code/qt5/client/SWGInstanceApi.h | 2 +- .../client/SWGInstanceChannelsResponse.cpp | 2 +- .../qt5/client/SWGInstanceChannelsResponse.h | 2 +- .../qt5/client/SWGInstanceDevicesResponse.cpp | 2 +- .../qt5/client/SWGInstanceDevicesResponse.h | 2 +- .../qt5/client/SWGInstanceSummaryResponse.cpp | 2 +- .../qt5/client/SWGInstanceSummaryResponse.h | 2 +- .../code/qt5/client/SWGLimeSdrInputReport.cpp | 2 +- .../code/qt5/client/SWGLimeSdrInputReport.h | 2 +- .../qt5/client/SWGLimeSdrInputSettings.cpp | 2 +- .../code/qt5/client/SWGLimeSdrInputSettings.h | 2 +- .../qt5/client/SWGLimeSdrOutputReport.cpp | 2 +- .../code/qt5/client/SWGLimeSdrOutputReport.h | 2 +- .../qt5/client/SWGLimeSdrOutputSettings.cpp | 2 +- .../qt5/client/SWGLimeSdrOutputSettings.h | 2 +- .../code/qt5/client/SWGLocalInputReport.cpp | 2 +- .../code/qt5/client/SWGLocalInputReport.h | 2 +- .../code/qt5/client/SWGLocalInputSettings.cpp | 2 +- .../code/qt5/client/SWGLocalInputSettings.h | 2 +- .../code/qt5/client/SWGLocalSinkSettings.cpp | 2 +- .../code/qt5/client/SWGLocalSinkSettings.h | 2 +- .../qt5/client/SWGLocationInformation.cpp | 2 +- .../code/qt5/client/SWGLocationInformation.h | 2 +- .../code/qt5/client/SWGLoggingInfo.cpp | 2 +- .../sdrangel/code/qt5/client/SWGLoggingInfo.h | 2 +- .../code/qt5/client/SWGModelFactory.h | 6 ++- .../code/qt5/client/SWGNFMDemodReport.cpp | 2 +- .../code/qt5/client/SWGNFMDemodReport.h | 2 +- .../code/qt5/client/SWGNFMDemodSettings.cpp | 2 +- .../code/qt5/client/SWGNFMDemodSettings.h | 2 +- .../code/qt5/client/SWGNFMModReport.cpp | 2 +- .../code/qt5/client/SWGNFMModReport.h | 2 +- .../code/qt5/client/SWGNFMModSettings.cpp | 2 +- .../code/qt5/client/SWGNFMModSettings.h | 2 +- .../sdrangel/code/qt5/client/SWGNamedEnum.cpp | 2 +- .../sdrangel/code/qt5/client/SWGNamedEnum.h | 2 +- swagger/sdrangel/code/qt5/client/SWGObject.h | 2 +- .../code/qt5/client/SWGPerseusReport.cpp | 2 +- .../code/qt5/client/SWGPerseusReport.h | 2 +- .../code/qt5/client/SWGPerseusSettings.cpp | 2 +- .../code/qt5/client/SWGPerseusSettings.h | 2 +- .../qt5/client/SWGPlutoSdrInputReport.cpp | 2 +- .../code/qt5/client/SWGPlutoSdrInputReport.h | 2 +- .../qt5/client/SWGPlutoSdrInputSettings.cpp | 2 +- .../qt5/client/SWGPlutoSdrInputSettings.h | 2 +- .../qt5/client/SWGPlutoSdrOutputReport.cpp | 2 +- .../code/qt5/client/SWGPlutoSdrOutputReport.h | 2 +- .../qt5/client/SWGPlutoSdrOutputSettings.cpp | 2 +- .../qt5/client/SWGPlutoSdrOutputSettings.h | 2 +- .../code/qt5/client/SWGPresetExport.cpp | 2 +- .../code/qt5/client/SWGPresetExport.h | 2 +- .../code/qt5/client/SWGPresetGroup.cpp | 2 +- .../sdrangel/code/qt5/client/SWGPresetGroup.h | 2 +- .../code/qt5/client/SWGPresetIdentifier.cpp | 2 +- .../code/qt5/client/SWGPresetIdentifier.h | 2 +- .../code/qt5/client/SWGPresetImport.cpp | 2 +- .../code/qt5/client/SWGPresetImport.h | 2 +- .../code/qt5/client/SWGPresetItem.cpp | 2 +- .../sdrangel/code/qt5/client/SWGPresetItem.h | 2 +- .../code/qt5/client/SWGPresetTransfer.cpp | 2 +- .../code/qt5/client/SWGPresetTransfer.h | 2 +- .../sdrangel/code/qt5/client/SWGPresets.cpp | 2 +- swagger/sdrangel/code/qt5/client/SWGPresets.h | 2 +- .../sdrangel/code/qt5/client/SWGRDSReport.cpp | 2 +- .../sdrangel/code/qt5/client/SWGRDSReport.h | 2 +- .../client/SWGRDSReport_altFrequencies.cpp | 2 +- .../qt5/client/SWGRDSReport_altFrequencies.h | 2 +- swagger/sdrangel/code/qt5/client/SWGRange.cpp | 2 +- swagger/sdrangel/code/qt5/client/SWGRange.h | 2 +- .../code/qt5/client/SWGRangeFloat.cpp | 2 +- .../sdrangel/code/qt5/client/SWGRangeFloat.h | 2 +- .../code/qt5/client/SWGRemoteInputReport.cpp | 2 +- .../code/qt5/client/SWGRemoteInputReport.h | 2 +- .../qt5/client/SWGRemoteInputSettings.cpp | 2 +- .../code/qt5/client/SWGRemoteInputSettings.h | 2 +- .../code/qt5/client/SWGRemoteOutputReport.cpp | 2 +- .../code/qt5/client/SWGRemoteOutputReport.h | 2 +- .../qt5/client/SWGRemoteOutputSettings.cpp | 2 +- .../code/qt5/client/SWGRemoteOutputSettings.h | 2 +- .../code/qt5/client/SWGRemoteSinkSettings.cpp | 2 +- .../code/qt5/client/SWGRemoteSinkSettings.h | 2 +- .../code/qt5/client/SWGRemoteSourceReport.cpp | 2 +- .../code/qt5/client/SWGRemoteSourceReport.h | 2 +- .../qt5/client/SWGRemoteSourceSettings.cpp | 2 +- .../code/qt5/client/SWGRemoteSourceSettings.h | 2 +- .../code/qt5/client/SWGRtlSdrReport.cpp | 2 +- .../code/qt5/client/SWGRtlSdrReport.h | 2 +- .../code/qt5/client/SWGRtlSdrSettings.cpp | 2 +- .../code/qt5/client/SWGRtlSdrSettings.h | 2 +- .../code/qt5/client/SWGSDRPlayReport.cpp | 2 +- .../code/qt5/client/SWGSDRPlayReport.h | 2 +- .../code/qt5/client/SWGSDRPlaySettings.cpp | 2 +- .../code/qt5/client/SWGSDRPlaySettings.h | 2 +- .../code/qt5/client/SWGSSBDemodReport.cpp | 2 +- .../code/qt5/client/SWGSSBDemodReport.h | 2 +- .../code/qt5/client/SWGSSBDemodSettings.cpp | 2 +- .../code/qt5/client/SWGSSBDemodSettings.h | 2 +- .../code/qt5/client/SWGSSBModReport.cpp | 2 +- .../code/qt5/client/SWGSSBModReport.h | 2 +- .../code/qt5/client/SWGSSBModSettings.cpp | 2 +- .../code/qt5/client/SWGSSBModSettings.h | 2 +- .../code/qt5/client/SWGSampleRate.cpp | 2 +- .../sdrangel/code/qt5/client/SWGSampleRate.h | 2 +- .../code/qt5/client/SWGSamplingDevice.cpp | 2 +- .../code/qt5/client/SWGSamplingDevice.h | 2 +- .../client/SWGSoapySDRFrequencySetting.cpp | 2 +- .../qt5/client/SWGSoapySDRFrequencySetting.h | 2 +- .../qt5/client/SWGSoapySDRGainSetting.cpp | 2 +- .../code/qt5/client/SWGSoapySDRGainSetting.h | 2 +- .../qt5/client/SWGSoapySDRInputSettings.cpp | 2 +- .../qt5/client/SWGSoapySDRInputSettings.h | 2 +- .../qt5/client/SWGSoapySDROutputSettings.cpp | 2 +- .../qt5/client/SWGSoapySDROutputSettings.h | 2 +- .../code/qt5/client/SWGSoapySDRReport.cpp | 2 +- .../code/qt5/client/SWGSoapySDRReport.h | 2 +- .../code/qt5/client/SWGSuccessResponse.cpp | 2 +- .../code/qt5/client/SWGSuccessResponse.h | 2 +- .../code/qt5/client/SWGTestSourceSettings.cpp | 2 +- .../code/qt5/client/SWGTestSourceSettings.h | 2 +- .../code/qt5/client/SWGUDPSinkReport.cpp | 2 +- .../code/qt5/client/SWGUDPSinkReport.h | 2 +- .../code/qt5/client/SWGUDPSinkSettings.cpp | 2 +- .../code/qt5/client/SWGUDPSinkSettings.h | 2 +- .../code/qt5/client/SWGUDPSourceReport.cpp | 2 +- .../code/qt5/client/SWGUDPSourceReport.h | 2 +- .../code/qt5/client/SWGUDPSourceSettings.cpp | 2 +- .../code/qt5/client/SWGUDPSourceSettings.h | 2 +- .../code/qt5/client/SWGWFMDemodReport.cpp | 2 +- .../code/qt5/client/SWGWFMDemodReport.h | 2 +- .../code/qt5/client/SWGWFMDemodSettings.cpp | 2 +- .../code/qt5/client/SWGWFMDemodSettings.h | 2 +- .../code/qt5/client/SWGWFMModReport.cpp | 2 +- .../code/qt5/client/SWGWFMModReport.h | 2 +- .../code/qt5/client/SWGWFMModSettings.cpp | 2 +- .../code/qt5/client/SWGWFMModSettings.h | 2 +- .../code/qt5/client/SWGXtrxInputReport.cpp | 2 +- .../code/qt5/client/SWGXtrxInputReport.h | 2 +- .../code/qt5/client/SWGXtrxInputSettings.cpp | 2 +- .../code/qt5/client/SWGXtrxInputSettings.h | 2 +- .../code/qt5/client/SWGXtrxOutputReport.cpp | 2 +- .../code/qt5/client/SWGXtrxOutputReport.h | 2 +- .../code/qt5/client/SWGXtrxOutputSettings.cpp | 2 +- .../code/qt5/client/SWGXtrxOutputSettings.h | 2 +- 287 files changed, 454 insertions(+), 298 deletions(-) diff --git a/plugins/channelrx/localsink/localsink.cpp b/plugins/channelrx/localsink/localsink.cpp index 909ada32e..ee61a6b77 100644 --- a/plugins/channelrx/localsink/localsink.cpp +++ b/plugins/channelrx/localsink/localsink.cpp @@ -50,9 +50,6 @@ LocalSink::LocalSink(DeviceAPI *deviceAPI) : m_deviceAPI(deviceAPI), m_running(false), m_sinkThread(0), - m_txBlockIndex(0), - m_frameCount(0), - m_sampleIndex(0), m_centerFrequency(0), m_frequencyOffset(0), m_sampleRate(48000), diff --git a/plugins/channelrx/localsink/localsink.h b/plugins/channelrx/localsink/localsink.h index e49f7ca1e..5e58066ca 100644 --- a/plugins/channelrx/localsink/localsink.h +++ b/plugins/channelrx/localsink/localsink.h @@ -87,16 +87,15 @@ public: int getLog2Decim() const { return m_log2Decim; } int getFilterChainHash() const { return m_filterChainHash; } - static MsgConfigureChannelizer* create(int sampleRate, int centerFrequency) - { - return new MsgConfigureChannelizer(sampleRate, centerFrequency); + static MsgConfigureChannelizer* create(unsigned int log2Decim, unsigned int filterChainHash) { + return new MsgConfigureChannelizer(log2Decim, filterChainHash); } private: unsigned int m_log2Decim; unsigned int m_filterChainHash; - MsgConfigureChannelizer(unsigned int log2Decim, int filterChainHash) : + MsgConfigureChannelizer(unsigned int log2Decim, unsigned int filterChainHash) : Message(), m_log2Decim(log2Decim), m_filterChainHash(filterChainHash) @@ -163,11 +162,6 @@ private: LocalSinkSettings m_settings; LocalSinkThread *m_sinkThread; - int m_txBlockIndex; //!< Current index in blocks to transmit in the Tx row - uint16_t m_frameCount; //!< transmission frame count - int m_sampleIndex; //!< Current sample index in protected block data - QMutex m_dataBlockMutex; - uint64_t m_centerFrequency; int64_t m_frequencyOffset; uint32_t m_sampleRate; diff --git a/plugins/channeltx/remotesource/remotesource.h b/plugins/channeltx/remotesource/remotesource.h index 62679e126..5f84b3931 100644 --- a/plugins/channeltx/remotesource/remotesource.h +++ b/plugins/channeltx/remotesource/remotesource.h @@ -196,8 +196,8 @@ public: virtual void getTitle(QString& title) { title = m_settings.m_title; } virtual qint64 getCenterFrequency() const { return 0; } - virtual int getNbSinkStreams() const { return 1; } - virtual int getNbSourceStreams() const { return 0; } + virtual int getNbSinkStreams() const { return 0; } + virtual int getNbSourceStreams() const { return 1; } virtual qint64 getStreamCenterFrequency(int streamIndex, bool sinkElseSource) const { diff --git a/plugins/samplesink/bladerf1output/bladerf1output.h b/plugins/samplesink/bladerf1output/bladerf1output.h index a74b6ae07..66182104b 100644 --- a/plugins/samplesink/bladerf1output/bladerf1output.h +++ b/plugins/samplesink/bladerf1output/bladerf1output.h @@ -108,6 +108,7 @@ public: virtual void setMessageQueueToGUI(MessageQueue *queue) { m_guiMessageQueue = queue; } virtual const QString& getDeviceDescription() const; virtual int getSampleRate() const; + virtual void setSampleRate(int sampleRate) { (void) sampleRate; } virtual quint64 getCenterFrequency() const; virtual void setCenterFrequency(qint64 centerFrequency); diff --git a/plugins/samplesink/bladerf2output/bladerf2output.h b/plugins/samplesink/bladerf2output/bladerf2output.h index dc0c56106..87c6101a5 100644 --- a/plugins/samplesink/bladerf2output/bladerf2output.h +++ b/plugins/samplesink/bladerf2output/bladerf2output.h @@ -119,6 +119,7 @@ public: virtual void setMessageQueueToGUI(MessageQueue *queue) { m_guiMessageQueue = queue; } virtual const QString& getDeviceDescription() const; virtual int getSampleRate() const; + virtual void setSampleRate(int sampleRate) { (void) sampleRate; } virtual quint64 getCenterFrequency() const; virtual void setCenterFrequency(qint64 centerFrequency); diff --git a/plugins/samplesink/filesink/filesinkoutput.h b/plugins/samplesink/filesink/filesinkoutput.h index 25c535a9b..38ffb639c 100644 --- a/plugins/samplesink/filesink/filesinkoutput.h +++ b/plugins/samplesink/filesink/filesinkoutput.h @@ -185,6 +185,7 @@ public: virtual void setMessageQueueToGUI(MessageQueue *queue) { m_guiMessageQueue = queue; } virtual const QString& getDeviceDescription() const; virtual int getSampleRate() const; + virtual void setSampleRate(int sampleRate) { (void) sampleRate; } virtual quint64 getCenterFrequency() const; virtual void setCenterFrequency(qint64 centerFrequency); std::time_t getStartingTimeStamp() const; diff --git a/plugins/samplesink/hackrfoutput/hackrfoutput.h b/plugins/samplesink/hackrfoutput/hackrfoutput.h index ec34521b3..bf835f5ce 100644 --- a/plugins/samplesink/hackrfoutput/hackrfoutput.h +++ b/plugins/samplesink/hackrfoutput/hackrfoutput.h @@ -109,6 +109,7 @@ public: virtual void setMessageQueueToGUI(MessageQueue *queue) { m_guiMessageQueue = queue; } virtual const QString& getDeviceDescription() const; virtual int getSampleRate() const; + virtual void setSampleRate(int sampleRate) { (void) sampleRate; } virtual quint64 getCenterFrequency() const; virtual void setCenterFrequency(qint64 centerFrequency); diff --git a/plugins/samplesink/limesdroutput/limesdroutput.h b/plugins/samplesink/limesdroutput/limesdroutput.h index 27994b026..114cd3049 100644 --- a/plugins/samplesink/limesdroutput/limesdroutput.h +++ b/plugins/samplesink/limesdroutput/limesdroutput.h @@ -198,6 +198,7 @@ public: virtual void setMessageQueueToGUI(MessageQueue *queue) { m_guiMessageQueue = queue; } virtual const QString& getDeviceDescription() const; virtual int getSampleRate() const; + virtual void setSampleRate(int sampleRate) { (void) sampleRate; } virtual quint64 getCenterFrequency() const; virtual void setCenterFrequency(qint64 centerFrequency); diff --git a/plugins/samplesink/plutosdroutput/plutosdroutput.h b/plugins/samplesink/plutosdroutput/plutosdroutput.h index 27d85dfd7..8d885a787 100644 --- a/plugins/samplesink/plutosdroutput/plutosdroutput.h +++ b/plugins/samplesink/plutosdroutput/plutosdroutput.h @@ -92,6 +92,7 @@ public: virtual void setMessageQueueToGUI(MessageQueue *queue) { m_guiMessageQueue = queue; } virtual const QString& getDeviceDescription() const; virtual int getSampleRate() const; + virtual void setSampleRate(int sampleRate) { (void) sampleRate; } virtual quint64 getCenterFrequency() const; virtual void setCenterFrequency(qint64 centerFrequency); diff --git a/plugins/samplesink/remoteoutput/remoteoutput.h b/plugins/samplesink/remoteoutput/remoteoutput.h index 558d41ddb..bcdd0a2f3 100644 --- a/plugins/samplesink/remoteoutput/remoteoutput.h +++ b/plugins/samplesink/remoteoutput/remoteoutput.h @@ -136,6 +136,7 @@ public: virtual void setMessageQueueToGUI(MessageQueue *queue) { m_guiMessageQueue = queue; } virtual const QString& getDeviceDescription() const; virtual int getSampleRate() const; + virtual void setSampleRate(int sampleRate) { (void) sampleRate; } virtual quint64 getCenterFrequency() const; virtual void setCenterFrequency(qint64 centerFrequency) { (void) centerFrequency; } std::time_t getStartingTimeStamp() const; diff --git a/plugins/samplesink/soapysdroutput/soapysdroutput.h b/plugins/samplesink/soapysdroutput/soapysdroutput.h index 3ced8f1a0..1e9f78f98 100644 --- a/plugins/samplesink/soapysdroutput/soapysdroutput.h +++ b/plugins/samplesink/soapysdroutput/soapysdroutput.h @@ -133,6 +133,7 @@ public: virtual void setMessageQueueToGUI(MessageQueue *queue) { m_guiMessageQueue = queue; } virtual const QString& getDeviceDescription() const; virtual int getSampleRate() const; + virtual void setSampleRate(int sampleRate) { (void) sampleRate; } virtual quint64 getCenterFrequency() const; virtual void setCenterFrequency(qint64 centerFrequency); diff --git a/plugins/samplesink/xtrxoutput/xtrxoutput.h b/plugins/samplesink/xtrxoutput/xtrxoutput.h index 6d6ef8515..d83a33977 100644 --- a/plugins/samplesink/xtrxoutput/xtrxoutput.h +++ b/plugins/samplesink/xtrxoutput/xtrxoutput.h @@ -186,6 +186,7 @@ public: virtual void setMessageQueueToGUI(MessageQueue *queue) { m_guiMessageQueue = queue; } virtual const QString& getDeviceDescription() const; virtual int getSampleRate() const; + virtual void setSampleRate(int sampleRate) { (void) sampleRate; } uint32_t getDevSampleRate() const; uint32_t getLog2HardInterp() const; double getClockGen() const; diff --git a/sdrbase/dsp/devicesamplesink.h b/sdrbase/dsp/devicesamplesink.h index c077f4a4c..98cdb89fa 100644 --- a/sdrbase/dsp/devicesamplesink.h +++ b/sdrbase/dsp/devicesamplesink.h @@ -55,6 +55,7 @@ public: virtual const QString& getDeviceDescription() const = 0; virtual int getSampleRate() const = 0; //!< Sample rate exposed by the sink + virtual void setSampleRate(int sampleRate) = 0; //!< For when the sink sample rate is set externally virtual quint64 getCenterFrequency() const = 0; //!< Center frequency exposed by the sink virtual void setCenterFrequency(qint64 centerFrequency) = 0; diff --git a/sdrbase/dsp/upchannelizer.cpp b/sdrbase/dsp/upchannelizer.cpp index 99b1ae507..2fe3dddf9 100644 --- a/sdrbase/dsp/upchannelizer.cpp +++ b/sdrbase/dsp/upchannelizer.cpp @@ -17,9 +17,10 @@ /////////////////////////////////////////////////////////////////////////////////// -#include +#include "dsp/upchannelizer.h" #include "dsp/inthalfbandfilter.h" #include "dsp/dspcommands.h" +#include "dsp/hbfilterchainconverter.h" #include #include @@ -28,6 +29,7 @@ MESSAGE_CLASS_DEFINITION(UpChannelizer::MsgChannelizerNotification, Message) MESSAGE_CLASS_DEFINITION(UpChannelizer::MsgSetChannelizer, Message) UpChannelizer::UpChannelizer(BasebandSampleSource* sampleSource) : + m_filterChainSetMode(false), m_sampleSource(sampleSource), m_outputSampleRate(0), m_requestedInputSampleRate(0), @@ -50,6 +52,12 @@ void UpChannelizer::configure(MessageQueue* messageQueue, int sampleRate, int ce messageQueue->push(cmd); } +void UpChannelizer::set(MessageQueue* messageQueue, unsigned int log2Interp, unsigned int filterChainHash) +{ + Message* cmd = new MsgSetChannelizer(log2Interp, filterChainHash); + messageQueue->push(cmd); +} + void UpChannelizer::pull(Sample& sample) { if(m_sampleSource == 0) { @@ -133,7 +141,10 @@ bool UpChannelizer::handleMessage(const Message& cmd) DSPSignalNotification& notif = (DSPSignalNotification&) cmd; m_outputSampleRate = notif.getSampleRate(); qDebug() << "UpChannelizer::handleMessage: DSPSignalNotification: m_outputSampleRate: " << m_outputSampleRate; - applyConfiguration(); + + if (!m_filterChainSetMode) { + applyConfiguration(); + } if (m_sampleSource != 0) { @@ -162,7 +173,7 @@ bool UpChannelizer::handleMessage(const Message& cmd) { MsgSetChannelizer& chan = (MsgSetChannelizer&) cmd; qDebug() << "UpChannelizer::handleMessage: MsgSetChannelizer"; - applySetting(chan.getStageIndexes()); + applySetting(chan.getLog2Interp(), chan.getFilterChainHash()); return true; } @@ -182,6 +193,8 @@ bool UpChannelizer::handleMessage(const Message& cmd) void UpChannelizer::applyConfiguration() { + m_filterChainSetMode = false; + if (m_outputSampleRate == 0) { qDebug() << "UpChannelizer::applyConfiguration: aborting (out=0):" @@ -192,6 +205,7 @@ void UpChannelizer::applyConfiguration() return; } + m_mutex.lock(); freeFilterChain(); @@ -217,14 +231,16 @@ void UpChannelizer::applyConfiguration() } } -void UpChannelizer::applySetting(const std::vector& stageIndexes) +void UpChannelizer::applySetting(unsigned int log2Interp, unsigned int filterChainHash) { + m_filterChainSetMode = true; + std::vector stageIndexes; + m_currentCenterFrequency = m_outputSampleRate * HBFilterChainConverter::convertToIndexes(log2Interp, filterChainHash, stageIndexes); + m_requestedCenterFrequency = m_currentCenterFrequency; + m_mutex.lock(); - freeFilterChain(); - m_currentCenterFrequency = m_outputSampleRate * setFilterChain(stageIndexes); - m_mutex.unlock(); m_currentInputSampleRate = m_outputSampleRate / (1 << m_filterStages.size()); diff --git a/sdrbase/dsp/upchannelizer.h b/sdrbase/dsp/upchannelizer.h index 64c98fa89..7c4b73f26 100644 --- a/sdrbase/dsp/upchannelizer.h +++ b/sdrbase/dsp/upchannelizer.h @@ -67,20 +67,25 @@ public: MESSAGE_CLASS_DECLARATION public: - MsgSetChannelizer() : - Message() + MsgSetChannelizer(unsigned int log2Interp, unsigned int filterChainHash) : + Message(), + m_log2interp(log2Interp), + m_filterChainHash(filterChainHash) { } - std::vector& getStageIndexes() { return m_stageIndexes; } + unsigned int getLog2Interp() const { return m_log2interp; } + unsigned int getFilterChainHash() const { return m_filterChainHash; } private: - std::vector m_stageIndexes; + unsigned int m_log2interp; + unsigned int m_filterChainHash; }; UpChannelizer(BasebandSampleSource* sampleSink); virtual ~UpChannelizer(); void configure(MessageQueue* messageQueue, int sampleRate, int centerFrequency); + void set(MessageQueue* messageQueue, unsigned int log2Interp, unsigned int filterChainHash); int getOutputSampleRate() const { return m_outputSampleRate; } virtual void start(); @@ -117,6 +122,7 @@ protected: }; typedef std::vector FilterStages; FilterStages m_filterStages; + bool m_filterChainSetMode; std::vector m_stageSamples; BasebandSampleSource* m_sampleSource; //!< Modulator int m_outputSampleRate; @@ -129,7 +135,7 @@ protected: QMutex m_mutex; void applyConfiguration(); - void applySetting(const std::vector& stageIndexes); + void applySetting(unsigned int log2Decim, unsigned int filterChainHash); bool signalContainsChannel(Real sigStart, Real sigEnd, Real chanStart, Real chanEnd) const; Real createFilterChain(Real sigStart, Real sigEnd, Real chanStart, Real chanEnd); double setFilterChain(const std::vector& stageIndexes); //!< returns offset in ratio of sample rate diff --git a/sdrbase/resources/res.qrc b/sdrbase/resources/res.qrc index 903d46282..6180d55fd 100644 --- a/sdrbase/resources/res.qrc +++ b/sdrbase/resources/res.qrc @@ -27,6 +27,7 @@ webapi/doc/swagger/include/PlutoSdr.yaml webapi/doc/swagger/include/RtlSdr.yaml webapi/doc/swagger/include/LocalSink.yaml + webapi/doc/swagger/include/LocalSource.yaml webapi/doc/swagger/include/RemoteSink.yaml webapi/doc/swagger/include/RemoteSource.yaml webapi/doc/swagger/include/RemoteInput.yaml diff --git a/sdrbase/resources/webapi/doc/html2/index.html b/sdrbase/resources/webapi/doc/html2/index.html index b340fb0cd..dd71c0604 100644 --- a/sdrbase/resources/webapi/doc/html2/index.html +++ b/sdrbase/resources/webapi/doc/html2/index.html @@ -1850,6 +1850,9 @@ margin-bottom: 20px; "LocalSinkSettings" : { "$ref" : "#/definitions/LocalSinkSettings" }, + "LocalSourceSettings" : { + "$ref" : "#/definitions/LocalSourceSettings" + }, "RemoteSinkSettings" : { "$ref" : "#/definitions/RemoteSinkSettings" }, @@ -3398,6 +3401,43 @@ margin-bottom: 20px; } }, "description" : "Local channel sink settings" +}; + defs.LocalSourceSettings = { + "properties" : { + "localDeviceIndex" : { + "type" : "integer", + "description" : "Sending local device index" + }, + "rgbColor" : { + "type" : "integer" + }, + "title" : { + "type" : "string" + }, + "log2Interp" : { + "type" : "integer" + }, + "filterChainHash" : { + "type" : "integer" + }, + "useReverseAPI" : { + "type" : "integer", + "description" : "Synchronize with reverse API (1 for yes, 0 for no)" + }, + "reverseAPIAddress" : { + "type" : "string" + }, + "reverseAPIPort" : { + "type" : "integer" + }, + "reverseAPIDeviceIndex" : { + "type" : "integer" + }, + "reverseAPIChannelIndex" : { + "type" : "integer" + } + }, + "description" : "Local channel source settings" }; defs.LocationInformation = { "required" : [ "latitude", "longitude" ], @@ -5950,7 +5990,7 @@ margin-bottom: 20px;