Bug 434486 - Powerdevil bug killing my bluetooth?
Summary: Powerdevil bug killing my bluetooth?
Status: RESOLVED UNMAINTAINED
Alias: None
Product: Powerdevil
Classification: Plasma
Component: general (show other bugs)
Version: 5.20.5
Platform: Other Linux
: NOR major
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-16 11:06 UTC by Erik Quaeghebeur
Modified: 2024-07-01 13:22 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Erik Quaeghebeur 2021-03-16 11:06:39 UTC
SUMMARY
I have the problem that sometimes my bluetooth is killed. Namely, my mouse and headset stop working and I need to stop and start the bluetoothd service to get them back. (Sometimes, it is only the mouse and it recovers after a few seconds by itself.)

In the logs, the activity around this is always preceded by

   org_kde_powerdevil[…]: QObject::disconnect: Unexpected nullptr parameter
   org_kde_powerdevil[…]: QObject::disconnect: Unexpected nullptr parameter

(However, this appears more often than that bluetooth falls away.)

It is followed by

   acpid[500]: input device has been disconnected, fd 23
   dbus-daemon[504]: [system] Rejected send message, 0 matched rules; type="method_return", sender=":1.77" (uid=1000 pid=1711 comm="/usr/bin/pulseaudio  --start --log-target=syslog ") interface="(unset)" member="(unset)" error name="(unset)" requested_reply="0" destination=":1.174" (uid=0 pid=40907 comm="/usr/libexec/bluetooth/bluetoothd ")

My takeaway is that there is some bug in Powerdevil (related to ‘Unexpected nullptr parameter’). It may be that this bug triggers my bluetooth issues. I'd like to investigate that idea

STEPS TO REPRODUCE
Unknown, but happens every few hours.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Gentoo with kernel 5.10.23
(available in About System)
KDE Plasma Version: 5.20.5
KDE Frameworks Version: 5.77.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
Hardware: Lenovo Thinkpad T14 AMD with Ryzen 4750U and Intel Corp. AX200 Bluetooth
Comment 1 Nate Graham 2023-09-01 16:30:16 UTC
Is this still happening in Plasma 5.27 with a newer kernel?
Comment 2 hector acosta 2024-02-02 14:57:41 UTC
(In reply to Nate Graham from comment #1)
> Is this still happening in Plasma 5.27 with a newer kernel?

I can confirm this is still happening in plasma 5.27.9 and kernel 6.5.13
Comment 3 Jakob Petsovits 2024-02-03 00:18:06 UTC
I won't say with certainty that the QObject::disconnect logs by org_kde_powerdevil are entirely unrelated to your issue. But what I will say is that PowerDevil does not handle Bluetooth at all. Bluetooth configuration and monitoring is handled by a separate component called BlueDevil, and system logs for that process would not be labeled as org_kde_powerdevil.
Comment 4 Jakob Petsovits 2024-02-03 00:32:46 UTC
Actually, sorry, there is one spot in 5.27 (and below) that deals with Bluetooth, which is the "Wireless Power Saving" action. It does not use QObject::disconnect calls, but it does send messages over D-Bus to ask for Bluetooth to be enabled or disabled when the current power state profile changes (between AC power, Battery or Low battery profiles). Could you check your system settings and see if perhaps one of those profiles has a Bluetooth drop-down set to "Turn off"?
Comment 5 Jakob Petsovits 2024-07-01 13:22:14 UTC
Ivan Tkachenko recently found and fixed an issue that resulted in two "QObject::disconnect: Unexpected nullptr parameter" log lines, see the merge request at https://invent.kde.org/plasma/powerdevil/-/merge_requests/371. Other than the undesirable logs, there was no bug.

There's a good chance that your logs were merely the consequence of your bluetooth device's batteries disappearing, at which point the older powerdevil service would print such log lines.

Given that we now have a good explanation for these logs, and (as mentioned earlier) PowerDevil in Plasma 6.0 or above does not interface with Bluetooth devices other than tracking their battery state, and any bug-fixing work will only go towards the 6.x series, I think we should close this bug. If there is still an issue and reason to believe that Plasma/PowerDevil/BlueDevil is indeed the culprit, please report a new bug with description and logs updated to newer versions.