Advertisement
dark_skeleton

Razer THX service restart script v1.5

Oct 17th, 2019 (edited)
9,670
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @ECHO off
  2. :: Script by /u/dark_skeleton updated on March 26th, 2021
  3.  
  4. :: Hey! Thanks for reading. /u/dark_skeleton here, if you notice any bugs contact me on reddit!
  5. :: This script will attempt to fix:
  6. :: - Broken THX audio.
  7. :: - No THX audio output.
  8. :: - Muffled THX sound.
  9. :: - Extremely bassy THX sound.
  10. :: - Greyed out app list in Synapse Mixer tab.
  11. :: - Synapse not actually toggling Stereo/Surround on Mixer tab
  12. :: - High CPU usage by Windows Audio Device Graph Isolation (as a side-effect lol, might be faster to just kill the task sometimes).
  13.  
  14. :: Please note that this script is not omnipotent and you might have to execute it any time you realize THX breaks
  15. ::        since Synapse is still buggy and that's probably not going away anytime soon.
  16. :: Supported headsets
  17. :: - Nari Essential, Nari Wireless, Nari Ultimate
  18. :: - Kraken TE, Kraken Ultimate
  19. :: - Razer 7.1 Surround standalone app
  20.  
  21. :: Changelog:
  22. :: v1.2 - I literally don't remember
  23. :: v1.3 - Sped up execution by removing a bunch of delays and skipping restarting Razer Central and other stuff that wasn't affecting audio
  24. :: v1.4 - Had to bring back restarting Windows Audio service, as some people (incl. myself) reported mixed results every now and then. Sadly this means all audio will stop for a second and some games might crash
  25. :: v1.5 - Added standalone 7.1 Surround app support
  26.  
  27. SC QUERY THXService > NUL
  28. IF NOT ERRORLEVEL 0 GOTO SOPHIE
  29.  
  30. :SYNAPSE3
  31. :: Synapse-based THX stuff
  32.  
  33. ECHO Now stopping Synapse services...
  34. NET STOP THXService /Y > NUL
  35. NET STOP "Razer Synapse Service" /Y > NUL
  36. TASKKILL /F /IM "Razer Synapse*" 2> NUL
  37. TASKKILL /F /IM THXHelper* 2> NUL
  38.  
  39. :: 051A is THX for Nari Ultimate
  40. :: 051C is THX for Nari
  41. :: 0520 is THX for Kraken TE
  42. :: 0527 is THX for Kraken Ultimate
  43. :: 22AD seems common for all headsets except standalone version of the THX Surround app
  44. :: For standalone we need to kill RZSurroundHelper.exe, RzSndSrv service, and rzappengine.exe
  45. :: If you have a headset that's not listed above, please contact me on reddit! I will need your help to add it so please be prepared to answer some questions
  46. TIMEOUT 5
  47. ECHO Now starting Synapse services back up...
  48. FOR %%d IN ( 051A 051C 0520 0527 ) DO (
  49.     IF EXIST "C:\Program Files (x86)\Razer\APO%%dDrv\Drivers\x64\THXHelper%%d.exe" (
  50.         START "" "C:\Program Files (x86)\Razer\APO%%dDrv\Drivers\x64\THXHelper%%d.exe" > NUL
  51.   )
  52. )
  53. IF EXIST "C:\Program Files (x86)\Razer\THXVAD\Drivers\x64\THXHelper22AD.exe" (
  54.     START "" "C:\Program Files (x86)\Razer\THXVAD\Drivers\x64\THXHelper22AD.exe" > NUL
  55. )
  56.  
  57. NET START THXService /Y > NUL
  58. :: Synapse likes not starting up within required time window so just ignore all messages altogether
  59. NET START "Razer Synapse Service" 1> NUL 2>&1
  60. START "" "C:\Program Files (x86)\Razer\Synapse3\WPFUI\Framework\Razer Synapse 3 Host\Razer Synapse 3.exe" > NUL
  61.  
  62. :SOPHIE
  63. :: Standalone THX stuff
  64. SC QUERY RzSndSrv > NUL
  65. IF NOT ERRORLEVEL 0 GOTO ALL
  66.  
  67. ECHO Now stopping 7.1 Surround services...
  68. TASKKILL /F /IM rzappengine.exe* 2> NUL
  69. TASKKILL /F /IM RZSurroundHelper.exe* 2> NUL
  70. NET STOP RzSndSrv /Y > NUL
  71.  
  72. ECHO Now starting 7.1 Surround services back up...
  73. IF EXIST "C:\Windows\System32\RZSurroundHelper.exe" START "" "C:\Windows\System32\RZSurroundHelper.exe" > NUL
  74. NET START RzSndSrv /Y > NUL
  75. IF EXIST "C:\Program Files\Razer\RzAppEngine\rzappengine.exe" START "" "C:\Program Files\Razer\RzAppEngine\rzappengine.exe" > NUL
  76.  
  77.  
  78. :ALL
  79. ECHO Almost there... Any sound being played will now stop and you'll need to start playback again! This may crash certain games!
  80. NET STOP Audiosrv /Y > NUL
  81. timeout 3
  82. NET START Audiosrv /Y > NUL
  83.  
  84. ECHO All done - just wait for Synapse to fully restart now. This window will disappear in 3 seconds!
  85. TIMEOUT 3
  86.  
  87. :: Run one last thing, sometimes CPU usage spikes here
  88. TASKKILL /F /IM audiodg.exe 2> NUL
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement