Xbmc: Matrix stripped power menu - Reboot / Shutdown no longer available

Created on 28 Oct 2020  路  10Comments  路  Source: xbmc/xbmc


Bug report

Describe the bug

Power menu options "Reboot/Shutdown" are no longer available despite a properly configured polkit with a current master build running on Debian 10 X11 Windowing system

Menu is like expected when building and using PR #18629 from two days ago on the same machine.

Expected Behavior

we need reboot / power off etc. back :)

Actual Behavior

only "Exit" and "Enter master mode" are shown on the power menu

Possible Fix

most likely introduced by #18534

To Reproduce

Steps to reproduce the behavior:

  1. Build and run current master branch on Debian 10 with properly configured polkit
  2. The power menu shows on "Exit" and "Enter master mode"

Debuglog

https://paste.kodi.tv/nexerijile.kodi

Your Environment

Used Operating system:

  • [X] Linux
  • Operating system version/name: Debian 10 Buster
  • Kodi version: current master X11 windowing system
Confirmed v19 Matrix

Most helpful comment

@lrusak can confirm the better fix working after rebasing https://github.com/howie-f/xbmc/commit/30c0cd625131dcb3b3c01e2fe9c13a5926c287ea

All 10 comments

I confirm that installing pre-#18534 build fixes the issue. Also "Selected logind/UPower as PowerSyscall" log entry appears on working build and does not appear on faulty ones.

I can confirm this too, not running debian, but a home grown self compiled toy OS, I'm positive it's not OS specific bug,
power stuff was working fine before multiwindowing was merged.
x11, gl (mesa, amdgpu)
I added some poor man's debug logging to try and narrow it down,
CLinuxPowerSyscall::Register() from https://github.com/xbmc/xbmc/blob/master/xbmc/platform/linux/powermanagement/LinuxPowerSyscall.cpp#L62 gets called
CLinuxPowerSyscall::CreateInstance() from here https://github.com/xbmc/xbmc/blob/master/xbmc/platform/linux/powermanagement/LinuxPowerSyscall.cpp#L22 does not.

grep -i powersys kodi.log
2020-10-29 02:09:05.824 T:10318    INFO <general>: CLinuxPowerSyscall::Register() - called

The problem is that now CServiceManager::InitStageTwo() which initializes the powermanager get called before windowing system initialization which registers CLinuxPowerSyscall::Register() , before the PR windowing was initialized just before InitStageTwo().
I was hoping I would be able to provide a quick patch, but looking at servicemanager code made me realize that this is lightyears above my paygrade :(

Hacky approach - moves powermanager initialization to InitStageThree() https://gist.githubusercontent.com/asavah/ecb200090a78df85d88b5c647655baf1/raw/c655c0958f234a4bc7fda1a5fd1c8a9f27ca1232/927-powermanager-initsgtagethree.patch
I don't think this is any good so I'm not creating a PR. If any dev thinks this is actually a proper fix - let me know will make proper PR.

@lrusak your patch is identical to mine ) It does work, runtime tested.

@lrusak can confirm the better fix working after rebasing https://github.com/howie-f/xbmc/commit/30c0cd625131dcb3b3c01e2fe9c13a5926c287ea

LGTM

last one looks and works fine

Was this page helpful?
0 / 5 - 0 ratings