Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make custom profiles system? #12

Closed
konkor opened this issue Feb 22, 2017 · 86 comments
Closed

Make custom profiles system? #12

konkor opened this issue Feb 22, 2017 · 86 comments

Comments

@konkor
Copy link
Owner

konkor commented Feb 22, 2017

Ability to create/save new profiles and apply them.

@konkor konkor changed the title Make custom profiles system. Make custom profiles system? Feb 23, 2017
@konkor
Copy link
Owner Author

konkor commented Apr 23, 2017

I can't see any rational reason to do this yet...

@konkor konkor closed this as completed Apr 23, 2017
@RicardoEPRodrigues
Copy link
Contributor

May I ask why not yet?

@konkor
Copy link
Owner Author

konkor commented Apr 24, 2017

@RicardoEPRodrigues we have talked about it at #14. And nobody replayed to this issue.
So what do you wanted from profiles exactly?
PS: I have a few ideas for now with #19 maybe i'll do some profiles there and a daemon for it. So i have been testing a lot the extension without other extensions and what i'm missing is CPU temperature and i'm thinking about optional support for coretemp module.

@konkor
Copy link
Owner Author

konkor commented Apr 24, 2017

@RicardoEPRodrigues I want make this extension lighter as possible so.

@RicardoEPRodrigues
Copy link
Contributor

Personally I would create 3 profiles and maybe it can go as an example.

  • Performance Mode: Performance Governor, Turbo Boost On, 100% Minimum Freq and All cores
  • Balanced Mode: Powersaver Governor, Turbo Boost Off, 0% Minimum Freq, 50% Maximum Freq and All cores
  • Powersaver Mode: Powersaver Governor, Turbo Boost Off, 0% Minimum Freq, 10% Maximum Freq and 1 cores

It would be easier to switch from one to another with profiles, but for now I have to make all the changes manually.

I agree that the extension must be light.

@konkor
Copy link
Owner Author

konkor commented Apr 24, 2017

Nice. I'll reopen this issue)
I'd not recommend to use 1 core even for Powersave Mode modern OSs and kernel works better on 2 cores to avoid overheating and CPU thermal throttle.

@konkor konkor reopened this Apr 24, 2017
@konkor
Copy link
Owner Author

konkor commented May 3, 2017

New branch profiles. It's not complete yet. Very 1st screenshot:
screenshot from 2017-05-03 21 12 03
PS: I have an idea to move New ... to Preferences->New Profile ... What do you think?

@konkor
Copy link
Owner Author

konkor commented May 4, 2017

OK we have this now:
screenshot from 2017-05-04 11 31 56

@RicardoEPRodrigues
Copy link
Contributor

I can't add new profiles 😢 I write the name of the new profile then I hit enter nothing happens, try to click check mark and it turns back to New....

I think that for now the New... should be at the bottom of the profile list.

  • Default
  • Profile 1
  • Profile 2
  • Profile 3
  • New...

@konkor
Copy link
Owner Author

konkor commented May 4, 2017

@RicardoEPRodrigues There is no keyboard handler yet. Press OK icon to add a profile. It's collecting settings and add menu entry but u can't save now. I want be sure in the format before savings... I'll write when it's completely ready for testings.
gtk-ok

@RicardoEPRodrigues
Copy link
Contributor

So for now I can't save profiles right? Just to be sure 😄 The OK icon is the check mark correct?

When I press the check mark, OK icon, it does not add a profile. It returns to New.... Is it the correct behavior?

@konkor
Copy link
Owner Author

konkor commented May 4, 2017

@RicardoEPRodrigues ty again) U are n1!!! It's look like in new gtk versions this events masked.

@konkor
Copy link
Owner Author

konkor commented May 5, 2017

@RicardoEPRodrigues It was a bug. Yesterday I reported this bug. And today It is closed. TY for improving Gnome :)
So this bug is affected 4 Gnome versions for 1.5 years. And It will be fixed in Gnome shell 3.24.2 + only.
Well I'm going to add keyboard handlers (Enter, Esc) It'd aid to resolve this issue for affected shells versions. Other way It's to add own button to replace 1 broken. Heh I don't like extra code...

@konkor
Copy link
Owner Author

konkor commented May 12, 2017

OMG The Profiles makes about +50% of the master code. If someone test it I would be glad to see some comments profiles.zip

@RicardoEPRodrigues
Copy link
Contributor

It works like a charm.

Yet I'm having trouble understanding when the profile is saved. Could you explain it a little bit?

How to create a profile 101.

@konkor
Copy link
Owner Author

konkor commented May 15, 2017

