pouët.net

Weird sync issues with new system

category: general [glöplog]
I'm having weird audio/video sync problems with the new system I have recently built. My benchmark demo for this issue is Andromeda/Orb Stargazer, though it happens in some, but not all other productions as well. For instance, ASD demos always stay in sync, where most productions from Portal Process and Stravaganza among others show the issue. In Stargazer, the audio lags behind noticably. By the time the intro scene is done, the audio is behind a full second. By the end of the demo, is has dropped back at least four seconds.

In Arise from Stravaganza, the audio runs ahead of the video. Again, it is off by several seconds by the time the demo reaches its end.

My old system, a P4 3.2ghz machine with a 7900GS video card and 2GB ram does not have this problem.

My new system is a Core 2 duo E8500, has a GTX260 Core 216 video card and Realtek ALC1200 audio. I have 4GB of memory installed. I did try a Turtle Beach sound card with the latest driver for that card and had the same problem, which points me towards video. The only settings change I have made is I enabled PhysX in the video driver.

Video driver is 180.48.
Audio driver is the latest one, released 12/31/08 but the problem existed with the original driver provided with the system board.
OS is Windows XP Pro, SP3 and is up to date.
I am not overclocking anything.
I did get the problem to go away by resetting bios defaults a couple of nights ago. The problem reappeared today.

Has anyone else experienced this problem? Resolved it? If so, how? Thanks in advance..
added on the 2009-01-07 01:47:30 by ngtflyer ngtflyer
Interesting.

We knew the party version of Stargazer could have a sound latency issue on Vista (coming from the too old version of Bass we used it seems) but what you mentionned it new to me. As a result, it could lead to audio starting with the visuals stuck on the loading picture.

Incidently, we are currently working on fixing another timer issue that arised recently (we cannot reproduce it on my machine or on Hyde's unfortunately), so any information on those various problems is welcome.
added on the 2009-01-07 02:05:08 by keops keops
funny to hear about timing-issues...
...our intro seems not to work correctly on some computers...
i think it has to do with all the effects getting triggered by the music...so if the music doesnt start there´ll be NO effects at all f.e.
maybe y2k-bug triggered now - in some strange way ? haha !
This affects a number of things. After restoring bios defaults the other day, audio/video was in perfect sync on everything I threw at it. I just did the same thing today and this time it did not resolve the problem. (shouldn't have any effect - I haven't changed anything since the last time.)

I am beginning to wonder if it's a problem with the video driver itself. Originally I had thought it was the sound hardware - I've never really been a fan of the cheap onboard sound that most motherboards have. I proved myself wrong by disabling onboard and using the Turtle Beach card.

As I said, this seems to affect many demos. I've noticed other quirks but this is the biggest one. Let me know if there is any specific information you need from my system. I'm planning on trying a few things tonight.
added on the 2009-01-07 04:06:32 by ngtflyer ngtflyer
OK so I have some more info. Here is what I have tried and the results:
Reset all to defaults in Nvidia control panel, no improvement.
Turned of PhysX, no improvement.
Rolled back to original Evga supplied driver for the video card, no improvement.
Performed System Restore to last Friday and restart, problem temporarily cured until restarted again.
Disabled Avast antivirus, no improvement.
Performed system restore to yesterday and restart, problem cured until sysem restarted again.

So, I am pretty much convinced that this issue is not hardware. I am currently clearing off another Sata drive for me to use - I plan to do another new XP build with all the latest drivers and start installing things one by one until (if) I see the problem resurface.
added on the 2009-01-07 06:49:54 by ngtflyer ngtflyer
i had problems with my box aswell...it sometimes just switched to one color fullscreen...the OS was still there and usable,but just not visible ( behind the one-color-frame ) ...so i couldnt even find the buttons to restart the OS...had to hardreset every time...
...this suddenly went away/didn´t happen anymore, after i flashed my BIOS to the newest version !
maybe there´s some firmware-upgrade for your bios aswell...check the net and try this before you reinstall everything !
It's 2:00am here and I think I have it fixed. I did a restore all the way back to right after installing the drivers but before installing anything else. Everything worked fine. So I brought it back current and the issue came back. After some experimentation and thought, I started suspecting the Asus power management software that was included with my motherboard. I set it to full performance mode and the problem became a bit less severe but still existed. So I uninstalled it and the problem is completely gone. I just finished running Stargazer again and this is the best performance I have yet seen. I'm going to reboot and try another run just to make sure, but I think I found the culprit. So, useful info for anyone who has problems with the audio and video getting out of sync in demos or anything 3D - try uninstalling any of those power management "apps" that come with your motherboard.
I suspect the problem I had was caused by the app's constant monitoring of cpu load. If the CPU and other components go idle, the app steps it down for lower power usage. I think this was causing clock ticks to be missed and throwing things off.

The real test, however, will be after I reboot.

I've downloaded the latest bios but installing it requires a dos boot floppy. Asus still does it the old way. :)

Thanks for your info - glad you got your machine cured as well.
added on the 2009-01-07 08:11:19 by ngtflyer ngtflyer
nice news :)
...and so everyone was happy again in the end...and if they haven´t died yet...they still demo ! :)
next please !
Keops: what ngtflyer is saying is unrelated to the "bass reports garbage latency under vista"-thing we had going. It's most probably due to us not updating the timer frequency when the power management nonsense starts doing its stuff.
added on the 2009-01-07 09:50:14 by Hyde Hyde
and hey - ngtflyer - watch the video like normal people do, ok? :)
added on the 2009-01-07 09:51:16 by Hyde Hyde
Yeah, I know it's unrelated, I just found the coincidence interesting since we recently had shitloads of those various timing issues :D
added on the 2009-01-07 13:23:17 by keops keops
I think Hyde nailed it. Since uninstalling the power management app, the whole system runs better. All demos run with good audio/graphics sync and DVD playback is also better. I tested this on a new system I am building for someone, has an MSI motherboard. This one is an AMD Sempron 3400+ with a GForce 9800GTX card. I loaded the MSI's power management app and then tried a couple of the same demos that I had observed the issue with on my system. Same results. Uninstalled it, problem disappeared on that machine as well.

