Jump to content
Sign in to follow this  
Iran

audio/movies lagging with single CPU affinity on certain multicore PCs

Recommended Posts

Same issue that RA95 has. To fix change the 'PUSH 80h' at 0x004D06AD to 'PUSH 20h'. This is the same thing that the LowerThreadPriority fix does that gets applied when Windows 95 compatibility is turned on.

 

AFAIK if you force single CPU affinity with this fix the game will run fine for all PCs (this seems to be the case with RA95) and you can permanently set single CPU affinity instead of only enabling it after running the config tool with cnc-ddraw turned off or something like that which you are currently doing.

Edited by Iran

Share this post


Link to post

So... mind explaining what exactly this change DOES?

Share this post


Link to post

Changes the HIGH_PRIORITY_CLASS argument to SetPriorityClass to NORMAL_PRIORITY_CLASS. The call to SetPriorityClass there is at the start of VQA_Play(). Setting the thread priority to high causes resource starvation under certain circumstances on multicore PCs.

 

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

Edited by Iran

Share this post


Link to post

Wait, so C&C changes its own priority during game play? Shouldn't it be better to um, disable all calls to that completely? :|

Share this post


Link to post

Yes, it happens at the start of VQA_Play(). I tried disabling the call but I couldn't get that to work, either crashed or caused weird video playback issues.

Share this post


Link to post

I upgrade to 106c Rev 3 (from Rev 2) yesterday and noticed there is a 5 second delay before a movies starts, between movie transitions, and when aborting a campaign. Possibly still an issue?

 

I changed {singlecpu=False} and it fixed the issue. Is this the proper work around at the moment?

Share this post


Link to post

Hm, interesting. I've had that issue too. Is that what causes it?

Did you change the option to "false", or to "true"?

[edit]

Indeed, with "singlecpu=true" it hangs for a couple of seconds before every video, and certain other things. Thanks for pinpointing this problem!

I'll need to check if this means that that option is enabled by default... that would not be a good thing.

[edit]

Indeed, it's accidentally enabled by default in the installers. Augh. I'll have to fix the installers, then.

Thank you for reporting this issue; it was driving me nuts too!

Share this post


Link to post

Having singlecpu=true makes my videos lag. :P

Share this post


Link to post

Yeah I'm not sure why you would want to do single cpu for C&C. I know for emulators having this option is needed for reducing latency and doing audio based synchronization (as opposed to Vsync).

 

I don't think latency is necessarily important for C&C since it is an RTS but I could be wrong. According to Iran above, it lags because the priority is incorrectly set and some code modification would need tobe done in order to fix it.

Share this post


Link to post

Yeah, but that would require releasing an actual new patch, and currently, my code is a bit of a mess. I need to sort it all out first.

 

Mind you, I doubt the actual use of a single CPU is the problem. As far as I've seen in my task manager, the game automatically runs on only one CPU when I run it, even without any compatibility modes. It seems to just be caused by how cnc-ddraw handles that option to force it.

Share this post


Link to post

It doesn't use just one core in my Prescott Pentium 4 (HyperThreading). Actually, setting singlecore=true lags the entire game here. :P

Share this post


Link to post

You just have a crappy PC, Pichorra :P

Share this post


Link to post

Create an account or sign in to comment

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

Create an account

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

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×