Jump to content

[Guide] Shadowplay Mods



This guide is not intended to help troubleshoot problems with Shadowplay or GFExperience !!
It is meant for users who already have Shadowplay WORKING and wish to learn more about it.

For GFE issues those questions should be posted here :
https://forums.geforce.com/default/board/110/

 
 
 
 

Quote

What is the purpose of this guide ??
 
This guide was created to share on how to use Shadowplay with minimal processes running and also to explore other possibilities.
 
What kind of feedback should be posted ?

Any information you want to share that relates to GFE or Shadowplay that you feel will be helpful to others, such as tips or tweaks.  Any questions about the files in this thread or debugging of GFE are welcome.

What kind of feedback should NOT be posted ?

As mentioned above, this is not a thread to work out your GFE issues, do that on the geforce forums !!

 
 


OwIqstm.png
Anything marked optional is referring to Shadowplay requirements

Quote

NvBackend.exe ( optional ) -- Scans pc for games ( for optimize list )

GFExperience.exe ( optional )-- The main gui interface

nvspcaps.exe ( required ) -- Responsible for capturing gameplay

 

XpDBbWW.png
Anything marked optional is referring to Shadowplay requirements

Quote

NVIDIA Network Service (optional ) -- Downloads updates from nvidia servers ( drivers, ect.. )

NVIDIA Display Driver Service (optional ) -- Provides system and desktop level support to the NVIDIA display driver

NVIDIA GeForce Experience Service (optional ) -- Not sure what this is does yet…

NVIDIA Streamer Service (optional ) -- Required for streaming to SHIELD devices

 

7mNVS68.png

Virtually all of the Shadowplay settings that you configure in GFExperience are saved in this registry key

Quote

HKEY_CURRENT_USER\Software\NVIDIA Corporation\Global\ShadowPlay\NVSPCAPS

Not all of the values within this subkey are formatted as a variable name, but most are and the others can be discovered by tracking program events or inspecting code.  The values are all binary format, which means they are little-endian hex.

Here are a couple of interesting keys :

Quote

m7Yhs4x6 => The data of this value is the bitrate selected in custom video mode
DwmEnabled => is set to “01 00 00 00”  when “Allow desktop capture” is checked

 
 

3PkPmo7.png

Spoiler
Quote

The heart of Shadowplay is nvspcaps.exe and none of the services listed above are required to use Shadowplay;  however the Streamer Service must be started if you wish to use the gui power button to start and stop Shadowplay.

Before using the methods below you must turn on Shadowplay at least once with the GFE program.

Once you have met the requirement above you may manage nvspcaps with a simple set of commands !  No services needed !


Starting Shadowplay

Quote

64 Bit example
C:\Windows\system32\rundll32.exe C:\Windows\system32\nvspcap64.dll,ShadowPlayEnable

 
Stopping Shadowplay
Quote

64 Bit example
C:\Windows\system32\rundll32.exe C:\Windows\system32\nvspcap64.dll,ShadowPlayDisable


Restart Desktop Window Manager ( dwm.exe ) only required once per session when using desktop capture
Quote
TASKKILL /F /IM dwm.exe                ( must be run as Administrator )

 



Additional processes
NvBackend.exe is started when you open the GFExperience program, but is not required to use Shadowplay.
This can be shutdown manually calling the process via shortcut ( or other means ) with the argument “ –shutdown”  
Here is a shortcut target example:
Quote

"C:\Program Files\NVIDIA Corporation\Update Core\NvBackend.exe" --shutdown

 


The commands above can be run from a batch file or even from the Run Command window.
( I have included a sample set of batch files as well as a small program to serve as an example )


ManagingSP_batch_files.zip
 

ManagingSP_sample_program.zip

 

 

 


 

 

dFaWsu0.png

Spoiler
Quote

There is more than one way to enable Shadowplay in the GFExperience interface even when you’re offline or Nvidia servers are down. ( The capture process nvspcaps.exe does not seem to be affected by being offline )

For now let’s just use the easiest way which is a simple registry entry.  ( it is a string value )

 

Quote

[HKEY_LOCAL_MACHINE\SOFTWARE\NVIDIA Corporation\Global\GFExperience]
"EBAB9D1E-3AF5-404B-8A15-135D426656B1"="1"

 

Quote

GFExperience reads this registry entry during startup to check for the Shadowplay override.

