PDA

View Full Version : My modified ReClock script to automatically change refresh rate without PowerStrip


cbemoore
10th September 2008, 14:29
ReClock includes a VB script which can automatically change resolution and refresh rate using PowerStrip.

Traditionally, PowerStrip has been the only way to create custom resolutions. But now, this functionality has been added to the latest NVidia drivers. So instead of using PowerStrip, you can create your custom resolutions using the NVidia drivers, and then use a small program called DisplayChanger (aka ResChange) to select a particular resolution.

So here's my steps to get this working with ReClock:

1) Create your custom resolutions using the NVidia control panel. I created the following custom resolutions:

1280x720 48Hz (Cinema)
1280x720 50Hz (PAL)
1280x720 60Hz (NTSC)

2) Copy the attached RunEvent.vbs script to your "C:\Program Files\ReClock" directory.

3) Download DisplayChanger from this link (http://www.12noon.com/index.htm), and store dc.exe in the following path: "C:\Program Files\DisplayChanger\dc.exe".

4) In the ReClock configuration program, select "Enable event notifications to VBS script when display mode is changing".

Now, when you start a video with a non-matching refresh rate, the script should automatically run, and set the resolution and refresh rate to the correct value.

If you want to use different refresh rates or resolutions, you can easily modify the script - it should be quite self-explanatory.

I've only come across one minor bug so far - the ReClock tray icon stays yellow after the resolution has changed, even though ReClock itself is working correctly. See my bug report here (http://forum.slysoft.com/showpost.php?p=130510&postcount=261) for details.

Good luck - let me know if it works for you!

Chris

theshadowrunner
10th September 2008, 14:56
You don't even need this if you're on a nvidia card.
just use:
If currentRefreshRate <> "48" Then WshShell.Run ("""rundll32.exe""nvcpl.dll,dtcfg setmode 1 1920 1080 32 48")
(this exemple switches to 1920x1080@48hz on first monitor)
adapt to your needs of course.
Later,

TSR
edit: of course you must create the rez first in nvidia panel before it works with this command line

cbemoore
10th September 2008, 15:18
You don't even need this if you're on a nvidia card.
just use:
If currentRefreshRate <> "48" Then WshShell.Run ("""rundll32.exe""nvcpl.dll,dtcfg setmode 1 1920 1080 32 48")
(this exemple switches to 1920x1080@48hz on first monitor)
adapt to your needs of course.
Later,

TSR
edit: of course you must create the rez first in nvidia panel before it works with this command line

I didn't realise you could do that!!

But as you say, that would be strictly for NVidia drivers. I guess an advantage of my script is that it should work with any graphics drivers, so long as the drivers allow you to create your desired resolution....

Mark_A_W
11th September 2008, 02:42
Can you get the same 3 decimal place control of the refresh rate than you can in Powerstrip?

sanderh
11th September 2008, 03:01
why would someone skip the more accurate powerstrip for this?

Mark_A_W
11th September 2008, 03:08
Because Powerstrip doesn't work with newer Nvidia cards.

sanderh
11th September 2008, 03:13
I assume Rick Wang is working on version that s compatible. Powerstrip has always been up-to-date. But for the time-beeing I have to agree that it is a good solution.

I own the 7600GT so no troubles here with powerstrip!

Mark_A_W
11th September 2008, 03:29
Unless something has changed in the last few months, Powerstrip cannot work with 8 and 9 series Nvidia cards because Nvidia doesn't want it to.

Rik is powerless.

(I have just browsed the Powerstrip forum, and there is occasional mention of later Nvidia cards, but I couldn't find anything definitive.)

James
12th September 2008, 04:47
3) Download DisplayChanger from this link (http://www.12noon.com/index.htm), and store dc.exe in the following path: "C:\Program Files\DisplayChanger\dc.exe".

You could use the wonderful SlySoft program "SetDisplayFrequency" instead. Comes with every AnyDVD installation.

e.g.

SetDisplayFrequency 60
SetDisplayFrequency 50
SetDisplayFrequency 48

optional /keep parameter to keep the frequency across reboots

leeperry
12th September 2008, 12:47
Powerstrip cannot work with 8 and 9 series Nvidia cards
there is experimental GF8/9 support in the latest builds ;)

protovision
17th September 2008, 13:55
With HD DVD/Blu feature movies, which speed should I be trying to achieve on my LCD, 23.976 or 24.0 hz ?

I have it at 24hz now, but I get a small skipped frame every 3- 5 secs if I look close.

If 23.976, does SetDisplayFrequency allow for decimals?

Jong
17th September 2008, 14:02
"Nearly all" are actually 23.976. I hear that 24fps is allowed for but I haven't seen any using it. Slysoft with their much wider collection of discs may know some.

James
17th September 2008, 14:26
With HD DVD/Blu feature movies, which speed should I be trying to achieve on my LCD, 23.976 or 24.0 hz ?

I have it at 24hz now, but I get a small skipped frame every 3- 5 secs if I look close.

You shouldn't if you use ReClock correctly, as it will play the stream synced to you refresh rate.


If 23.976, does SetDisplayFrequency allow for decimals?
No. This is the GDI refresh rate (an integer). The actual refresh rate will be the rate assigned to the integer value.

Jong
17th September 2008, 14:30
You shouldn't if you use ReClock correctly, as it will play the stream synced to you refresh rate.Not quite true. For the last 2 years I have been sending s/pdifed AC3/DTS to my AV amp, but still using Reclock to sync clocks and auto-switch refresh rates.

If using AC3/DTS output (other than encoded after Reclock e.g. by DTS Connect/Dolby Digital Live) you will get dropped/repeated audio packets if the refresh rates are not spot on (although the video should still be smooth, if your TV can handle it).

James
17th September 2008, 14:37
Not quite true. For the last 2 years I have been sending s/pdifed AC3/DTS to my AV amp, but still using Reclock to sync clocks and auto-switch refresh rates.

If using AC3/DTS output (other than encoded after Reclock e.g. by DTS Connect/Dolby Digital Live) you will get dropped/repeated audio packets if the refresh rates are not spot on (although the video should still be smooth, if your TV can handle it).

You're right, but you really, really shouldn't use ReClock with SPDIF. It sucks. It doesn't work well. Never did. Until I'll add an AC3 encoder to ReClock, SPDIF should be avoided, or a soundcard with real time DTS or AC3 encoding should be used.

Jong
17th September 2008, 14:54
I think this might be a case of YMMV.

Honestly, it seemed to work perfectly here for the last couple of years, with very finely tuned 50Hz and 48.952 timings, although now with multi-channel LPCM I am converting to PCM. :clap:

James
17th September 2008, 15:03
I think this might be a case of YMMV.
Certainly. I'll prefer a (good) analogue multi channel connection over SPDIF with ReClock anytime.


Honestly, it seemed to work perfectly here for the last couple of years, with very finely tuned 50Hz and 48.952 timings, although now with multi-channel LPCM I am converting to PCM. :clap:
Wise move. I had high hopes for the new ATI 4xxx cards with 8 channel LPCM output over HDMI, but ATI managed to screw things up ... again. In 7.1 channel configuration they have swapped the side & back surround assignment. :mad: And with 24fps the driver behaves .... weird. Can't describe it much better. And PowerStrip timings are a "no go", because audio over HDMI doesn't work with "non out-of-the-box" timings, e.g. 48Hz.

Jong
17th September 2008, 15:18
And PowerStrip timings are a "no go", because audio over HDMI doesn't work with "non out-of-the-box" timings, e.g. 48Hz.
Very interesting!! I did not know that. Why does this stuff have to be so hard!! It is always one step forward and 9/10th of a step back (sometimes more!). Is this a linitation of just the ATI cards or all HDMI audio?

James
17th September 2008, 15:35
Very interesting!! I did not know that. Why does this stuff have to be so hard!! It is always one step forward and 9/10th of a step back (sometimes more!). Is this a linitation of just the ATI cards or all HDMI audio?
I don't know. But it does make (at least a little bit) of sense, as video & audio are transported via the same digital stream. If you use PowerStrip to alter the video timings (but the "audio part" doesn't know?) you'll get silence. You *can* alter the timings a little bit with ReClock, e.g. setting the ATI card to 24fps and then using PowerStrip to tweak it to 23.98. But setting the card to 60fps and then applying the PowerStrip 23.98 timing will cause silence.

It is also possible, the amplifier - which has to separate video & audio from the data stream - cannot do this with "non standard" timings which are very different from the standard HDTV timings (24p,25p,50p/i, 60p/i).

But the most annoying bug is the switch of the side/back surround channels. In the end, I'll have to use .... analogue sound connections to watch the Dark City director's cut BD with 7.1 audio... because with HDMI you can't simply "switch" the wrong channels through re-wiring the audio cables. :bang:

Jong
17th September 2008, 17:25
Makes me glad I stuck with 5.1 sound!

Anyway, your new product has persuaded me to go with PCM and DDL (which I already had) for now and hope that the ATI 5xxx series will give me glorious HD audio. If not, I guess I will have to go back to the stone age and get a good analogue sound card.

James
17th September 2008, 20:11
Makes me glad I stuck with 5.1 sound!

Anyway, your new product has persuaded me to go with PCM and DDL (which I already had) for now and hope that the ATI 5xxx series will give me glorious HD audio. If not, I guess I will have to go back to the stone age and get a good analogue sound card.

Well, the ATI 4xxx series give you glorious HD sound in 5.1 (or 7.1 with swapped surround channels)

Jong
18th September 2008, 04:03
If you don't want to use Powerstrip.

leeperry
18th September 2008, 09:31
I don't know. But it does make (at least a little bit) of sense, as video & audio are transported via the same digital stream. If you use PowerStrip to alter the video timings (but the "audio part" doesn't know?) you'll get silence. You *can* alter the timings a little bit with ReClock, e.g. setting the ATI card to 24fps and then using PowerStrip to tweak it to 23.98. But setting the card to 60fps and then applying the PowerStrip 23.98 timing will cause silence.
yes, pstrip tech support was very puzzled by this :
http://forums.entechtaiwan.net/viewtopic.php?t=6320

