It is currently October 27th, 2021, 11:37 pm

[Solved] Meters and measure hidden/disabled still consuming CPU

Help with creating, editing & fixing problems with skins
User avatar
Duschmoll
Posts: 26
Joined: May 5th, 2021, 6:08 pm

[Solved] Meters and measure hidden/disabled still consuming CPU

Post by Duschmoll »

Hello,

In my skin I've added the possibilitie to hide parts of the skin.

I'm using the following command for it:

Code: Select all

    [ToggleAudio]
    Measure=Calc
    IfCondition=#ToggleAudio# = 0
    IfTrueAction=[!HideMeterGroup "Audio"][!SetOptionGroup Audio UpdateDivider "-1"][!SetOptionGroup Audio Disabled "0"]
    UpdateDivider=-1
I have this setup for all parts of my skin.
But when all of the skins parts are hidden/disable/updatedivider=-1 rainmeter is still using some of my CPU. Compare to when I unload the skin where it's at zero of CPu usage.

I'm wondering if there is something I'm messing or if it's the way of rainmeter functionning.
Still new to rainmeter, so I'm trying to optimize the skin.
Last edited by Duschmoll on September 14th, 2021, 10:50 am, edited 2 times in total.
User avatar
David8192
Posts: 50
Joined: July 8th, 2021, 11:30 pm
Location: The King's Avenue, Golden Kingdom

Re: Meters and measure hiding/disabled still consuming CPU

Post by David8192 »

What's the value of Update in the Rainmeter section?
Do you have DynamicVariables=1 on the skin.
The full code could shed more light on your situation.
For some Reason, the square root of X2 does not involve X

the DA GALLERY 8-)
User avatar
Duschmoll
Posts: 26
Joined: May 5th, 2021, 6:08 pm

Re: Meters and measure hiding/disabled still consuming CPU

Post by Duschmoll »

David8192 wrote: September 12th, 2021, 6:41 pm What's the value of Update in the Rainmeter section?
The value of the update is at 1000.
David8192 wrote: September 12th, 2021, 6:41 pm Do you have DynamicVariables=1 on the skin.
Yes I do have some DynamicVariables at 1. I've just tried to add [!SetOptionGroup Audio DynamicVariables "0"] to the skin, still using CPU
David8192 wrote: September 12th, 2021, 6:41 pm The full code could shed more light on your situation.
The Skin is 1220 lines, so quite larges for posting it here, I've put a part of the skin in question that I try to hide
In all MeterStyle= there is an updatedivider=-1 and no DynamicVariables

Code: Select all

