xsmile/ryzen-ppd

Fails with "invalid monitor value: stapm_limit"

Closed this issue · 12 comments

When I try to run the tool, the output I get is:
[CRITICAL] invalid monitor value: stapm_limit

According to RyzenAdj my stapm_limit is 35000.
The processor is Ryzen 3500U.

Thanks for the help :)

Hi @DoggoOfSpeed, you need to set up the [ryzenadj] and [profiles] sections in the /etc/ryzen-ppd.ini configuration file first by uncommenting each setting and editing it to your liking. At the very least limits and two profiles referenced in the [ac] and [battery] sections (balanced and low-power by default) need to be present.

A STAPM limit of 35 W is higher than those pre-set in the default config file. If this is your default setting, then you should probably run RryzenAdj on Windows and check the power and temperature limits of the various power modes. Otherwise your notebook will be slower than necessary :-)

Thank you, that seemed to do it.
I still get some errors: dbus_next.errors.InterfaceNotFoundError: interface not found on this object: org.freedesktop.DBus.Properties,
but I think it works now :)

DBus is used to receive notifications about power source changes (AC/battery), you should look into that.

Try running the following command. This is how the result looks like here:

% dbus-send --system --type=method_call --print-reply --dest=org.freedesktop.UPower /org/freedesktop/UPower/devices/line_power_AC org.freedesktop.DBus.Introspectable.Introspect
...
<!-- GDBus 2.70.3 -->
<node>
  <interface name="org.freedesktop.DBus.Properties">                <------
    <method name="Get">
      <arg type="s" name="interface_name" direction="in"/>
      <arg type="s" name="property_name" direction="in"/>
      <arg type="v" name="value" direction="out"/>
    </method>
    <method name="GetAll">
      <arg type="s" name="interface_name" direction="in"/>
      <arg type="a{sv}" name="properties" direction="out"/>
    </method>
    <method name="Set">
      <arg type="s" name="interface_name" direction="in"/>
      <arg type="s" name="property_name" direction="in"/>
      <arg type="v" name="value" direction="in"/>
    </method>
    <signal name="PropertiesChanged">
      <arg type="s" name="interface_name"/>
      <arg type="a{sv}" name="changed_properties"/>
      <arg type="as" name="invalidated_properties"/>
    </signal>
  </interface>
...

Hmm... Well the output of that was blank for me. I'll try to look into it and get it fixed. Thanks for the help.

Hm, do you have the upower package installed? I'm not sure what else can cause this.

If you want to debug this, you can also use a GUI to explore the various DBus objects, for example d-feet:
d-feet

Well from what I've noticed is that even though the output of the dbus-send was empty, ryzen-ppd works as intended. Ryzenadj -i shows the expected numbers both on battery and AC, so I guess everything's fine...

For me ryzen-ppd it also fails with

Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/dbus_next/proxy_object.py", line 217, in get_interface
    intr_interface = next(i for i in self.introspection.interfaces if i.name == name)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
StopIteration

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/ryzen-ppd", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/lib/python3.12/site-packages/ryzen_ppd/main.py", line 294, in main
    bus = dbus_subscribe(daemon.ac_callback, daemon.sleep_callback)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/ryzen_ppd/main.py", line 202, in dbus_subscribe
    properties = obj.get_interface('org.freedesktop.DBus.Properties')
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/dbus_next/glib/proxy_object.py", line 283, in get_interface
    return super().get_interface(name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/dbus_next/proxy_object.py", line 219, in get_interface
    raise InterfaceNotFoundError(f'interface not found on this object: {name}')
dbus_next.errors.InterfaceNotFoundError: interface not found on this object: org.freedesktop.DBus.Properties

Both, weather upowerd is running or not, does not play a role.

dbus-send --system --type=method_call --print-reply --dest=org.freedesktop.UPower /org/freedesktop/UPower/devices/line_power_AC org.freedesktop.DBus.Introspectable.Introspect returns for me

method return time=1714996546.417043 sender=:1.396 -> destination=:1.415 serial=25 reply_serial=2
   string "<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
                      "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<!-- GDBus 2.80.0 -->
<node>
</node>
"

I have no idea how D-BUS works, so I cannot debug it further on my own.

@dreirund I was able to reproduce the error and I suspect that it is caused by a missing/differently named object path on the UPower interface.

Running dbus-send --system --type=method_call --print-reply --dest=org.freedesktop.UPower /org/freedesktop/UPower/devices org.freedesktop.DBus.Introspectable.Introspect on a good system (HP laptop) produces:

<node>
  <node name="battery_BAT0"/>
  <node name="DisplayDevice"/>
  <node name="line_power_AC"/>
</node>

... while running it on a bad system (VM) produces:

<node>
  <node name="DisplayDevice"/>
</node>

I use the line_power_AC object to determine the current power source. What device are you using? What is your use case?

That's definitely a good idea.

I will also add upower as a dependency in the next release.

@dreirund Please try again. In the current version the suffix of the line power device(s) does not matter, as long as it contains the string line_power.

@dreirund Please try again.

Works. Thanks!