at some point, pstrip will be rendered useless with all this b/s :(

ashlar
18th September 2008, 09:34
Which is the reason why I tend to prefer analogue solutions. Less chances to **** them up with tech BS.

DrinkLyeAndDie
18th September 2008, 11:31
Which is the reason why I tend to prefer analogue solutions. Less chances to **** them up with tech BS.

In the future, please watch your language. I "fixed" your post.

bakerpr
18th September 2008, 14:34
Not quite sure what I am doing wrong but I can't work out why reclock won't use the script properly.
All that happens when I load a file in MPC is that I get numerous copies of the script open in notepad with no effect on the resolution.
Would I have a problem because I ues duel cloned outputs from my nvidia 8600GT.
Could someone please indicate the items which need to be altered in the script.

bakerpr
21st September 2008, 06:26
Thought I had cracked it by changing the Default program that is set to open the RunEvent.vbs fle to the windows based script host rather than Notepad which I used to modify the script.
However although this allows MPC to ru without crashing it does not change the refresh rate on the fly as I'd hoped.
To add some more info I am ruuning Vista 32 Home Premium with 175.16 Nvidia driver.

The custom resolutions I have created are as follows:

1368 x 768 at 50.0Hz (50Hz as reported by OS) - For Pal
1368 x 768 at 60.0Hz (60Hz as reported by OS) - For ntsc
1368 x 768 at 71.93Hz (72Hz as reported by OS) - For cinema

I have attached my modified script file. hopefully someone can spot a stupid error I have made.

bakerpr
24th September 2008, 17:22
Don't quite know why I hadb problems but everything seems to work fine now.
I did change the default program and reboot.

Can anyone advise whether it is possible to use a similr method to run a dual monitor system with different resolution requirements.

rickdry
29th September 2008, 18:48
I am no vbscript expert am newbie to syntax required ...I want to use the direct approach so can someone assist me to this using the variables in the script with the nvidia approach

If currentRefreshRate <> newrefreshrate Then WshShell.Run ("""rundll32.exe""nvcpl.dll,dtcfg setmode 1 "newWidth" "newheight" 32 "newrefreshrate"")
End If


where newrefresh newwidth newheight are the varaibles in your script

Thanks Rick

theshadowrunner
29th September 2008, 18:50
And hmm what is the question Rick?

rickdry
29th September 2008, 21:41
Question is would that syntax above work?

theshadowrunner
29th September 2008, 22:34
I'm not sure what you mean.

The following is a nvidia thing:

Format: rundll32.exe NvCpl.dll,dtcfg setmode <display#> <hres> <vres> <bpp> <freq>

Example rundll32.exe NvCpl.dll,dtcfg setmode 1 1024 768 32 75
Sets display #1 to 1024x768x32 @75Hz.

It will ONLY work if this resolution is already setup/already exists.(ie, if you are already able to switch to this resolution manually in windows "display properties")

You have to specify <display#> <hres> <vres> <bpp> <freq> manually for each cases in your RunEvent.
<display#> <hres> <vres> <bpp> <freq> cannot/will not be filled automatically/dynamically by ReClock/RunEvent.

I hope that answers your question.
Later,

TSR

Drez
30th September 2008, 07:24
I believe the syntax only works in XP, not in Vista.

rickdry
30th September 2008, 21:12
Ok maybe some help for me to get this into Girder so I can control everything from there as I can do anything in Girder.

Need some help easiest thing would be just to pass the entire string to girder and deal with it in there.

So I need to call c:\programs\promixis\girder5\event.exe -<event -payload


where event is say "reclock" and the payload will be what is pasted to the vbscript eg.

- YELLOW PAL SPDIF 1 1 1024x768 72 25000 25000 c:\test.avi

effectively passing on the payload state from reclock to girder for actioning.

what VBscript would I need to achieve this? what variable does the payload from reclock show up in?

as then I can use lua and girder to do all i want.

rickdry
30th September 2008, 21:57
tried this but no go

If currentRefreshRate <> newRefreshRate Then

Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(&H26&)
Set objFolderItem = objFolder.Self



WshShell.Run """" & objFolderItem.Path & _
"C:\Program Files\Promixis\Girder\event.exe Reclock"" -refresh=" & newRefreshRate & _



WScript.Quit 0

End If
get syntax error on next line after program path

thanks in advance :)

rickdry
30th September 2008, 23:01
ok progress got this to work
eventg5 = "reclock"
g5device = "18"
' Do we have new timings to apply ?
'If currentRefreshRate <> newRefreshRate Then

Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(&H26&)
Set objFolderItem = objFolder.Self



WshShell.Run """" & objFolderItem.Path & _
"\Promixis\Girder5\event.exe"" " & eventg5 & _
" " & g5device & _
" " & newRefreshRate, 0, true

' In case we did a configuration change we MUST return 0 to
' indicate ReClock it need to recalibrate itself.
WScript.Quit 0

'End If one more question what variable in the script has the entire payload from reclock?

rickdry
30th September 2008, 23:40
ok this works for any girder users
eventg5 = "reclock"
g5device = "18"
' Do we have new timings to apply ?
'If currentRefreshRate <> newRefreshRate Then

Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(&H26&)
Set objFolderItem = objFolder.Self



WshShell.Run """" & objFolderItem.Path & _
"\Promixis\Girder5\event.exe"" " & eventg5 & _
" " & g5device & _
" " & eventName & _
"" & mediaType & _
"" & soundMode & _
"" & currentMonitor & _
"" & totalMonitorCount & _
"" & currentResolution & _
"" & currentRefreshRate & _
"" & originalPlaybackSpeed & _
"" & currentPlaybackSpeed & _
" " & currentMediaFile, 0, true

' In case we did a configuration change we MUST return 0 to
' indicate ReClock it need to recalibrate itself.
WScript.Quit 0

'End If

lixe
9th October 2008, 04:21
I have a problem in Vista Media Center...
With Powerstrip it wordked fine to change timings, but i just want to change the refesh rate, so i tried displaychanger.
In Windows Media Player it works perfectly, but in VMC i only get a black screen after changing and have to close VMC. Until I move the mouse over and it disappears, reclock is showing yellow.
Next thing i've tried was using SetDisplayFrequenzy instead of DisplayChanger, but same problem. And I couldn't find a way like the rundll32.exe nvidia... for ati?!

Here is the last part of my runevent.vbs:
' Do we have new timings to apply ?
If currentRefreshRate <> newRefreshRate Then

Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(&H26&)
Set objFolderItem = objFolder.Self

' Now run DisplayChanger command and wait for it to finish its job
WshShell.Run """" & objFolderItem.Path & _
"\SlySoft\AnyDVD\SetDisplayFrequency.exe"" " & newRefreshRate, 0, true

' In case we did a configuration change we MUST return 0 to
' indicate ReClock it need to recalibrate itself.
WScript.Quit 0

End If

' We have done nothing. Return 1 to indicate ReClock that
' the configuration has not changed
WScript.Quit 1


Does anyone have an idea why my VMC isn't able to change and then play?

TheWho2008
12th October 2008, 09:55
this script should have been great for me but i sometimes use my first display the computer display and when i watch movies on the projector i switch the output in nvidia control panel and only use one display..


is it possible to only when im using the projector to change the Hz ?

sanderh
2nd February 2009, 10:07
I ve read this whole thread but still have some questions concerning auto-detect AND change refresh rate.

I own the ATI HD4350 with the latest driver and use the CCC. In the CCC I made three custom resolutions: 1080p@24Hz, 1080p@25Hz and 1080p@30Hz. Now I want ReClock to automatically detect the refresh rate of the movie and then select the right custom made resolution/refresh rate that I custom made with the CCC.

What is the best and most simple way to do this?

I have to make the extra notice that I do not want to use Powerstrip for this. Reasons are incompatibility of Powerstrip with my card. Even if it worked I don t want to use Powerstrip. I know it is a product to make the most accurate refresh rates and get the closest possible match, but there are more cons in Powerstrip (for ME!) than pros.

Can someone put me in the right direction and tell me step by step what to do for this?

Thanks for all help guys.

noee
2nd February 2009, 10:58
You can use the CCC CLI interface to set profiles if you want to. Set up a profile for each refresh/resolution, then in the RunEvent, you can call the CLI to set the profile.

There are some snipets somewhere that detail this in the RunEvent code. Try the search.

ANother option is to use dc.exe from 12noon. You can see samples of using this on their site. RunEvent code is very similar, you just issue the "DC.exe" with the proper params, there is a snipet for that as well.

Some players have built-in refresh/resolution utils. For example, JRiver's Media Center can change the monitor refresh/reso using the command line:

C:\WINDOWS\system32\MC13.exe /monitorswitch 0:1920x1080x32x24

-or-

C:\WINDOWS\system32\MC13.exe /monitorswitch 0:1920x1080x32x60


So, if your player supports a way to do it, you could use that call in RunEvent or if not, try one of the methods listed above.

Sorry I can't find the links to the code, I know they're here somewhere.

HTH.

sanderh
2nd February 2009, 11:05
My player (MPC-HC) doesn t support auto-detect/change refresh rates. I prefer the first method you mentioned. But I don t know how to set this up exactly. So can someone maybe post how to do this in steps?

thanks guys.

noee
2nd February 2009, 11:22
Well, do you know how to set up a profile in CCC? It's very easy and described in the help file. Set up a profile for each reso/refresh you want.

Then, modify your RunEvent.VBS to call the proper profile. Here is the code from my RunEvent.VBS for calling the CCC CLI to set the desired profile:

'ATI Profile Version - Sets refresh rate using profile interface (CLI).

' Check for args/call
Set objArgs = WScript.Arguments
If objArgs.Count < 10 Then
MsgBox "Bad argument count !", MB_OK, "ReClock Event Notification"
WScript.Quit 1
End If

' Get Parms
eventName = objArgs(0)
mediaType = objArgs(1)
soundMode = objArgs(2)
currentMonitor = objArgs(3)
totalMonitorCount = objArgs(4)
currentResolution = objArgs(5)
currentRefreshRate = objArgs(6)
originalPlaybackSpeed = objArgs(7)
currentPlaybackSpeed = objArgs(8)
currentMediaFile = objArgs(9)

' If you need to debug, replace false with true in the following line
if false Then MsgBox _
eventName & " " & _
mediaType & " " & _
soundMode & " " & _
currentMonitor & " " & _
totalMonitorCount & " " & _
currentResolution & " " & _
currentRefreshRate & " " & _
originalPlaybackSpeed & " " & _
currentPlaybackSpeed, _
MB_OK, "ReClock Event Notification"

newTimings = ""

If eventName = "YELLOW" Then

If soundMode = "PCM" Then

' Call the profile that match best what we need in PCM mode
Select Case mediaType & ":" & currentResolution
Case "CINEMA:1920x1080"
If currentRefreshRate <> "24" Then newtimings = "24p"

Case "NTSC:1920x1080"
If currentRefreshRate <> "60" Then newTimings = "60Hz"
End Select

ElseIf soundMode = "SPDIF" Then

' In SPDIF mode we need an exact multiple to minimize the drops/repeats
' Note: be careful in NTSC mode, because if "currentRefreshRate" is already "60"
' when we go here then we won't switch but it may be 60 "bad" hz instead of 59.94 "wanted" hz
' The same problem exists for NTSC film (23.976fps)
' A solution is to force settings in the GREEN icon notification, but that would mean a pause
' each time we play a file with SPDIF ...
' That's why we use 59.94 hz and 71.928 hz for PCM too so we will never user 60 and 72 hz
Select Case currentResolution & "x" & originalPlaybackSpeed
Case "1920x1080x23976"
If currentRefreshRate <> "24" Then newTimings = "24p"

Case "1920x1080x29970"
If currentRefreshRate <> "60" Then newTimings = "60Hz"
End Select

End if

End If

If newTimings <> "" Then

Set wshShell = CreateObject("WScript.Shell")
WshShell.Run """" & "C:\Program Files\ATI Technologies\ATI.ACE\Core-Static\CLI.exe"" Start Load profilename=" & _
"""" & newTimings & """" , 0, true

' In case we did a configuration change we MUST return 0 to
' indicate ReClock it need to recalibrate itself.
WScript.Quit 0

End If

' We have done nothing. Return 1 to indicate ReClock that
' the configuration has not changed
WScript.Quit 1


Note that I named my profiles "24p" and "60Hz" respectively. Then also note the call to set the profile using "C:\Program Files\ATI Technologies\ATI.ACE\Core-Static\CLI.exe" with the proper params to set the profile.

So, name your profiles something distinctive for each reso/refresh, then based on the "event" notification, set the param string to the desired profile name.

Then, in ReClock, you'll need to set the option on the Advanced tab to "Enable Events Notification".

I'm pretty sure we've been through this somwhere before on the forum, but I can't find it.

sanderh
2nd February 2009, 11:32
Thanks for your reaction noee. Like I said in my post, I already made three different profiles with the CCC. So now all I need to do is figure out which things to alter in the .vbs script. You helped me on my way but I m sure questions will rise up when I ll going to try it after work tonight ;)

sanderh
3rd February 2009, 11:25
Ok, I ve made a script called 'RunEvent.vbs' which contains the following information:

'ATI Profile Version - Sets refresh rate using profile interface (CLI).

' Check for args/call
Set objArgs = WScript.Arguments
If objArgs.Count < 10 Then
MsgBox "Bad argument count !", MB_OK, "ReClock Event Notification"
WScript.Quit 1
End If

' Get Parms
eventName = objArgs(0)
mediaType = objArgs(1)
soundMode = objArgs(2)
currentMonitor = objArgs(3)
totalMonitorCount = objArgs(4)
currentResolution = objArgs(5)
currentRefreshRate = objArgs(6)
originalPlaybackSpeed = objArgs(7)
currentPlaybackSpeed = objArgs(8)
currentMediaFile = objArgs(9)

' If you need to debug, replace false with true in the following line
if false Then MsgBox _
eventName & " " & _
mediaType & " " & _
soundMode & " " & _
currentMonitor & " " & _
totalMonitorCount & " " & _
currentResolution & " " & _
currentRefreshRate & " " & _
originalPlaybackSpeed & " " & _
currentPlaybackSpeed, _
MB_OK, "ReClock Event Notification"

newTimings = ""

If eventName = "YELLOW" Then

If soundMode = "PCM" Then

' Call the profile that match best what we need in PCM mode
Select Case mediaType & ":" & currentResolution
Case "CINEMA:1920x1080"
If currentRefreshRate <> "50" Then newtimings = "1080p @50Hz"

Case "CINEMA:1920x1080"
If currentRefreshRate <> "24" Then newtimings = "1080p @24Hz"

Case "NTSC:1920x1080"
If currentRefreshRate <> "60" Then newTimings = "1080p @60Hz"
End Select

ElseIf soundMode = "SPDIF" Then

' In SPDIF mode we need an exact multiple to minimize the drops/repeats
' Note: be careful in NTSC mode, because if "currentRefreshRate" is already "60"
' when we go here then we won't switch but it may be 60 "bad" hz instead of 59.94 "wanted" hz
' The same problem exists for NTSC film (23.976fps)
' A solution is to force settings in the GREEN icon notification, but that would mean a pause
' each time we play a file with SPDIF ...
' That's why we use 59.94 hz and 71.928 hz for PCM too so we will never user 60 and 72 hz
Select Case currentResolution & "x" & originalPlaybackSpeed
Case "1920x1080x23976"
If currentRefreshRate <> "24" Then newTimings = "1080p @24Hz"

Case "1920x1080x25000"
If currentRefreshRate <> "50" Then newTimings = "1080p @50Hz"

Case "1920x1080x29970"
If currentRefreshRate <> "60" Then newTimings = "1080p @60Hz"
End Select

End if

End If

If newTimings <> "" Then

