It is currently April 19th, 2024, 6:27 am

[BUG?] AudioLevel not updating default devices on headphone switch

Report bugs with the Rainmeter application and suggest features.
User avatar
Yincognito
Rainmeter Sage
Posts: 7125
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

[BUG?] AudioLevel not updating default devices on headphone switch

Post by Yincognito »

Hey there, welcome to another post of your favorite bug finder on the forum... :sly:

Test skin (disregard groups, bands or substitutes if you want, they're here just for logical and copy pasting reasons and are not important in this case):

Code: Select all

[Variables]

[Rainmeter]
Update=50
DynamicWindowSize=1
AccurateText=1
BackgroundMode=2
SolidColor=0,0,0,128
SolidColor2=16,16,16,128
GradientAngle=90

---Measures Win7Audio---

[MS_Win7Audio_Win7AudioDevice]
Group=Win7AudioGroup
Measure=Plugin
Plugin=Win7AudioPlugin

---Measures AudioLevel---

[MS_AudioLevel_Input]
Group=AudioLevelGroup | InputGroup
Measure=Plugin
Plugin=AudioLevel
Port=Input
RMSAttack=15
RMSDecay=250
RMSGain=1.50
PeakAttack=0
PeakDecay=0
PeakGain=1.0
FFTSize=4096
FFTOverlap=2048
FFTAttack=150
FFTDecay=300
Bands=24
FreqMin=20
FreqMax=24000
Sensitivity=25

[MS_AudioLevel_Input_DeviceList]
Group=AudioLevelGroup | InputGroup
Measure=Plugin
Plugin=AudioLevel
Parent=MS_AudioLevel_Input
Type=DeviceList
RegExpSubstitute=1
Substitute="(?siU){.*}.{.*}:\s*?":"","(^\n+|\n+$)":"","^([\s\S]*)$":"#CRLF#\1","\n":"#CRLF#∆ ","[ @:\(\)]\?\?\?[ @:\(\)]":"Indef.","(^\n∆ $|^\n∆ 0$|^\n∆ -1$)":"#CRLF#≡ No audio input devices detected."

[MS_AudioLevel_Input_DeviceName]
Group=AudioLevelGroup | InputGroup
Measure=Plugin
Plugin=AudioLevel
Parent=MS_AudioLevel_Input
Type=DeviceName

[MS_AudioLevel_Input_Format]
Group=AudioLevelGroup | InputGroup
Measure=Plugin
Plugin=AudioLevel
Parent=MS_AudioLevel_Input
Type=Format

[MS_AudioLevel_Input_Band0]
Group=AudioLevelGroup | InputGroup
Measure=Plugin
Plugin=AudioLevel
Parent=MS_AudioLevel_Input
Type=Band
BandIdx=0

[MS_AudioLevel_Input_Band1]
Group=AudioLevelGroup | InputGroup
Measure=Plugin
Plugin=AudioLevel
Parent=MS_AudioLevel_Input
Type=Band
BandIdx=1

[MS_AudioLevel_Input_Band2]
Group=AudioLevelGroup | InputGroup
Measure=Plugin
Plugin=AudioLevel
Parent=MS_AudioLevel_Input
Type=Band
BandIdx=2

[MS_AudioLevel_Input_Band3]
Group=AudioLevelGroup | InputGroup
Measure=Plugin
Plugin=AudioLevel
Parent=MS_AudioLevel_Input
Type=Band
BandIdx=3

[MS_AudioLevel_Input_Band4]
Group=AudioLevelGroup | InputGroup
Measure=Plugin
Plugin=AudioLevel
Parent=MS_AudioLevel_Input
Type=Band
BandIdx=4

[MS_AudioLevel_Input_Band5]
Group=AudioLevelGroup | InputGroup
Measure=Plugin
Plugin=AudioLevel
Parent=MS_AudioLevel_Input
Type=Band
BandIdx=5

[MS_AudioLevel_Input_Band6]
Group=AudioLevelGroup | InputGroup
Measure=Plugin
Plugin=AudioLevel
Parent=MS_AudioLevel_Input
Type=Band
BandIdx=6

[MS_AudioLevel_Input_Band7]
Group=AudioLevelGroup | InputGroup
Measure=Plugin
Plugin=AudioLevel
Parent=MS_AudioLevel_Input
Type=Band
BandIdx=7

[MS_AudioLevel_Input_Band8]
Group=AudioLevelGroup | InputGroup
Measure=Plugin
Plugin=AudioLevel
Parent=MS_AudioLevel_Input
Type=Band
BandIdx=8

[MS_AudioLevel_Input_Band9]
Group=AudioLevelGroup | InputGroup
Measure=Plugin
Plugin=AudioLevel
Parent=MS_AudioLevel_Input
Type=Band
BandIdx=9

[MS_AudioLevel_Input_Band10]
Group=AudioLevelGroup | InputGroup
Measure=Plugin
Plugin=AudioLevel
Parent=MS_AudioLevel_Input
Type=Band
BandIdx=10

[MS_AudioLevel_Input_Band11]
Group=AudioLevelGroup | InputGroup
Measure=Plugin
Plugin=AudioLevel
Parent=MS_AudioLevel_Input
Type=Band
BandIdx=11

[MS_AudioLevel_Input_Band12]
Group=AudioLevelGroup | InputGroup
Measure=Plugin
Plugin=AudioLevel
Parent=MS_AudioLevel_Input
Type=Band
BandIdx=12

[MS_AudioLevel_Input_Band13]
Group=AudioLevelGroup | InputGroup
Measure=Plugin
Plugin=AudioLevel
Parent=MS_AudioLevel_Input
Type=Band
BandIdx=13

[MS_AudioLevel_Input_Band14]
Group=AudioLevelGroup | InputGroup
Measure=Plugin
Plugin=AudioLevel
Parent=MS_AudioLevel_Input
Type=Band
BandIdx=14

[MS_AudioLevel_Input_Band15]
Group=AudioLevelGroup | InputGroup
Measure=Plugin
Plugin=AudioLevel
Parent=MS_AudioLevel_Input
Type=Band
BandIdx=15

[MS_AudioLevel_Input_Band16]
Group=AudioLevelGroup | InputGroup
Measure=Plugin
Plugin=AudioLevel
Parent=MS_AudioLevel_Input
Type=Band
BandIdx=16

[MS_AudioLevel_Input_Band17]
Group=AudioLevelGroup | InputGroup
Measure=Plugin
Plugin=AudioLevel
Parent=MS_AudioLevel_Input
Type=Band
BandIdx=17

[MS_AudioLevel_Input_Band18]
Group=AudioLevelGroup | InputGroup
Measure=Plugin
Plugin=AudioLevel
Parent=MS_AudioLevel_Input
Type=Band
BandIdx=18

[MS_AudioLevel_Input_Band19]
Group=AudioLevelGroup | InputGroup
Measure=Plugin
Plugin=AudioLevel
Parent=MS_AudioLevel_Input
Type=Band
BandIdx=19

[MS_AudioLevel_Input_Band20]
Group=AudioLevelGroup | InputGroup
Measure=Plugin
Plugin=AudioLevel
Parent=MS_AudioLevel_Input
Type=Band
BandIdx=20

[MS_AudioLevel_Input_Band21]
Group=AudioLevelGroup | InputGroup
Measure=Plugin
Plugin=AudioLevel
Parent=MS_AudioLevel_Input
Type=Band
BandIdx=21

[MS_AudioLevel_Input_Band22]
Group=AudioLevelGroup | InputGroup
Measure=Plugin
Plugin=AudioLevel
Parent=MS_AudioLevel_Input
Type=Band
BandIdx=22

[MS_AudioLevel_Input_Band23]
Group=AudioLevelGroup | InputGroup
Measure=Plugin
Plugin=AudioLevel
Parent=MS_AudioLevel_Input
Type=Band
BandIdx=23

[MS_AudioLevel_Output]
Group=AudioLevelGroup | OutputGroup
Measure=Plugin
Plugin=AudioLevel
Port=Output
RMSAttack=15
RMSDecay=250
RMSGain=1.5
FFTSize=4096
FFTOverlap=2048
FFTAttack=150
FFTDecay=300
Bands=24
FreqMin=20
FreqMax=24000
Sensitivity=25

[MS_AudioLevel_Output_DeviceList]
Group=AudioLevelGroup | OutputGroup
Measure=Plugin
Plugin=AudioLevel
Parent=MS_AudioLevel_Output
Type=DeviceList
RegExpSubstitute=1
Substitute="(?siU){.*}.{.*}:\s*?":"","(^\n+|\n+$)":"","^([\s\S]*)$":"#CRLF#\1","\n":"#CRLF#∆ ","[ @:\(\)]\?\?\?[ @:\(\)]":"Indef.","(^\n∆ $|^\n∆ 0$|^\n∆ -1$)":"#CRLF#≡ No audio output devices detected."

[MS_AudioLevel_Output_DeviceName]
Group=AudioLevelGroup | OutputGroup
Measure=Plugin
Plugin=AudioLevel
Parent=MS_AudioLevel_Output
Type=DeviceName

[MS_AudioLevel_Output_Format]
Group=AudioLevelGroup | OutputGroup
Measure=Plugin
Plugin=AudioLevel
Parent=MS_AudioLevel_Output
Type=Format

[MS_AudioLevel_Output_Band0]
Group=AudioLevelGroup | OutputGroup
Measure=Plugin
Plugin=AudioLevel
Parent=MS_AudioLevel_Output
Type=Band
BandIdx=0

[MS_AudioLevel_Output_Band1]
Group=AudioLevelGroup | OutputGroup
Measure=Plugin
Plugin=AudioLevel
Parent=MS_AudioLevel_Output
Type=Band
BandIdx=1

[MS_AudioLevel_Output_Band2]
Group=AudioLevelGroup | OutputGroup
Measure=Plugin
Plugin=AudioLevel
Parent=MS_AudioLevel_Output
Type=Band
BandIdx=2

[MS_AudioLevel_Output_Band3]
Group=AudioLevelGroup | OutputGroup
Measure=Plugin
Plugin=AudioLevel
Parent=MS_AudioLevel_Output
Type=Band
BandIdx=3

[MS_AudioLevel_Output_Band4]
Group=AudioLevelGroup | OutputGroup
Measure=Plugin
Plugin=AudioLevel
Parent=MS_AudioLevel_Output
Type=Band
BandIdx=4

[MS_AudioLevel_Output_Band5]
Group=AudioLevelGroup | OutputGroup
Measure=Plugin
Plugin=AudioLevel
Parent=MS_AudioLevel_Output
Type=Band
BandIdx=5

[MS_AudioLevel_Output_Band6]
Group=AudioLevelGroup | OutputGroup
Measure=Plugin
Plugin=AudioLevel
Parent=MS_AudioLevel_Output
Type=Band
BandIdx=6

[MS_AudioLevel_Output_Band7]
Group=AudioLevelGroup | OutputGroup
Measure=Plugin
Plugin=AudioLevel
Parent=MS_AudioLevel_Output
Type=Band
BandIdx=7

[MS_AudioLevel_Output_Band8]
Group=AudioLevelGroup | OutputGroup
Measure=Plugin
Plugin=AudioLevel
Parent=MS_AudioLevel_Output
Type=Band
BandIdx=8

[MS_AudioLevel_Output_Band9]
Group=AudioLevelGroup | OutputGroup
Measure=Plugin
Plugin=AudioLevel
Parent=MS_AudioLevel_Output
Type=Band
BandIdx=9

[MS_AudioLevel_Output_Band10]
Group=AudioLevelGroup | OutputGroup
Measure=Plugin
Plugin=AudioLevel
Parent=MS_AudioLevel_Output
Type=Band
BandIdx=10

[MS_AudioLevel_Output_Band11]
Group=AudioLevelGroup | OutputGroup
Measure=Plugin
Plugin=AudioLevel
Parent=MS_AudioLevel_Output
Type=Band
BandIdx=11

[MS_AudioLevel_Output_Band12]
Group=AudioLevelGroup | OutputGroup
Measure=Plugin
Plugin=AudioLevel
Parent=MS_AudioLevel_Output
Type=Band
BandIdx=12

[MS_AudioLevel_Output_Band13]
Group=AudioLevelGroup | OutputGroup
Measure=Plugin
Plugin=AudioLevel
Parent=MS_AudioLevel_Output
Type=Band
BandIdx=13

[MS_AudioLevel_Output_Band14]
Group=AudioLevelGroup | OutputGroup
Measure=Plugin
Plugin=AudioLevel
Parent=MS_AudioLevel_Output
Type=Band
BandIdx=14

[MS_AudioLevel_Output_Band15]
Group=AudioLevelGroup | OutputGroup
Measure=Plugin
Plugin=AudioLevel
Parent=MS_AudioLevel_Output
Type=Band
BandIdx=15

[MS_AudioLevel_Output_Band16]
Group=AudioLevelGroup | OutputGroup
Measure=Plugin
Plugin=AudioLevel
Parent=MS_AudioLevel_Output
Type=Band
BandIdx=16

[MS_AudioLevel_Output_Band17]
Group=AudioLevelGroup | OutputGroup
Measure=Plugin
Plugin=AudioLevel
Parent=MS_AudioLevel_Output
Type=Band
BandIdx=17

[MS_AudioLevel_Output_Band18]
Group=AudioLevelGroup | OutputGroup
Measure=Plugin
Plugin=AudioLevel
Parent=MS_AudioLevel_Output
Type=Band
BandIdx=18

[MS_AudioLevel_Output_Band19]
Group=AudioLevelGroup | OutputGroup
Measure=Plugin
Plugin=AudioLevel
Parent=MS_AudioLevel_Output
Type=Band
BandIdx=19

[MS_AudioLevel_Output_Band20]
Group=AudioLevelGroup | OutputGroup
Measure=Plugin
Plugin=AudioLevel
Parent=MS_AudioLevel_Output
Type=Band
BandIdx=20

[MS_AudioLevel_Output_Band21]
Group=AudioLevelGroup | OutputGroup
Measure=Plugin
Plugin=AudioLevel
Parent=MS_AudioLevel_Output
Type=Band
BandIdx=21

[MS_AudioLevel_Output_Band22]
Group=AudioLevelGroup | OutputGroup
Measure=Plugin
Plugin=AudioLevel
Parent=MS_AudioLevel_Output
Type=Band
BandIdx=22

[MS_AudioLevel_Output_Band23]
Group=AudioLevelGroup | OutputGroup
Measure=Plugin
Plugin=AudioLevel
Parent=MS_AudioLevel_Output
Type=Band
BandIdx=23

---Meters---

[MeterVolume]
Meter=String
FontFace=Consolas
FontSize=16
FontColor=255,255,255,255
AntiAlias=1
MeasureName=MS_Win7Audio_Win7AudioDevice
MeasureName2=MS_AudioLevel_Output_DeviceName
Text="Output Audio Device (Win7Audio) = %1#CRLF#Output Audio Device (AudioLevel) = %2"
DynamicVariables=1
Problem: When disconnecting my headphones (a Runmus on Windows 10), the output text correctly switches to Speaker for both Win7Audio and AudioLevel measures, however when I connect them again, only the Win7Audio measure reacts properly and outputs the headphone device, with the AudioLevel one not updating its output (or its RMS and band values, for that matter) to the new circumstances:
AudioLevel vs Win7Audio Default Device.jpg
Just in case anyone is wondering, I have no odd executable or driver crapware running at startup, it's just the well known Realtek HD Audio driver that's installed on my system. I already use non-exclusive mode for all audio devices, too.

Solution: Basically, the solution would be to manually refresh the skin to have both measures yielding the correct result, but that sort of defeats their purpose in the first place. I could set up an IfMatch to (try to, as I didn't do that yet) update the AudioLevel parent measure as soon as its device name measure is sensibly different than what Win7Audio measure's string value is, but this is a bit problematic as they don't match exactly and even if I set up an A "like" B system I'm not entirely sure it will work for all cases (maybe for some the difference is more than some bracket enclosed string suffix). Plus, the latter won't work if you don't have a Win7Audio measure in the skin anyway.

Any thoughts on this? Bug or not bug, that is the question (I mean, Windows properly changes the default device on both connecting and disconnecting the headphones, as you can see from the screenshot)... :???:
You do not have the required permissions to view the files attached to this post.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth