Closed lowlevl closed 2 years ago
My main question is: Do you have any idea on what could be happening and how could I fix it ?
No idea, I'm afriad - QSGBatchRenderer::Renderer::buildRenderLists is within the Qt library.
The only unusual thing I can see, is you are using Qt 5.15.3, which I think is the commercial version of Qt - so probably hasn't been used previously. Might be worth trying Qt 5.15.2 if possible.
I'll try, I don't know if I can easily downgrade a package in Alpine without breaking everything ^^'
Anyways, this is really weird, because it seems like it blocks the main event loop, because even the API on port 8091
does not respond after adding the Map component (while it does before).
I don't have a lot of experience with Qt, but couldn't it be due to a missing dependency of some sort ? Maybe a QML dependency ?
Generally when there's a missing QML dependency, you'll see that in the log and the map will just be grey.
Actually, the only time I got ADS-B
working with my setup was when I forgot to install qt5-qtquickcontrols2
, it showed an error in the logs, didn't render the map, so it didn't block the event loop ¯\(ツ)/¯
But it isn't satisfying to provide a broken package ^^'
After some investigation, I found this not-too-old SO post: https://stackoverflow.com/questions/52663856/qwidget-ui-freezes-when-using-a-qquickwidget, it says:
Note: Using QQuickWidget disables the threaded render loop on all platforms. This means that some of the benefits of threaded rendering, for example Animator classes and vsync driven animations, will not be available.
I changed my QQuickWidget to a QQuickView and everything is working.
I see that the Map in sdrangel
uses QQuickWidget
, shouldn't we try using QQuickView
instead ?
What do you think ?
What specific changes did you make? Do you have a diff?
I made no change whatsoever to the source code, I took the latest available version tag from the releases, I was just saying that removing the QML dependency qt5-qtquickcontrols2
from my system made the map crash (with a QML error in the console), and thus making the ADS-B module available, but with a blank map.
Unfortunately this is not suitable for distribution use.
Edit: Ah, I get what you meant, I only quoted the StackOverflow post, I didn't do anything myself.
I have the same problem on Gentoo. I tested qt-5.15.2 and qt-5.15.3 it doesn't change anything. The only map that works is mapboxgl, but you can't run it in sdrangel without changing the source code. I wrote a patch for version 6.17.3 that changes the default map from osm to mapboxgl. But unfortunately my patches don't work with the new sdrangel version. The problem is the qt library.
My patch to change the default map from osm to mapboxgl for sdrangel-6.17.3:
--- sdrangel-6.17.3/plugins/feature/map/map/map_5_12.qml 2021-10-07 22:11:10.000000000 +0200
+++ sdrangel-6.17.3/plugins/feature/map/map/map_5_12.qml 2021-10-10 21:52:47.047685653 +0200
@@ -7,7 +7,7 @@
Item {
id: qmlMap
property int mapZoomLevel: 11
- property string mapProvider: "osm"
+ property string mapProvider: "mapboxgl"
property variant mapParameters
property variant mapPtr
--- sdrangel-6.17.3/plugins/feature/map/map/map.qml 2021-10-07 22:11:10.000000000 +0200
+++ sdrangel-6.17.3/plugins/feature/map/map/map.qml 2021-10-10 21:52:33.846278982 +0200
@@ -7,7 +7,7 @@
Item {
id: qmlMap
property int mapZoomLevel: 11
- property string mapProvider: "osm"
+ property string mapProvider: "mapboxgl"
property variant mapParameters
property variant mapPtr
--- sdrangel-6.17.3/plugins/feature/map/mapsettings.cpp 2021-11-06 21:33:26.000000000 +0100
+++ sdrangel-6.17.3/plugins/feature/map/mapsettings.cpp 2021-12-27 11:48:23.328835300 +0100
@@ -55,7 +55,7 @@
void MapSettings::resetToDefaults()
{
m_displayNames = true;
- m_mapProvider = "osm";
+ m_mapProvider = "mapboxgl";
m_mapBoxApiKey = "";
m_mapBoxStyles = "";
m_sources = -1;
@@ -113,7 +113,7 @@
QString strtmp;
d.readBool(1, &m_displayNames, true);
- d.readString(2, &m_mapProvider, "osm");
+ d.readString(2, &m_mapProvider, "mapboxgl");
d.readString(3, &m_mapBoxApiKey, "");
d.readString(4, &m_mapBoxStyles, "");
d.readU32(5, &m_sources, -1);
--- sdrangel-6.17.3/plugins/feature/vorlocalizer/map/map.qml 2021-10-07 22:11:10.000000000 +0200
+++ sdrangel-6.17.3/plugins/feature/vorlocalizer/map/map.qml 2021-10-10 22:11:28.096467945 +0200
@@ -9,7 +9,7 @@
Plugin {
id: mapPlugin
- name: "osm"
+ name: "mapboxgl"
}
Map {
--- sdrangel-6.17.3/plugins/channelrx/demodadsb/map/map.qml 2021-10-07 22:11:10.000000000 +0200
+++ sdrangel-6.17.3/plugins/channelrx/demodadsb/map/map.qml 2021-10-10 19:45:55.253273159 +0200
@@ -10,7 +10,7 @@
Plugin {
id: mapPlugin
- name: "osm"
+ name: "mapboxgl"
}
Map {
Thanks, but we can't apply that patch, as mapboxgl isn't supported on Windows (but of course map be useful to others with this issue)
This patch works with the latest version of sdrangel-6.20.2:
--- sdrangel-6.17.4/plugins/feature/map/map/map_5_12.qml 2021-11-26 22:51:28.000000000 +0100
+++ sdrangel-6.17.4/plugins/feature/map/map/map_5_12.qml 2021-11-27 19:55:19.052137780 +0100
@@ -7,7 +7,7 @@
Item {
id: qmlMap
property int mapZoomLevel: 11
- property string mapProvider: "osm"
+ property string mapProvider: "mapboxgl"
property variant mapPtr
property variant guiPtr
--- sdrangel-6.17.4/plugins/feature/map/map/map.qml 2021-11-26 22:51:28.000000000 +0100
+++ sdrangel-6.17.4/plugins/feature/map/map/map.qml 2021-11-27 19:54:44.258925452 +0100
@@ -7,7 +7,7 @@
Item {
id: qmlMap
property int mapZoomLevel: 11
- property string mapProvider: "osm"
+ property string mapProvider: "mapboxgl"
property variant mapPtr
property variant guiPtr
--- sdrangel-6.20.2/plugins/feature/map/mapsettings.cpp 2022-03-30 22:16:08.000000000 +0200
+++ sdrangel-6.20.2/plugins/feature/map/mapsettings.cpp 2022-03-30 23:29:52.396420897 +0200
@@ -83,7 +83,7 @@
void MapSettings::resetToDefaults()
{
m_displayNames = true;
- m_mapProvider = "osm";
+ m_mapProvider = "mapboxgl";
m_thunderforestAPIKey = "";
m_maptilerAPIKey = "";
m_mapBoxAPIKey = "";
@@ -166,7 +166,7 @@
QByteArray blob;
d.readBool(1, &m_displayNames, true);
- d.readString(2, &m_mapProvider, "osm");
+ d.readString(2, &m_mapProvider, "mapboxgl");
d.readString(3, &m_mapBoxAPIKey, "");
d.readString(4, &m_mapBoxStyles, "");
d.readString(8, &m_title, "Map");
--- sdrangel-6.17.3/plugins/feature/vorlocalizer/map/map.qml 2021-10-07 22:11:10.000000000 +0200
+++ sdrangel-6.17.3/plugins/feature/vorlocalizer/map/map.qml 2021-10-10 22:11:28.096467945 +0200
@@ -9,7 +9,7 @@
Plugin {
id: mapPlugin
- name: "osm"
+ name: "mapboxgl"
}
Map {
--- sdrangel-6.17.5/plugins/channelrx/demodadsb/map/map.qml 2021-12-16 10:32:52.000000000 +0100
+++ sdrangel-6.17.5/plugins/channelrx/demodadsb/map/map.qml 2021-12-23 15:16:39.722044195 +0100
@@ -8,7 +8,7 @@
id: qmlMap
property int aircraftZoomLevel: 11
property int airportZoomLevel: 11
- property string mapProvider: "osm"
+ property string mapProvider: "mapboxgl"
property variant mapPtr
property string requestedMapType
property bool lightIcons
@@ -51,6 +51,7 @@
anchors.fill: parent
center: QtPositioning.coordinate(51.5, 0.125) // London
zoomLevel: 10
+ copyrightsVisible: false
// Needs to come first, otherwise MouseAreas in the MapItemViews don't get clicked event first
// Setting z doesn't seem to work
Hello @janczeresnia, thank you for this patch, I'll try it locally with Alpine !
Thanks, but we can't apply that patch, as mapboxgl isn't supported on Windows (but of course map be useful to others with this issue) — @srcejon
Couldn't we branch in the .qml
file to use mapboxgl
in Linux and osm
in Windows ? Alternatively a compilation flag would be fine with me !
Couldn't we branch in the
.qml
file to usemapboxgl
in Linux andosm
in Windows ? Alternatively a compilation flag would be fine with me !
You can probably do it. Need to add a preprocessor macro to the source code like this:
#if !((defined _WIN32_) || (defined _MSC_VER))
"Change for linux: map mapboxgl"
#else
"Orginal code for windows : map osm"
#endif
Or easier:
#if (defined _WIN32_) || (defined _MSC_VER)
"Orginal code for windows : map osm"
#else
"Change for linux: map mapboxgl"
#endif
Thanks, I'll look into it :) For now, the patch kinda works, but there is still some freezes, I'll try to investigate a bit more.
There is only a small problem that QML files do not support preprocessor macros. But it can be done.
Yes, but we don't have to modify the QML files at all, since this is done in the C++ code, thus overriding the QML mapProvider
definition before rendering :)
I think I'll just disable the osm
dropdown item in QT 3.15+ for Linux.
You can do that for your own build - but osm does work on other Linux distributions.
@srcejon does it for Qt 3.15.3+ ? (Commercial distribution) @janczeresnia was suggesting this was an upstream bug in Qt.
I wrote a test application in qt-creator to check if the problem is really in the qt library. It looks like there is a bug in qt.
It works fine in 5.15.2 in Ubuntu for me.
I haven't tried 5.15.3, although I see it is now available as open-source, so maybe I can when builds are available.
I am not a QT specialist but in Gentoo the osm maps do not work with qt-5.15.2 and qt-5.15.3. Only these two versions of QT are available in Gentoo. Maybe it's some other bug not related to QT I don't know.
@srcejon: Would it be manageable for you if I provided an option (via a PR) in the CMakeFile.txt
called DISABLE_OSM_MAPPROVIDER
(or any name you'd prefer) that'll disable OpenStreetMap in sdrangel
and replace it by MapBoxGL ?
That would save me from maintaining a patch file throughout versions.
for now I did this, and it seems to work:
diff --git a/plugins/channelrx/demodadsb/adsbdemodgui.cpp b/plugins/channelrx/demodadsb/adsbdemodgui.cpp
index 37e8084de..8a979cbe8 100644
--- a/plugins/channelrx/demodadsb/adsbdemodgui.cpp
+++ b/plugins/channelrx/demodadsb/adsbdemodgui.cpp
@@ -3590,7 +3590,7 @@ void ADSBDemodGUI::applyMapSettings()
}
// Create the map using the specified provider
- QQmlProperty::write(item, "mapProvider", "osm");
+ QQmlProperty::write(item, "mapProvider", "mapboxgl");
QVariantMap parameters;
// Use our repo, so we can append API key and redefine transmit maps
parameters["osm.mapping.providersrepository.address"] = QString("http://127.0.0.1:%1/").arg(m_osmPort);
diff --git a/plugins/feature/map/mapsettings.cpp b/plugins/feature/map/mapsettings.cpp
index 732e58502..24e250bcf 100644
--- a/plugins/feature/map/mapsettings.cpp
+++ b/plugins/feature/map/mapsettings.cpp
@@ -47,7 +47,6 @@ const QStringList MapSettings::m_pipeURIs = {
// GUI combo box should match ordering in this list
const QStringList MapSettings::m_mapProviders = {
- QStringLiteral("osm"),
QStringLiteral("esri"),
QStringLiteral("mapbox"),
QStringLiteral("mapboxgl"),
@@ -83,7 +82,7 @@ MapSettings::~MapSettings()
void MapSettings::resetToDefaults()
{
m_displayNames = true;
- m_mapProvider = "osm";
+ m_mapProvider = "mapboxgl";
m_thunderforestAPIKey = "";
m_maptilerAPIKey = "";
m_mapBoxAPIKey = "";
@@ -166,7 +165,7 @@ bool MapSettings::deserialize(const QByteArray& data)
QByteArray blob;
d.readBool(1, &m_displayNames, true);
- d.readString(2, &m_mapProvider, "osm");
+ d.readString(2, &m_mapProvider, "mapboxgl");
d.readString(3, &m_mapBoxAPIKey, "");
d.readString(4, &m_mapBoxStyles, "");
d.readString(8, &m_title, "Map");
diff --git a/plugins/feature/map/mapsettingsdialog.ui b/plugins/feature/map/mapsettingsdialog.ui
index 30cc95f37..963a5e289 100644
--- a/plugins/feature/map/mapsettingsdialog.ui
+++ b/plugins/feature/map/mapsettingsdialog.ui
@@ -135,11 +135,6 @@
<property name="toolTip">
<string>Select map provider</string>
</property>
- <item>
- <property name="text">
- <string>OpenStreetMap</string>
- </property>
- </item>
The only problem I might face is conditionally removing the item in the mapsettingsdialog.ui
file...
@srcejon: Would it be manageable for you if I provided an option (via a PR) in the
CMakeFile.txt
calledDISABLE_OSM_MAPPROVIDER
(or any name you'd prefer) that'll disable OpenStreetMap insdrangel
and replace it by MapBoxGL ? That would save me from maintaining a patch file throughout versions.
It would be very nice to add this functionality to the next version of sdrangel :)
For now, the patch kinda works, but there is still some freezes, I'll try to investigate a bit more.
You're right ADS-B demodulator and VOR localizer is not working properly sdrangel freezes when loading the map. Hmmm and after crash plugin ADS-B disappeared, it is not in the plug-in list. Very strange. But feature map work OK.
Even after the changes to the plugin's QML files, it seems that the map doesn't change to mapboxgl and the osm map still works.
2022-03-31 20:22:18.715 (W) QGeoTileFetcherOsm: all providers resolved
Patch for sdrangel-6.20.2 working ADS-B plugin:
--- sdrangel-6.20.2/plugins/feature/map/map/map_5_12.qml 2022-03-30 22:16:08.000000000 +0200
+++ sdrangel-6.20.2/plugins/feature/map/map/map_5_12.qml 2022-03-31 16:22:38.501652980 +0200
@@ -7,7 +7,7 @@
Item {
id: qmlMap
property int mapZoomLevel: 11
- property string mapProvider: "osm"
+ property string mapProvider: "mapboxgl"
property variant mapPtr
property variant guiPtr
--- sdrangel-6.20.2/plugins/feature/map/map/map.qml 2022-03-30 22:16:08.000000000 +0200
+++ sdrangel-6.20.2/plugins/feature/map/map/map.qml 2022-03-31 16:22:04.866110754 +0200
@@ -7,7 +7,7 @@
Item {
id: qmlMap
property int mapZoomLevel: 11
- property string mapProvider: "osm"
+ property string mapProvider: "mapboxgl"
property variant mapPtr
property variant guiPtr
--- sdrangel-6.20.2/plugins/feature/map/mapsettingsdialog.ui 2022-03-30 22:16:08.000000000 +0200
+++ sdrangel-6.20.2/plugins/feature/map/mapsettingsdialog.ui 2022-04-02 00:43:23.300717875 +0200
@@ -137,7 +137,7 @@
</property>
<item>
<property name="text">
- <string>OpenStreetMap</string>
+ <string>MapboxGL</string>
</property>
</item>
<item>
@@ -151,11 +151,6 @@
</property>
</item>
<item>
- <property name="text">
- <string>MapboxGL</string>
- </property>
- </item>
- <item>
<property name="text">
<string>MapLibre</string>
</property>
--- sdrangel-6.20.2/plugins/feature/map/mapsettings.cpp 2022-03-30 22:16:08.000000000 +0200
+++ sdrangel-6.20.2/plugins/feature/map/mapsettings.cpp 2022-04-02 01:20:11.452656864 +0200
@@ -47,10 +47,9 @@
// GUI combo box should match ordering in this list
const QStringList MapSettings::m_mapProviders = {
- QStringLiteral("osm"),
+ QStringLiteral("mapboxgl"),
QStringLiteral("esri"),
QStringLiteral("mapbox"),
- QStringLiteral("mapboxgl"),
QStringLiteral("maplibre")
};
@@ -83,7 +82,7 @@
void MapSettings::resetToDefaults()
{
m_displayNames = true;
- m_mapProvider = "osm";
+ m_mapProvider = "mapboxgl";
m_thunderforestAPIKey = "";
m_maptilerAPIKey = "";
m_mapBoxAPIKey = "";
@@ -166,7 +165,7 @@
QByteArray blob;
d.readBool(1, &m_displayNames, true);
- d.readString(2, &m_mapProvider, "osm");
+ d.readString(2, &m_mapProvider, "mapboxgl");
d.readString(3, &m_mapBoxAPIKey, "");
d.readString(4, &m_mapBoxStyles, "");
d.readString(8, &m_title, "Map");
--- sdrangel-6.20.2/plugins/feature/vorlocalizer/map/map.qml 2022-03-30 22:16:08.000000000 +0200
+++ sdrangel-6.20.2/plugins/feature/vorlocalizer/map/map.qml 2022-03-31 16:34:12.322824086 +0200
@@ -9,7 +9,7 @@
Plugin {
id: mapPlugin
- name: "osm"
+ name: "mapboxgl"
}
Map {
@@ -19,6 +23,7 @@
plugin: mapPlugin
center: QtPositioning.coordinate(51.5, 0.125) // London
zoomLevel: 10
+ copyrightsVisible: false
MapItemView {
--- sdrangel-6.20.2/plugins/channelrx/demodadsb/adsbdemodgui.cpp 2022-03-30 22:16:08.000000000 +0200
+++ sdrangel-6.20.2/plugins/channelrx/demodadsb/adsbdemodgui.cpp 2022-04-02 04:57:53.302931616 +0200
@@ -3590,7 +3590,7 @@
}
// Create the map using the specified provider
- QQmlProperty::write(item, "mapProvider", "osm");
+ QQmlProperty::write(item, "mapProvider", "mapboxgl");
QVariantMap parameters;
// Use our repo, so we can append API key and redefine transmit maps
parameters["osm.mapping.providersrepository.address"] = QString("http://127.0.0.1:%1/").arg(m_osmPort);
--- sdrangel-6.20.2/plugins/channelrx/demodadsb/map/map.qml 2022-03-30 22:16:08.000000000 +0200
+++ sdrangel-6.20.2/plugins/channelrx/demodadsb/map/map.qml 2022-03-31 16:39:16.438718738 +0200
@@ -8,7 +8,7 @@
id: qmlMap
property int aircraftZoomLevel: 11
property int airportZoomLevel: 11
- property string mapProvider: "osm"
+ property string mapProvider: "mapboxgl"
property variant mapPtr
property string requestedMapType
property bool lightIcons
@@ -52,6 +56,7 @@
anchors.fill: parent
center: QtPositioning.coordinate(51.5, 0.125) // London
zoomLevel: 10
+ copyrightsVisible: false
// Needs to come first, otherwise MouseAreas in the MapItemViews don't get clicked event first
// Setting z doesn't seem to work
Created a Qt bug for this: https://bugreports.qt.io/browse/QTBUG-103592 (as even the Qt Map Viewer example program doesn't work on Qt 5.15.3)
Workaround implemented in 7.3.2.
Hello :)
Context
I'm trying to provide a package to pkgs.alpinelinux.org for
sdrangel
, because I think this would be cool for this project to be available out of the box in Alpine.My specs (from
neofetch
):Also, this issue happens with or without a SDR connected to the computer, for reference I own a HackRF.
Actual behavior
Note: The project is build from sources using the MUSL (default in Alpine Linux). (with Qt:
5.15.3_git20220217
)When launching the program, and adding anything related to a Map (either Channel -> ADS-B or Feature -> Map), the program instantly freezes, nothing responds, and 1 CPU core has a 100% usage for an undefined time (I waited for 10mn and it didn't unfreeze).
After some investigations, using
gdb
, when adding the Map element, the code blocks in a recursive call to:Also, below are the full logs when launching the project and adding the Map Feature until it freezes.
Expected behavior
This shouldn't freeze the GUI.
Steps to reproduce
Build, launch the project, and add the Map feature in the right panel.
Log Files
Note: I added a dash separator for when I clicked the Apply button in the Add feature dialog.
Thanks !