Set wshShell = CreateObject("WScript.Shell")
WshShell.Run """" & "C:\Program Files\ATI Technologies\ATI.ACE\Core-Static\CLI.exe"" Start Load profilename=" & _
"""" & newTimings & """" , 0, true

' In case we did a configuration change we MUST return 0 to
' indicate ReClock it need to recalibrate itself.
WScript.Quit 0

End If

' We have done nothing. Return 1 to indicate ReClock that
' the configuration has not changed
WScript.Quit 1

My custom made ATI profiles are called '1080p @24Hz' , '1080p @50Hz' and '1080p @60Hz'.

My CLI.exe file is stored in the same dir. as yours so I didn t change anything about this in the script.

What do you say so far about the script? See any faults maybe?

I ll try it tonight to see if it works.

noee
3rd February 2009, 13:25
I think you're going to have a problem with the same condition holding true for both 50 and 24.

Let's just say you're currently at 60Hz, then you start a new video and reclock is sending "CINEMA:1920x1080", with your logic, you'll always get your 50Hz profile, even if your movie is 24p.

I think you need to change the condition to "PAL:1920x1080" for your 50Hz profile.

sanderh
4th February 2009, 03:23
Didn t had a change to test it last night. I ve changed the script the way you said. But if I only use my SPDIF signal for transfer, then this doesn t really matter does it? It only looks at the second part of the script correct?

sanderh
7th February 2009, 12:01
Ok guys,

I ve made a RunEvent.vbs script that calls in my ATI profiles. It runs perfectly and my video card is switching automatically now when switching to a movie with a different refresh rate. But there is still one important bug for my:

I use Media Player Classic, the Home Cinema version. I use VMR9 renderless because I need this. Why? Because when using VMR9 renderless MPC HC made an option called 'Direct3D Fullscreen (Remove Tearing)'. I HAVE to use this feature of MPC HC in order to get perfect tearing free playback (let s not begin to argue about this because I really need this feature, believe me, I ve done my homework :agree:). BUT when I use this option the script (or MPC HC, that I don t know) get screwed up or something and I get a black screen. I do hear the audio however. When I do not use the remove tearing option everything runs fine (audio+video) except for the tearing ;).

Is there a way to solve this problem? Has it got something to do with the script? I think it is the combination of the script with MPC HC but don t know how to figure out what is wrong.

Maybe I can get some input in this topic.

Thxz

CraziFuzzy
8th February 2009, 09:00
This is more a limitation of VMR9. It doesn't like changes in the middle of playback, and it loses fullscreen exclusive mode when that happens. There are other renderers that are more 'robust' in this regard. I believe the Haali renderer works well, or if you are on Vista, the EVR works very well at eliminating tearing, and can happily switch resolution/refresh rates on the fly.

Jong
8th February 2009, 09:30
Yeah, but with HR you are in software mode, which may not be desireable.

From my testing the only way to acheive VMR9 renderless D3D and use runevent scripting is to use Powerstrip. You do not have to use special timing; You can use pstrip to set the standard timings for your display. Just pstrip, by making its changes without the player or driver knowing, manages to fool them into working!

All ATI cards are supported by pstrip AFAIK.

sanderh
8th February 2009, 12:21
I don t want Haali Renderer because then I get tearing. The only config when I have no tearing is VMR9 renderless WITH direct 3d option enabled (the exclusive function of MPC-HC)

Jong
8th February 2009, 12:30
I don t want Haali Renderer because then I get tearing. The only config when I have no tearing is VMR9 renderless WITH direct 3d option enabled (the exclusive function of MPC-HC)Sorry then, I do not know an answer other than pstrip, which you have also ruled out. :(

sanderh
9th February 2009, 09:23
I ve decided to give Powerstrip another try. Can someone post his .vbs script so I can use this as reference to make my own script? I can t remember what basics the powerstrip compatible script needs.

Jong
9th February 2009, 09:52
Here is mine.If you wish to use standard timings then just switch to each refresh rate using CCC, then go to Powerstrip's advanced timing options window and "copy timings to clipboard". Then paste them into notepad and extract the required timing string.

sanderh
9th February 2009, 11:24
thxz Jong,

and what if I only use SPDIF? Just change the word PCM in SPDIF?

Jong
9th February 2009, 14:12
My script does not even check; Even when I used spdif I never really saw the point of using different rates depending on whether s/pdif or pcm. I made it equally accurate for both.

Of course, if using s/pdif you have to have a refresh rate very close to an exact multiple of the frame rate (or also 59.94Hz for 23.976fps) if you are to avoid many dropped/repeated audio packets.

sanderh
13th February 2009, 06:29
I ve just made a script that is almost working perfect. Only problem is when my card output made a switch (from eg. 1920x1080@25Hz => 1920x1080@23,976Hz) and my projector switches internally (blanking screen for a few seconds with the noticication 'NO SIGNAL'), there is one problem:

I see the movie playing but my taksbar is still 'on the background' of MPC HC (running in VRM9 renderless with remove tearing option enabled) flickering very fast (you problably know what situation I mean :agree:). Just one click with my mouse on MPC solves this problem. But I want that it works 100% :)

I think it has something to do with the wscript.sleep in the .vbs script but not sure about this.

Mark_A_W
13th February 2009, 07:40
Sander, just replace the 3450 with something beefier.

I have a 2600XT and tearing is not an issue.

sanderh
13th February 2009, 07:49
I use the 4350

Jong
13th February 2009, 07:49
I ve just made a script that is almost working perfect. Only problem is when my card output made a switch (from eg. 1920x1080@25Hz => 1920x1080@23,976Hz) and my projector switches internally (blanking screen for a few seconds with the noticication 'NO SIGNAL'), there is one problem:

I see the movie playing but my taksbar is still 'on the background' of MPC HC (running in VRM9 renderless with remove tearing option enabled) flickering very fast (you problably know what situation I mean :agree:). Just one click with my mouse on MPC solves this problem. But I want that it works 100% :)

I think it has something to do with the wscript.sleep in the .vbs script but not sure about this.No I do not think it is wscript.sleep.

What OS are you using? I have seen the kind of thing you describe with Vista but not XP :confused:

I would be looking in two places.

- Are you using pstrip now? If you look in my script you will see I have changed the way the script checks if pstrip is running. The Ogo way does not work, at least for me, when using D3D. If you are using pstrip try replacing the Ogo way with mine.

- What version of CoreAVC are you using 1.8.5 is broken and does not work with D3D (its systray applet causes problems). 1.9.0 has just been released, which says it has fixed it, although I admit I haven't yet tried it.

Mark_A_W
13th February 2009, 07:51
I use the 4350


Sorry.

But that's still entry level isn't it?

Tearing is related to the 3D performance. Sucky 3D card = Tearing.

You need at least the middle of the range.

sanderh
13th February 2009, 07:54
What OS are you using? I have seen the kind of thing you describe with Vista but not XP :confused:strange, I use XP with SP3

- Are you using pstrip now?Yes

If you look in my script you will see I have changed the way the script checks if pstrip is running. The Ogo way does not work, at least for me, when using D3D. If you are using pstrip try replacing the Ogo way with mine. I m not an expert, is it possible for you to post your script here and point out exactly what I need to change?

- What version of CoreAVC are you using 1.8.5 is broken and does not work with D3D (its systray applet causes problems). 1.9.0 has just been released, which says it has fixed it, although I admit I haven't yet tried it. I just installed 1.9.0. Will try tonight again.

Jong
13th February 2009, 07:54
I use the 4350Reviewers have said this is underpowered and has problems with 1080 interlaced content (OK for 24fps progressive movies). The 4550 is really the the place to start with current gen ATI hardware. But if you do not view HD interlaced content the 4350 should be fine.

Not sure tearing is always about GPU or CPU power. I too see tearing with my 3850 in non-D3D mode, and the GPU is barely breaking a sweat. I prefer D3D anyway, where possible.

Jong
13th February 2009, 07:55
I m not an expert, is it possible for you to post your script here and point out exactly what I need to change?It's pretty clear. I've added specific comments about it in my script.

sanderh
13th February 2009, 07:58
Reviewers have said this is underpowered and has problems with 1080 interlaced content (OK for 24fps progressive movies). The 4550 is really the the place to start with current gen ATI hardware. But if you do not view HD interlaced content the 4350 should be fine.

Not sure tearing is always about GPU or CPU power. I too see tearing with my 3850 in non-D3D mode, and the GPU is barely breaking a sweat. I prefer D3D anyway, where possible.

I share your opinion and I am 100% sure it has NOTHING to do with GPU or CPU power. Only play progressive 1080 material here. Have a Quad-Core processor with 4gb mem. Both GPU and CPU or freakin low.

Mark_A_W
13th February 2009, 08:03
I share your opinion and I am 100% sure it has NOTHING to do with GPU or CPU power. Only play progressive 1080 material here. Have a Quad-Core processor with 4gb mem. Both GPU and CPU or freakin low.


Hmm...I also have a Quad Core and 4GB ram, and I also only watch 1080p progressive stuff.

But in my experience over the years, it's always the low spec cards that tear. It's a memory bandwidth issue or something - not directly related to the GPU, but a card with decent 3D performance is a much safer bet.

Vista is a lot less likely to tear also.

Jong
13th February 2009, 08:06
It also depends on the player/filter.

I never see tearing in PowerDVD, even though it runs in VMR9(renderless) non-D3D. But MPC-HC nearly always tears using VMR9(renderless) (not with all other renderers) unless D3D is used.

Anyway I like the dependability of the player doing the presenting and not having Windows do it on its behalf, where possible.

Jong
13th February 2009, 08:13
You may find this interesting:

http://www.xbitlabs.com/articles/video/display/media-playback_6.html#sect0

It suggests that even the 4500 series has problems with inverse telecine of progressive content, which you may come across.

I do tend to agree with Mark it is still better to stick to the middle, rather than lower, end of the GPU range, regardless of tearing, for guaranteed trouble-free decoding and optimum visual quality, whatever the sales blurb says!

sanderh
13th February 2009, 08:42
I have the same problem Jong: Tearing is always present (also with 576i material, which is low-end material) when using VMR9 renderless, but not when I enable D3D.

Jong
13th February 2009, 14:54
It's pretty clear. I've added specific comments about it in my script.To make it easy I would swap this whole section of the scriptIf newTimings <> "" Then

Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(&H26&)
Set objFolderItem = objFolder.Self
Set locator = CreateObject("WbemScripting.SWbemLocator")
Set service = locator.ConnectServer()
Set props = service.ExecQuery("select name, description from Win32_Process where name = 'pstrip.exe'")


' We will call Powerstrip 2 times
' In the second call, we will ask Powerstrip to change refresh rate/resolution
' and wait for it to finish the job. If Powerstrip would not be launched before, it would not
' return from this call leaving this VBS script stuck. That's why we make this first call to
' make sure that it is actually available (but we launch it only if it's not already running)

' NB. This is a different method to that used in the Ogo sample script, which, in some environments at least,
' causes D3D exclusive playback to be minimised to the taskbar.
Do While props.Count = 0 ' if so pstrip not running
WshShell.Run """" & objFolderItem.Path & _
"\PowerStrip\pstrip.exe"""
WScript.Sleep(2000)
Set props = service.ExecQuery("select name, description from Win32_Process where name = 'pstrip.exe'")
Loop

' Now run Powerstrip command and wait for it to finish its job

WScript.Sleep 0

WshShell.Run """" & objFolderItem.Path & _
"\PowerStrip\pstrip.exe"" /TARGET:" & currentMonitor & _
" /T:" & newTimings, 0, true

WScript.Sleep 500

' In case we did a configuration change we MUST return 0 to
' indicate ReClock it need to recalibrate itself.
' However, I found no way to check that Powerstrip did the job correctly ...
WScript.Quit 0

End If

sanderh
14th February 2009, 08:49
The 'fast-flicker taskbar problem' is still present Jong. I ve installed CoreAVC 1.9 and made a script that looks like this but the problem remains :( Do you have other tips maybe?

' -------------------------------------
' Event notification script for ReClock
' -------------------------------------
'
' This script will be called when ReClock change the media adaptation of a played file
' either automatically or after some manual change made in the properties panel
' It is called only for media file which contain a video stream, and when frame rate of this file is known
'
' ---------------------------------------------------------------------------------------------
' The 7 parameters received by this script are explained below:
'
' (1) contains the event name that just occurred:
' - "GREEN" : tray icon just got green (all is fine). Parameter
' - "YELLOW" : tray icon just got yellow. We should make what is necessary
' to change the monitor refresh rate
' - "STOP" : playback just stopped
' - "QUIT" : ReClock is about to quit
'
' Parameters (2), (3), (8) and (9) apply only with "GREEN" and "YELLOW" events. Otherwise they contain "-"
'
' (2) contains the type of media file currently played :
' - "CINEMA" : frame rate of source file is around 24 fps
' - "PAL" : frame rate of source file is around 25 fps
' - "NTSC" : frame rate of source file is around 30 fps
' - "CUSTOM" : frame rate of source file does not fall in previous categories
'
' (3) contains the current sound playback mode (apply only with GREEN/YELLOW event):
' - "PCM" : PCM mode
' - "SPDIF" : AC3 passthrough SPDIF
'
' (4) contains the current monitor selected for playback (1=primary, 2=secondary, etc...)
'
' (5) contains the total monitor count detected in the system
'
' (6) contains the current resolution of your monitor (WIDTHxHEIGHT)
'
' (7) contains the current refresh rate of your monitor (in Hz)
'
' (8) contains the original playback rate of the file (in fps multiplied by 1000)
'
' (9) contains the current playback rate of the file (in fps multiplied by 1000)
'
' (10) contains the filename of the current media file
'
' ---------------------------------------------------------------------------------------------
' Notifications examples:
' - GREEN CINEMA PCM 1 1 1024x768 72 23976 24000 c:\test.avi : all is good
' - GREEN NTSC PCM 1 1 1024x768 60 29970 30000 c:\test.avi : all is good
' - YELLOW PAL SPDIF 1 1 1024x768 72 25000 25000 c:\test.avi : please switch to a multiple of 25 hz since PAL wants 25 fps
' - YELLOW CINEMA SPDIF 1 1 1024x768 75 23976 23976 c:\test.avi : please switch to 71.928 hz
'
' ---------------------------------------------------------------------------------------------
' Here is a VbScript script that will call Powerstrip to change the monitor refresh rate
' using the /T parameter (to obtain the timings parameters go to the timings setup in powerstrip and copy
' them to the clipboard)
' There is a VERY important thing to note. Powerstrip change the timings directly in the hardware, but
' forget to notify Windows applications it did that (including ReClock). So this script MUST exit with
' an exit code of 0 if it did change the configuration with powerstrip. Otherwise the script should
' return 1

' Decode the parameters
Set objArgs = WScript.Arguments
If objArgs.Count < 10 Then
MsgBox "Bad argument count !", MB_OK, "ReClock Event Notification"

' We have done nothing. Return 1 to indicate ReClock that
' the configuration has not changed
WScript.Quit 1
End If

eventName = objArgs(0)
mediaType = objArgs(1)
soundMode = objArgs(2)
currentMonitor = objArgs(3)
totalMonitorCount = objArgs(4)
currentResolution = objArgs(5)
currentRefreshRate = objArgs(6)
originalPlaybackSpeed = objArgs(7)
currentPlaybackSpeed = objArgs(8)
currentMediaFile = objArgs(9)

' If you need to debug, replace false with true in the following line
if false Then MsgBox _
eventName & " " & _
mediaType & " " & _
soundMode & " " & _
currentMonitor & " " & _
totalMonitorCount & " " & _
currentResolution & " " & _
currentRefreshRate & " " & _
originalPlaybackSpeed & " " & _
currentPlaybackSpeed, _
MB_OK, "ReClock Event Notification"

Set wshShell = CreateObject("WScript.Shell")

' We will put new timings here if necessary
newTimings = ""

' Obviously we have something to do only if the icon is yellow
If eventName = "YELLOW" Then

If soundMode = "PCM" Then

' Call the profile that match best what we need in PCM mode
Select Case mediaType & ":" & currentResolution
Case "CINEMA:1920x1080"
If currentRefreshRate <> "24" Then newTimings = "1920,640,48,144,1080,4,5,36,74250,1" ' 24 hz

Case "PAL:1920x1080"
If currentRefreshRate <> "50" Then newTimings = "1920,528,48,144,1080,4,5,36,148500,1" ' 50 hz

Case "NTSC:1920x1080"
If currentRefreshRate <> "60" Then newTimings = "1920,88,48,144,1080,4,5,36,148500,1" ' 60 hz
End Select

ElseIf soundMode = "SPDIF" Then

' In SPDIF mode we need an exact multiple to minimize the drops/repeats
' Note: be careful in NTSC mode, because if "currentRefreshRate" is already "60"
' when we go here then we won't switch but it may be 60 "bad" hz instead of 59.94 "wanted" hz
' The same problem exists for NTSC film (23.976fps)
' A solution is to force settings in the GREEN icon notification, but that would mean a pause
' each time we play a file with SPDIF ...
' That's why we use 59.94 hz and 71.928 hz for PCM too so we will never user 60 and 72 hz
Select Case currentResolution & "x" & originalPlaybackSpeed
Case "1920x1080x23976"
If currentRefreshRate <> "24" Then newTimings = "1920,640,48,144,1080,4,5,36,74250,1" ' 24 hz

Case "1920x1080x25000"
If currentRefreshRate <> "50" Then newTimings = "1920,528,48,144,1080,4,5,36,148500,1" ' 50 hz

Case "1920x1080x29970"
If currentRefreshRate <> "60" Then newTimings = "1920,88,48,144,1080,4,5,36,148500,1" ' 60 hz
End Select

End if

End If

' When we quit the player, we can restore our favorite refresh rate and/or resolution
' Using "QUIT" instead of "STOP" as "STOP" causes too many refresh rate changes when playing NTSC/Blu-ray discs
' NB: Some players may not trigger a QUIT e.g. TheaterTek, so will not change back to default refresh rate
' Remove comments on the next three lines if you wish to restore a default refresh rate
'If eventName = "QUIT" Then

' If currentRefreshRate <> "60" Then newTimings= "1920,88,44,148,1080,4,5,36,148500,528" ' 60Hz

'End If

' Do we have new timings to apply ?
If newTimings <> "" Then

Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(&H26&)
Set objFolderItem = objFolder.Self
Set locator = CreateObject("WbemScripting.SWbemLocator")
Set service = locator.ConnectServer()
Set props = service.ExecQuery("select name, description from Win32_Process where name = 'pstrip.exe'")


' We will call Powerstrip 2 times
' In the second call, we will ask Powerstrip to change refresh rate/resolution
' and wait for it to finish the job. If Powerstrip would not be launched before, it would not
' return from this call leaving this VBS script stuck. That's why we make this first call to
' make sure that it is actually available (but we launch it only if it's not already running)

' NB. This is a different method to that used in the Ogo sample script, which, in some environments at least,
' causes D3D exclusive playback to be minimised to the taskbar.
Do While props.Count = 0 ' if so pstrip not running
WshShell.Run """" & objFolderItem.Path & _
"\PowerStrip\pstrip.exe"""
WScript.Sleep(2000)
Set props = service.ExecQuery("select name, description from Win32_Process where name = 'pstrip.exe'")
Loop

