It is currently March 28th, 2024, 10:39 am

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

Get 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: 246
Joined: July 8th, 2021, 11:30 pm
Location: The King's Avenue, Golden Kingdom
Contact:

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.
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: 1363
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: 246
Joined: July 8th, 2021, 11:30 pm
Location: The King's Avenue, Golden Kingdom
Contact:

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  
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.
Attachments
Gefjon & Zisa - Utility Bar_0.9.rmskin
(477.1 KiB) Downloaded 11 times
User avatar
death.crafter
Rainmeter Sage
Posts: 1399
Joined: April 24th, 2021, 8:13 pm
Contact:

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.
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
Rainmeter Sage
Posts: 1399
Joined: April 24th, 2021, 8:13 pm
Contact:

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?
Post Reply