;===========================================+
;                   Audio                   |
;-------------------------------------------+

    ;===========================================+
    ;                   Calcs                   |
    ;-------------------------------------------+

        [ValKAudio]
        Measure=Calc
        Formula=0
        UpdateDivider=-1
        Group=Audio

        [ValInAudio]
        Measure=Calc
        Formula=(#VolumeValue#/1.05)
        AverageSize=8
        DynamicVariables=1
        Group=Audio | AudioUpdate

        [CalcINAudio]
        Measure=Calc
        Formula=ValKAudio > [ValInAudio] ? 0 : ValInAudio
        AverageSize=8
        DynamicVariables=1
        Group=Audio | AudioUpdate

        [CalcIN2Audio]
        Measure=Calc
        Formula=CalcINAudio/100
        AverageSize=8
        DynamicVariables=1
        Group=Audio | AudioUpdate

    ;===========================================+
    ;                   Scripts                 |
    ;-------------------------------------------+

        [ScriptAudio]
        Measure=Script
        ScriptFile=#@#Scripts\Smurfier-Volume.lua
        Group=Audio | AudioUpdate

    ;===========================================+
    ;                 Measures                  |
    ;-------------------------------------------+

        [MeasureAudio]
        Measure=Plugin
        Plugin=Win7AudioPlugin
        IfBelowValue=0
        IfAboveValue=-1
        Group=Audio | AudioUpdate

    ;===========================================+
    ;                 Background                |
    ;-------------------------------------------+

        [ContainerAudio]
        Meter=Shape
        MeterStyle=ContainerStyle

        Y=(#Scale#*#ContainerHeight#+#Spacer#)*#PositionAudio#

        Group=Audio

        [BackgroundAudio]
        Meter=Image
        MeterStyle=BackgroundStyle

        Container=ContainerAudio
        Group=Audio

        [BackgroundButtonAudio]
        Meter=Image
        
        W=(#Scale#*#ContainerWidth#)
        H=(#Scale#*#ContainerHeight#)-(#CurrentIconSize#/2)
        Y=((#Scale#*#CurrentIconSize#)-(#Scale#*#CurrentIconSize#*0.50))+(#Scale#*#ContainerHeight#+#Spacer#)*#PositionAudio#

        SolidColor=150,150,150,0

        LeftMouseUpAction=[!CommandMeasure MeasureAudio ToggleMute][!UpdateMeasureGroup AudioUpdate][!UpdateMeterGroup AudioUpdate][!UpdateMeasureGroup AudioUpdate][!UpdateMeterGroup AudioUpdate][!ReDraw]
        MouseScrollUpAction=[!CommandMeasure "MeasureAudio" "ChangeVolume +#VolumeIncrement#"][!UpdateMeasureGroup AudioUpdate][!UpdateMeterGroup AudioUpdate][!UpdateMeasureGroup AudioUpdate][!UpdateMeterGroup AudioUpdate][!ReDraw]
        MouseScrollDownAction=[!CommandMeasure "MeasureAudio" "ChangeVolume -#VolumeIncrement#"][!UpdateMeasureGroup AudioUpdate][!UpdateMeterGroup AudioUpdate][!UpdateMeasureGroup AudioUpdate][!UpdateMeterGroup AudioUpdate][!ReDraw]

        UpdateDivider=-1      
        Group=Audio

    ;===========================================+
    ;             Lower Part Data               |
    ;-------------------------------------------+

        [HistoLineAudio]
        Meter=Histogram
        MeterStyle=GraphLineStyle
        MeasureName=CalcIN2Audio

        PrimaryColor=#ColorGraph#

        UpdateDivider=1
        Container=ContainerAudio
        Group=Audio | AudioUpdate

        [VolumeGraphLine]
        Meter=Line
        MeterStyle=GraphLineStyle
        MeasureName=CalcIN2Audio

        LineWidth=(#Scale# >= 1 ? (#Scale#*2) : 2)

        UpdateDivider=1
        Container=ContainerAudio
        Group=Audio | AudioUpdate
        
        [SeparatorAudio]
        Meter=Image
        MeterStyle=SeparatorStyle

        Container=ContainerAudio
        Group=Audio

        [PercentAudio]
        Meter=STRING
        MeterStyle=PercentStyle
        Text=
        
        FontSize=(#PercentageSizeAudio#)

        UpdateDivider=1
        Container=ContainerAudio
        Group=Audio | AudioUpdate

    ;===========================================+
    ;              Upper Part Data              |
    ;-------------------------------------------+

        [IconAudio]
        Meter=Image
        MeterStyle=IconStyle
        ImageName=#@#Images\Volume_01.png

        Container=ContainerAudio
        Group=Audio

        [IconButtonAudio]
        Meter=Image
        MeterStyle=IconStyle

        Y=(#Scale#*#ContainerHeight#+#Spacer#)*#PositionAudio#
        
        SolidColor=0,0,0,0

        LeftMouseUpAction=[!CommandMeasure MeasureAudio ToggleNext][!UpdateMeasureGroup Audio][!UpdateMeterGroup Audio][!ReDraw][!UpdateMeasureGroup Audio][!UpdateMeterGroup Audio][!ReDraw]
            
        Group=Audio

        [TitleAudio]
        Meter=STRING
        MeterStyle=TitleStyle
        Text=Source :

        Container=ContainerAudio
        Group=Audio | AudioUpdate

        [TitleContentAudio]
        Meter=STRING
        MeterStyle=TitleContentStyle
        MeasureName=MeasureAudio
        Text=%1

        Container=ContainerAudio
        Group=Audio | AudioUpdate

        [DividerAudio]
        Meter=Image
        MeterStyle=DividerStyle

        Container=ContainerAudio
        Group=Audio

User avatar
CodeCode
Posts: 708
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Meters and measure hiding/disabled still consuming CPU

Post by CodeCode »

DynamicVariables= needs to be set as 1, not zero "0" is the off state. If that was intentional, you might consider that enabling or disabling meters or measures.

Rainmeter will always use some CPU processing, generally the small variance you mentioned is hardly negligible.

Please check you are using the proper modifier between '0' and '1'1. 0 being the off state for almost everything in rainmeter, 1 is on.
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
Duschmoll
Posts: 26
Joined: May 5th, 2021, 6:08 pm

Re: Meters and measure hiding/disabled still consuming CPU

Post by Duschmoll »

CodeCode wrote: September 12th, 2021, 7:05 pm DynamicVariables= needs to be set as 1, not zero "0" is the off state. If that was intentional, you might consider that enabling or disabling meters or measures.

Rainmeter will always use some CPU processing, generally the small variance you mentioned is hardly negligible.

Please check you are using the proper modifier between '0' and '1'1. 0 being the off state for almost everything in rainmeter, 1 is on.
Yes that exactly the point, I want to disable some parts of the skin, that why dynamic variables is set to 0 in the bang.
User avatar
David8192
Posts: 50
Joined: July 8th, 2021, 11:30 pm
Location: The King's Avenue, Golden Kingdom

Re: Meters and measure hiding/disabled still consuming CPU

Post by David8192 »

Your measures and most meters are quite active, so CPU usage is in that case is expected behavior. If, and only if, it does not affect the functionality of your skin, you can use

Code: Select all

DefaultUpdateDivider=-1
in the Rainmeter section.
  This is effective if the skin is mouse driven  
For some Reason, the square root of X2 does not involve X

the DA GALLERY 8-)
User avatar
Duschmoll
Posts: 26
Joined: May 5th, 2021, 6:08 pm

Re: Meters and measure hiding/disabled still consuming CPU

Post by Duschmoll »

David8192 wrote: September 12th, 2021, 7:53 pm Your measures and most meters are quite active, so CPU usage is in that case is expected behavior. If, and only if, it does not affect the functionality of your skin, you can use

Code: Select all

DefaultUpdateDivider=-1
in the Rainmeter section.
  This is effective if the skin is mouse driven  
That's good to know, it's not what I want sadly, cheers for the help.
I've uploaded the skin. (dumb to not have notice sooner the attachements tab)
right click on it to access the config variables and switch the ToggleMeters of all to 0. (be sure to use the test.ini variant)
When all of then are off, it's "supposed" to be at "0%" CPU usage, but it's not the case.
You do not have the required permissions to view the files attached to this post.
User avatar
death.crafter
Posts: 1071
Joined: April 24th, 2021, 8:13 pm

Re: Meters and measure hiding/disabled still consuming CPU

Post by death.crafter »

Duschmoll wrote: September 12th, 2021, 6:22 pm Hello,

In my skin I've added the possibilitie to hide parts of the skin.

I'm using the following command for it:

Code: Select all

    [ToggleAudio]
    Measure=Calc
    IfCondition=#ToggleAudio# = 0
    IfTrueAction=[!HideMeterGroup "Audio"][!SetOptionGroup Audio UpdateDivider "-1"][!SetOptionGroup Audio Disabled "0"]
    UpdateDivider=-1
I have this setup for all parts of my skin.
But when all of the skins parts are hidden/disable/updatedivider=-1 rainmeter is still using some of my CPU. Compare to when I unload the skin where it's at zero of CPu usage.

I'm wondering if there is something I'm messing or if it's the way of rainmeter functionning.
Still new to rainmeter, so I'm trying to optimize the skin.
You can pause a measure if you want to. No need of messing with dynamic variables or disabled. Unpause it later. If you want it's value to be 0 when not in use, just use disable measure bang.

See measure bangs in bangs section of docs.
from the Realm of Death
My Current Desktop
User avatar
Duschmoll
Posts: 26
Joined: May 5th, 2021, 6:08 pm

Re: Meters and measure hiding/disabled still consuming CPU

Post by Duschmoll »

death.crafter wrote: September 13th, 2021, 10:01 am You can pause a measure if you want to. No need of messing with dynamic variables or disabled. Unpause it later. If you want it's value to be 0 when not in use, just use disable measure bang.

See measure bangs in bangs section of docs.
Thanks you I didn't saw that earlier in the documents, that's helpful !

So now I'm using IfTrueAction=[!HideMeterGroup "Audio"][!SetOptionGroup Audio UpdateDivider "-1"][!SetOptionGroup Audio DynamicVariables "0"][!DisableMeasureGroup Audio]

The SeoptionGroup are to be sure that the meters are "disabled" and will not update.
But in the end it's still consuming some CPU even if they are not showing and updating.

Is there anything else I can do ?

Thanks again for all the help !
User avatar
death.crafter
Posts: 1071
Joined: April 24th, 2021, 8:13 pm

Re: Meters and measure hiding/disabled still consuming CPU

Post by death.crafter »

Duschmoll wrote: September 13th, 2021, 2:08 pm Thanks you I didn't saw that earlier in the documents, that's helpful !

So now I'm using IfTrueAction=[!HideMeterGroup "Audio"][!SetOptionGroup Audio UpdateDivider "-1"][!SetOptionGroup Audio DynamicVariables "0"][!DisableMeasureGroup Audio]

The SeoptionGroup are to be sure that the meters are "disabled" and will not update.
But in the end it's still consuming some CPU even if they are not showing and updating.

Is there anything else I can do ?

Thanks again for all the help !
Can you give a rough note on how much they consume and how much you expect them to consume?
from the Realm of Death
My Current Desktop