The reason the issue disappeared right after doing a system restore is, the registry entries for the power mgmt app were changed, preventing the thing from running until after a reboot.

So, yeah. Tech tip: Stay away from those "power management" programs. They cause more problems than they solve. Keops: Check that machine you found the timing problem on with the new version and see if it has any of that crap installed.
added on the 2009-01-08 17:31:14 by ngtflyer ngtflyer
We already fixed that bug indeed (hopefully). As soon as we fix the other remaining issue, we can send you a test version of the final final if by any chance you're interested in helping :D
added on the 2009-01-08 17:34:44 by keops keops
Ngtflyer : Btw, the other timing problem we currently have with the final version only is quite different but it would be interesting if you had it too, you will tell us when it's out ;)
added on the 2009-01-08 17:37:22 by keops keops
For the Stravaganza demos I basically use Bass 1.8a for music and QueryPerformanceCounter/QueryPerformanceFrequency for timing (QueryPerformanceFrequency is called only once and at the start).
I heard many times QueryPerformanceFrequency() can vary due to power saving, but never experienced this myself.
So, the fix should be taking QueryPerformanceFrequency() into account each time you call QueryPerformanceCounter() ?
added on the 2009-01-08 17:41:49 by ithaqua ithaqua
ithaqua: yes, same here for the timer. http://msdn.microsoft.com/en-us/library/ms644905(VS.85).aspx states that "The QueryPerformanceFrequency function retrieves the frequency of the high-resolution performance counter, if one exists. The frequency cannot change while the system is running." But didn't Pantaloon or someone just mention in another thread that this wasn't always true?

I checked a nehe tutorial the other day, and there was only one frequency readoff at startup there too.
added on the 2009-01-08 19:06:02 by Hyde Hyde
Syncing visuals to audio is best done by using the sound-players timers. This is because some audio-drivers round off the playback-frequencies slightly, causing the audio to play at a slightly wrong pitch. This is usually so little that it's not audible, but it shows quite clearly at the end of a 3-4 minutes long demos. Since you're using BASS already, why don't you use BASS_ChannelBytes2Seconds(stream, BASS_ChannelGetPosition(stream, BASS_POS_BYTE))) instead? This gives a high precision timer, perfectly synced to your audio.

I've heard shit-loads of reports that QueryPerformanceFrequency changes as intel speed-step kicks in and similar, so I was a bit surprised to read that detail on MSDN. I haven't tested this myself, though.
added on the 2009-01-08 20:00:25 by kusma kusma
Kusma : we made a version using indeed Bass's timer that solved our problems (this one and another quite different) but we want to make sure its precision is high enough.

In other words : we did not fully test it yet but at first it seemed to work fine indeed :D

I remember Fmod's timer was horrible (terrible precision), that's one of the reasons why we were reluctant to use the one from Bass at first.
added on the 2009-01-08 20:06:52 by keops keops
Yeah, FMOD has a horrible timer, but luckily this is not the case for BASS :)
added on the 2009-01-08 20:10:04 by kusma kusma
Thanks Kusma! Nobody likes sync better than ssecxe, so screw QueryPerformanceCounter() :)
added on the 2009-01-08 20:39:25 by Hyde Hyde
I'd be happy to test anything you guys want me to. I have two platforms available; my new system and my previous P4 beast. Full stats on both:
New: Asus P5Q Pro, Core 2 duo E8500, 4GB memory, Evga GTX216 Core 216, Onboard Realtek sound, WinXP Pro SP3, all drivers are latest versions.
Old: Abit IC7-G, P4 3.2ghz space-heater, 2GB memory, XFX 7900GS, WinXP Pro SP3, Turtle Beach Santa Cruz sound card, WinXP Pro, all drivers are latest versions.

I don't run any power management software on either. :)
added on the 2009-01-08 21:26:52 by ngtflyer ngtflyer
whoops.. GTX260 Core 216.
added on the 2009-01-09 00:03:15 by ngtflyer ngtflyer
Speaking of Bass and for those who use it, do you use the sound latency value Bass returns ?

Some people seem to think it has to be used because the sound latency value can be noticable with some configurations whereas other people told me to avoid it since it was wrong.

A previous version of Bass used to return a latency value of something like -4.6e+006ms on Vista (which made no sense) but the latest version seems to return a more likely value on my machine : 30ms on average.

Can one trust and use that value or not and can this latency be actually be enough to make things look out of sync if not taken into account ?
added on the 2009-01-09 15:55:04 by keops keops
keops: I don't use the calculated latency anywhere. Remember that you have some latency in the video as well (I pretty much always use tripple buffering, which should give something like 2 / fps seconds of video-latency, which is 33ms at 60fps - about the same as you reported the audio-latency to be), so don't try to correct too much, or you'll just end up making everything worse :P

Anyway, for non-interactive stuff, a small latency isn't that big of a deal; the human eye / brain / ears / whatever actually compensates a bit. It's when the sync starts to slip out you'll have real problems.
added on the 2009-01-09 16:09:19 by kusma kusma
keops: By the way, how were you able to get a negative latency-value? The latency-field of BASS_INFO is DWORD, so it's unsigned... Is there some other latency-query that I don't know of?
added on the 2009-01-09 18:02:55 by kusma kusma

login