SOLVED - Automatic Steam Optimization

Hi Martin

Automatic Steam-VR optomization does not work when Steam is installed in non standard folder.
I have mine installed in D:\Steam

2 Likes

hmm thats weird.

Is your steamvr.vrsettings located in D:\Program Files (x86)\Steam\config\ when having it installed on D:?

I will look into this later tonight and maybe add a new version that might fix this. I think I know what went wrong here :slight_smile:

2 Likes

Hi Martin

Nope :grinning: you asked for non-standard installations, mine is :smile:
It’s located in:
D:\Steam\config\

3 Likes

Perfect, I will get back to you later or at latest tomorrow morning if I dont get it done in time tonight. Its so weird these things doesnt work when I was 100% sure they did hehe… but Im pretty sure I know what i missed!

4 Likes

@SweViver in my version i’m using a call to vrPathReg.exe to make sure i get the right path, you’re welcome to check it out.

3 Likes

Hi,

Just to say I have the same issue as my Steam is also into a non standard directory (C:/Games/Steam), the steamvr.vrsettings is not modified.

Check the new version Beta v.0.21. This SHOULD work now, Im 99% confident haha

https://community.openmr.ai/t/private-beta-build-v0-21/30154

Thanks a lot man. I will have a look at this and maybe change some of my code :slight_smile: really appreciated!!

3 Likes

Will test tonight, currently @work

2 Likes

Automatic Steam Optimization now finds my correct steamvr.vrsettings file and edits it.
But :slight_smile: When pressing optimize now the following lines are added for each time it’s pressed.
, “maxRecommendedResolution” : 8192,
“allowSupersampleFiltering” : false,
“supersampleManualOverride” : true,
“supersampleScale” : 1

my complete file now looks like this

{
“DesktopUI” : {
“controllerbinding_desktop” : “768,211,1920,1080,0”,
“pairing” : “1328,451,800,600,0”,
“settings_desktop” : “2632,792,800,600,0”
},
“GpuSpeed” : {
“gpuSpeed0” : 1500,
“gpuSpeed1” : 1500,
“gpuSpeed2” : 1500,
“gpuSpeed3” : 1500,
“gpuSpeed4” : 1500,
“gpuSpeed5” : 1500,
“gpuSpeed6” : 1500,
“gpuSpeed7” : 1500,
“gpuSpeed8” : 1500,
“gpuSpeed9” : 1500,
“gpuSpeedCount” : 10,
“gpuSpeedDriver” : “27.21.14.5167”,
“gpuSpeedHorsepower” : 923,
“gpuSpeedRenderTargetScale” : 0.71999996900558472,
“gpuSpeedVendor” : “NVIDIA GeForce GTX 1080 Ti”,
“gpuSpeedVersion” : 2
},
“LastKnown” : {
“HMDManufacturer” : “Pimax VR, Inc.”,
“HMDModel” : “Pimax 5K Plus”
},
“audio” : {
“enablePlaybackDeviceOverride_Pimax VR, Inc._Pimax 5K Plus” : true,
“enableRecordingDeviceOverride_Pimax VR, Inc._Pimax 5K Plus” : true,
“playbackDeviceOverrideName_Pimax VR, Inc._Pimax 5K Plus” : “Højttalere (USB Audio Device)”,
“playbackDeviceOverride_Pimax VR, Inc._Pimax 5K Plus” : “{0.0.0.00000000}.{a508286d-3f3c-4a1f-9316-4887c10d2476}”,
“recordingDeviceOverrideName_Pimax VR, Inc._Pimax 5K Plus” : “Microphone (USB Audio Device)”,
“recordingDeviceOverride_Pimax VR, Inc._Pimax 5K Plus” : “{0.0.1.00000000}.{18edc676-9529-4f3d-a780-7e2f16d4ac6c}”
},
“collisionBounds” : {
“CollisionBoundsColorGammaA” : 76,
“CollisionBoundsStyle” : 1
},
“dashboard” : {
“desktopScale” : 1.5,
“desktopScale1” : 1.5,
“lastAccessedExternalOverlayKey” : “sb.fpsVR.dashboardoverlay”
},
“keyboard” : {
“TutorialCompletions” : 1
},
“openvr.tool.steamvr_environments” : {
“disableAsync” : false,
“motionSmoothingOverride” : 2,
“resolutionScale” : 100
},
“power” : {
“turnOffScreensTimeout” : 0
},
“steam.app.1073390” : {
“motionSmoothingOverride” : 0
},
“steam.app.546560” : {
“DominantHand” : 2
},
“steam.app.908520” : {
“resolutionScale” : 100
},
“steamvr” : {
“allowSupersampleFiltering” : false,
“background” : “#FF000000”,
“enableDistortion” : false,
“forceFadeOnBadTracking” : false,
“hmdDisplayColorGainG” : 0.94999992847442627,
“hmdDisplayColorGainR” : 0.99999994039535522,
“installID” : “16135027460754591206”,
“lastVersionNotice” : “1.13.10”,
“lastVersionNoticeDate” : “1594678162”,
“maxRecommendedResolution” : 16384,
“mirrorViewEye” : 0,
“motionSmoothing” : false,
“showAdvancedSettings” : true,
“showMirrorView” : false,
“supersampleManualOverride” : true,
“supersampleScale” : 1
, “maxRecommendedResolution” : 8192,
“allowSupersampleFiltering” : false,
“supersampleManualOverride” : true,
“supersampleScale” : 1
, “maxRecommendedResolution” : 8192,
“allowSupersampleFiltering” : false,
“supersampleManualOverride” : true,
“supersampleScale” : 1
, “maxRecommendedResolution” : 8192,
“allowSupersampleFiltering” : false,
“supersampleManualOverride” : true,
“supersampleScale” : 1
, “maxRecommendedResolution” : 8192,
“allowSupersampleFiltering” : false,
“supersampleManualOverride” : true,
“supersampleScale” : 1
}
}

