Baldomo / asusctltray

Simple tray profile switcher for asusctl
MIT License
34 stars 5 forks source link

Suddenly stopped working after update #20

Closed openwick closed 11 months ago

openwick commented 1 year ago

Hi I just did a full system update and after that the software is unable to launch.

Initially when I tried to launch from command line it said there is no module dbus. Then I installed dbus using sudo pacman -S python-dbus. But now it is giving me some other error. I am pasting it here.

Also I think there is issue with conda as well as regular python too you can see from the log cause when I tried to use asusctltray when conda is activated it gave me error when package gi is not installed.

I reinstalled from AUR and even tried from git repo and got the same issues. Any idea how to fix this cause this worked flawlessly even if there is no icon

(base) [wick@sanganaka ~]$ asusctltray 
Traceback (most recent call last):
  File "/usr/local/bin/asusctltray", line 31, in <module>
    import gi
ModuleNotFoundError: No module named 'gi'
(base) [wick@sanganaka ~]$ asusctltray
Traceback (most recent call last):
  File "/usr/local/bin/asusctltray", line 31, in <module>
    import gi
ModuleNotFoundError: No module named 'gi'
(base) [wick@sanganaka ~]$ conda deactivate
[wick@sanganaka ~]$ asusctltray
Traceback (most recent call last):
  File "/usr/local/bin/asusctltray", line 695, in <module>
    TrayIcon(loop)
  File "/usr/local/bin/asusctltray", line 655, in __init__
    self.build_menu()
  File "/usr/local/bin/asusctltray", line 671, in build_menu
    FanCurveController().attach(self.menu)
  File "/usr/local/bin/asusctltray", line 329, in attach
    for item in self.items:
                ^^^^^^^^^^
  File "/usr/local/bin/asusctltray", line 469, in items
    return [FAN_CURVES[i] for i in self.proxy.Profiles()]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/bin/asusctltray", line 469, in <listcomp>
    return [FAN_CURVES[i] for i in self.proxy.Profiles()]
            ~~~~~~~~~~^^^
  File "/usr/local/bin/asusctltray", line 124, in __getitem__
    return self.right[key]
           ~~~~~~~~~~^^^^^
  File "/usr/local/bin/asusctltray", line 80, in __getitem__
    return self._dict[key]
           ~~~~~~~~~~^^^^^
KeyError: dbus.String('Performance')
Baldomo commented 1 year ago

Thank you for the bug report! It seems like asusctl changed their DBus API for the 100th time, sadly I don't have much free time this week (I'm on vacation with slow internet) but I should be able to investigate in a couple days time. Would you kindly send the output of asusctl -v?

openwick commented 1 year ago

Here is the output for asusctl -v

(base) [wick@sanganaka ~]$ asusctl -v
asusctl v4.7.0-RC3

asusctl version: 4.7.0-RC3
 Product family: ROG Zephyrus G14
     Board name: GA402RK
Optional arguments:
  -h, --help             print help message
  -v, --version          show program version number
  -s, --show-supported   show supported functions of this laptop
  -k, --kbd-bright       <off, low, med, high>
  -n, --next-kbd-bright  Toggle to next keyboard brightness
  -p, --prev-kbd-bright  Toggle to previous keyboard brightness
  -c, --chg-limit        Set your battery charge limit <20-100>

  led-mode   Set the keyboard lighting from built-in modes
  led-pow-2  Set the LED power states
  profile    Set or select platform_profile
  fan-curve  Set, select, or modify fan curves if supported
  graphics   Set the graphics mode (obsoleted by supergfxctl)
  anime      Manage AniMe Matrix
  bios       Change bios settings

Extra help can be requested on any command or subcommand:
 asusctl led-mode --help
 asusctl led-mode static --help

PS : I turned off boosting before the application is working and I dont know whether boosting is on or not. Are they any commands so I can manually turn on or off the boosting of CPUs?

openwick commented 1 year ago

