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

Random error, VBVMR_GetParameterFloat returned -6 #12

Open
Glaived opened this issue Nov 26, 2021 · 7 comments
Open

Random error, VBVMR_GetParameterFloat returned -6 #12

Glaived opened this issue Nov 26, 2021 · 7 comments

Comments

@Glaived
Copy link

Glaived commented Nov 26, 2021

I have this error in a completely random way, I also put you the related autohotkey code to try to reproduce it

image

#if WinExist("ahk_exe VALORANT-Win64-Shipping.exe")
	~*u::
	~*v::
		if (vmr.strip[1].B1 == false && WinActive("ahk_exe VALORANT-Win64-Shipping.exe"))
			vmr.strip[1].B1 := !vmr.strip[1].B1
	return

	~*u Up::
	~*v Up::
		if (vmr.strip[1].B1 == true && WinActive("ahk_exe VALORANT-Win64-Shipping.exe"))
			vmr.strip[1].B1 := !vmr.strip[1].B1
	return
#if
@Glaived
Copy link
Author

Glaived commented Nov 26, 2021

I updated VMR to the latest version, I don't think it will fix the problem since GetParameterFloat() has not been modified since.

I confirm that the error occurs even with the latest version.

@SaifAqqad
Copy link
Owner

That's really weird, I can't find anything about return value -6 in Voicemeeter's docs or their header file and I could not reproduce it.

I have asked the devs about it in their discord server, once they reply I look into it.

@Glaived
Copy link
Author

Glaived commented Nov 26, 2021

I did a little investigating on my side. The error comes from the fact that I have an infinite loop with a delay of 500ms~ before doing a new cycle. In the cycle, there is a check of the state of vmr.strip[5].Mute == true, it is this call that causes the error.

I thought it could be due to the frequency of Voicemeeter's polling, so I did a little test (see code), but I don't get any error when trying to force the thing, I conclude that it's not due to the frequency of Voicemeeter's API call.

#include <VMR>

global vmr := new VMR().login()

loop {
    test := vmr.strip[5].Mute
    sleep 1
}

@SaifAqqad
Copy link
Owner

Can you give me the whole script so I can try to reproduce the error?

@Glaived
Copy link
Author

Glaived commented Nov 26, 2021

I'm using a home-made engine, so it will be complicated to show the code as it is. But here is the execution path.


kernel.ahk

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Persistent ; Keeps a script permanently running (that is, until the user closes it or ExitApp is encountered).
#SingleInstance force
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
FileEncoding UTF-8
DetectHiddenWindows On
SetTitleMatchMode RegEx

#include <VMR>

global vmr := new VMR().login()

loop {
	startTime := A_TickCount
	#includeAgain %A_ScriptDir%\loader\loop.ahk
	elapsedTime := A_TickCount - startTime

	if (500 - elapsedTime > 0)
		sleep 500 - elapsedTime
}

%A_ScriptDir%\loader\loop.ahk

#includeAgain *i %A_ScriptDir%\bundle\Spotify\loop.ahk

%A_ScriptDir%\bundle\Spotify\loop.ahk

if (ProcessExist("Spotify.exe")) {
	SetFormat Float, 0.3

	WinGet _windows, List

	loop % _windows {
		_hwnd := _windows%A_Index%
		WinGet _process, ProcessName, ahk_id %_hwnd%
		WinGetTitle _title, ahk_id %_hwnd%
	} until (_process == "Spotify.exe" && _title != "")

	if (_process == "Spotify.exe" && (_title = "Advertisement" || _title = "Spotify" || _title = "Spotify Free" || _title = "Les 250 ans de Beethoven en podcast !")) {
		if (vmr.strip[5].Mute == false) { ; Ads = mute
			vmr.strip[5].mute := true
		}
	} else {
		if (vmr.strip[5].Mute == true) { ; No ads
			vmr.strip[5].mute := false
		}
	}
}

@SaifAqqad
Copy link
Owner

I still can't seem to get the error :/

2021-11-26.09-58-55.mp4

@Glaived
Copy link
Author

Glaived commented Nov 26, 2021

I don't have a very powerful PC (potato pc), would that have a link ?…

🤷

I can't reproduce the problem either. Except when it pops up randomly

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

No branches or pull requests

2 participants