Verpous / AlwaysShadow

Makes sure Shadowplay's Instant Replay feature is on.
GNU General Public License v3.0
131 stars 3 forks source link

Instant replay keeps enabling/disabling when watching Netflix and input language changes? #1

Closed xPokerr closed 7 months ago

xPokerr commented 2 years ago

I've added both Netflix processes to the "Whitelist.txt" file but AlwaysShadow keeps trying to enable Instant Replay when watching Netflix and keeps changing my input language to English instead of keeping default language.

Verpous commented 2 years ago

For the whitelist issue, it's hard for me to help you but I can ask you to verify that the line for the Netflix process in your whitelist matches its command line according to what you see in Task Manager exactly. Also, make sure that you restart AlwaysShadow after modifying the whitelist. I can also tell you that I didn't need to add more than one process to my list to block Netflix, even though Netflix does run several process, so maybe you just need to find the right one. If this issue only happens to you rarely and not every time you run Netflix, then you can manually disable AlwaysShadow when it happens.

As for the language switch, it happened to me too and it's because the default shortcut for toggling Shadowplay is Alt+Shift+F10 which contains Alt+Shift which changes languages. I solved this by changing the shortcut to toggle Shadowplay (I use Ctrl+Shift+F10). Make sure to restart AlwaysShadow after changing the shortcut.

rhipex commented 2 years ago

Hi, I was not able to get it to work, until I realized that you need to have a shortcut set for instant replay on/off. I had the shortcut disabled and it was not working. After I set it to Ctrl+Shift+F10 it started working. Thank you!

benedlore commented 2 years ago

Is there any way to just keep it running even if netflix is open in a tab? Many times I will have a paused video on netflix or paused song on spotify open somewhere buried in all my browser tabs while I'm gaming, and it prevents replay from being enabled even though those tabs were paused and the replay would not contain any protected content. It's making nvidia instant replay unusable. Perhaps you could point me in the direction of modifying my browser or replay directly to stop this annoying behavior (and no, I am not trying to use instant replay to "steal" music from spotify lol, since 2005 anyone could download audacity and record their speaker output if they really wanted to do that).

AvivEdery commented 2 years ago

@benedlore I don't have ideas for solving your problem, sorry.

jonymer commented 2 years ago

@AvivEdery damn I was hoping this program could solve this issue with having crunchyroll or netflix in the background.

ttactivau commented 2 years ago

Whitelist for Netflix does not work, need help to solve it please. All I need to do is just to inicialize executable and drag the Whitelist.txt file ?

Edit:

Okay, i think I found the solution, the line : "C:\WINDOWS\system32\wwahost.exe" -ServerName:Netflix.App.wwa.bt

I have changed the WINDOWS word for Windows like: "C:\windows\system32\wwahost.exe" -ServerName:Netflix.App.wwa.bt

If anyone fix like this reply me please

PolicyPuma4 commented 1 year ago

For the whitelist issue, it's hard for me to help you but I can ask you to verify that the line for the Netflix process in your whitelist matches its command line according to what you see in Task Manager exactly. Also, make sure that you restart AlwaysShadow after modifying the whitelist. I can also tell you that I didn't need to add more than one process to my list to block Netflix, even though Netflix does run several process, so maybe you just need to find the right one. If this issue only happens to you rarely and not every time you run Netflix, then you can manually disable AlwaysShadow when it happens.

As for the language switch, it happened to me too and it's because the default shortcut for toggling Shadowplay is Alt+Shift+F10 which contains Alt+Shift which changes languages. I solved this by changing the shortcut to toggle Shadowplay (I use Ctrl+Shift+F10). Make sure to restart AlwaysShadow after changing the shortcut.

FYI ShadowPlay has a local webserver running which can be used to do a plethera of things, including getting and setting the current Instant Replay state. @cm_pony explains here. I'd imagine this would be a more reliable way to fetch and post the Instant Replay state.

PolicyPuma4 commented 1 year ago

For anyone experiencing this issue still, I've gone ahead and created PersistentInstant, a teeny tiny app that does exactly what AlwaysShadow does, however it doesn't rely on using hotkeys to enable Instant Replay, so it will not change your input language or trigger any other hotkeys.

If you still experience the Netflix issue on PersistentInstant, do let me know and I'll investigate further.

Verpous commented 1 year ago

@PolicyPuma4 Looks like I've got competition! Thanks for the resources, maybe I'll change AlwaysShadow to use it sometime. It's just a little outside my comfort zone so I will need to find a time when I feel like learning it.

PolicyPuma4 commented 1 year ago

@PolicyPuma4 Looks like I've got competition! Thanks for the resources, maybe I'll change AlwaysShadow to use it sometime. It's just a little outside my comfort zone so I will need to find a time when I feel like learning it.

To enable Instant Replay via the HTTP API, you must send a POST request to http://localhost:<port>/ShadowPlay/v.1.0/InstantReplay/Enable with a header X_LOCAL_SECURITY_COOKIE set as <secret> and the body set as {"status":true}. <port> and <secret> are both located in a memory mapped file which ShadowPlay creates.

While making a HTTP request in C is no trivial task, and I haven't taken on that challenge just yet, with my couple hours of learning C, I have managed to extract the <port> and <secret> from the memory mapped file.

```c #include #include void substr(char *dest, char *source, int start, int length) { memcpy(dest, source + start, length); dest[length] = '\0'; } int main() { HANDLE mapHandle = OpenFileMapping(FILE_MAP_READ, FALSE, "{8BA1E16C-FC54-4595-9782-E370A5FBE8DA}"); if (mapHandle == NULL) { return 1; } LPVOID mapView = MapViewOfFile(mapHandle, FILE_MAP_READ, 0, 0, 0); if (mapView == NULL) { CloseHandle(mapHandle); return 1; } char *pMapping = (char *)mapView; if (strlen(pMapping) != 58) { return 1; } char str[strlen(pMapping) + 1]; strcpy(str, pMapping); UnmapViewOfFile(mapView); CloseHandle(mapHandle); char port[5 + 1]; substr(port, str, 8, 5); char secret[32 + 1]; substr(secret, str, 24, 32); printf("%s, %s\n", port, secret); return 0; } ```
Verpous commented 7 months ago

@PolicyPuma4 I just released a new version which uses this method, using libcurl to do some heavy lifting. Thanks!