' Now run Powerstrip command and wait for it to finish its job

WScript.Sleep 0

WshShell.Run """" & objFolderItem.Path & _
"\PowerStrip\pstrip.exe"" /TARGET:" & currentMonitor & _
" /T:" & newTimings, 0, true

WScript.Sleep 500

' In case we did a configuration change we MUST return 0 to
' indicate ReClock it need to recalibrate itself.
' However, I found no way to check that Powerstrip did the job correctly ...
WScript.Quit 0

End If

' We have done nothing. Return 1 to indicate ReClock that
' the configuration has not changed
WScript.Quit 1

Jong
14th February 2009, 09:50
Not really. As I said I have not seen this on XP. Normally if something is causing problems in the systray then the video minimises and you cannot see it.

I would try using MPC Video decoder (enable AVC decoding in MPC) instead of CoreAVC, to see if that is still causing problems. If that fails turn off D£D and see if you can see anything in the systray that may be causing trouble. :confused:

sanderh
15th February 2009, 12:59
thxz for all your help Jong. I decided to give up on the whole SPDIF thing and give James a try (all decoding done by HTPC).

So you ve already told me what to do for this but I want to know some more about it. Am I correct that I do not need Powerstrip anymore when I choose for PAL speeddown in ReClock? Is it so that then all my content is shown @23,976fps? This would be great for me: This way I don t need custom resolutions anymore, don t need Powerstrip anymore, no .vbs needed anymore. I want to go back to a simple easy setup......

James
15th February 2009, 13:09
thxz for all your help Jong. I decided to give up on the whole SPDIF thing and give James a try (all decoding done by HTPC).

So you ve already told me what to do for this but I want to know some more about it. Am I correct that I do not need Powerstrip anymore when I choose for PAL speeddown in ReClock? Is it so that then all my content is shown @23,976fps? This would be great for me: This way I don t need custom resolutions anymore, don t need Powerstrip anymore, no .vbs needed anymore. I want to go back to a simple easy setup......

Yes, yes, yes and yes. Only tick the first PAL Speedup removal box.

Jong
15th February 2009, 14:10
....as long as you do not want to watch any US "video" stuff (60Hz interlaced).

Mark_A_W
15th February 2009, 16:28
thxz for all your help Jong. I decided to give up on the whole SPDIF thing and give James a try (all decoding done by HTPC).

So you ve already told me what to do for this but I want to know some more about it. Am I correct that I do not need Powerstrip anymore when I choose for PAL speeddown in ReClock? Is it so that then all my content is shown @23,976fps? This would be great for me: This way I don t need custom resolutions anymore, don t need Powerstrip anymore, no .vbs needed anymore. I want to go back to a simple easy setup......


I did exactly this Sander.

I only use a 96hz resolution now. I watch all recorded TV at 24fps. I haven't noticed an issue with that - it's just TV afterall.

And all movies are played correctly at 24fps, whether they come from BD, PAL DVD, or 1080i 50hz recordings.

sanderh
16th February 2009, 04:05
@Jong: I don t watch US video stuff so lucky me ;)

So what is the difference when using the AC3 encoder of ReClock or AC3 filter? What is the best to use?

sanderh
16th February 2009, 04:21
Some more questions:

Now that I ve made the switch to HTPC decoding I have some new questions in order to understand the whole process that takes place. Questions are related to AC3filter.

1.
In the Output format in the settings of AC3filter, is AS IS (no change) the option I want to pick?

2.
Next, there is the option how much bit you want for the Output Format. I have the options PCM 16bit, PCM 24bit, PCM 32bit and PCM Float. What do I have to choose here? (my soundcard is a Trust SC5250, also known as C-Media 8738 I think).

3.
The SPDIF options (Detect SPDIF stream in PCM data, Use AC3 uncoder etc. etc.). Am I correct that I can UNCHECK these because they have no influence on the sound anymore?

4.
At the system properties of the AC3filter you can select the default audio renderer. Do I have to change this to use 'DirectSound by default'? (I m assuming this because ReClock also uses DirectSound for PCM).

that s it for now. More questions will come I think :agree:

Jong
16th February 2009, 05:00
@Jong: I don t watch US video stuff so lucky me ;)

So what is the difference when using the AC3 encoder of ReClock or AC3 filter? What is the best to use?Better to use the Reclock encoder. Then Reclock sees PCM audio and can full adapt it to suit the media.

Regarding AC3Filter output format, I have already said you may want to resample all audio to 48Khz so 44.1khz audio can be AC3 Encoded (or you can use ffdshow to do this).

sanderh
16th February 2009, 05:07
Regarding AC3Filter output format, I have already said you may want to resample all audio to 48Khz so 44.1khz audio can be AC3 Encoded (or you can use ffdshow to do this).

Jong, I don t understand what you re saying here :( Can you explain it again and a bit more comprehensively.

sanderh
16th February 2009, 11:38
And more questions :)

I m going to use my ATI HD4350 card for transmitting audio over the HDMI. Am I correct when I say that my HD4350 is this scenario gets feed with an uncompressed 5.1 PCM signal from ReClock and then passes this uncompressed 5.1 PCM signal through to my receiver?

Jong
16th February 2009, 12:57
Yes indeed.

Jong
16th February 2009, 12:59
Jong, I don t understand what you re saying here :( Can you explain it again and a bit more comprehensively.Some video, some Apple trailers for example, have 44.1Khz multi-channel audio. Reclock can only AC3encode 48Khz audio. So, if you want to hear any audio on these movies you need to use something to resample to 48Khz.

sanderh
16th February 2009, 17:12
Some video, some Apple trailers for example, have 44.1Khz multi-channel audio. Reclock can only AC3encode 48Khz audio. So, if you want to hear any audio on these movies you need to use something to resample to 48Khz.

ok, I understand this. However, what has this to do with my question 2?


Now that I ve made the switch to HTPC decoding I have some new questions in order to understand the whole process that takes place. Questions are related to AC3filter.

1.
In the Output format in the settings of AC3filter, is AS IS (no change) the option I want to pick?

2.
Next, there is the option how much bit you want for the Output Format. I have the options PCM 16bit, PCM 24bit, PCM 32bit and PCM Float. What do I have to choose here? (my soundcard is a Trust SC5250, also known as C-Media 8738 I think).

3.
The SPDIF options (Detect SPDIF stream in PCM data, Use AC3 uncoder etc. etc.). Am I correct that I can UNCHECK these because they have no influence on the sound anymore?

4.
At the system properties of the AC3filter you can select the default audio renderer. Do I have to change this to use 'DirectSound by default'? (I m assuming this because ReClock also uses DirectSound for PCM).

can you also come back on the other questions? thxz!

Mark_A_W
16th February 2009, 17:40
Sander, what type of audio are you decoding?

For AC3/DTS/DTS MA (core only)/TrueHD I use Ffdshow audio.

I set it to output 32bit only, so that Kernel Streaming in Reclock works for all material.

I set the Dolby PrologicII decoder to convert all 2 channel sources to 5.1.

I set it to resample all material less than 44.1khz to 48000khz - or I get silence from low end stuff.

For FLAC audio I use Madflac decoder, connecting to Ffdshow audio, which then upconverts the 24bit to 32bit, as above.


I prefer to convert my BDs to MKV with FLAC audio. Playback from BD disc directly works at full resolution for TrueHD, but for DTS-MA only the DTS Core is decoded currently.


Mark

Mark_A_W
16th February 2009, 17:46
Some more questions:

Now that I ve made the switch to HTPC decoding I have some new questions in order to understand the whole process that takes place. Questions are related to AC3filter.

1.
In the Output format in the settings of AC3filter, is AS IS (no change) the option I want to pick?

2.
Next, there is the option how much bit you want for the Output Format. I have the options PCM 16bit, PCM 24bit, PCM 32bit and PCM Float. What do I have to choose here? (my soundcard is a Trust SC5250, also known as C-Media 8738 I think).

3.
The SPDIF options (Detect SPDIF stream in PCM data, Use AC3 uncoder etc. etc.). Am I correct that I can UNCHECK these because they have no influence on the sound anymore?

4.
At the system properties of the AC3filter you can select the default audio renderer. Do I have to change this to use 'DirectSound by default'? (I m assuming this because ReClock also uses DirectSound for PCM).

that s it for now. More questions will come I think :agree:

1. Yes. I use Ffdshow audio, with the mixer disabled, which is the same result.

2. Depends if you want reclock to do Kernel Streaming. For Kernel Streaming to work for all material (16 and 24bit) on my soundcard, I have to pick 32bit PCM.

3. Leave SPDIF unticked. It plays no part anymore.

4. Reclock will override this.

sanderh
17th February 2009, 03:30
1. Yes. I use Ffdshow audio, with the mixer disabled, which is the same result. check!

2. Depends if you want reclock to do Kernel Streaming. For Kernel Streaming to work for all material (16 and 24bit) on my soundcard, I have to pick 32bit PCM. Kernel Streaming does not work with the ATI hdmi audio device as it seems. I ve tried kernel streaming with 16, 24, 32 and float but no sound. So switched back to 'DirectSound (default)'. But then I still remain with the question which one to pick (16, 24, 32 or float), because I do get sound with ALL four.

3. Leave SPDIF unticked. It plays no part anymore.check!

4. Reclock will override this.check!

Sander, what type of audio are you decoding?I use three different media types: .mkv (ac3 signal?), .wmv (wma audio) and VIDEO_TS material (standard def. dvd) (ac3 signal?)

I set it to resample all material less than 44.1khz to 48000khz - or I get silence from low end stuff.Cannot find such a function in the AC3Filter.

EDIT:
Can the ffdshow audio also be installed without the video ffdshow? If so, can ffdshow do all things that AC3Filter does? (decoding also .wma to PCM).

Mark_A_W
17th February 2009, 03:35
Kernel Streaming does not work with the ATI hdmi audio device as it seems. I ve tried kernel streaming with 16, 24, 32 and float but no sound. So switched back to 'DirectSound (default)'. But then I still remain with the question which one to pick (16, 24, 32 or float), because I do get sound with ALL four.




I don't like this in AC3filter. It is forcing you to pick one. There should be an option for "AS IS".

I'd use ffdshow audio instead, and set 16 and 24bit as available outputs - it will use the most suitable one then.

However, if you insist on using AC3filter, I'd pick 24bit. Better to zero-pad 16bit to 24bit, than to chuck away the extra 8 bits of Hi-Res audio.

Mark_A_W
17th February 2009, 03:36
No Bluray or HD-DVD?

sanderh
17th February 2009, 03:42
No Bluray or HD-DVD?


nop, I do this with my stand-alone player, Denon3800.

Mark_A_W
17th February 2009, 03:45
Then I think picking 16bit in AC3filter will be fine.

sanderh
17th February 2009, 03:46
I don't like this in AC3filter. It is forcing you to pick one. There should be an option for "AS IS".

I'd use ffdshow audio instead, and set 16 and 24bit as available outputs - it will use the most suitable one then.

However, if you insist on using AC3filter, I'd pick 24bit. Better to zero-pad 16bit to 24bit, than to chuck away the extra 8 bits of Hi-Res audio.

Ok, you just convinced my to switch to FFDSHOW. I just installed it and looking at the configuration of the audio decoder right now.
What do I check/uncheck or config here looking at my setup? (ATI HD4350 for passing through an already decoded PCM signal to my receiver).

rickdry
2nd March 2009, 17:29
I use the script and it is truncating the filename to first 10 characters can you look at a fix for this...

The reason I want file name is to change refresh based on file ext eg mkv then change res if avi stay as is...

So I need the file name instead I get "C:\Documents" instead of
"C:\Documents and Settings\rickdry\My Documents\heroes\Heroes S3\Heroes S03 E15.avi"

Thanks

Mark_A_W
2nd March 2009, 17:36
Umm...it's the space.

Move_your_video_material_to_a different_folder_and_replace_all_spaces_with_an_un derscore.

rickdry
2nd March 2009, 19:15
Thanks Mark that worked shame it will not pass the string as is any work around for that or is that just the way it is...

Mark_A_W
2nd March 2009, 19:21
Can you put "talking marks" around the text in the script?

rickdry
2nd March 2009, 19:27
WshShell.Run """" & objFolderItem.Path & _
"\Promixis\Girder5\event.exe"" " & eventg5 & _
" " & g5device & _
" " & eventName & _
"." & mediaType & _
"." & soundMode & _
"." & currentMonitor & _
"." & totalMonitorCount & _
"." & currentResolution & _
"." & currentRefreshRate & _
"." & originalPlaybackSpeed & _
"." & currentPlaybackSpeed & _
" " & currentMediaFile, 0, true


