You are not logged in.

#1 2009-02-09 23:29:57

lodolfo
Member
Registered: 2008-10-12
Posts: 7

Problems with kpowersave [SOLVED]

Hi!

I'm having some weird problems with kpowersave. I'm using kpowersave-devel and a kdemod installation of kde3. Yesterday the lights in my house went out, and I decided I should suspend my laptop while I worked on the problem. So I selected the option of Suspend to Ram on the kpowersave tray icon, but I thought it hadn't worked, so I used the Fn key. Nothing happened, so I started closing windows and I saw a notification that said it wasn't able to suspend because it couldn't unmount some drive (I guess it was talking about the cdrom that was in, because there were no other external drives plugged in), and asked me if I wanted to suspend anyway. I answered Yes and it went on suspending. After I fixed the issue with the house's electricity, I came back to the laptop and opened the lid. It tried to resume, but since I hadn't configured the "resume=/dev/sda5" option in grub, it couldn't resume. The system just kept on spinning the cdrom drive, but that's all. I pressed the power button until the machine was off, and I booted it up again.

It booted without a problem, and I wasn't watching the screen messages because I didn't think anything weird would happen, so when I looked back everything was normal, the kdm screen was on and I logged in. Now the screen brightness was at the lowest level, so I tried turning it up by rolling the mouse wheel on the kpowersave icon, and it didn't work. Then I right-clicked on the icon to get the menu and the Suspend to Disk and Suspend to RAM options and the Set CPU Frequency Policy menu were all grayed out. I left-click on the icon to get the information dialog and it says Current CPU Frequency Policy > Unknown (all other information is as it should).

I fixed the resume option in grub, and tested Suspend to Ram and Suspend to Disk with pm-utils. I've tried deleting the kpowersave config files in the /opt/kde/share/config and .kde/share/config directories. I've tried uninstalling and reinstalling kpowersave. I've readded myself to the power group. I don't know how else to reset the options or what other config files I can check to restore those options.

Does anybody have any idea about this? Are there any config files that I'm missing or anything?

Last edited by lodolfo (2009-02-11 09:18:09)

Offline

#2 2009-02-10 05:33:11

Zibi1981
Member
From: Poland
Registered: 2008-01-31
Posts: 628

Re: Problems with kpowersave [SOLVED]

Check if you have cpufreq added in the DAEMONS section of your /etc/rc.conf, and if it's running after a fresh start. Here's what I get

zbyszek ~ $  lsmod | grep cpu
cpufreq_powersave       3840  0
cpufreq_ondemand       10512  1
acpi_cpufreq           10896  1
freq_table              6272  2 cpufreq_ondemand,acpi_cpufreq
processor              46648  4 thermal,acpi_cpufreq

"... being a Linux user is sort of like living in a house inhabited by a large family of carpenters and architects. Every morning when you wake up, the house is a little different. Maybe there is a new turret, or some walls have moved. Or perhaps someone has temporarily removed the floor under your bed."

MSI Raider GE78HX 13VI-032PL

Offline

#3 2009-02-10 07:16:06

lodolfo
Member
Registered: 2008-10-12
Posts: 7

Re: Problems with kpowersave [SOLVED]

Thanks for replying. Here's  my modules and daemons sections in rc.conf:

MODULES=(b44 mii bcm43xx snd-mixer-oss snd-pcm-oss snd-hwdep snd-page-alloc snd-pcm snd-timer snd snd-hda-intel soundcore !pcspkr !snd_pcsp powernow-k8 cpufreq_ondemand cpufreq_powersave fuse)
DAEMONS=(syslog-ng network netfs crond hal cpufreq @openntpd)

And here's the output from lsmod:

lodo[~]$ lsmod | grep cpu
cpufreq_powersave       3456  0
cpufreq_ondemand        8972  1
freq_table              5632  2 cpufreq_ondemand,powernow_k8

The only difference is I have an AMD Turion chip, and that's why I use the powernow-k8 module.

Offline

#4 2009-02-10 21:42:06