3 Likes

Doesn’t SteamVR remove the dulicates on start-up?

Not saying it’s not a bug (should only add line if missing of course), but it shouldn’t present any issues at least (if that’s the case)… :slight_smile:

1 Like

Unfortunately, due to my so called coding skills I haven’t been able to serialize the entire .vrsettings file as JSON and edit values upon extracting them (like I do with all other stuff and config files). The steamvr.vrsettings is such a mess and looks different from system to system.

So yes Im ashamed to say this but this is how I temporarily solved it:
File is read line by line.
GPUSPEED lines are replaced
The other values inside steamvr {} bracket are basically put at the end before ending bracket }.

So yeah it does not look pretty right when added, but it does work every time as SteamVR fixed this upon starting up. Duplicates are removed and last values are the ones set.

So if u first set supersample scale 1 and right after set 2 (before you start steamvr), the last supersample value will be read and correctly lined up when SteamVR have started :slight_smile:

I will go through the code @BNP had shared and hopefully I can probably rewrite the whole function so its better looking and more safe …

3 Likes

Do you use one of the great JSON packages for Unity? They can make life so much easier…

3 Likes

i’m usually importing Newtonsoft.Json as a nuget package, it makes it easy to load and manipulate json (line 97 - 158 ish) i’m assuming it or something like it is available for you.

2 Likes

Hmm I may try Newtonsoft.JSON or Ultimate JSON for this, thanks!
Currently, for all other JSON files and functions, Im using the simplified (which really isnt that simple) built-in json serializer built in Unity, called JsonUtility, which is quite limited. For every level I need to create Serialized Classes and Lists and link these together. As soon as its multi-level JSON, its just way over my head haha.

A two level is rather simple (when importing VivePort titles):

// VivePortJSON data 
[Serializable]
public class VivePortGameJSONData
{
    public string appId = "";
    public string title = "";
    public string imageUri = "";
    public string path = "";
    public string uri = "";

}
[Serializable]
public class VivePortGameRoot
{
    public VivePortGameJSONData[] games;
}

But 3 level and more just doesnt work for me…

2 Likes

JObject json = JObject.Parse(File.ReadAllText(vrSettingsPath));

json[“GpuSpeed”][“gpuSpeed0”] = GPUSpeedValue;

File.WriteAllText(vrSettingsPath, json.ToString());

if the property doesn’t exists it will automatically be created, it really doesn’t get much simpler. :wink:

4 Likes

I will dig into this later tonight. I remember I spent a day or two doing this with JSON Utility and after failing over and over again (not gpuspeed values but inside SteamVR and the per-application brackets), I gave up and went with the ugly way.
But I will try again :slight_smile: thanks

3 Likes

HOLY SH*T Im so thankful for your tips and the code example! Newtonsoft.Json is such a blast to work with. Soo freakin easy compared to the JsonUtility I have been using so far :slight_smile:
Im working on re-coding the SteamVR optimization completely now…

6 Likes

Great :v: 020202022020

2 Likes

One thing I havent found out yet, is HOW to see if SteamVR config is read/stored in openvr folder or not:

In other words, either in:

  • Default SteamVR installation config (example: C:\Program Files (x86)\Steam\config\steamvr.vrsettings)

or

  • C:\Users\user\AppData\Local\openvr\steamvr.vrsettings

This seems to be totally random, and when applying settings, I make sure to also change settings in C:\Users\user\AppData\Local\openvr\steamvr.vrsettings (if file exists).

But when reading current SteamVR values, I have no idea which file I should read from (and which actually is used by SteamVR).

Any thoughts @BNP?

It has happened many times in the past on my PCs, that suddenly SteamVR starts to read and use the config file in C:\Users\user\AppData\Local\openvr\steamvr.vrsettings instead of the default file in Steam install folder. I have no clue what triggered it.

On this specific PC, the default config file is used, but openVR folders/files still exists:

1 Like

in line 55 to 80 ish in my code you’ll see that I’m using the vrPathReg.exe from the steam installation to extract the current configuration folder. with the assumption that Steam knows where it is supposed to be.

that’s my best guess.

1 Like