If that works yes here is what I am passing to girder I am not much of a vb user so not entirely sure what you mean

The currentMediaFile is the variable how would I send that as pure text

The reason I want to do this is that mkv at 24p does not tear with evr but avi's do ...as per others observations....was going to leave avi's at 50hz with reclock speed up and change it to 24p for mkv's as they output on waveout spif so need to match refresh rate to avoid stutter this would give me a really elegant solution...girder can then process the if then else for refresh rate change...girder can parse any string in any way so no issue just need a string with path

rickdry
3rd March 2009, 17:18
What I need is a way to append make currentmdeiafile have the quote marks or just strip the space from it first is there a command in vb to remove spaces from a string? or better yet just search the string for .mkv .ifo and or .avi

then I will just pass that

rickdry
3rd March 2009, 17:39
ok solved google is your friend

Extavi = InStr(currentMediaFile, ".avi") 'returns a number
Extmkv = InStr(currentMediaFile, ".mkv")

If Extavi > 0 Then
FileExt = "avi"

End If
If Extmkv > 0 Then
FileExt = "mkv"

End If

Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(&H26&)
Set objFolderItem = objFolder.Self



WshShell.Run """" & objFolderItem.Path & _
"\Promixis\Girder5\event.exe"" " & eventg5 & _
" " & g5device & _
" " & eventName & _
"." & mediaType & _
"." & soundMode & _
"." & currentMonitor & _
"." & totalMonitorCount & _
"." & currentResolution & _
"." & currentRefreshRate & _
"." & originalPlaybackSpeed & _
"." & currentPlaybackSpeed & _
"." & FileExt & _
"." & currentMediaFile, 0, true 'put . in to test this is a separator so we can use anything

' In case we did a configuration change we MUST return 0 to
' indicate ReClock it need to recalibrate itself.
WScript.Quit 0

Nety
24th July 2009, 20:52
Hi, I have installed ReClock and setup custom resolutions in the NVidia control pannel but I know very little about VB scripts so am a bit stuck on getting reclock to use the NVidia resolutions.

Has someone got a script that uses the NVidia control pannel that they could post? I am happy to modify a script to suite the resolutions that I use I just have no idea how to change it to use the nvidia custom resolutions.

I have tested the resolutions and they seem to work great. Just need reclock to change them automatically and I will be one very happy man!

f_carone
27th July 2009, 09:51
I created my runevent.vbs,
' -------------------------------------
' Event notification script for ReClock
' -------------------------------------
'
' This script will be called when ReClock change the media adaptation of a played file
' either automatically or after some manual change made in the properties panel
' It is called only for media file which contain a video stream, and when frame rate of this file is known
'
' ---------------------------------------------------------------------------------------------
' The 7 parameters received by this script are explained below:
'
' (1) contains the event name that just occurred:
' - "GREEN" : tray icon just got green (all is fine). Parameter
' - "YELLOW" : tray icon just got yellow. We should make what is necessary
' to change the monitor refresh rate
' - "STOP" : playback just stopped
' - "QUIT" : ReClock is about to quit
'
' Parameters (2), (3), (8) and (9) apply only with "GREEN" and "YELLOW" events. Otherwise they contain "-"
'
' (2) contains the type of media file currently played :
' - "CINEMA" : frame rate of source file is around 24 fps
' - "PAL" : frame rate of source file is around 25 fps
' - "NTSC" : frame rate of source file is around 30 fps
' - "CUSTOM" : frame rate of source file does not fall in previous categories
'
' (3) contains the current sound playback mode (apply only with GREEN/YELLOW event):
' - "PCM" : PCM mode
' - "SPDIF" : AC3 passthrough SPDIF
'
' (4) contains the current monitor selected for playback (1=primary, 2=secondary, etc...)
'
' (5) contains the total monitor count detected in the system
'
' (6) contains the current resolution of your monitor (WIDTHxHEIGHT)
'
' (7) contains the current refresh rate of your monitor (in Hz)
'
' (8) contains the original playback rate of the file (in fps multiplied by 1000)
'
' (9) contains the current playback rate of the file (in fps multiplied by 1000)
'
' (10) contains the filename of the current media file
'
' ---------------------------------------------------------------------------------------------
' Notifications examples:
' - GREEN CINEMA PCM 1 1 1024x768 72 23976 24000 c:\test.avi : all is good
' - GREEN NTSC PCM 1 1 1024x768 60 29970 30000 c:\test.avi : all is good
' - YELLOW PAL SPDIF 1 1 1024x768 72 25000 25000 c:\test.avi : please switch to a multiple of 25 hz since PAL wants 25 fps
' - YELLOW CINEMA SPDIF 1 1 1024x768 75 23976 23976 c:\test.avi : please switch to 71.928 hz
'
' ---------------------------------------------------------------------------------------------
' Here is a sample in VbScript that will call Powerstrip to change the monitor refresh rate
' using the /T parameter (to obtain the timings parameters go to the timings setup in powerstrip and copy
' them to the clipboard)
' There is a VERY important thing to note. Powerstrip change the timings directly in the hardware, but
' forget to notify Windows applications it did that (including ReClock). So this script MUST exit with
' an exit code of 0 if it did change the configuration with powerstrip. Otherwise the script should
' return 1

' Decode the parameters
Set objArgs = WScript.Arguments
If objArgs.Count < 10 Then
MsgBox "Bad argument count !", MB_OK, "ReClock Event Notification"

' We have done nothing. Return 1 to indicate ReClock that
' the configuration has not changed
WScript.Quit 1
End If

eventName = objArgs(0)
mediaType = objArgs(1)
soundMode = objArgs(2)
currentMonitor = objArgs(3)
totalMonitorCount = objArgs(4)
currentResolution = objArgs(5)
currentRefreshRate = objArgs(6)
originalPlaybackSpeed = objArgs(7)
currentPlaybackSpeed = objArgs(8)
currentMediaFile = objArgs(9)

' If you need to debug, replace false with true in the following line
if false Then MsgBox _
eventName & " " & _
mediaType & " " & _
soundMode & " " & _
currentMonitor & " " & _
totalMonitorCount & " " & _
currentResolution & " " & _
currentRefreshRate & " " & _
originalPlaybackSpeed & " " & _
currentPlaybackSpeed, _
MB_OK, "ReClock Event Notification"

' Here is a sample of what can be done with PowerStrip
Set wshShell = CreateObject("WScript.Shell")

' We will put new timings here if necessary
newTimings = ""

' Obviously we have something to do only if the icon is yellow
If eventName = "YELLOW" Then

If soundMode = "PCM" Then

' Call the profile that match best what we need in PCM mode
Select Case mediaType & ":" & currentResolution
Case "CINEMA:1920x1080"
If currentRefreshRate <> "24" Then WshShell.Run ("""rundll32.exe""nvcpl.dll,dtcfg setmode 1 1920 1080 32 24")