( I have included a .reg file that will allow you to try the override )
SP_override.zip





( OPTIONAL ) Blocking GFExperience ( forcing offline )

!!! Warning !!!  This is only for advanced users that wish to keep GFExperience and its assorted processes from transmitting data to nvidia servers.  This method will block the main nvidia.com domain and cause a lot of problems if you don’t know what you’re doing. !!! Warning !!!

Here is a basic list of domains to block that relate to GFExperience

 

Quote

 

Quote

gfwsl.geforce.com
www.nvidia.com
gfe.nvidia.com
download-cdn.gfe.nvidia.com
download.gfe.nvidia.com

 

If you block these domains and enable the Shadowplay override you can prevent GFE from calling home and still be able to configure Shadowplay in the interface.

 

 


 

915LVNp.png

Spoiler
Quote

*** As of version 2.4.1.21 the bitrate is now 192 Kbps by default  ***

 

The information below applies to ver. 2.2.2.0 and older.

Background information : Shadowplay uses the AAC Encoder included with windows for audio encoding and by default it uses 96 Kbps as the bitrate.  More information is available on the MSDN page.

https://msdn.microsoft.com/en-us/library/windows/desktop/dd742785(v=vs.85).aspx

The bitrate is variable, but may not be sufficient for every user at 96 Kbps.  Fortunately we don’t have to stay at that setting !   With a simple hex edit you can change that value to one of the 4 available :   96, 128, 160, 192

The default as we know is 96, but the encoder expects one of the supported UINT32 values, which means its 12000.
If we convert the int32 to Hex, we get 2E E0 and finally flip the values around to make them little-endian = E0 2E.
Using either a hex editor or debugger, one can find and modify the value in nvspcaps to what they wish.
Here is an example of what it looks like in 32 bit nvspcaps :

8fXYTPV.png

         
 

For people that are not familiar with editing executables I have included an aac package that will allow you to easily make the changes yourself.

aac_package.zip

 

 

 

All download links ( same as the ones above in the article )

ManagingSP_sample_program.zip

ManagingSP_batch_files.zip

aac_package.zip

SP_override.zip




Disclaimer
--------------------------

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

Link to comment
Share on other sites

Link to post
Share on other sites

I never got Shadow Play to work for me, and I think it has something due to me disabling Streamer Service. I disabled it since it has been known to cause BSOD in windows 8.1 Is it safe to renable it now so I can use Shadowplay? Did they fix this problem?

 eGPU Setup: Macbook Pro 13" 16GB DDR3 RAM, 512GB SSD, i5 3210M, GTX 980 eGPU

New PC: i7-4790k, Corsair H100iGTX, ASrock Fatal1ty Z97 Killer, 24GB Ram, 850 EVO 256GB SSD, 1TB HDD, GTX 1080 Fractal Design R4, EVGA Supernova G2 650W

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

I never got Shadow Play to work for me, and I think it has something due to me disabling Streamer Service. I disabled it since it has been known to cause BSOD in windows 8.1 Is it safe to renable it now so I can use Shadowplay? Did they fix this problem?

SP works fine for me on 8.1

Try uninstalling the old version if you still have it and install the latest one from here

http://www.geforce.com/geforce-experience/download

You will need the Streamer Service running if you want to start shadowplay with the GFE interface.

If that doesn't work try the GFE forums : https://forums.geforce.com/default/board/110/

Link to comment
Share on other sites

Link to post
Share on other sites

But ShadowPlay doesn't record or stream in 4:3 stretched, so, it's a no go already. 

What do they know of England, who only England know?

"Well that's what I always said I wanted to be remembered for, for being honest. Nothing else is worth a damn"
 

 

Link to comment
Share on other sites

Link to post
Share on other sites

  • 2 weeks later...

Anyone worked out how to assign a hotkey to flick the switch on in the shadowplay menu?

Link to comment
Share on other sites

Link to post
Share on other sites

Anyone worked out how to assign a hotkey to flick the switch on in the shadowplay menu?

If you look at the examples under Managing Shadowplay, that is basically what is happening when you toggle the switch ( with desktop capture OFF ).  If you have desktop capture on, GFE will execute the dll command and also restart / kill the dwm.exe process.

You could use a desktop shortcut or autohotkey or some other program to create a hotkey for starting / stopping SP with those commands.  If you need to restart dwm you may use this command ( run as Administrator )

 

TASKKILL /F /IM dwm.exe

 

Link to comment
Share on other sites

Link to post
Share on other sites

Can you get shadowplay to record windows or should I just work around it by recording and then cropping the video to the window I want recorded?

Link to comment
Share on other sites

Link to post
Share on other sites

Can you get shadowplay to record windows or should I just work around it by recording and then cropping the video to the window I want recorded?

I'm not sure if Shadowplay has this ability yet, so for now you have to record the desktop and crop the video afterwards.  It is technically possible though, as I've seen Steam's In-home Streaming accomplish this with NVFBC / NVIFR.

Link to comment
Share on other sites

Link to post
Share on other sites

  • 10 months later...

What type of registry entry (string, binary etc?) should we use to create the registry entry to make shadowplay work when offline? Thanks in advance :)

Im referring to this;
" [HKEY_LOCAL_MACHINE\SOFTWARE\NVIDIA Corporation\Global\GFExperience]
"EBAB9D1E-3AF5-404B-8A15-135D426656B1"="1" "

Link to comment
Share on other sites

Link to post
Share on other sites

  • 1 month later...

The registry override is a string value or reg_sz
The files from the guide are now attachments, so you can just get the reg file if you wish.

Sorry for the late reply, but I never thought I'd get any more questions.

Link to comment
Share on other sites

Link to post
Share on other sites

  • 3 years later...
On 3/29/2016 at 10:53 AM, bit_drifter said:

The registry override is a string value or reg_sz
The files from the guide are now attachments, so you can just get the reg file if you wish.

Sorry for the late reply, but I never thought I'd get any more questions.

Sorry for necroing this thread :P. Thanks for all your info!


