It is currently March 28th, 2024, 11:36 pm

Lagging Audio Visualizer

Get help with creating, editing & fixing problems with skins
DromaTheRyn
Posts: 9
Joined: March 11th, 2018, 7:47 pm

Lagging Audio Visualizer

Post by DromaTheRyn »

Hey everyone!
I got a problem with a lagging audio visualizer. It's the Lano- Visualizer from Marco Pixel.
The lags only appear when my System Monitor skins are loaded. It uses the HWiNFO plugin.
The lags appear as micro stuttering and I guess they appear on an update cycle.
The first iteration of the System Monitor made Rainmeter lag really badly: If I'd move the Rainmeter window in circles really fast, it would freeze for a few ms on every update cycle. I solved the problem by splitting the System Monitor into multiple skins, which really helped, but the lags remained on the audio visualizer (they've gotten a lot better though, but they haven't disappeared).
I also think the lags could be caused by some of the skins drawing graphs. Before I included them, I've never had problems. About a third of my System Monitor is based on SK Neon Meters. I don't really want to get rid of the graphs though, because they add a lot to the skin.

Any ideas how I could fix the problem?
I don't know how I could make the skin more efficient, because I want to read and display a lot of values. Plus I got a pretty good CPU, and even with all the reading and displaying, I never get load spikes. Also doesn't look like the memory is leaking.
I've also got a lot of the min/ max readings on a pretty high UpdateDivider, so I can't really figure out where all the lags come from. I'll post a few code snippets below, if you have any idea on how to make them more efficient or how to eliminate the lag, I'd love to hear your thoughts!

Typical graph, based on the SK Neon Meters skin (1)

Code: Select all

[Rainmeter]
Update=1000
OnRefreshAction=[!AutoSelectScreen "1"]

[Variables]
Page=1;
@Include=Config\Styles.inc
@Include2=Config\Config.inc

