Bug 497325

Summary: Map search is slow again to start
Product: [Applications] digikam Reporter: _ <myaccount132>
Component: Geolocation-EngineAssignee: Digikam Developers <digikam-bugs-null>
Status: REPORTED ---    
Severity: normal CC: caulier.gilles, metzpinguin
Priority: NOR    
Version First Reported In: 8.5.0   
Target Milestone: ---   
Platform: Appimage   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: map freezing 1/2
map ready after freezing 2/2
map view opened

Description _ 2024-12-11 12:13:11 UTC
I'm unsure if it started with 8.5.0 but map (opened from left side tab) is very slow again to start. Map always starts zoomed out (earlier where it was left last time) and processing all items takes very long zime. Process will (usually/eventually) finish but digikam is doesn't react anything except abrupt closing from x button. After finishing all works fine.

KDE 6.7.0
Qt 6.7.3 (built against 6.7.3)
Comment 1 caulier.gilles 2024-12-12 03:01:28 UTC
Wich map type are used ? GoogleMaps, OSM, Marble ?
Comment 2 _ 2024-12-12 12:02:53 UTC
I'm using Marble Virtual Globe with OpenStreetMap. Weird thing is that after last freeze was gone through, digikam started to behave normal way, and automatically zoomed in to location of last use, without any delay/freeze since. There has been many system updates lately so maybe some of them has solved the problem. I will update if problem starts again.
Comment 3 _ 2024-12-17 08:55:53 UTC
Map was now zoomed out when opened for some unknown reason (instead of starting zoomed in to last location, while selection itself was retained). However digikam had no trouble to place the markers - so no actual trouble this time.
Comment 4 _ 2024-12-31 14:57:32 UTC
Not fixed. Map has worked well since last occurrence, but was now very slow again. Map is zoomed out on start, and took 5 minutes to get through the freeze - during that time digikam was completely unresponsive using 50% CPU.
Comment 5 _ 2025-03-18 15:11:59 UTC
Is there anything that can be done to this?

Selecting map tab from left causes digikam freeze for several minutes. During that time ui doesn't react to anything. Eventually process finishes, geolocation pins appear to map and area selections can be normally done, but launching takes too much time.
Comment 6 _ 2025-03-31 05:24:27 UTC
Bug still exists in 8.6.0. I'm unsure if the zoom out map causes this but it could be part of the problem.
Comment 7 _ 2025-04-03 13:56:43 UTC
Now on occasional startup when map was expectedly *ZOOMED IN everything worked in reasonable time* , so this zoom out issue is definitely part of the problem which should be fixed. 

Previously map was always zoomed to last location, recently it has started from globe view and possibly counting all itmes takes too long time that way. But as this behavior is now random, there could be something else wrong too.
Comment 8 caulier.gilles 2025-04-04 01:26:32 UTC
Hi,

The new AppImage bundle 8.7.0 pre-release for Linux based on Qt 6.8.3 is
online at usual place :

https://files.kde.org/digikam/

Let's me know if the problem remain.

Best regards

Gilles Caulier
Comment 9 _ 2025-04-13 13:35:11 UTC
I could test 8.7.0 but before I do that, is there a reason to expect it's fixed there as this problem started with earlier version.
Comment 10 caulier.gilles 2025-04-13 18:18:33 UTC
Because i rebuild all the bundles from scratch (Windows, Mac, AppImage) with all dependecies up-to-date, and especially Qt frameworks and KDE frameworks.

The bundle are a long process to build (many hours by item), with a complex puzzle to solve to achieve. It's know that some problems have be (mysteriously) solved like this (especially ones that we cannot reproduce...)

Best

Gilles Caulier
Comment 11 caulier.gilles 2025-04-13 18:20:31 UTC
Like bug 478503 for ex...
Comment 12 _ 2025-05-27 20:49:33 UTC
I did download the build now, but problem appeared on first launch trying to open the map. Last time with stable version apparently caused my computer overheat and crash so I chose to terminate the application this time and am reverting back to stable. Last 5+ times or so with stable started the map quite ok but the freezing problem now came back again. 

Coincidentally I'm also having some problems with hibernating my system (similarly takes minutes and freezes the system while doing so) - I think it occurs only when digikam is open but I haven't tested this. This has been going on for some time now, and it *could* be the same time this map issue started again but at this point this is just guessing.
Comment 13 _ 2025-06-13 12:44:56 UTC
Created attachment 182246 [details]
map freezing 1/2

This log contains all from the point of starting initiating the map after digikam has first finished launching. CPU is all the time around 60%. Scrolled out and moved around map to the point of freezing. No single marker has appeared to map after several minutes waiting. 1/2
Comment 14 _ 2025-06-13 12:48:27 UTC
Created attachment 182247 [details]
map ready after freezing 2/2

beginning of the log after map loading finishes and works normally. 2/2
Comment 15 _ 2025-06-22 07:09:07 UTC
Would switching from SQLite to MySQL-Internal help? I also don't have WAL enabled - db is on HDD. I have large database but I haven't noticed any other latency issues.
Comment 16 caulier.gilles 2025-06-22 07:15:03 UTC
Hi,

I think no. the database type do not must change anything to display the map.

It sound like a network latency to get the map data from the Internet.

Best

