Bug 503966

Summary: Power management asserts in ddc_packet_io.c at line 266 after resume from suspend
Product: [Plasma] plasmashell Reporter: cptncosmo
Component: Power management & brightnessAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED DUPLICATE    
Severity: crash CC: cptncosmo, cycoone, nate
Priority: NOR    
Version First Reported In: 6.3.5   
Target Milestone: 1.0   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description cptncosmo 2025-05-09 16:03:41 UTC
SUMMARY
When I wake my PC from sleep the Power Management Icon is gone from the tray and in System Settings under Power Management I am being told that the Power Management Service is not running.

STEPS TO REPRODUCE
1. Start PC
2. Don't use PC until it goes to sleep
3. Wake PC from sleep
4. Look for the Power Icon in Tray

OBSERVED RESULT
The Icon is gone after waking from Sleep and the plasma-powerdevil service is no longer running (but was running/working before sleeping)

EXPECTED RESULT
The service should still be running and the icon still be shown.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Archlinux latest
KDE Plasma Version: 6.3.5 
KDE Frameworks Version: 6.13.0
Qt Version: 6.9.0

ADDITIONAL INFORMATION
Comment 1 cptncosmo 2025-05-09 16:04:45 UTC
Mai 09 09:00:12 microtech systemd[1060]: Starting Powerdevil...
Mai 09 09:00:12 microtech org_kde_powerdevil[1451]: Starting libddcutil. library built Not set at Not set. stdout_stderr_redirected=true
Mai 09 09:00:12 microtech org_kde_powerdevil[1451]: Initializing libddcutil.  ddcutil version: 2.2.0, shared library: /usr/lib/libddcutil.so.5.2.0
Mai 09 09:00:12 microtech org_kde_powerdevil[1451]: [  1451] Options passed from client:
Mai 09 09:00:12 microtech org_kde_powerdevil[1451]: [  1451] Applying combined libddcutil options:
Mai 09 09:00:13 microtech org_kde_powerdevil[1451]: [  1451] busno=6, sleep-multiplier= 2,00, Testing for unsupported feature 0xdd returned Error_Info[DDCRC_RETRIES in ddc_write_read_with_retry, causes: DDCRC_READ_ALL_ZERO(10)]
Mai 09 09:00:13 microtech org_kde_powerdevil[1451]: [  1451] Turning off dynamic sleep and retrying
Mai 09 09:00:14 microtech org_kde_powerdevil[1451]: [  1451] busno=6, sleep-multiplier = 1,00, Retesting for unsupported feature 0xdd returned Error_Info[DDCRC_RETRIES in ddc_write_read_with_retry, causes: DDCRC_READ_ALL_ZERO(10)]
Mai 09 09:00:17 microtech org_kde_powerdevil[1451]: [  1451] busno=6, sleep-multiplier= 2,00, Testing for unsupported feature 0x41 returned Error_Info[DDCRC_RETRIES in ddc_write_read_with_retry, causes: DDCRC_READ_ALL_ZERO(10)]
Mai 09 09:00:17 microtech org_kde_powerdevil[1451]: [  1451] Turning off dynamic sleep and retrying
Mai 09 09:00:18 microtech org_kde_powerdevil[1451]: [  1451] busno=6, sleep-multiplier = 1,00, Retesting for unsupported feature 0x41 returned Error_Info[DDCRC_RETRIES in ddc_write_read_with_retry, causes: DDCRC_READ_ALL_ZERO(10)]
Mai 09 09:00:18 microtech org_kde_powerdevil[1451]: Library initialization complete.
Mai 09 09:00:18 microtech org_kde_powerdevil[1451]: [  1451] Watching for display connection changes, resolved watch mode = Watch_Mode_Xevent, poll loop interval = 100 millisec
Mai 09 09:00:18 microtech org_kde_powerdevil[1451]: [  1451]                                          extra_stabilization_millisec: 0,  stabilization_poll_millisec: 100
Mai 09 09:00:18 microtech org_kde_powerdevil[1451]: [  1451] libddcutil recheck thread (nil) started
Mai 09 09:00:18 microtech org_kde_powerdevil[1451]: [  1451] libddcutil watch thread 0x5847bef78e70 started
Mai 09 09:00:18 microtech org_kde_powerdevil[1451]: [  1700] (dw_recheck_displays_func) Recheck interval: Slept for 200 millisec
Mai 09 09:00:18 microtech org_kde_powerdevil[1451]: org.kde.powerdevil: org.kde.powerdevil.chargethresholdhelper.getthreshold failed "Charge thresholds are not supported by the kernel for this hardware"
Mai 09 09:00:18 microtech org_kde_powerdevil[1451]: org.kde.powerdevil: org.kde.powerdevil.backlighthelper.brightness failed
Mai 09 09:00:18 microtech systemd[1060]: Started Powerdevil.
Mai 09 09:00:18 microtech org_kde_powerdevil[1451]: org.kde.powerdevil: Handle button events action could not check for screen configuration
Mai 09 09:00:18 microtech org_kde_powerdevil[1451]: org.kde.powerdevil: org.kde.powerdevil.chargethresholdhelper.getthreshold failed "Charge thresholds are not supported by the kernel for this hardware"
Mai 09 14:43:06 microtech org_kde_powerdevil[1451]: [  1701] Removing connected display on bus 5
Mai 09 14:43:06 microtech org_kde_powerdevil[1451]: [  1701] Emitting DDCA_Display_Status_Event[20574.459:  DDCA_EVENT_DISPLAY_DISCONNECTED, card1-HDMI-A-2, dref: DDCA_Display_Ref[1], io_path:/dev/i2c-5, ddc working: false]
Mai 09 14:43:06 microtech org_kde_powerdevil[1451]: [  1701] libddcutil callback thread 0x73f5a801e900 started
Mai 09 14:43:06 microtech org_kde_powerdevil[1451]: [  1701] Started 1 event callback thread(s)
Mai 09 14:43:07 microtech org_kde_powerdevil[1451]: [  1701] Adding connected display with bus 5
Mai 09 14:43:07 microtech org_kde_powerdevil[1451]: [  1702] (ddc_open_display) Delay before rechecking attribute status: Slept for 1000 millisec
Mai 09 14:43:07 microtech org_kde_powerdevil[1451]: [  1702] Assertion failed: "bus_info" in file ddc_packet_io.c at line 266
Mai 09 14:43:07 microtech org_kde_powerdevil[1451]: QSocketNotifier: Socket notifiers cannot be enabled or disabled from another thread
Mai 09 14:43:07 microtech org_kde_powerdevil[1451]: QtDBus: cannot relay signals from parent QObject(0x5847befe1ac0 "") unless they are emitted in the object's thread QThread(0x5847beefec00 "Qt mainThread"). Current thread is QThread(0x5847befbc8b8 "").
Mai 09 14:43:07 microtech org_kde_powerdevil[1451]: [  1702] Watch thread terminated.
Mai 09 14:43:07 microtech org_kde_powerdevil[1451]: QMutex: destroying locked mutex
Mai 09 14:43:07 microtech org_kde_powerdevil[1451]: QObject::killTimer: Timers cannot be stopped from another thread
Mai 09 14:43:07 microtech org_kde_powerdevil[1451]: QObject::~QObject: Timers cannot be stopped from another thread
Mai 09 14:43:07 microtech systemd[1060]: plasma-powerdevil.service: Consumed 5.458s CPU time, 12M memory peak.
Mai 09 17:47:21 microtech systemd[1060]: Starting Powerdevil...
Mai 09 17:47:21 microtech org_kde_powerdevil[45644]: Starting libddcutil. library built Not set at Not set. stdout_stderr_redirected=true
Mai 09 17:47:21 microtech org_kde_powerdevil[45644]: Initializing libddcutil.  ddcutil version: 2.2.0, shared library: /usr/lib/libddcutil.so.5.2.0
Mai 09 17:47:21 microtech org_kde_powerdevil[45644]: [ 45644] Options passed from client:
Mai 09 17:47:21 microtech org_kde_powerdevil[45644]: [ 45644] Applying combined libddcutil options:
Mai 09 17:47:22 microtech org_kde_powerdevil[45644]: [ 45644] busno=6, sleep-multiplier= 2,00, Testing for unsupported feature 0xdd returned Error_Info[DDCRC_RETRIES in ddc_write_read_with_retry, causes: DDCRC_READ_ALL_ZERO(10)]
Mai 09 17:47:22 microtech org_kde_powerdevil[45644]: [ 45644] Turning off dynamic sleep and retrying
Mai 09 17:47:23 microtech org_kde_powerdevil[45644]: [ 45644] busno=6, sleep-multiplier = 1,00, Retesting for unsupported feature 0xdd returned Error_Info[DDCRC_RETRIES in ddc_write_read_with_retry, causes: DDCRC_READ_ALL_ZERO(10)]
Mai 09 17:47:26 microtech org_kde_powerdevil[45644]: [ 45644] busno=6, sleep-multiplier= 2,00, Testing for unsupported feature 0x41 returned Error_Info[DDCRC_RETRIES in ddc_write_read_with_retry, causes: DDCRC_READ_ALL_ZERO(10)]
Mai 09 17:47:26 microtech org_kde_powerdevil[45644]: [ 45644] Turning off dynamic sleep and retrying
Mai 09 17:47:27 microtech org_kde_powerdevil[45644]: [ 45644] busno=6, sleep-multiplier = 1,00, Retesting for unsupported feature 0x41 returned Error_Info[DDCRC_RETRIES in ddc_write_read_with_retry, causes: DDCRC_READ_ALL_ZERO(10)]
Mai 09 17:47:27 microtech org_kde_powerdevil[45644]: Library initialization complete.
Mai 09 17:47:27 microtech org_kde_powerdevil[45644]: [ 45644] Watching for display connection changes, resolved watch mode = Watch_Mode_Xevent, poll loop interval = 100 millisec
Mai 09 17:47:27 microtech org_kde_powerdevil[45644]: [ 45644]                                          extra_stabilization_millisec: 0,  stabilization_poll_millisec: 100
Mai 09 17:47:27 microtech org_kde_powerdevil[45644]: [ 45644] libddcutil recheck thread (nil) started
Mai 09 17:47:27 microtech org_kde_powerdevil[45644]: [ 45644] libddcutil watch thread 0x56966867e7d0 started
Mai 09 17:47:27 microtech org_kde_powerdevil[45644]: [ 45666] (dw_recheck_displays_func) Recheck interval: Slept for 200 millisec
Mai 09 17:47:27 microtech org_kde_powerdevil[45644]: org.kde.powerdevil: org.kde.powerdevil.chargethresholdhelper.getthreshold failed "Charge thresholds are not supported by the kernel for this hardware"
Mai 09 17:47:27 microtech org_kde_powerdevil[45644]: org.kde.powerdevil: org.kde.powerdevil.backlighthelper.brightness failed
Mai 09 17:47:27 microtech systemd[1060]: Started Powerdevil.
Mai 09 17:47:27 microtech org_kde_powerdevil[45644]: org.kde.powerdevil: Handle button events action could not check for screen configuration
Mai 09 17:47:27 microtech org_kde_powerdevil[45644]: org.kde.powerdevil: org.kde.powerdevil.chargethresholdhelper.getthreshold failed "Charge thresholds are not supported by the kernel for this hardware"
Comment 2 Nate Graham 2025-05-09 17:19:57 UTC
Is `org_kde_powerdevil` running anymore?
Comment 3 cptncosmo 2025-05-09 18:34:38 UTC
(In reply to Nate Graham from comment #2)
> Is `org_kde_powerdevil` running anymore?

I checked with systemctl status plasma-powerdevil.service and it was no longer running after waking from sleep
Comment 4 cptncosmo 2025-05-09 18:35:46 UTC
Forgot to say, i can get the tray icon and functionality back with systemctl --user restart plasma-powerdevil.service (or revooting of course)
Comment 5 Nate Graham 2025-05-09 19:07:30 UTC
Right after this happens, what does `systemctl status plasma-powerdevil.service` say?
Comment 6 cptncosmo 2025-05-09 19:55:41 UTC
[cosmo@microtech ~]$ systemctl --user status plasma-powerdevil.service
○ plasma-powerdevil.service - Powerdevil
     Loaded: loaded (/usr/lib/systemd/user/plasma-powerdevil.service; static)
     Active: inactive (dead) since Fri 2025-05-09 21:54:47 CEST; 13s ago
   Duration: 12min 58.246s
 Invocation: 514d4e8e367644019ac02b816446e691
    Process: 1448 ExecStart=/usr/lib/org_kde_powerdevil (code=killed, signal=TERM)
   Main PID: 1448 (code=killed, signal=TERM)
   Mem peak: 12.7M
        CPU: 2.718s

Mai 09 21:54:47 microtech org_kde_powerdevil[1448]: [  3893] Adding connected display with bus 5
Mai 09 21:54:47 microtech org_kde_powerdevil[1448]: [  3894] (ddc_open_display) Delay before rechecking attribute status: Slept for 1000 millisec
Mai 09 21:54:47 microtech org_kde_powerdevil[1448]: [  3894] Assertion failed: "bus_info" in file ddc_packet_io.c at line 266
Mai 09 21:54:47 microtech org_kde_powerdevil[1448]: QSocketNotifier: Socket notifiers cannot be enabled or disabled from another thread
Mai 09 21:54:47 microtech org_kde_powerdevil[1448]: QtDBus: cannot relay signals from parent QObject(0x5c203bddd490 "") unless they are emitted in the object's thread QThread(0x5c203bd06c00 "Qt mainThread"). Current thread is QThread(0x5c203bdd40e8 "").
Mai 09 21:54:47 microtech org_kde_powerdevil[1448]: [  3894] Watch thread terminated.
Mai 09 21:54:47 microtech org_kde_powerdevil[1448]: QMutex: destroying locked mutex
Mai 09 21:54:47 microtech org_kde_powerdevil[1448]: QObject::killTimer: Timers cannot be stopped from another thread
Mai 09 21:54:47 microtech org_kde_powerdevil[1448]: QObject::~QObject: Timers cannot be stopped from another thread
Mai 09 21:54:47 microtech systemd[1065]: plasma-powerdevil.service: Consumed 2.718s CPU time, 12.7M memory peak.
Comment 7 Nate Graham 2025-05-13 16:05:30 UTC
Aha, this is the key bit:

> Assertion failed: "bus_info" in file ddc_packet_io.c at line 266

So it's asserting in DDC. What version of the ddcutil package do you have installed? Is it 2.2.1 or later? If not, perhaps try upgrading to that version if possible and see if that fixes it.
Comment 8 cptncosmo 2025-05-13 16:40:42 UTC
I am on 2.2.0-1, 2.2.1 is not currently available for my Distro
Comment 9 Nate Graham 2025-05-13 16:42:29 UTC
Ok, let us know when you upgrade to that. It's supposed to help.
Comment 10 cptncosmo 2025-05-13 16:43:42 UTC
(In reply to Nate Graham from comment #9)
> Ok, let us know when you upgrade to that. It's supposed to help.

That will probably happen once 2.2.1 is actually released
Comment 11 Stephen Baker 2025-05-22 01:56:40 UTC
My system is probably so similar as to not be interesting, but I see the same thing on Arch Linux:

log in reverse order:
```
May 19 14:09:59 drink org_kde_powerdevil[1477]: libddcutil terminating.
May 19 14:09:59 drink kclockd[1680]: PowerDevil left DBus
May 19 14:09:59 drink org_kde_powerdevil[1477]: QMutex: destroying locked mutex
May 19 14:09:59 drink org_kde_powerdevil[1477]: [  9286] Watch thread terminated.
May 19 14:09:59 drink org_kde_powerdevil[1477]: QtDBus: cannot relay signals from parent QObject(0x5ea3c0fb1840 "") unless they are emitted in the obj>
May 19 14:09:59 drink org_kde_powerdevil[1477]: QSocketNotifier: Socket notifiers cannot be enabled or disabled from another thread
May 19 14:09:59 drink org_kde_powerdevil[1477]: [  9286] Assertion failed: "bus_info" in file ddc_packet_io.c at line 266
May 19 14:09:59 drink org_kde_powerdevil[1477]: [  9286] (ddc_open_display) Delay before rechecking attribute status: Slept for 1000 millisec
May 19 14:09:59 drink flatpak[10648]: [56:0519/140959.493000:ERROR:gl_display.cc(497)] EGL Driver message (Error) eglGetMscRateANGLE: glXGetMscRateOML>
May 19 14:09:59 drink kwin_wayland_wrapper[1290]: XWAYLAND: mode -1x-1 is not available
```
Comment 12 Nate Graham 2025-05-27 17:56:19 UTC

*** This bug has been marked as a duplicate of bug 500843 ***