Also I think any python based application which is using this gi module is broken. I am suing an application called cpupowercontrol-gui and it is also broken.

Here is the log for it

(base) [wick@sanganaka ~]$ cpupower-gui 
Traceback (most recent call last):
  File "/usr/bin/cpupower-gui", line 361, in <module>
    import gi
  File "/home/wick/anaconda3/lib/python3.9/site-packages/gi/__init__.py", line 40, in <module>
    from . import _gi
ImportError: /usr/lib/libgirepository-1.0.so.1: undefined symbol: g_string_free_and_steal
(base) [wick@sanganaka ~]$ conda deactivate
[wick@sanganaka ~]$ cpupower-gui 
Traceback (most recent call last):
  File "/usr/bin/cpupower-gui", line 361, in <module>
    import gi
  File "/home/wick/anaconda3/lib/python3.9/site-packages/gi/__init__.py", line 40, in <module>
    from . import _gi
ImportError: /usr/lib/libgirepository-1.0.so.1: undefined symbol: g_string_free_and_steal
[wick@sanganaka ~]$ 

Perhaps the issue is some update which broke module gi ??

cpucontrol-gui have the similar issue raised but I think it is related to dbus vagnum08/cpupower-gui/issues/107

Baldomo commented 1 year ago

The gi module is just Python bindings for GObject and other GTK libraries. I doubt it is totally broken otherwise way more apps would crash on your system, maybe cpupower-gui has other issues.

Are they any commands so I can manually turn on or off the boosting of CPUs?

See asusctltray lines 181-192. Replace {path} with the path above and run the commands for off and on.

flukejones commented 1 year ago

See also https://gitlab.com/asus-linux/asusctl/-/blob/main/CHANGELOG.md?ref_type=heads#breaking

michlinux commented 1 year ago

PS : I turned off boosting before the application is working and I dont know whether boosting is on or not. Are they any commands so I can manually turn on or off the boosting of CPUs?

boost is controlled via sysfs depends on your brand of cpu... (note the boolean is reversed from each other) AMD:(1 = boost is on, 0 = boost is off): /sys/devices/system/cpu/cpufreq/boost Intel(0 = boost is on, 1 = boost is off): /sys/devices/system/cpu/intel_pstate/no_turbo

to find out if your boost is on or not: AMD: cat /sys/devices/system/cpu/cpufreq/boost Intel: cat /sys/devices/system/cpu/intel_pstate/no_turbo

to turn on boost: AMD: echo 1 | sudo tee -a /sys/devices/system/cpu/cpufreq/boost Intel: echo 0 | sudo tee -a /sys/devices/system/cpu/intel_pstate/no_turbo

to turn off boost: AMD: echo 0 | sudo tee -a /sys/devices/system/cpu/cpufreq/boost Intel: echo 1 | sudo tee -a /sys/devices/system/cpu/intel_pstate/no_turbo

michlinux commented 1 year ago

ive fixed the errors at least for my laptop. I dont have much experience with GTK/DBUS in python... so use at your own risk.

https://github.com/michlinux/asusctltray https://github.com/michlinux/asusctltray/commit/8de20e0caac5f8d4e2616dfb99c0a2700fa1753c

Baldomo commented 1 year ago

Sorry for the lack of a response, I've been swamped with work in the last month so I couldn't publish a release.

ive fixed the errors at least for my laptop. I dont have much experience with GTK/DBUS in python... so use at your own risk.

https://github.com/michlinux/asusctltray https://github.com/michlinux/asusctltray/commit/8de20e0caac5f8d4e2616dfb99c0a2700fa1753c

Thanks, the fix I implemented locally is something quite similar. Be careful when using the labels of the widget as data because they are just what's shown on the UI, they never guarantee consistency on the data below. Other than that, thank you for reminding me of fixing this!

Baldomo commented 11 months ago

This has been fixed! I'm deeply sorry to have taken so long and I have no excuses. Thank you all for using my projects and contributing to them.