Zibi1981
Member
From: Poland
Registered: 2008-01-31
Posts: 628

Re: Problems with kpowersave [SOLVED]

Strange...it seems KPowersave also stopped working correctly for me. I don't have active buttons for processor scaling, although all the daemons and modules are up and running. Maybe a recent upgrade broke something?


"... being a Linux user is sort of like living in a house inhabited by a large family of carpenters and architects. Every morning when you wake up, the house is a little different. Maybe there is a new turret, or some walls have moved. Or perhaps someone has temporarily removed the floor under your bed."

MSI Raider GE78HX 13VI-032PL

Offline

#5 2009-02-11 00:21:43

Zibi1981
Member
From: Poland
Registered: 2008-01-31
Posts: 628

Re: Problems with kpowersave [SOLVED]

It seems I have located the problem smile I was googling for an answer to this issue and finally I run into this bug report on Red Hat bugzilla. Someone reported that after installing acpid KPowersave started to require root privileges to control CPU governor and other options too. I checked it and it appeared that it's the same story in my case. Then I tried different steps to find a solution, one of which was to run KPowersave from console as a normal user to see what's being printed out. Among others while playing with brightness setting I found these entries

kpowersave: ButtonPressed event from HAL: brightness-down
kpowersave: WARNING: Could not set brightness to lower level, it's already set t                                                                             o min.
kpowersave: ButtonPressed event from HAL: brightness-down
kpowersave: WARNING: Could not set brightness to lower level, it's already set t                                                                             o min.
kpowersave: ButtonPressed event from HAL: brightness-down
kpowersave: WARNING: Could not set brightness to lower level, it's already set t                                                                             o min.
kpowersave: ButtonPressed event from HAL: brightness-up
kpowersave: ERROR: Could not send dbus message: org.freedesktop.hal.power-management.lcd-panel no <-- (action, result)

The part market on red seemed familiar to me. I realized that after recen HAL update I was having problems with mounting my pendrive as a normal user. Someothernick advised me to add some entries to /etc/PolicyKit/PolicyKit.conf. It worked. Maybe we need something similar here but I'm not sure what roll

P.S. Anyone know why recent HAL update has issues with runnign certain applications without root priviliges?

Last edited by Zibi1981 (2009-02-11 00:25:27)


"... being a Linux user is sort of like living in a house inhabited by a large family of carpenters and architects. Every morning when you wake up, the house is a little different. Maybe there is a new turret, or some walls have moved. Or perhaps someone has temporarily removed the floor under your bed."

MSI Raider GE78HX 13VI-032PL

Offline

#6 2009-02-11 00:38:03

Zibi1981
Member
From: Poland
Registered: 2008-01-31
Posts: 628

Re: Problems with kpowersave [SOLVED]

O.K. Now I figured out how to make KPowersave to be able to manage CPU scaling and LCD brightness. You just need to edit aforementioned /etc/PolicyKit/PolicyKit.conf file and add to it these two entries

<match action="org.freedesktop.hal.power-management.lcd-panel">
  <match user="USERNAME">
    <return result="yes"/>
  </match>
</match>

<match action="org.freedesktop.hal.power-management.cpufreq">
  <match user="USERNAME">
    <return result="yes"/>
  </match>
</match>

Replace string USERNAME with your login. Then save changes and restart both HAL and KPowersave. Now it should be able to control both of these options, although Suspend and Hibernate buttons are still greyed out...

Last edited by Zibi1981 (2009-02-11 05:24:18)


"... being a Linux user is sort of like living in a house inhabited by a large family of carpenters and architects. Every morning when you wake up, the house is a little different. Maybe there is a new turret, or some walls have moved. Or perhaps someone has temporarily removed the floor under your bed."

MSI Raider GE78HX 13VI-032PL

Offline

#7 2009-02-11 09:17:40

lodolfo
Member
Registered: 2008-10-12
Posts: 7

Re: Problems with kpowersave [SOLVED]

Thank you!

As it turns out, the command polkit-action shows all the possible actions that you can use in /etc/PolicyKit/PolicyKit.conf . I just had to modify your examples to add options for Suspend (Suspend-to-RAM) and Hibernate (Suspend-to-Disk).

This is what the config part looks like right now. Any comments? Brightness works now, and none of the options in the menu are grayed anymore.

<config version="0.1">

<match action="org.freedesktop.hal.power-management.lcd-panel">
      <match user="username">
          <return result="yes"/>
      </match>
</match>

<match action="org.freedesktop.hal.power-management.cpufreq">
      <match user="username">
          <return result="yes"/>
        </match>
</match>

<match action="org.freedesktop.hal.power-management.suspend">
    <match user="username">
        <return result="yes"/>
    </match>
</match>


<match action="org.freedesktop.hal.power-management.hibernate">
    <match user="username">
        <return result="yes"/>
    </match>
</match>

</config>

Apparently all we need is a combination of polkit-action and the PolicyKit.conf(5) manpage. Also, as I read the PolicyKit.conf(5) manpage, I just found that we could just add a:

<match user="user1|user2">
     <return result="yes"/>
</match>

and be done with it unless we need a more fine-grained policy. Which in my case isn't necessary. I would just like it better if instead of specifying users one by one, we could specify members of a group. For example something like:

<match group="power">
     <return result="yes"/>
</match>

might be easier to administer in some situations. But that doesn't seem to be possible right now. Oh, well, at least I got it working for now. Thanks Zibi for all your help!

Offline

#8 2009-02-11 18:18:48

Zibi1981
Member
From: Poland
Registered: 2008-01-31
Posts: 628

Re: Problems with kpowersave [SOLVED]

I'm glad I could help smile
The last entry you've mentioned about giving certain rights to groups instead of individual users seems more convenient to me. At the moment my /etc/PolicyKit/PolicyKit.conf has 6 entries

<match action="org.freedesktop.hal.storage.mount-removable">
  <match user="zbyszek">
    <return result="yes"/>
  </match>
</match>

<match action="org.freedesktop.hal.storage.mount-fixed">
  <match user="zbyszek">
    <return result="yes"/>
  </match>
</match>

<match action="org.freedesktop.hal.power-management.lcd-panel">
  <match user="zbyszek">
    <return result="yes"/>
  </match>
</match>

<match action="org.freedesktop.hal.power-management.cpufreq">
  <match user="zbyszek">
    <return result="yes"/>
  </match>
</match>

<match action="org.freedesktop.hal.power-management.suspend">
  <match user="zbyszek">
    <return result="yes"/>
  </match>
</match>

<match action="org.freedesktop.hal.power-management.hibernate">
  <match user="zbyszek">
    <return result="yes"/>
  </match>
</match>

And these are my policies

zbyszek ~ $  polkit-auth --user zbyszek
org.freedesktop.hal.storage.mount-fixed
org.freedesktop.hal.storage.mount-removable
org.freedesktop.hal.power-management.suspend
org.freedesktop.hal.power-management.hibernate
org.freedesktop.hal.power-management.cpufreq
org.freedesktop.hal.power-management.lcd-panel

I found that people are having many more permissions, although I don't think I need entries like org.freedesktop.hal.power-management.reboot, because I'm still able to reboot via K-menu without special permissions as a normal user. Maybe these are useful if one likes to do it using some kind of 3rd party applications.
Anyway it's great my advises were useful smile

Last edited by Zibi1981 (2009-02-11 18:19:24)


"... being a Linux user is sort of like living in a house inhabited by a large family of carpenters and architects. Every morning when you wake up, the house is a little different. Maybe there is a new turret, or some walls have moved. Or perhaps someone has temporarily removed the floor under your bed."

MSI Raider GE78HX 13VI-032PL

Offline

#9 2009-04-12 17:46:09

MorningWood
Member
Registered: 2008-06-06
Posts: 78

Re: Problems with kpowersave [SOLVED]

I'm just posting in this thread to say thank you to both Zibi and lodolfo for helping me fix an indentical problem.

Offline

Board footer

Powered by FluxBB