@RicardoEPRodrigues when you select 'New...' and enter some name (My very own Profile :)) press Return or OK button... that it. To switch profile you have to select profile. If you want remember profile for next boot u should switch ON Preferences->'Remember Settings' (if it's off) and select profile name. To rename profile select (properties). to delete press last icon.

@konkor
Copy link
Owner Author

konkor commented May 15, 2017

@RicardoEPRodrigues So It's saving profile at same time u created some profile. Even if 'Remember Settings' option is OFF.

@konkor
Copy link
Owner Author

konkor commented May 15, 2017

There is keyboard hotkeys in edit mode too. 'Esc' - cancel edit and 'Enter/Return' to save changes.

@RicardoEPRodrigues
Copy link
Contributor

Is it possible that the UI allows saving changes to a profile? Maybe a button next to edit or something like that. Maybe another button may make the UI too crowded, but it would help the users make all changes with a mouse only.

@konkor
Copy link
Owner Author

konkor commented May 15, 2017

No. I think It's too much for me. I like minimalism so and don't like to add extra code. So profile creating is not an everyday task. There is no difficulty to create some new profile even with same name and delete old. Just make once your settings and give it a name. I want to add more important functionality to extension so i want to keep it light like possible.


PS: So it's no difficulty to make it. Maybe we leave it for now only. There is one problem: remember all changes in edit mode or only on the saving (enter or OK). It's like 2 extra strings... @RicardoEPRodrigues LoL But there is other problem when it's going to edit mode should it load profile before editing? Bcs now it's allow you just renaming and doesn't require loading the editing profile. Ehh, one question creates 2 other...

@konkor
Copy link
Owner Author

konkor commented May 15, 2017

@RicardoEPRodrigues Don't blame me if my commends sound hard. I just want to discuss and make good for the project. I really appreciate all your comments and opinions!

@RicardoEPRodrigues
Copy link
Contributor

@konkor I do like to have these conversations. What I'm thinking is that the Edit mode is almost optional.

I was thinking that if you can easily create a new profile, why not just remove the edit mode. Less confusion on when does it save.

Just an idea. 😄

@konkor
Copy link
Owner Author

konkor commented May 15, 2017

@RicardoEPRodrigues maybe you are right. Actually It's not edit mode just renaming mode. I can hide edit button for now... wasted time heh

@konkor
Copy link
Owner Author

konkor commented May 16, 2017

@RicardoEPRodrigues Eh, here is full editing support now. You can set parameters before and while editing. Press OK or Enter to apply changes. Press outside text entry or Esc to cancel editing. Now is it OK? xD


So just to rename profile you have to load profile before editing!!!

@RicardoEPRodrigues
Copy link
Contributor

I'll get to that this weekend 😄

@konkor
Copy link
Owner Author

konkor commented May 20, 2017

https://i.imgur.com/v0i6EcV.png

@terencode
Copy link
Collaborator

@konkor daaaaamn looks soooo good!

@konkor
Copy link
Owner Author

konkor commented May 21, 2017

@terencode ty very much. It's very 1st step yet. I'm working on the Info Panel. So I'm going to publish this brunch and make issue to talk about the info in this widget. For now I'm want to show CPU model, Linux/kernel version, system loading, temperature, thermal throttle, governors per CPU if they are Mixed, and WARN MESSAGE PLACE to say 'Your System OK', 'Hey, something wrong (to loaded, to hot, have throttling, low memory....)

@terencode
Copy link
Collaborator

@konkor so much things to do, good luck!

@RicardoEPRodrigues
Copy link
Contributor

@konkor I've tested the extension of Fedora 22 Live Boot and the problem persists when I switch from a Performance profile to a Powersaver one (switching the number of active cores).

Additionally the problem with the Network bugging out also exists in Fedora. I think it might be related to specific WiFi drivers...

@konkor
Copy link
Owner Author

konkor commented May 22, 2017

@RicardoEPRodrigues I made a some crazy full delayed (like JavaScript can) profile loading with 2 seconds (2000 msec) delay for each stage. So this version will load a profile about 10 secs. Run in the terminal sudo journalctl -f to see what's going on...

_delayed_load: function () {
        let delay = 1000;
        if (core_event != 0) {
            Mainloop.source_remove (core_event);
            core_event = 0;
        }
        this._load_stage (this.prf);
        this.stage++;
        switch (this.stage) {
            case 1: // reset min/max frequencies
                delay = 2000;
                break;
            case 2: // setting governors
                delay = 2000;
                break;
            case 3: // setting boost
                delay = 2000;
                break;
            case 4: // setting min frequency
                delay = 2000;
                break;
            case 5: // setting max frequency
                delay = 2000;
                break;
            default:
                return;
        }
        print ("load delay", delay);
        core_event = Mainloop.timeout_add (delay, Lang.bind (this, this._delayed_load));
    },

You have to play with this timeouts. You have to increase all this from timeouts 2000 ms to 5000-10000 until ur profiles isn't loaded. Then decrease 1 by 1 to 1000/500/100/50 ms delays to find optimal ranges and find weak places.

So I am pretty sure ur problem in the 'intel_pstate' driver. So test it without intel_pstate once at least...
I'm waiting for ur replay...

@RicardoEPRodrigues
Copy link
Contributor

Ok this bug was tricky, but I found the solution.

It has nothing to do with the delays. It's weird, but what happens is if a CPU has the performance governor (even if it is disabled) it forces the Turbo Boost ON, because of that even if I have cores on powersave they are always on 100%... it must be intel_pstate doing...

I'm making a pull request that basically sets all cores to the selected governor in intel_pstate.

@konkor
Copy link
Owner Author

konkor commented May 22, 2017

But you still can do it manually... So there is a question... If you are going to ur Performance profile (switch Remember setting OFF to be sure) and after that:

  1. Turn off 4 cores;
  2. Set governor to powersave;
  3. Set turbo off;
  4. Set minimum frequency to 0%;
  5. Set maximum frequency to 0%...
    Is the issue exist or all OK?

@konkor
Copy link
Owner Author

konkor commented May 22, 2017

@RicardoEPRodrigues now we have sequence:

  1. Cores count;
  2. Reset min/max (it must have for acpi mode)
  3. Governors per core
  4. Turbo
  5. Min freq
  6. Max freq

So if you want change all governors 1st you have to add
0. Turn on all cores;
for the switching from less cores to less (2 to 4, 4 to 6....)

You could play with _load_stage function too...

@RicardoEPRodrigues
Copy link
Contributor

I made a pull request #32. Could you see if it is a good solution? All the profiles define all the cores even if they are disabled.

@konkor
Copy link
Owner Author

konkor commented May 22, 2017

OMG Is it working for you?

@konkor
Copy link
Owner Author

konkor commented May 22, 2017

So #12 (comment) dont work?

@konkor
Copy link
Owner Author

konkor commented May 22, 2017

So i'm waiting for answer #12 (comment) too...

@RicardoEPRodrigues
Copy link
Contributor

When I do those steps I get the same bug. For some reason if I have any core on Performance, they all behave has if they are on performance... It's truly weird...

@RicardoEPRodrigues
Copy link
Contributor

RicardoEPRodrigues commented May 22, 2017

My pull request fixes the issue for intel_pstate.

@konkor
Copy link
Owner Author

konkor commented May 22, 2017

Finally, I get an answer. So can you reduce delays from 2000 ms to 50 ms and tell me how it works? If you think it only sequence issue.
So what gonna happen if you switching from (2 cores performance 6 offline) to ur 4 cores powersave? So it couldn't work on older (stable) kernels without cpufreq profiles links...

@RicardoEPRodrigues
Copy link
Contributor

Damn... We do have to turn on all cores before making changes...

So what gonna happen if you switching from (2 cores performance 6 offline) to ur 4 cores powersave?

Because not all cores are active, setting the governor for all fails.
I'll update the pull request! 😄

Reducing the delays worked well.

@konkor
Copy link
Owner Author

konkor commented May 22, 2017

Cool. So is it working in all your cases now?

@RicardoEPRodrigues
Copy link
Contributor

Yes 😄

@konkor
Copy link
Owner Author

konkor commented May 22, 2017

Wow finally... we can go on, after my finally test and so. I'll merge profiles to master... Congrats

@RicardoEPRodrigues
Copy link
Contributor

RicardoEPRodrigues commented May 22, 2017

When testing could you check on mixed profiles. That is something that I didn't test a lot.

@konkor
Copy link
Owner Author

konkor commented May 23, 2017

OK I think it's time to close this issue. Profiles branch merged to master and gnome...

Latest version has a changes in the profiles! There is a new property type of driver (acpi:boolean).
Please remove or update your testing profiles!!! Don't forget to load/activate them first!

I'll do checking for the types later because profiles in pstate can't work properly in acpi and so... I'm going merge profiles/master to info branch for next development.

Thank you all!

@konkor
Copy link
Owner Author

konkor commented May 23, 2017

PS: Someone maintained the extension on Arch Linux https://aur.archlinux.org/packages/gnome-shell-extension-cpufreq-git/

@konkor konkor closed this as completed May 23, 2017
@konkor
Copy link
Owner Author

konkor commented May 24, 2017

Gnome moderator is in shock of changes.

@RicardoEPRodrigues
Copy link
Contributor

Good shock or bad shock?

@konkor
Copy link
Owner Author

konkor commented May 24, 2017

How is know? Maybe because we are going to oversize Gnome-shell... Or just a lot changes like +50%...
But anyway he activated it.

@konkor
Copy link
Owner Author

konkor commented May 24, 2017

@RicardoEPRodrigues he asked Just don't do big code-reorderings while including new features.

@RicardoEPRodrigues
Copy link
Contributor

Then my pull request should be 2 separate things: Code reordering, Profiles on Top. Separate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants