Script /etc/acpi/ati-powermode.sh don't work correctly. It should switch power mode, but it do nothing. There are known problems with default power state and using finger command. Reproducible: Always Steps to Reproduce: 1. emerge ati-drivers 2. unplug ac-adapter 3. nothing happened Expected Results: Should switch ATI card to power save mode.
Created attachment 134664 [details, diff] this solve both problems
Ok, I think I understood now what happened here. There is/was already a patch for this in portage. (See ati-drivers/files/ati-powermode.sh.patch.) This got replaced because aticonfig moved from /opt/ati/bin/ to /opt/bin. (New name for the patch is ati-powermode-opt-path.sh.patch.) With that move the rest of the patch got lost. Here is a replacement, that should fix this issue. That "who"->"finger" should be done via sed, I guess.
Created attachment 136854 [details, diff] replacement(!) for ati-powermode-opt-path.patch in portage This replaces ati-powermode-opt-path.patch and should fix again.
Created attachment 136856 [details, diff] Replace 'finger' with 'who'. This adds a sed statement to the ebuild that replaces finger with who in ati-powermode.sh. In addition with the above patch this should fix this bug.
8.433 is in the tree
The patch "ati-powermode-opt-path.patch" from Bernd Steinhauser still doesn't work correctly. There is wrong detection of default power state. Steps to reproduce: 1. unplug AC-adapter - it works and card is now in low power state 2. plug AC-adapter - nothing happens and card is still in low power mode just run "aticonfig --lsp" in some X terminal to check this Command "aticonfig --lsp" must be run by the user who is logged in X. If you run it as another user, you will get output like: with current ati-powermode.sh from ati-driwers 8.433 the command is executed like here (you can try it from vt1): root ~ # aticonfig --lsp Error: Unable to open display `'. so I correct this by adding environment variable DISPLAY, but still getting error: root ~ # DISPLAY=:0 aticonfig --lsp Xlib: connection to ":0.0" refused by server Xlib: Invalid MIT-MAGIC-COOKIE-1 key Error: Unable to open display `:0'. In my first patch it works, because I run this command in environment where both user and DISPLAY are correct.
(In reply to comment #6) > In my first patch it works, because I run this command in environment where > both user and DISPLAY are correct. > For me this does work, if I run it as root as well as a normal user. But I see what you mean.
Created attachment 137532 [details, diff] Fix ati-powermode-opt-path-1.patch So maybe something like this is what you are suggesting? Removing the --effective=now as well, that will just print an error, that it is ignored.
(In reply to comment #8) > So maybe something like this is what you are suggesting? > Yes, this works. Thank you.
Created attachment 137712 [details, diff] fixed patch Previous patch didn't apply for some reason. This one should.
Fixed in >=8.443.1