mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-12-23 01:55:48 -05:00
Better handling of rtlsdr GUI display when settings change (initial load, load of presets)
This commit is contained in:
parent
b2e78e1411
commit
e536a1f1e9
61
Readme.md
61
Readme.md
@ -1,3 +1,10 @@
|
|||||||
|
======================
|
||||||
|
Cloning the repository
|
||||||
|
======================
|
||||||
|
|
||||||
|
- Clone as usual
|
||||||
|
- Checkout the f4exb branch: `git checkout f4exb`
|
||||||
|
|
||||||
==============
|
==============
|
||||||
Funcube Dongle
|
Funcube Dongle
|
||||||
==============
|
==============
|
||||||
@ -11,16 +18,29 @@ Funcube Dongle Pro+ USB drivers are broken on some hardware with recent kernels.
|
|||||||
For Ubuntu
|
For Ubuntu
|
||||||
==========
|
==========
|
||||||
|
|
||||||
"sudo apt-get install libqt5multimedia5-plugins qtmultimedia5-dev qttools5-dev qttools5-dev-tools libqt5opengl5-dev qtbase5-dev libusb-1.0 librtlsdr-dev"
|
`sudo apt-get install libqt5multimedia5-plugins qtmultimedia5-dev qttools5-dev qttools5-dev-tools libqt5opengl5-dev qtbase5-dev libusb-1.0 librtlsdr-dev`
|
||||||
|
|
||||||
"mkdir out && cd out && cmake ../ && make"
|
`mkdir build && cd build && cmake ../ && make`
|
||||||
|
|
||||||
"librtlsdr-dev" is in the "universe" repo. (utopic 14.10 amd64.)
|
`librtlsdr-dev` is in the `universe` repo. (utopic 14.10 amd64.)
|
||||||
|
|
||||||
Use "cmake ../ -DV4L-RTL=ON" to build the Linux kernel driver for RTL-SDR (Experimental). Needs a recent kernel and libv4l2. Will need extra work to support SDRPlay. Needs "cp KERNEL_SOURCE/include/linux/compiler.h /usr/include/linux/" and "cp KERNEL_SOURCE/include/uapi/linux/videodev2.h /usr/include/uapi/linux/" and package "libv4l-dev".
|
Use `cmake ../ -DV4L-RTL=ON` to build the Linux kernel driver for RTL-SDR (Experimental). Needs a recent kernel and libv4l2. Will need extra work to support SDRPlay. Needs `cp KERNEL_SOURCE/include/linux/compiler.h /usr/include/linux/` and `cp KERNEL_SOURCE/include/uapi/linux/videodev2.h /usr/include/uapi/linux/` and package `libv4l-dev`.
|
||||||
|
|
||||||
The Gnuradio plugin source needs extra packages, including "liblog4cpp-dev libboost-system-dev gnuradio-dev libosmosdr-dev"
|
The Gnuradio plugin source needs extra packages, including `liblog4cpp-dev libboost-system-dev gnuradio-dev libosmosdr-dev`
|
||||||
|
|
||||||
|
For non standard installations of RTL-SDR library, the GNU Radio runtime and gr.osmocom drivers use the following variables in the cmake command line. The paths specified are just examples:
|
||||||
|
|
||||||
|
- For GNU Radio runtime:
|
||||||
|
- Includes: `-DGNURADIO_RUNTIME_INCLUDE_DIRS=/opt/install/gnuradio-3.7.5.1/include`
|
||||||
|
- Library: `-DGNURADIO_RUNTIME_LIBRARIES=/opt/install/gnuradio-3.7.5.1/lib/libgnuradio-runtime.so`
|
||||||
|
- For gr.osmocom:
|
||||||
|
- Includes: `-DGNURADIO_OSMOSDR_INCLUDE_DIRS=/opt/install/gr-osmosdr/include`
|
||||||
|
- Library: `-DGNURADIO_OSMOSDR_LIBRARIES=/opt/install/gr-osmosdr/lib/libgnuradio-osmosdr.so`
|
||||||
|
- For RTL-SDR library:
|
||||||
|
- Includes: `-DLIBRTLSDR_INCLUDE_DIR=/opt/install/rtlsdr/include`
|
||||||
|
- Library: `-DLIBRTLSDR_LIBRARIES=/opt/install/rtlsdr/lib/librtlsdr.so`
|
||||||
|
|
||||||
|
There is no installation procedure the executable is at the root of the build directory
|
||||||
|
|
||||||
============
|
============
|
||||||
For Debian 8
|
For Debian 8
|
||||||
@ -28,15 +48,38 @@ For Debian 8
|
|||||||
|
|
||||||
Debian 7 "wheezy" uses Qt4. Qt5 is available from the "wheezy-backports" repo, but this will remove Qt4.
|
Debian 7 "wheezy" uses Qt4. Qt5 is available from the "wheezy-backports" repo, but this will remove Qt4.
|
||||||
|
|
||||||
"sudo apt-get install cmake g++ pkg-config libfftw3-dev libusb-1.0-0-dev libusb-dev qt5-default qtbase5-dev qtchooser libqt5multimedia5-plugins qtmultimedia5-dev qttools5-dev qttools5-dev-tools libqt5opengl5-dev qtbase5-dev librtlsdr-dev"
|
`sudo apt-get install cmake g++ pkg-config libfftw3-dev libusb-1.0-0-dev libusb-dev qt5-default qtbase5-dev qtchooser libqt5multimedia5-plugins qtmultimedia5-dev qttools5-dev qttools5-dev-tools libqt5opengl5-dev qtbase5-dev librtlsdr-dev`
|
||||||
|
|
||||||
"mkdir out && cd out && cmake ../ && make"
|
`mkdir out && cd out && cmake ../ && make`
|
||||||
|
|
||||||
|
The same remarks as for Ubuntu apply...
|
||||||
|
|
||||||
============
|
============
|
||||||
Known Issues
|
Known Issues
|
||||||
============
|
============
|
||||||
|
|
||||||
FM is mostly untested.
|
- Actually NFM seems to be working pretty well
|
||||||
|
- WFM does not work for broadcast
|
||||||
|
- RTL frontend will have bad aliasing in noisy environments. Considering the size of the hardware there is no place for proper filters. With good filtering and a good antenna up front these devices work remarkably well for the price!
|
||||||
|
|
||||||
RTL frontend will have bad aliasing in noisy environments.
|
===================
|
||||||
|
Done since the fork
|
||||||
|
===================
|
||||||
|
|
||||||
|
- Added ppm correction for the LO of RTL-SDR. This uses the corresponding function in the librtlsdr interface (range -99..99 ppm)
|
||||||
|
- Added a preset update button (the diskette with the yellow corner) to be able to save the current settings on an existing preset
|
||||||
|
- Added variable decimation in log2 increments from 2^0=1 to 2^4=16 allowing to see the full 2048 kHz of spectrum if so you wish
|
||||||
|
- Better handling of rtlsdr GUI display when settings change (initial load, load of presets)
|
||||||
|
|
||||||
|
=====
|
||||||
|
To Do
|
||||||
|
=====
|
||||||
|
|
||||||
|
- Display center frequency of the receiver in scope. Presently there is no way to set the frequency precisely
|
||||||
|
- AM demod. What about the air band?!
|
||||||
|
- Add the possibility to change the brightness and/or color of the grid. Sometimes it is barely visible yet useful
|
||||||
|
- Possibility to completely undock the receiver in a separate window. Useful when there are many receivers
|
||||||
|
- Larger decimation capability for narrowband and very narrowband work (32, 64, ...)
|
||||||
|
- Even more demods ...
|
||||||
|
- Triggering capability like on expensive spectrum analyzers to trap burst signals
|
||||||
|
- recording capability
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
#include <iostream>
|
||||||
#include "rtlsdrgui.h"
|
#include "rtlsdrgui.h"
|
||||||
#include "ui_rtlsdrgui.h"
|
#include "ui_rtlsdrgui.h"
|
||||||
#include "plugin/pluginapi.h"
|
#include "plugin/pluginapi.h"
|
||||||
@ -95,7 +96,13 @@ bool RTLSDRGui::handleMessage(Message* message)
|
|||||||
void RTLSDRGui::displaySettings()
|
void RTLSDRGui::displaySettings()
|
||||||
{
|
{
|
||||||
ui->centerFrequency->setValue(m_generalSettings.m_centerFrequency / 1000);
|
ui->centerFrequency->setValue(m_generalSettings.m_centerFrequency / 1000);
|
||||||
ui->samplerate->setValue(1);
|
ui->samplerateText->setText(tr("%1k").arg(m_settings.m_samplerate / 1000));
|
||||||
|
unsigned int sampleRateIndex = RTLSDRSampleRates::getRateIndex(m_settings.m_samplerate);
|
||||||
|
ui->samplerate->setValue(sampleRateIndex);
|
||||||
|
ui->ppm->setValue(m_settings.m_loPpmCorrection);
|
||||||
|
ui->ppmText->setText(tr("%1").arg(m_settings.m_loPpmCorrection));
|
||||||
|
ui->decimText->setText(tr("%1").arg(1<<m_settings.m_log2Decim));
|
||||||
|
ui->decim->setValue(m_settings.m_log2Decim);
|
||||||
|
|
||||||
if(m_gains.size() > 0) {
|
if(m_gains.size() > 0) {
|
||||||
int dist = abs(m_settings.m_gain - m_gains[0]);
|
int dist = abs(m_settings.m_gain - m_gains[0]);
|
||||||
@ -159,8 +166,7 @@ void RTLSDRGui::on_gain_valueChanged(int value)
|
|||||||
|
|
||||||
void RTLSDRGui::on_samplerate_valueChanged(int value)
|
void RTLSDRGui::on_samplerate_valueChanged(int value)
|
||||||
{
|
{
|
||||||
int Rates[] = {288, 1024, 1536, 1152, 2048, 2500 };
|
int newrate = RTLSDRSampleRates::getRate(value);
|
||||||
int newrate = Rates[value];
|
|
||||||
ui->samplerateText->setText(tr("%1k").arg(newrate));
|
ui->samplerateText->setText(tr("%1k").arg(newrate));
|
||||||
m_settings.m_samplerate = newrate * 1000;
|
m_settings.m_samplerate = newrate * 1000;
|
||||||
sendSettings();
|
sendSettings();
|
||||||
@ -193,3 +199,30 @@ void RTLSDRGui::on_checkBox_stateChanged(int state) {
|
|||||||
sendSettings();
|
sendSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned int RTLSDRSampleRates::m_rates[] = {288, 1024, 1536, 1152, 2048, 2500 };
|
||||||
|
unsigned int RTLSDRSampleRates::m_nb_rates = 6;
|
||||||
|
|
||||||
|
unsigned int RTLSDRSampleRates::getRate(unsigned int rate_index)
|
||||||
|
{
|
||||||
|
if (rate_index < m_nb_rates)
|
||||||
|
{
|
||||||
|
return m_rates[rate_index];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return m_rates[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned int RTLSDRSampleRates::getRateIndex(unsigned int rate)
|
||||||
|
{
|
||||||
|
for (unsigned int i=0; i < m_nb_rates; i++)
|
||||||
|
{
|
||||||
|
if (rate/1000 == m_rates[i])
|
||||||
|
{
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
@ -9,6 +9,7 @@ class PluginAPI;
|
|||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class RTLSDRGui;
|
class RTLSDRGui;
|
||||||
|
class RTLSDRSampleRates;
|
||||||
}
|
}
|
||||||
|
|
||||||
class RTLSDRGui : public QWidget, public PluginGUI {
|
class RTLSDRGui : public QWidget, public PluginGUI {
|
||||||
@ -52,4 +53,13 @@ private slots:
|
|||||||
void updateHardware();
|
void updateHardware();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class RTLSDRSampleRates {
|
||||||
|
public:
|
||||||
|
static unsigned int getRate(unsigned int rate_index);
|
||||||
|
static unsigned int getRateIndex(unsigned int rate);
|
||||||
|
private:
|
||||||
|
static unsigned int m_rates[6];
|
||||||
|
static unsigned int m_nb_rates;
|
||||||
|
};
|
||||||
|
|
||||||
#endif // INCLUDE_RTLSDRGUI_H
|
#endif // INCLUDE_RTLSDRGUI_H
|
||||||
|
@ -27,7 +27,9 @@ MESSAGE_CLASS_DEFINITION(RTLSDRInput::MsgReportRTLSDR, Message)
|
|||||||
|
|
||||||
RTLSDRInput::Settings::Settings() :
|
RTLSDRInput::Settings::Settings() :
|
||||||
m_gain(0),
|
m_gain(0),
|
||||||
m_samplerate(1024000)
|
m_samplerate(1024000),
|
||||||
|
m_loPpmCorrection(0),
|
||||||
|
m_log2Decim(4)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -60,7 +62,7 @@ bool RTLSDRInput::Settings::deserialize(const QByteArray& data)
|
|||||||
|
|
||||||
if(d.getVersion() == 1) {
|
if(d.getVersion() == 1) {
|
||||||
d.readS32(1, &m_gain, 0);
|
d.readS32(1, &m_gain, 0);
|
||||||
//d.readS32(2, &m_samplerate, 0);
|
d.readS32(2, &m_samplerate, 0);
|
||||||
d.readS32(3, &m_loPpmCorrection, 0);
|
d.readS32(3, &m_loPpmCorrection, 0);
|
||||||
d.readU32(4, &m_log2Decim, 4);
|
d.readU32(4, &m_log2Decim, 4);
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user