Bug 494840

Summary: KSplash screen takes long time after 6.2.1
Product: [Plasma] ksplash Reporter: CUI Hao <cuihao.leo>
Component: generalAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: andrea.ippo, daron439, guido.iodice, kde, nate, parag.lkml, serdarthtux
Priority: HI Keywords: regression
Version: 6.2.1   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In: 6.2.1.1
Sentry Crash Report:

Description CUI Hao 2024-10-16 04:11:27 UTC
SUMMARY

The KSplash screen used to take a few seconds on my PC. Now after upgrading to 6.2.1, it takes much longer (~30s).

It seems the KSplash "ready" Stage signal was fired as usual but KSplash no longer reacts to it:

```
Oct 15 20:56:37 cvhc-tomato systemd[1763]: Starting Splash screen shown during boot...
Oct 15 20:56:40 cvhc-tomato systemd[1763]: Starting KSplash "ready" Stage...
Oct 15 20:56:40 cvhc-tomato systemd[1763]: Finished KSplash "ready" Stage.
Oct 15 20:57:07 cvhc-tomato systemd[1763]: Finished Splash screen shown during boot.
```

This was before the upgrade:

```
May 15 09:51:34 cvhc-tomato systemd[1391]: Starting Splash screen shown during boot...
May 15 09:51:39 cvhc-tomato systemd[1391]: Starting KSplash "ready" Stage...
May 15 09:51:39 cvhc-tomato systemd[1391]: Finished KSplash "ready" Stage.
May 15 09:51:39 cvhc-tomato systemd[1391]: Finished Splash screen shown during boot.
```

SOFTWARE/OS VERSIONS

Operating System: Arch Linux 
KDE Plasma Version: 6.2.1
KDE Frameworks Version: 6.7.0
Qt Version: 6.8.0
Kernel Version: 6.11.3-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 7700X 8-Core Processor
Memory: 58.3 GiB of RAM
Graphics Processor: AMD Radeon Graphics
Comment 1 CUI Hao 2024-10-16 04:35:33 UTC
Looks like this change between 6.2.0 and 6.2.1 caused the issue:

```
diff --git a/startkde/systemd/plasma-ksplash-ready.service.in b/startkde/systemd/plasma-ksplash-ready.service.in
index 3f6744f378..0bd88e6c92 100644
--- a/startkde/systemd/plasma-ksplash-ready.service.in
+++ b/startkde/systemd/plasma-ksplash-ready.service.in
@@ -6,5 +6,5 @@ PartOf=graphical-session.target
 
 [Service]
 Type=oneshot
-ExecStart=-@QtBinariesDir@/qdbus org.kde.KSplash /KSplash org.kde.KSplash.setStage ready
+ExecStart=dbus-send --session  --reply-timeout=1 --dest=org.kde.KSplash /KSplash org.kde.KSplash.setStage string:ready
 Slice=session.slice
```

I try to use the previous qdbus version and the long waiting time is gong:

```
$ cat /home/cuihao/.config/systemd/user/plasma-ksplash-ready.service.d/override.conf
[Service]
ExecStart=
ExecStart=/usr/bin/qdbus org.kde.KSplash /KSplash org.kde.KSplash.setStage ready
```
Comment 2 Bug Janitor Service 2024-10-16 12:54:05 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/4841
Comment 3 Bug Janitor Service 2024-10-16 12:54:06 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/4841
Comment 4 David Edmundson 2024-10-16 13:36:07 UTC
*** Bug 494852 has been marked as a duplicate of this bug. ***
Comment 5 David Edmundson 2024-10-16 13:40:37 UTC
*** Bug 494821 has been marked as a duplicate of this bug. ***
Comment 6 David Edmundson 2024-10-16 15:11:30 UTC
*** Bug 494872 has been marked as a duplicate of this bug. ***
Comment 7 Nate Graham 2024-10-16 15:28:17 UTC
Git commit 83aa79af1e624d8978593e0f8724e3b42d8365ac by Nate Graham, on behalf of Wolfgang Müller.
Committed on 16/10/2024 at 15:05.
Pushed by davidedmundson into branch 'master'.

startkde: Specify --type=method_call to correctly notify ksplash

In 3e295c33d0 (startkde: Avoid waiting when notifying ksplash is up,
2024-10-11) the invocation of the dbus interface was changed from qdbus
to dbus-send. The former defaults to calling a method, whilst the latter
defaults to sending a signal, causing the setStage method to never be
called.

Instead of using the default behaviour, specify explicitly that we want
to call a method using --type=method_call.

M  +1    -1    startkde/systemd/plasma-ksplash-ready.service.in

https://invent.kde.org/plasma/plasma-workspace/-/commit/83aa79af1e624d8978593e0f8724e3b42d8365ac
Comment 8 Bug Janitor Service 2024-10-16 15:32:55 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/4842
Comment 9 Nate Graham 2024-10-16 15:55:19 UTC
Git commit 271801a547a94f8979d6293dc653643aa70dafe7 by Nate Graham.
Committed on 16/10/2024 at 15:32.
Pushed by ngraham into branch 'Plasma/6.2'.

startkde: Specify --type=method_call to correctly notify ksplash

In 3e295c33d0 (startkde: Avoid waiting when notifying ksplash is up,
2024-10-11) the invocation of the dbus interface was changed from qdbus
to dbus-send. The former defaults to calling a method, whilst the latter
defaults to sending a signal, causing the setStage method to never be
called.

Instead of using the default behaviour, specify explicitly that we want
to call a method using --type=method_call.


(cherry picked from commit 83aa79af1e624d8978593e0f8724e3b42d8365ac)

Co-authored-by: Wolfgang Müller <wolf@oriole.systems>

M  +1    -1    startkde/systemd/plasma-ksplash-ready.service.in

https://invent.kde.org/plasma/plasma-workspace/-/commit/271801a547a94f8979d6293dc653643aa70dafe7
Comment 10 Bug Janitor Service 2024-10-16 16:04:39 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/4843
Comment 11 Fushan Wen 2024-10-17 00:20:08 UTC
Git commit bcc206be8288ba20265c03240e8fac8e5a62de13 by Fushan Wen.
Committed on 17/10/2024 at 00:00.
Pushed by fusionfuture into branch 'master'.

startkde: test setStage is called after starting plasma-ksplash-ready.service
Related: bug 482267

M  +1    -0    appiumtests/CMakeLists.txt
A  +14   -0    appiumtests/ksplash/CMakeLists.txt
A  +79   -0    appiumtests/ksplash/ksplashtest.py
M  +2    -0    lookandfeel/org.kde.breeze/contents/splash/Splash.qml

https://invent.kde.org/plasma/plasma-workspace/-/commit/bcc206be8288ba20265c03240e8fac8e5a62de13
Comment 12 Andrea Ippolito 2024-10-18 12:58:55 UTC
I'm so happy I found this, I just reinstalled my OS and all of a sudden logins were incredibly slow.

If you are reading this and don't want to wait for the fix, I guess you can just apply the change of this commit:

https://invent.kde.org/plasma/plasma-workspace/-/commit/83aa79af1e624d8978593e0f8724e3b42d8365ac

to the systemd unit file here (needs root permissions):

/usr/lib/systemd/user/plasma-ksplash-ready.service

I had tried applying the override.conf as suggested by CUI Hao in a previous comment, but somehow it was ineffective.
Comment 13 David Edmundson 2024-10-18 13:05:03 UTC
There was a 6.2.1.1 so hopefully you're not waiting too long