Case "PAL:1920x1080"
If currentRefreshRate <> "50" Then WshShell.Run ("""rundll32.exe""nvcpl.dll,dtcfg setmode 1 1920 1080 32 50")

Case "NTSC:1920x1080"
If currentRefreshRate <> "60" Then WshShell.Run ("""rundll32.exe""nvcpl.dll,dtcfg setmode 1 1920 1080 32 60")

End Select

ElseIf soundMode = "SPDIF" Then

' In SPDIF mode we need an exact multiple to minimize the drops/repeats
' Note: be careful in NTSC mode, because if "currentRefreshRate" is already "60"
' when we go here then we won't switch but it may be 60 "bad" hz instead of 59.94 "wanted" hz
' The same problem exists for NTSC film (23.976fps)
' A solution is to force settings in the GREEN icon notification, but that would mean a pause
' each time we play a file with SPDIF ...
' That's why we use 59.94 hz and 71.928 hz for PCM too so we will never user 60 and 72 hz
Select Case currentResolution & "x" & originalPlaybackSpeed
Case "1920x1080x23976"
If currentRefreshRate <> "24" Then WshShell.Run ("""rundll32.exe""nvcpl.dll,dtcfg setmode 1 1920 1080 32 24")


Case "1024x768x25000"
If currentRefreshRate <> "50" Then WshShell.Run ("""rundll32.exe""nvcpl.dll,dtcfg setmode 1 1920 1080 32 50")

Case "1024x768x29970"
If currentRefreshRate <> "60" Then WshShell.Run ("""rundll32.exe""nvcpl.dll,dtcfg setmode 1 1920 1080 32 60")

End Select

End if

End If

' We quit the player, restore our favorite refresh rate and/or resolution
If eventName = "QUIT" Then

Select Case currentResolution
Case "1920x1080"
If currentRefreshRate <> "50" Then WshShell.Run ("""rundll32.exe""nvcpl.dll,dtcfg setmode 1 1920 1080 32 50")

End Select

End If


' We have done nothing. Return 1 to indicate ReClock that
' the configuration has not changed
WScript.Quit 1



but when run KMPlayer, frequency is setting correctly but the screen appears black.
Sorry my bad English.
fil

may22
23rd August 2009, 10:14
I have recently realized how useful the RunEvent.vbs can be - thanks for the great work so far! After experimenting a lot I have a proposal for improvement:
Please add a parameter to RunEvent.vbs to indicate if the OriginalPlaybackSpeed is a "final" value given by the built-in estimator!

I play a lot of .mkv files, and often receive an incorrect early yellow event. With the improvement above it would be possible to avoid initiating a refresh rate change upon the incorrect event.

Thanks!
BR,
May

ashlar
9th September 2009, 10:47
Tried pretty much all solutions. Powerstrip, Display Changer, Catalyst Control Center's profiles.

I'm on MPC-HC (latest official release), using its own filters. Windows 7 RTM, Radeon 4890 with latest official drivers. Video renderer is EVR custom. Sound card X-Fi Extreme Music, analog multichannel out.

In a way or another all the script I've tried fail at providing a seamless experience. Some manage to handle the first switch but if you open a second file the frame rate goes to single digit figures. Others handle one switch and on the second switch keep on playing back at the previous refresh rate (as an example, let's say I have the desktop at 50Hz. If I play a 60Hz video, Reclock switches correctly to 60Hz; if later I open a 24Hz video, the screen switches but Reclock plays back the file at 24Hz on a 60Hz screen. Yes, it's a mess I know).

Anyone with a seamlessly working script in a similar configuration (Win7, Radeon 4xxx, MPC-HC, EVR Custom, analog out)?

James
9th September 2009, 11:56
Tried pretty much all solutions. Powerstrip, Display Changer, Catalyst Control Center's profiles.

I'm on MPC-HC (latest official release), using its own filters. Windows 7 RTM, Radeon 4890 with latest official drivers. Video renderer is EVR custom. Sound card X-Fi Extreme Music, analog multichannel out.

In a way or another all the script I've tried fail at providing a seamless experience. Some manage to handle the first switch but if you open a second file the frame rate goes to single digit figures. Others handle one switch and on the second switch keep on playing back at the previous refresh rate (as an example, let's say I have the desktop at 50Hz. If I play a 60Hz video, Reclock switches correctly to 60Hz; if later I open a 24Hz video, the screen switches but Reclock plays back the file at 24Hz on a 60Hz screen. Yes, it's a mess I know).

Anyone with a seamlessly working script in a similar configuration (Win7, Radeon 4xxx, MPC-HC, EVR Custom, analog out)?

The API (or the ATI driver? Unlikely) for switching refresh rates is broken under Windows 7. Shame on you, Microsoft. Try to execute the refresh rate switch twice in your script, e.g. when using SetDisplayFrequency.exe which ships with AnyDVD. You can try this easily from a command prompt.

ashlar
14th September 2009, 03:53
Actually was returning 0 at the end of the script, which is something I've found out it's needed only for Powerstrip (http://forum.slysoft.com/showpost.php?p=148462&postcount=2078). Returning 1 seems to make things a lot better.

They're pretty much perfect as long as I open a new instance of MPC-HC. If I try to open a file while another file is playing... it's a bit more hit-and-miss.

Maldark
17th September 2009, 13:46
OK I only found this thread today, and it seems that it's exactly what I've been looking for. I'm trying to get the script to run and change profiles via ATI CCC. The refresh rates set by ATI are already as accurate as anything I could get in powerstrip anyway, so I figure why not skip the middleman.

'ATI Profile Version - Sets refresh rate using profile interface (CLI).

' Check for args/call
Set objArgs = WScript.Arguments
If objArgs.Count < 10 Then
MsgBox "Bad argument count !", MB_OK, "ReClock Event Notification"
WScript.Quit 1
End If

' Get Parms
eventName = objArgs(0)
mediaType = objArgs(1)
soundMode = objArgs(2)
currentMonitor = objArgs(3)
totalMonitorCount = objArgs(4)
currentResolution = objArgs(5)
currentRefreshRate = objArgs(6)
originalPlaybackSpeed = objArgs(7)
currentPlaybackSpeed = objArgs(8)
currentMediaFile = objArgs(9)

' If you need to debug, replace false with true in the following line
if false Then MsgBox _
eventName & " " & _
mediaType & " " & _
soundMode & " " & _
currentMonitor & " " & _
totalMonitorCount & " " & _
currentResolution & " " & _
currentRefreshRate & " " & _
originalPlaybackSpeed & " " & _
currentPlaybackSpeed, _
MB_OK, "ReClock Event Notification"

newTimings = ""

If eventName = "YELLOW" Then

If soundMode = "PCM" Then

' Call the profile that match best what we need in PCM mode
Select Case mediaType & ":" & currentResolution
Case "CINEMA:1920x1080"
If currentRefreshRate <> "23" Then newtimings = "24Hz"

Case "PAL:1920x1080"
If currentRefreshRate <> "50" Then newtimings = "25Hz"

Case "NTSC:1920x1080"
If currentRefreshRate <> "59" Then newTimings = "30Hz"
End Select

ElseIf soundMode = "SPDIF" Then

' In SPDIF mode we need an exact multiple to minimize the drops/repeats
' Note: be careful in NTSC mode, because if "currentRefreshRate" is already "60"
' when we go here then we won't switch but it may be 60 "bad" hz instead of 59.94 "wanted" hz
' The same problem exists for NTSC film (23.976fps)
' A solution is to force settings in the GREEN icon notification, but that would mean a pause
' each time we play a file with SPDIF ...
' That's why we use 59.94 hz and 71.928 hz for PCM too so we will never user 60 and 72 hz
Select Case currentResolution & "x" & originalPlaybackSpeed
Case "1920x1080x23976"
If currentRefreshRate <> "23" Then newtimings = "24Hz"

Case "1920x1080x25000"
If currentRefreshRate <> "50" Then newtimings = "25Hz"

Case "1920x1080x29970"
If currentRefreshRate <> "59" Then newTimings = "30Hz"
End Select

End if

End If

If newTimings <> "" Then

Set wshShell = CreateObject("WScript.Shell")
WshShell.Run """" & "C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static\CLI.exe"" Start Load profilename=" & _
"""" & newTimings & """" , 0, true

' In case we did a configuration change we MUST return 0 to
' indicate ReClock it need to recalibrate itself.
WScript.Quit 0

End If

' We have done nothing. Return 1 to indicate ReClock that
' the configuration has not changed
WScript.Quit 1

I keep returning the error Bad argument count !. But I can't see any reason why. I guess I'd just like another set of eyes.

Thanks for any help in advance.

Running Win7 x64 with MPC-HC and reclock 1.8.4.9 if that helps.

Jong
17th September 2009, 14:14
How are you running the script? If you try to run it from the command line it will always give that error - because you are not passing any arguments! It wiill only work if Reclock calls the script automatically.

Maldark
17th September 2009, 14:39
How are you running the script? If you try to run it from the command line it will always give that error - because you are not passing any arguments! It wiill only work if Reclock calls the script automatically.

Thanks, that did it, knew it would be something completely noob.

Now I'm stuck with another problem. I guess CCC isn't changing the refreshrate fast enough on startup or something, because when i go from say PAL to NTSC reclock reports the displayrefreshrate as which ever refresh was loaded previously, this can lead to funky stuff.

Eg. Load up PAL material, changes refresh to 50Hz.
Close Player
Load up NTSC material, changes refresh to 60Hz, but still reports 50Hz in reclock.

If I can get this running then I'll be a happy man.

Jong
17th September 2009, 14:40
I use pstrip, which in my environment is more reliable, so I cannot help here I'm afraid.

James
17th September 2009, 15:36
Thanks, that did it, knew it would be something completely noob.

Now I'm stuck with another problem. I guess CCC isn't changing the refreshrate fast enough on startup or something, because when i go from say PAL to NTSC reclock reports the displayrefreshrate as which ever refresh was loaded previously, this can lead to funky stuff.

Eg. Load up PAL material, changes refresh to 50Hz.
Close Player
Load up NTSC material, changes refresh to 60Hz, but still reports 50Hz in reclock.

If I can get this running then I'll be a happy man.

Try to always return '1' when you exit the script.

EDIT: Do you still have PowerStrip installed / running?

Maldark
18th September 2009, 04:05
OK so I gave up using ATI CCC and started using powerstip instead. Now i've got another problem :S

I'm using HDMI audio in exclusive mode to set the channels/sample rate with reclock.

My new script works, changes the refresh rate perfectly however. If I change the refreshrate using powerstip to anything other than what is set in CCC I get no sound.

Eg 24Hz is set in CCC.
Load up PAL material, script activates changes refreshrate in powerstrip to 50Hz
CCC still reads as 24Hz, actual refresh is 50Hz
No sound until CCC is set to 50Hz as well.

Has anyone encountered a similar problem?

'If you wish to use standard timings then just switch to each refresh rate using CCC, then go to Powerstrip's advanced timing options window and "copy timings to clipboard". Then paste them into notepad and extract the required timing string.
' -------------------------------------
' Event notification script for ReClock
' -------------------------------------
'
' This script will be called when ReClock change the media adaptation of a played file
' either automatically or after some manual change made in the properties panel
' It is called only for media file which contain a video stream, and when frame rate of this file is known
'
'10 ---------------------------------------------------------------------------------------------
' The 7 parameters received by this script are explained below:
'
' (1) contains the event name that just occurred:
' - "GREEN" : tray icon just got green (all is fine). Parameter
' - "YELLOW" : tray icon just got yellow. We should make what is necessary
' to change the monitor refresh rate
' - "STOP" : playback just stopped
' - "QUIT" : ReClock is about to quit
'
'20 Parameters (2), (3), (8) and (9) apply only with "GREEN" and "YELLOW" events. Otherwise they contain "-"
'
' (2) contains the type of media file currently played :
' - "CINEMA" : frame rate of source file is around 24 fps
' - "PAL" : frame rate of source file is around 25 fps
' - "NTSC" : frame rate of source file is around 30 fps
' - "CUSTOM" : frame rate of source file does not fall in previous categories
'
' (3) contains the current sound playback mode (apply only with GREEN/YELLOW event):
' - "PCM" : PCM mode
'30 - "SPDIF" : AC3 passthrough SPDIF
'
' (4) contains the current monitor selected for playback (1=primary, 2=secondary, etc...)
'
' (5) contains the total monitor count detected in the system
'
' (6) contains the current resolution of your monitor (WIDTHxHEIGHT)
'
' (7) contains the current refresh rate of your monitor (in Hz)
'
'40 (8) contains the original playback rate of the file (in fps multiplied by 1000)
'
' (9) contains the current playback rate of the file (in fps multiplied by 1000)
'
' (10) contains the filename of the current media file
'
' ---------------------------------------------------------------------------------------------
' Notifications examples:
' - GREEN CINEMA PCM 1 1 1024x768 72 23976 24000 c:\test.avi : all is good
' - GREEN NTSC PCM 1 1 1024x768 60 29970 30000 c:\test.avi : all is good
'50 - YELLOW PAL SPDIF 1 1 1024x768 72 25000 25000 c:\test.avi : please switch to a multiple of 25 hz since PAL wants 25 fps
' - YELLOW CINEMA SPDIF 1 1 1024x768 75 23976 23976 c:\test.avi : please switch to 71.928 hz
'
' ---------------------------------------------------------------------------------------------
' Here is a VbScript script that will call Powerstrip to change the monitor refresh rate
' using the /T parameter (to obtain the timings parameters go to the timings setup in powerstrip and copy
' them to the clipboard)
' There is a VERY important thing to note. Powerstrip change the timings directly in the hardware, but
' forget to notify Windows applications it did that (including ReClock). So this script MUST exit with
' an exit code of 0 if it did change the configuration with powerstrip. Otherwise the script should
'60 return 1

' Decode the parameters
Set objArgs = WScript.Arguments
If objArgs.Count < 10 Then
MsgBox "Bad argument count !", MB_OK, "ReClock Event Notification"

' We have done nothing. Return 1 to indicate ReClock that
' the configuration has not changed
WScript.Quit 1
End If '70

eventName = objArgs(0)
mediaType = objArgs(1)
soundMode = objArgs(2)
currentMonitor = objArgs(3)
totalMonitorCount = objArgs(4)
currentResolution = objArgs(5)
currentRefreshRate = objArgs(6)
originalPlaybackSpeed = objArgs(7)
currentPlaybackSpeed = objArgs(8) '80
currentMediaFile = objArgs(9)

' If you need to debug, replace false with true in the following line
if false Then MsgBox _
eventName & " " & _
mediaType & " " & _
soundMode & " " & _
currentMonitor & " " & _
totalMonitorCount & " " & _
currentResolution & " " & _
currentRefreshRate & " " & _
originalPlaybackSpeed & " " & _
currentPlaybackSpeed, _
MB_OK, "ReClock Event Notification"

Set wshShell = CreateObject("WScript.Shell")

' We will put new timings here if necessary
newTimings = ""
'100
' Obviously we have something to do only if the icon is yellow
If eventName = "YELLOW" Then

' Call the profile that match best what we need in PCM mode
Select Case mediaType
Case "CINEMA"
If currentRefreshRate <> "24" Then newTimings= "1920,638,44,148,1080,4,5,36,74176,528" ' 24Hz

Case "PAL"
If currentRefreshRate <> "50" Then newTimings= "1920,528,44,148,1080,4,5,36,148500,528" ' 50Hz '110

Case "NTSC"
If currentRefreshRate <> "59" Then newTimings= "1920,88,44,148,1080,4,5,36,148350,528" ' 59Hz

Case "CUSTOM" ' may no longer be needed. At one time some video was being reported atit's field rate, e.g. 59.94Hz
' for NTSC interlaced content
If originalPlaybackSpeed > 58000 AND originalPlaybackSpeed < 62000 Then
If currentRefreshRate <> "59" Then newTimings= "1920,88,44,148,1080,4,5,36,148346,528" ' 59Hz

ElseIf originalPlaybackSpeed > 48000 AND originalPlaybackSpeed < 52000 Then '120
If currentRefreshRate <> "50" Then newTimings= "1920,528,44,148,1080,4,5,36,148500,528" ' 50Hz

End if

End Select

End If

' When we quit the player, we can restore our favorite refresh rate and/or resolution '130
' Using "QUIT" instead of "STOP" as "STOP" causes too many refresh rate changes when playing NTSC/Blu-ray discs
' NB: Some players may not trigger a QUIT e.g. TheaterTek, so will not change back to default refresh rate
' Remove comments on the next three lines if you wish to restore a default refresh rate
'If eventName = "QUIT" Then

' If currentRefreshRate <> "50" Then newTimings= "1920,528,44,148,1080,4,5,36,148500,528" ' 50Hz

'End If

'140 Do we have new timings to apply ?
If newTimings <> "" Then

Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(&H26&)
Set objFolderItem = objFolder.Self
Set locator = CreateObject("WbemScripting.SWbemLocator")
Set service = locator.ConnectServer()
Set props = service.ExecQuery("select name, description from Win32_Process where name = 'pstrip.exe'")


' We will call Powerstrip 2 times
' In the second call, we will ask Powerstrip to change refresh rate/resolution
' and wait for it to finish the job. If Powerstrip would not be launched before, it would not
' return from this call leaving this VBS script stuck. That's why we make this first call to
' make sure that it is actually available (but we launch it only if it's not already running)

' NB. This is a different method to that used in the Ogo sample script, which, in some environments at least,
' causes D3D exclusive playback to be minimised to the taskbar.
Do While props.Count = 0 ' if so pstrip not running
WshShell.Run """" & objFolderItem.Path & _
"\PowerStrip\pstrip.exe"""
WScript.Sleep(2000)
Set props = service.ExecQuery("select name, description from Win32_Process where name = 'pstrip.exe'")
Loop

' Now run Powerstrip command and wait for it to finish its job

WScript.Sleep 0

WshShell.Run """" & objFolderItem.Path & _
"\PowerStrip\pstrip.exe"" /TARGET:" & currentMonitor & _
" /T:" & newTimings, 0, true

WScript.Sleep 500

' In case we did a configuration change we MUST return 0 to
' indicate ReClock it need to recalibrate itself.
' However, I found no way to check that Powerstrip did the job correctly ...
WScript.Quit 0

End If

' We have done nothing. Return 1 to indicate ReClock that
' the configuration has not changed
WScript.Quit 1

Jong
18th September 2009, 04:16
You will need to use CCC if you want audio over HDMI.

When using CCC did you change the quit code to "1" as James suggested ("0" is only needed for pstrip)? Did you have pstrip installed?

Maldark
19th September 2009, 02:14
OK thanks for all your help guys. Went back to the CCC script, changed the 0 to a 1 and it works.

There's only one little annoyance left now.
Going from
NTSC->Cinema is fine
NTSC->PAL is fine
Cinema->NTSC is fine
Cinema->PAL is fine
PAL -> NTSC is fine

The problem is going from PAL -> Cinema. Reclock shows as green because it's adapting the Cinema 23.976fps to 25fps, so the script dosn't kick in. Is there a way to stop reclock from adapting Cinema to PAL?

Jong
19th September 2009, 02:42
That's easy to fix!

You just need to change the "acceptable speedup of media speed in PCM mode", on the "video settings" tab of Reclock config, to 1%.

Maldark
19th September 2009, 03:12
That's easy to fix!

You just need to change the "acceptable speedup of media speed in PCM mode", on the "video settings" tab of Reclock config, to 1%.

Awesome!!! It all works now. Thanks so much for your help.

htctyo
26th October 2009, 09:49
Pls post your runEvent vbs file . Thanks for your help .

grkn
28th October 2009, 20:48
Do While Not wshShell.AppActivate ("pstrip") ' it has a hidden window called with this name
WshShell.Run """" & objFolderItem.Path & _
"C:\Program Files\PowerStrip\pstrip.exe"""
WScript.Sleep(2000)
Loop

This just gives me in win7 64 bit an error saying:
Windows Script Host blablabla, line blabla
Error: The system cannot find the file specified.
Code: 80070002

And yes, the location is correct :P Using just \PowerStrip\pstrip.exe doesn't help, and both reclock and powerstrip is in C:\Program Files\

I've also made some shortcuts using displaychanger, any easy way of launching them with the script?

htctyo
5th January 2010, 10:21
Tried pretty much all solutions. Powerstrip, Display Changer, Catalyst Control Center's profiles.

I'm on MPC-HC (latest official release), using its own filters. Windows 7 RTM, Radeon 4890 with latest official drivers. Video renderer is EVR custom. Sound card X-Fi Extreme Music, analog multichannel out.

In a way or another all the script I've tried fail at providing a seamless experience. Some manage to handle the first switch but if you open a second file the frame rate goes to single digit figures. Others handle one switch and on the second switch keep on playing back at the previous refresh rate (as an example, let's say I have the desktop at 50Hz. If I play a 60Hz video, Reclock switches correctly to 60Hz; if later I open a 24Hz video, the screen switches but Reclock plays back the file at 24Hz on a 60Hz screen. Yes, it's a mess I know).

Anyone can help me to post the RunEvent. Vb script that can work in win7

Ingram
8th January 2010, 21:58
Can someone give me some help please.

I'm on Vista SP2 32-Bit, ATI 9.12 drivers, no powerstrip installed.

I use 1920x1080i @ 25Hz for FILM and PAL DVDs. I want to implement this script to switch to 30Hz when NTSC content is detected (Extra features on my Blu-Rays).

I'm using the following code, I stripped the SPDIF out because I use PCM/AC3 Encoder:

'ATI Profile Version - Sets refresh rate using profile interface (CLI).

' Check for args/call
Set objArgs = WScript.Arguments
If objArgs.Count < 10 Then
MsgBox "Bad argument count !", MB_OK, "ReClock Event Notification"
WScript.Quit 1
End If

' Get Parms
eventName = objArgs(0)
mediaType = objArgs(1)
soundMode = objArgs(2)
currentMonitor = objArgs(3)
totalMonitorCount = objArgs(4)
currentResolution = objArgs(5)
currentRefreshRate = objArgs(6)
originalPlaybackSpeed = objArgs(7)
currentPlaybackSpeed = objArgs(8)
currentMediaFile = objArgs(9)

' If you need to debug, replace false with true in the following line
if false Then MsgBox _
eventName & " " & _
mediaType & " " & _
soundMode & " " & _
currentMonitor & " " & _
totalMonitorCount & " " & _
currentResolution & " " & _
currentRefreshRate & " " & _
originalPlaybackSpeed & " " & _
currentPlaybackSpeed, _
MB_OK, "ReClock Event Notification"

newTimings = ""

If eventName = "YELLOW" Then

' Call the profile that match best what we need in PCM mode
Select Case mediaType & ":" & currentResolution
Case "CINEMA:1920x1080"
If currentRefreshRate <> "50" Then newtimings = "25Hz"

Case "PAL:1920x1080"
If currentRefreshRate <> "50" Then newtimings = "25Hz"

Case "NTSC:1920x1080"
If currentRefreshRate <> "60" Then newTimings = "30Hz"
End Select


End If

If newTimings <> "" Then

Set wshShell = CreateObject("WScript.Shell")
WshShell.Run """" & "C:\Program Files\ATI Technologies\ATI.ACE\Core-Static\CLI.exe"" Start Load profilename=" & _
"""" & newTimings & """" , 0, true

' In case we did a configuration change we MUST return 0 to
' indicate ReClock it need to recalibrate itself.
WScript.Quit 0

End If

' We have done nothing. Return 1 to indicate ReClock that
' the configuration has not changed
WScript.Quit 1

The problem is that nothing is happening, I've tested both sides of the coin and there is no change.

30hz, watch a FILM video, no switch to 25hz.
25hz, watch a NTSC video, no switch to 30hz.

Not getting any error messages or anything either.

My profiles are created, and named 25hz and 30hz.

karoloydi
11th January 2010, 20:20
It takes me more than a minute until the resolution changes and the movie starts playing (on a core i7 system).
Is it just me, or is that "normal"?

Ingram
11th January 2010, 21:17
Hey at least you have it working, I can't get it to work at all. Doesn't seem to be anyone around to help either :(

karoloydi
12th January 2010, 03:18
Hey at least you have it working, I can't get it to work at all. Doesn't seem to be anyone around to help either :(

It wouldnt woork for me at first. Cause it said on the first post that you can change the resolution without the need of powerstrip. So I just installed that other programme Display Changer. It would give me error messages. Then I installed powerstrip and it worked.
Is that your problem?

mark007
14th January 2010, 18:00
Hi all,

Using DisplayChanger I can switch between 24hz and 50hz modes perfectly depending on input, but can't help noticing with mpc-hc and reclock, changing resolution sometimes causes the player to crash. I have tried adding sleeps, after the display change command is called before returning to reclock, but its like 50% of the time, a crash will happen.

Is this mpc-hc's fault or reclock?

When a crash occurs, I always see this at the bottom of the reclock log

ChangeAudioRate(48000.00,0.0,48000)

ALSO, I think reclock can be much improved in this area. For example, with my TV set to 50hz, pal speed down disabled, playing a 25fps file, I would expect green all the way, except for when reclock is estimating the refresh rate, when I think it should be optional to send "<unknown>" to the display changer. Here is what happens in this case anyways, basically the debug output from display vbs file typed below, after I load this 25fps file in mpc-hc, and bolded is what I think is wrong and should be improved.

-------------------------------------------------

<FILE LOADS>
<RECLOCK ESTIMATES RATE AT 23.976fps>

YELLOW CINEMA PCM 1 1 1920x1080 50 23976 23976 << Incorrect, I think another flag should be sent, to indicate in estimation stage, or better still, send nothing at all. Display rate changes shouldn't be made during estimation.

<display changes to 23.976hz>

GREEN CINEMA PCM 1 1 1920x1080 24 23976 24000
GREEN CINEMA PCM 1 1 1920x1080 24 23976 24000 << Duplicate of above, solution, don't send the same messages twice in a row.
STOP - - 1 1 1920x1080 24 - -
STOP - - 1 1 1920x1080 24 - - << Duplicate of above, solution, don't send the same messages twice in a row.

<RECLOCK ESTIMATES RATE AT 25fps>

YELLOW PAL PCM 1 1 1920x1080 24 25000 25000

<display changes back to 50hz>

GREEN PAL PCM 1 1 50 25000 25000
GREEN PAL PCM 1 1 50 25000 25000 << Duplicate of above, solution, don't send the same messages twice in a row.
STOP - - 1 1 1920x1080 50 - - << WHY?

<either video plays, or I get a crash>

karoloydi
17th January 2010, 18:09
Just upgraded to Win 7. When loading movieswith media player classic it wont automatically change the resolutionany more.
Well, it kid of works. If I change the resolution to 24hz manually it will automatically change it to 60hz. So, its doing the opposite from what its supposed to do. (I am using the Display Changer with powerstrip with an Nvidia gts 250 card).
It worked fine with wmp11 and vista.

James
17th January 2010, 18:22
Hi all,

Using DisplayChanger I can switch between 24hz and 50hz modes perfectly depending on input, but can't help noticing with mpc-hc and reclock, changing resolution sometimes causes the player to crash. I have tried adding sleeps, after the display change command is called before returning to reclock, but its like 50% of the time, a crash will happen.

Is this mpc-hc's fault or reclock?

When a crash occurs, I always see this at the bottom of the reclock log

ChangeAudioRate(48000.00,0.0,48000)

ALSO, I think reclock can be much improved in this area. For example, with my TV set to 50hz, pal speed down disabled, playing a 25fps file, I would expect green all the way, except for when reclock is estimating the refresh rate, when I think it should be optional to send "<unknown>" to the display changer. Here is what happens in this case anyways, basically the debug output from display vbs file typed below, after I load this 25fps file in mpc-hc, and bolded is what I think is wrong and should be improved.

-------------------------------------------------

<FILE LOADS>
<RECLOCK ESTIMATES RATE AT 23.976fps>

YELLOW CINEMA PCM 1 1 1920x1080 50 23976 23976 << Incorrect, I think another flag should be sent, to indicate in estimation stage, or better still, send nothing at all. Display rate changes shouldn't be made during estimation.

<display changes to 23.976hz>

GREEN CINEMA PCM 1 1 1920x1080 24 23976 24000
GREEN CINEMA PCM 1 1 1920x1080 24 23976 24000 << Duplicate of above, solution, don't send the same messages twice in a row.
STOP - - 1 1 1920x1080 24 - -
STOP - - 1 1 1920x1080 24 - - << Duplicate of above, solution, don't send the same messages twice in a row.

<RECLOCK ESTIMATES RATE AT 25fps>

YELLOW PAL PCM 1 1 1920x1080 24 25000 25000

<display changes back to 50hz>

GREEN PAL PCM 1 1 50 25000 25000
GREEN PAL PCM 1 1 50 25000 25000 << Duplicate of above, solution, don't send the same messages twice in a row.
STOP - - 1 1 1920x1080 50 - - << WHY?

<either video plays, or I get a crash>
Logfile, please. And where is your script so I can look? When using ATI, stop the AMD external event service in service manager. Do not exit the script with WScript.Quit 0.

karoloydi
22nd January 2010, 03:12
Managed to get reclock to auto change by using wmp instead of mcp.
Now only thing I need to do is change to 30hz when 29.97fps content is played.
Even if I change the NTSC setting from 60Hz to 30hz the resolution still remains the same. But I managed to change the setting from 48hz to 24hz for the CINEMA setting.
Any ideas?

mark007
22nd January 2010, 14:45
Logfile, please. And where is your script so I can look? When using ATI, stop the AMD external event service in service manager. Do not exit the script with WScript.Quit 0.

Hi James, Thanks for looking at this. I have uploaded my vbs script and log file. You can see that when reclock is estimating the files refresh rate, it obviously gets it wrong initially, and makes my screen change, then when it gets it right, it changes it back again.

Just notice I am using 50hz, and a 25fps file (with no intended speed down). So I shouldn't see any vbs script calls that are anything but green, but there are many yellow ones, and duplicates etc.

http://www.2shared.com/file/10834271/82039f3e/Log_and_vbs.html

In log above you will count two yellow status's sent to the vbs. There should be none as its 25fps content on 50hz screen.

Can this be improved to not make any non green vbs calls, if you have time? I am using Nvidia GTX 295 with display changer.

jmonier
22nd January 2010, 15:38
Can this be improved to not make any non green vbs calls, if you have time? I am using Nvidia GTX 295 with display changer.

1.8.6.1 already has this option. Look at the release notes.

mark007
22nd January 2010, 15:55
1.8.6.1 already has this option. Look at the release notes.

Of course but my problem is that reclocks estimation of frame rate incorrectly sends yellow notifications to VBS even when file and refresh are the same. I argue notiications shouldn't be sent when in estimation phase.

It's a pity estimation is necessary at all as detection of frame rate would be instant If reclock could read rate from somewhere.

James
22nd January 2010, 16:10
http://www.2shared.com/file/10834271/82039f3e/Log_and_vbs.html

Attach them to a post, please.

mark007
22nd January 2010, 16:22
logs............................

mark007
4th February 2010, 17:57
Hi James, Did you consider updating reclock to maybe

1) Avoid sending updates to vbs while in the estimation of frame rate stage (would really improve the experience on my HTPC, ie would avoid having my resolution change 3 times per 25fps movie being slowed to 24fps, rather than the desired 1 or sometimes even 0.)
2) Avoid sending the same message twice (not a big problem really)

James
4th February 2010, 18:10
Hi James, Did you consider updating reclock to maybe

1) Avoid sending updates to vbs while in the estimation of frame rate stage (would really improve the experience on my HTPC, ie would avoid having my resolution change 3 times per 25fps movie being slowed to 24fps, rather than the desired 1 or sometimes even 0.)

In the log you posted it got it from the registry:
Searched framerate in registry l_found=1 m_digest=76D7B9459ACFD1670E06C287AADB394F l_rateNum=1

Can you try to clear the frame rate database?


2) Avoid sending the same message twice (not a big problem really)
It doesn't.
DO NOT EXIT THE SCRIPT WITH WScript.Quit 0, I've told you several times.

mark007
4th February 2010, 18:23
I have cleared the database and my first problem is fixed. Thanks alot. How often should it be cleaned up. I guess I am asking is there a flaw in reclocks logic somewhere that makes the database incorrect or not updated. I imagine you don't intend the database ever having to be cleared if all the logic is right with regards to keeping database accurate?

..


I never saw a post regarding wscript.quit 1 so there's no need to use capital letters. My eyesight is perfect without the need for them!!!!!!! Relax!!

I'll remove it and try but my understanding from the posts in this thread that if no changes were made then the script should be exited with this return code of 1 to keep reclock informed. I guess this has changed in recent reclock versions? If a change is made my script returns 0 but still see reclock sending te same thing more than once to vbs script.

I'm happy as is now anyways :D I guess I'll just have to do a database cleanup every now and again until this is no longer necessary :D

James
4th February 2010, 18:56
I have cleared the database and my first problem is fixed. Thanks alot. How often should it be cleaned up. I guess I am asking is there a flaw in reclocks logic somewhere that makes the database incorrect or not updated. I imagine you don't intend the database ever having to be cleared if all the logic is right with regards to keeping database accurate?

..


I never saw a post regarding wscript.quit 1 so there's no need to use capital letters. My eyesight is perfect without the need for them!!!!!!! Relax!!


I thought you might miss it ... again:
http://forum.slysoft.com/showthread.php?p=241409&highlight=WScript.Quit#post241409

I'll remove it and try but my understanding from the posts in this thread that if no changes were made then the script should be exited with this return code of 1 to keep reclock informed. I guess this has changed in recent reclock versions?

http://forum.slysoft.com/showthread.php?p=235623&highlight=WScript.Quit#post235623

ReClock is automatically informed by Windows if the refresh rate changes. Only if you use a tool which hits the hardware directly (Windows has no clue that there was a change), ReClock needs to be informed with WScriptQuit 0

If you use a "proper" tool (= not PowerStrip) *and* use WScriptQuit 0, ReClock will see two refresh rate changes in a row. Not good.

mark007
4th February 2010, 19:03
Brilliant, thanks alot. I'm using display changer, so I'll take out those commands.

Thanks again!!

EDIT: Oops, after removing wscript.quit's from my vbs script, and clearing database, when playing back a 25i file Deinterlaced to 50p with pal speed down off, at 50hz refresh rate, I get a resolution change to 24hz, then 50hz.

Again, in this case I think during the first second or two, the guessing phase of reclock causes the 2 unnecessary resolution changes. First to 24hz when it doesn't know the rate is 50 and then back to 50 when it correctly learns the rate. Log attached incase your interested in this. I see two yellow notifications being sent. Can you confirm this is caused by reclock first guessing a certain frame rate yet still sending vbs notification, and only after a few seconds getting it right and sending vbs notification again.

I ask because it is the sending of notifications during this guessing phase that still doesn't seem exactly right, after database cleanup.

sanderh
8th March 2010, 11:19
I just downloaded the trial version of the latest Anydvd application. I want to use SetDisplayFrequency.exe in combination with the Reclock .vbs script so I can get automatic fps detection and after the detection automatic display frequency changing (ati profiles).

I don t know how to config this correct.

- How does the .vbs script have to look like?
- Is it needed that Anydvd is running or is all I need the file 'SetDisplayFrequency.exe' and can the trail version of Anydvd be uninstalled?

Are there any ATI users out there who can point me in the right direction?

Cheers!

leeperry
8th March 2010, 11:44
is there anything better than DisplayChanger for nvidia on XP? it used to work fine on older drivers, but it's only getting worse and worse these days...I can change reso/refresh rate in the nvidia drivers, but DC doesn't do anything :o

yes, I did try "-force" and updating DC to the latest version

James
8th March 2010, 12:10
is there anything better than DisplayChanger for nvidia on XP? it used to work fine on older drivers, but it's only getting worse and worse these days...I can change reso/refresh rate in the nvidia drivers, but DC doesn't do anything :o

yes, I did try "-force" and updating DC to the latest version

SetDisplayFrequency? ;)

leeperry
8th March 2010, 13:15
SetDisplayFrequency? ;)
I use(d) DC w/ batches in my start menu to change reso/refresh rate...apparently SDF can only change the refresh rate? and it's part of the AnyDVD package?

I'd rather not resort to pstrip, which is buggy as hell on nvidia :o

sanderh
11th March 2010, 03:38
guys,

Can you maybe help me out? I got the file 'SetDisplayFrequency.exe' from some forum and put it in my Program Files (x86)\ReClock folder. I enabled the .vbs option in ReClock and made the runevent.vbs script look like this:

' -------------------------------------
' Event notification script for ReClock
' -------------------------------------
'
' This script will be called when ReClock change the media adaptation of a played file
' either automatically or after some manual change made in the properties panel
' It is called only for media file which contain a video stream, and when frame rate of this file is known
'
' ---------------------------------------------------------------------------------------------
' The 7 parameters received by this script are explained below:
'
' (1) contains the event name that just occurred:
' - "GREEN" : tray icon just got green (all is fine). Parameter
' - "YELLOW" : tray icon just got yellow. We should make what is necessary
' to change the monitor refresh rate
' - "STOP" : playback just stopped
' - "QUIT" : ReClock is about to quit
'
' Parameters (2), (3), (8) and (9) apply only with "GREEN" and "YELLOW" events. Otherwise they contain "-"
'
' (2) contains the type of media file currently played :
' - "CINEMA" : frame rate of source file is around 24 fps
' - "PAL" : frame rate of source file is around 25 fps
' - "NTSC" : frame rate of source file is around 30 fps
' - "CUSTOM" : frame rate of source file does not fall in previous categories
'
' (3) contains the current sound playback mode (apply only with GREEN/YELLOW event):
' - "PCM" : PCM mode
' - "SPDIF" : AC3 passthrough SPDIF
'
' (4) contains the current monitor selected for playback (1=primary, 2=secondary, etc...)
'
' (5) contains the total monitor count detected in the system
'
' (6) contains the current resolution of your monitor (WIDTHxHEIGHT)
'
' (7) contains the current refresh rate of your monitor (in Hz)
'
' (8) contains the original playback rate of the file (in fps multiplied by 1000)
'
' (9) contains the current playback rate of the file (in fps multiplied by 1000)
'
' (10) contains the filename of the current media file
'
' -------------------------------------------------------------------------
' SetDisplayFrequency Version - Sets refresh rate using SetDisplayFrequency
' -------------------------------------------------------------------------

' Decode the parameters

Set objArgs = WScript.Arguments

If objArgs.Count < 10 Then

MsgBox "Bad argument count !", MB_OK, "ReClock Event Notification"

' We have done nothing. Return 1 to indicate ReClock that the configuration has not changed.

WScript.Quit 1

End If

eventName = objArgs(0)
mediaType = objArgs(1)
soundMode = objArgs(2)
currentMonitor = objArgs(3)
totalMonitorCount = objArgs(4)
currentResolution = objArgs(5)
currentRefreshRate = objArgs(6)
originalPlaybackSpeed = objArgs(7)
currentPlaybackSpeed = objArgs(8)
currentMediaFile = objArgs(9)

' If you need to debug, replace false with true in the following line.

If false Then MsgBox _
eventName & " " & _
mediaType & " " & _
soundMode & " " & _
currentMonitor & " " & _
totalMonitorCount & " " & _
currentResolution & " " & _
currentRefreshRate & " " & _
originalPlaybackSpeed & " " & _
currentPlaybackSpeed, _
MB_OK, "ReClock Event Notification"

Set wshShell = CreateObject("WScript.Shell")

' We will put new refresh rate here if necessary.

newRefreshRate = currentRefreshRate

' Obviously we have something to do only if the icon is yellow.

If eventName = "YELLOW" Then

If currentRefreshRate <> originalPlaybackSpeed Then

Select Case mediaType
Case "CINEMA"
newRefreshRate = "23"
Case "PAL"
newRefreshRate = "50"
Case "NTSC"
newRefreshRate = "59"
End Select

End If

End If

' We quit the player, restore our favorite refresh rate.

If eventName = "QUIT" Then

newRefreshRate = "60"

End If

' Do we have new refresh rate to apply ?

If currentRefreshRate <> newRefreshRate Then

Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(&H26&)
Set objFolderItem = objFolder.Self

' Now run SetDisplayFrequency command and wait for it to finish its job.

WshShell.Run """" & objFolderItem.Path & _
"\ReClock\SetDisplayFrequency.exe"" " & newRefreshRate, 0, true

' In case we did a configuration change we MUST return 0 to indicate ReClock it need to recalibrate itself.

WScript.Quit 0

End If

' We have done nothing. Return 1 to indicate ReClock that the configuration has not changed.

WScript.Quit 1

When I run MPC-HC with ReClock and the .vbs script option enabled MPC-HC seems to do SOMETHING (screen seems to change) but not how I want it. When I ran a 25fps source it does not switch to my ati 1920@1080@50Hz profile and when I run a 29,970fps source it does not switch to my ati 1920@1080@59Hz profile.

What could I be doing wrong here?

Jong
11th March 2010, 05:37
I cannot quite believe that you have illegally downloaded Slysoft software (supplied with AnyDVD) and then come to a Slysoft forum for support!

sanderh
11th March 2010, 06:12
setdisplayfrequency.exe comes along with the free trial of Anydvd so nothing illegal here.

Jong
11th March 2010, 06:38
Just because they gave you a free trial and it does not have protection does not make it legal to keep using it and anyway you said you downloaded it from "some forum". Anyway it is not my job to be a policeman, I just found it amusing! And IMO until James says it is OK I don't think it would be right to troubleshoot.

sanderh
11th March 2010, 06:57
You have to think more before posting something on the forum m8:

Slysoft AnyDVD is a software package that has to be paid for. I m NOT going to grab AnyDVD from some kind of newleecher or something. I only downloaded the 'SetDisplayFrequency.exe' to see and try if it work. And WTF are you talking anyway? Do I SAY anywhere that I m not going to buy AnyDVD if it works? And moreover, AnyDVD can be downloaded as a TRIAL from the official site. You can only use it for 14 days (it is protected I assume?). There s no documentation that a person cannot copy the 'SetDisplayFrequency.exe' to his local hard drive. If Slysoft wanted they could have made a protection for this little app too. But again, I m going to buy AnyDVD anyway if it fits for my after 14 days.

Jong
11th March 2010, 07:07
I could say the same to you! if you said you downloaded the AnyDVD trial we would not be having this exchange, but you said you downloaded Slysoft software from"some forum"! in the nicest possible way, that is pretty dumb!

I am not trying to be a pain here, but in the face of such a flagrant breach I think we have to wait to see if James accepts your explanation!

sanderh
11th March 2010, 07:20
hahahaha, James freakin hates me. You really think he s going to support me? NOT!

But thanks Jong, for putting me in such a bad daylight. If there ONE SINGLE PERSON on this planet who only has all his software legal, it s me.

Thanks man, really :mad::mad:

Jong
11th March 2010, 07:39
Well I'm sorry. I really am. But it was just too obvious to ignore and I'd have left it as a lighthearted remark if you had not pushed.

By the way, I do not think there are any specific advantages of setdisplayfrequency over other similar and free tools, unless James can say otherwise.

sanderh
11th March 2010, 07:48
Well I'm sorry. I really am. But it was just too obvious to ignore and I'd have left it as a lighthearted remark if you had not pushed.

By the way, I do not think there are any specific advantages of setdisplayfrequency over other similar and free tools, unless James can say otherwise.

ok, I may have overreacted too in the heat of the moment. Case closed for me Jong!

I ve already skipped SetDisplayFrequency.exe anyway. I thought I needed this to 'call in' my ATI profiles but I just learned from renethx from the AVS forum that I don t need anything at all. I just need to config the .vbs script correct so it 'sees' my ATI profiles.

Jong
11th March 2010, 08:13
That's what I meant here:

http://forum.slysoft.com/showpost.php?p=249517&postcount=121

But is didn't work for me with mpc-hc. Then again, I have not tried James' magic "call it twice" trick!

sanderh
11th March 2010, 08:52
That's what I meant here:

http://forum.slysoft.com/showpost.php?p=249517&postcount=121

But is didn't work for me with mpc-hc. Then again, I have not tried James' magic "call it twice" trick!

Sorry, I didn t understood what you meant with that post but now I do.

How does James ''call it twice trick'' work exactly?

Jong
11th March 2010, 10:55
http://forum.slysoft.com/showpost.php?p=249611&postcount=123

Basically, if I read him right and I think I do, just call whatever routine you use to change rates twice. It might be necessary to leave a few 100ms between each call. I don't know.

And also note the need to exit the script with "0" not "1" if you are not using pstrip ;)

James
11th March 2010, 16:54
http://forum.slysoft.com/showpost.php?p=249611&postcount=123

It might be necessary to leave a few 100ms between each call.

No, you just call it twice in a row. (I'm not sure if this is still necessary with the newest ATI drivers).

leeperry
15th July 2010, 20:35
For some reason dc.exe has stopped working a while ago("unsupported resolution")...I've just tried nircmd.exe but it also doesn't do anything. I can change resolutions through the windows config, but it's just annoying..not sure wth is up?! Each time I install a new forceware driver, I use DriverCleaner, maybe it's messed up the registry somehow.

apparently I can't go >85Hz in dc.exe?! :(

I've made a dummy .inf for my monitor that says 120Hz max...same story. It's prolly the nvidia drivers that get the 85Hz limit through DDC, time to break some pins :D

DeadMan3000
14th December 2010, 15:47
I can't get it to work. It says it cannot find the file specified. Yes the path is correct.

soapit
29th September 2011, 22:14
is there any chance of someone posting the full runevent.vbs for just changing with the nvidia built in changer.

i know theres the if statement you need in the second post of this thread but i can't figure out how to mesh it with the other full runevent.vbs's that people have posted on here.

Barleyman
15th October 2011, 19:10
I thought this would be easy way to match refresh rate to media rate without manually changing things. No such luck, thought, doesn't play nice with TMT. TMT stops and restarts playback on resolution/refresh change and you can see where this is going.. :doh:

I guess acceptable workaround is to make simple batch file with DC for TMT..