Unfortunately, the guys at Nvidia removed the exports from nvspcap64.dll back in 2015/2016 and there is no easy way now to disable/enable SP that I know of. I need it to prevent my backup software from backing up 10gb of SP recordings daily, as it copies the disk blocks (and I don't shut down my PC).

 

After wasting so many hours reversing that b*tch that is the only way I found:

 

typedef int(WINAPI * nvspapi_15_t)(int a1, int a2, const wchar_t* parameters, int a4); //parameters = L"-org=ServiceRestart" L"-org=DriverReload", but can be 0, its basically (HWND hwnd, HINSTANCE hinst, LPWSTR lpszCmdLine, int nCmdShow); but unfortunately as its unicode can't be called with rundll32
nvspapi_15_t pfnnvspapi_15; = (nvspapi_15_t)GetProcAddress(LoadLibrary(L"C:\\Program Files (x86)\\NVIDIA Corporation\\ShadowPlay\\nvspapi.dll"), MAKEINTRESOURCEA(15));
pfnnvspapi_15(0, 0, L"-org=DriverReload", 0);

There are a few ordinal exports (13, 15) you can call with "-org=DriverReload", this will disable ShadowPlay and reload the driver, which is pretty fast, and it deletes the cache. Unfortunately it enables SP again, but you could call that function in an interval.

 

Basically it disables ShadowPlay before the driver reload and it ends up calling a function in ipccommon.dll. At that point I already wasted too much time, but if anyone wants to give it a go, please report your findings back here :D. I'm sure you just need to create the interface with CreateShadowPlayApiInterface and call the right function  (CShadowPlayApi::DisableShadowPlay)

Link to comment
Share on other sites

Link to post
Share on other sites

  • 11 months later...

Sorry for necroing this thread for the second time :P

I figured lots from CreateShadowPlayApiInterface interface as well as disable\enable shadowplay you can look it up here https://github.com/cm-pony/Experienceless/blob/master/Experienceless/SPApi.cs 

At this point I'm looking for a way to do shadowplay stuff without installing GFE, like a minimum requirement for it to work.

I know you can disable Telemetry service, but you should be running NvContainerLocalSystem and NvContainerNetworkService services and can disable Telemetry plugin within

eg

net stop NvTelemetryContainer
sc delete NvTelemetryContainer

net stop NvContainerLocalSystem
sc delete NvContainerLocalSystem
sc create NvContainerLocalSystem binPath="\"C:\Program Files\NVIDIA Corporation\NvContainer\nvcontainer.exe\" -s NvContainerLocalSystem -a -f \"C:\ProgramData\NVIDIA\NvContainerLocalSystem.log\" -l 3 -d \"C:\Program Files\NVIDIA Corporation\NvContainer\plugins\LocalSystem\" -r -p 30000" start=auto

net stop NvContainerNetworkService
sc delete NvContainerNetworkService
sc create NvContainerNetworkService binPath="\"C:\Program Files\NVIDIA Corporation\NvContainer\nvcontainer.exe\" -s NvContainerNetworkService -f \"C:\ProgramData\NVIDIA\NvContainerNetworkService.log\" -l 3 -d \"C:\Program Files\NVIDIA Corporation\NvContainer\plugins\NetworkService\" -r -p 30000" obj="NT AUTHORITY\NetworkService"
pause

 

Link to comment
Share on other sites

Link to post
Share on other sites

4 hours ago, rainberry said:

Sorry for necroing this thread for the second time :P

I figured lots from CreateShadowPlayApiInterface interface as well as disable\enable shadowplay you can look it up here https://github.com/cm-pony/Experienceless/blob/master/Experienceless/SPApi.cs 

At this point I'm looking for a way to do shadowplay stuff without installing GFE, like a minimum requirement for it to work.

I know you can disable Telemetry service, but you should be running NvContainerLocalSystem and NvContainerNetworkService services and can disable Telemetry plugin within

eg


net stop NvTelemetryContainer
sc delete NvTelemetryContainer

net stop NvContainerLocalSystem
sc delete NvContainerLocalSystem
sc create NvContainerLocalSystem binPath="\"C:\Program Files\NVIDIA Corporation\NvContainer\nvcontainer.exe\" -s NvContainerLocalSystem -a -f \"C:\ProgramData\NVIDIA\NvContainerLocalSystem.log\" -l 3 -d \"C:\Program Files\NVIDIA Corporation\NvContainer\plugins\LocalSystem\" -r -p 30000" start=auto

net stop NvContainerNetworkService
sc delete NvContainerNetworkService
sc create NvContainerNetworkService binPath="\"C:\Program Files\NVIDIA Corporation\NvContainer\nvcontainer.exe\" -s NvContainerNetworkService -f \"C:\ProgramData\NVIDIA\NvContainerNetworkService.log\" -l 3 -d \"C:\Program Files\NVIDIA Corporation\NvContainer\plugins\NetworkService\" -r -p 30000" obj="NT AUTHORITY\NetworkService"
pause

 

 

Awesome! You put a lot of work into it. Exactly what I needed. I solved my backup problem by just moving the Shadowplay folder to another disk with backups disabled, but possibly I could use it for something else. If you use certain DRM protected apps, eg. Netflix from the Windows store, it immediately disables ShadowPlay once you play a show. I think it even resets some of your settings (Shadowplay folder, cache folder), its ridiculous. With your tool I could restore those settings or alternatively, hook the API itself to prevent the DRM from working :)

 

What was your motivation to start this tool? Just to not install any Nvidia stuff?

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, Meleur said:

What was your motivation to start this tool? Just to not install any Nvidia stuff?

Yeah, I just wanna something to record replays without running nodejs server in background and I'm not interested in other features from GFE.

I'm also just curious in reverse engineering but have zero experience, tried many times with other programs but just gave up eventually.

Link to comment
Share on other sites

Link to post
Share on other sites

3 minutes ago, rainberry said:

Yeah, I just wanna something to record replays without running nodejs server in background and I'm not interested in other features from GFE.

I'm also just curious in reverse engineering but have zero experience, tried many times with other programs but just gave up eventually.

Well, you figured the structures, I would call that reverse engineering :P

Link to comment
Share on other sites

Link to post
Share on other sites

  • 1 year later...

@bit_drifter Any way we could force ShadowPlay to use lossless PCM audio instead of AAC?
or perhaps disable surround sound downmixing to stereo and preserve all channels as-is?

Link to comment
Share on other sites

Link to post
Share on other sites

  • 1 year later...

Recently Shadowplay Instant Replay has not been detecting games correctly. I think I have the startings of how to get around this by reading a Steam reg key that shows what game by ID is running. I plan to just have the privacy switch for capture disabled so it captures the entire screen. But can not figure out a way to start and stop Instant Replay. I have even found a reg key that tells me if it's on or off. But changing said key does not enable and disable it... Does anyone know how to enable end disable Shadowplay Instant Replay?

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×