Gilles Caulier
Comment 17 _ 2025-06-23 09:40:07 UTC
Map should work without internet. I try disabling the internet while opening map for now on. First try opened it like it should to the place where it was last left without being scrolled out to 0 0, but it has worked correctly for short periods before. Will continue testing.
Comment 18 _ 2025-06-24 14:50:14 UTC
FYI Last time map was zoomed out and pointing to 0 0 but no delay was present as internet connection was disabled. So it seems that loading map via internet for some reason causes the problem. I will continue testing with this workaround.
Comment 19 _ 2025-06-29 14:40:00 UTC
no luck, digikam frost again while network was disabled.
Comment 20 caulier.gilles 2025-06-29 14:56:40 UTC
ok, it can be a GPU issue. Typically the map rendering use QtWebEngine to draw contents which can use OPenGL in the background.

Go to DK/Setup/Miscs/System and enable the OpenGL Software option. Restart digiKam and try again.

Gilles Caulier
Comment 21 _ 2025-06-29 18:26:48 UTC
I have this enabled now and will continue testing in normal use. First dk-restart was ok, but this could need whole system restart for the problem to be able to reappear.
Comment 22 _ 2025-07-07 14:28:06 UTC
This setting doesn't fix it. Worked well for over a week but is freezing again. It seemed to be scrolling ok from 0 0 to preferred location, but when I tried to draw rectangle without any items yet appearing on map it stopped. After terminating processes and restarting map is still freezing, so this process has to be waited to finish before being able to access the feature again.
Comment 23 caulier.gilles 2025-07-07 14:55:58 UTC
Ok another point to check.

Marble widget used to render the map uses a cache in your home directory:

~/.local/share/digikam/marble_data/maps/earth

Look if directory exists, if your home directory is not full, or if the right to create/use this directory is fine.

Create a backup of the ~/.local/share/digikam/marble_data and remove it. It will be created again at next digiKam session.

We will seen if the problem remain.

Best

Gilles Caulier
Comment 24 _ 2025-07-07 21:18:39 UTC
Freezing immediately at first try.

All fine directory wise: new files were being created and there's disk space. After deleting new directories were created as expected, but this didn't fix the problem.
Comment 25 _ 2025-07-07 21:35:08 UTC
Updated to 8.7.0 and repeated deleting marble_data directory. Now it worked correctly so at least that doesn't seem to automatically cause the issue. (Unless the upgrade somehow now fixed this, but possibly not?)
Comment 26 _ 2025-07-08 08:03:48 UTC
It's frozen again so nothing was accidentally fixed in upgrade.
Comment 27 _ 2025-07-10 09:16:14 UTC
Lately I had been able to use the map about a week without serious problems after initial freezing, but after I deleted the original directory the map (again) started to freeze on every occasion. I don't know how this is possibly related to the main issue?
Comment 28 caulier.gilles 2025-07-10 14:52:10 UTC
Ok, we will process differently.

Install Marble application (digiKam use a dedicated Qt6 port since 2 years now)
Try to reproduce the problem playing with map using the same context (map, zoom level, etc).

Also take a look to the Marble bugzilla, there are similar reports:

https://bugs.kde.org/show_bug.cgi?id=305195
https://bugs.kde.org/show_bug.cgi?id=162681
https://bugs.kde.org/show_bug.cgi?id=339115
https://bugs.kde.org/show_bug.cgi?id=286982
https://bugs.kde.org/show_bug.cgi?id=195515
https://bugs.kde.org/show_bug.cgi?id=311119

all files are closed and older. The last one is important as it highligh a possible problem to render cloud using possible data from the web. In digiKam you can disable the overlay to only show the map substance...

Best

Gilles Caulier
Comment 29 Maik Qualmann 2025-07-10 18:59:57 UTC
The problem won't be with Marble. I've looked at your log again; you've selected a coordinate range that includes over 180,000 images. Loading that many images into the Item Model and Marble Model simply takes time. There's nothing we can do about it quickly.

In the future, we'll have to switch to a model loading system that only loads the part that currently needs to be displayed in the view

Maik
Comment 30 _ 2025-07-10 19:48:35 UTC
As I said earlier map often starts with zoomed out to 0 0 coordinates. This has been the most consistent indication that freezing soon occurs when I start closing to preferred location. (Things have been more random lately after trying different settings and for some reason the freeze didn't always occur even when map was zoomed out to nowhere.) 

Expected behavior is and has been that map starts from last location where it was left. This has been consistent behavior for 10+ years. For some reason this has changed i think at the time this problem started. And if the problem is as you say in loading map tiles, the problem will be pretty much fixed if the earlier behavior at start is fixed back as a consistent feature.
Comment 31 _ 2025-07-11 07:29:44 UTC
Created attachment 183153 [details]
map view opened

This is the map view opened most if not every time freezing occurs. This is nothing I have chosen to be opened. After I tested two different settings (disabling network and OpenGL Software) for some reason this didn't always cause a freeze but I could use the map feature about a week without problems while startup location was random between last left and this zoomed out view.
Comment 32 _ 2025-09-27 05:27:54 UTC
Is there a fix for this to be expected in next release?

Possibly quickest fix would be to ensure that map starts every time from the location and zoom level it was left last time. Now it mostly prefers to open zoomed out to origo which started when the problems started. This can't be hard to fix?