BoxQty = 10
BoxWidth=(#WORKAREAWIDTH#-(#BoxQty#*10)-30)/#BoxQty#
BoxPos1 = 20
BoxPos2 = #BoxWidth#+30
BoxPos3 = (2*#BoxWidth#)+40
BoxPos4 = (3*#BoxWidth#)+50
BoxPos5 = (4*#BoxWidth#)+60
BoxPos6 = (5*#BoxWidth#)+70
BoxPos7 = (6*#BoxWidth#)+80
BoxPos8 = (7*#BoxWidth#)+90
BoxPos9 = (8*#BoxWidth#)+100
BoxPos10 = (9*#BoxWidth#)+110
BGRight1 = (#WORKAREAWIDTH#-230)
BGRight2 = (#WORKAREAWIDTH#-270)
BGLeft1 = 270
BGLeft2 = 320

[MeterOutlineBox5]
Meter=Shape
Shape=Rectangle #BoxPos5#,22,#BoxWidth#,50 | Fill Color 0,0,0,0 | StrokeWidth 1 | Stroke Color #CPUcolor#,255

[MeterLabelBox5]
Meter=String
MeterStyle=StyleGraphLabels
X=(#BoxWidth#/2)+#BoxPos5#
Y=0
Text="Load"
AntiAlias=1

[MeasureDataBox5]
Measure=Plugin
Plugin=HWiNFO.dll
HWiNFOSensorId=0xf0000300
HWiNFOSensorInstance=0x0
HWiNFOEntryId=0x7000007
HWiNFOType=CurrentValue
MinValue=0
MaxValue=100
UpdateDivider=1

[MeterGraphLineBox5]
Meter=Line
MeasureName=MeasureDataBox5
X=#BoxPos5#
Y=22
W=#BoxWidth#
H=50
LineCount=1
LineColor=#CPUcolor#,255
SolidColor=#BACKcolor#
AntiAlias=1
LineWidth=2
GraphOrientation=Vertical

[MeterHistogramBox5]
Meter=Histogram
MeasureName=MeasureDataBox5
X=#BoxPos5#
Y=22
W=#BoxWidth#
H=50
PrimaryColor=#CPUcolor#,60
AntiAlias=1
GraphOrientation=Vertical

[MeterDataTextBox5]
Meter=String
MeterStyle=StyleGraphData
MeasureName=MeasureDataBox5
X=(#BoxWidth#/2)+#BoxPos5#
Y=75
Scale=1
NumOfDecimals=0
Text="%1%"
AntiAlias=1[/snippet][/spoiler]

Typical graph, based on the SK Neon Meters skin (2)
[spoiler][snippet][Rainmeter]
Update=1000
OnRefreshAction=[!AutoSelectScreen "1"]

[Variables]
Page=1;
@Include=Config\Styles.inc
@Include2=Config\Config.inc

BoxQty = 10
BoxWidth=(#WORKAREAWIDTH#-(#BoxQty#*10)-30)/#BoxQty#
BoxPos1 = 20
BoxPos2 = #BoxWidth#+30
BoxPos3 = (2*#BoxWidth#)+40
BoxPos4 = (3*#BoxWidth#)+50
BoxPos5 = (4*#BoxWidth#)+60
BoxPos6 = (5*#BoxWidth#)+70
BoxPos7 = (6*#BoxWidth#)+80
BoxPos8 = (7*#BoxWidth#)+90
BoxPos9 = (8*#BoxWidth#)+100
BoxPos10 = (9*#BoxWidth#)+110
BGRight1 = (#WORKAREAWIDTH#-230)
BGRight2 = (#WORKAREAWIDTH#-270)
BGLeft1 = 270
BGLeft2 = 320

[MeterOutlineBox1]
Meter=Shape
Shape=Rectangle #BoxPos1#,22,#BoxWidth#,50 | Fill Color 0,0,0,0 | StrokeWidth 1 | Stroke Color #GPUcolor#,255

[MeterLabelBox1]
Meter=String
MeterStyle=StyleGraphLabels
X=(#BoxWidth#/2)+#BoxPos1#
Y=0
Text="Memory"
AntiAlias=1

[MeasureDataBox1]
Measure=Plugin
Plugin=HWiNFO.dll
HWiNFOSensorId=0xe0002000
HWiNFOSensorInstance=0x0
HWiNFOEntryId=0x800003c
HWiNFOType=CurrentValue
MinValue=0
MaxValue=6144
UpdateDivider=11

[MeterGraphLineBox1]
Meter=Line
MeasureName=MeasureDataBox1
X=#BoxPos1#
Y=22
W=#BoxWidth#
H=50
LineCount=1
LineColor=#GPUcolor#,255
SolidColor=#BACKcolor#
AntiAlias=1
LineWidth=2
GraphOrientation=Vertical

[MeterHistogramBox1]
Meter=Histogram
MeasureName=MeasureDataBox1
X=#BoxPos1#
Y=22
W=#BoxWidth#
H=50
PrimaryColor=#GPUcolor#,60
AntiAlias=1
GraphOrientation=Vertical


[MeterDataTextBox1]
Meter=String
MeterStyle=StyleGraphData
MeasureName=MeasureDataBox1
X=(#BoxWidth#/2)+#BoxPos1#
Y=75
Scale=1
NumOfDecimals=0
Text="%1 MB"
AntiAlias=1[/snippet][/spoiler]

Snippet of the general design of the rest of my system monitor, without graphs, just displayed as text
[spoiler][snippet][MeasureCpuVoltage]
Measure=Plugin
Plugin=HWiNFO.dll
HWiNFOSensorId=0xf7067950
HWiNFOSensorInstance=0x0
HWiNFOEntryId=0x2000000
HWiNFOType=CurrentValue

[MeasureCpuVoltageMin]
Measure=Plugin
Plugin=HWiNFO.dll
HWiNFOSensorId=0xf7067950
HWiNFOSensorInstance=0x0
HWiNFOEntryId=0x2000000
HWiNFOType=MinimumValue
UpdateDivider=300

[MeasureCpuVoltageMax]
Measure=Plugin
Plugin=HWiNFO.dll
HWiNFOSensorId=0xf7067950
HWiNFOSensorInstance=0x0
HWiNFOEntryId=0x2000000
HWiNFOType=MaximumValue
UpdateDivider=300

[MeterCpuVoltage]
Meter=String
MeterStyle=StyleExpand
FontSize=12
MeasureName=MeasureCpuVoltage
X=1770
Y=125
NumOfDecimals=3
Text="%1v"
AntiAlias=1

[MeterCpuVoltageMin]
Meter=String
MeterStyle=StyleExpand
FontSize=12
MeasureName=MeasureCpuVoltageMin
X=1830
Y=125
NumOfDecimals=3
Text="[%1v -"
AntiAlias=1

[MeterCpuVoltageMax]
Meter=String
MeterStyle=StyleExpand
FontSize=12
MeasureName=MeasureCpuVoltageMax
X=1890
Y=125
NumOfDecimals=3
Text="%1v]"
AntiAlias=1