Game Development Community

Weird sound in D3D mode

by Martin Andresen · in Torque Game Builder · 05/27/2009 (6:32 am) · 5 replies

When running our game in D3D mode a faint continously sound can be heard, even when no audio is being played. Depending on the speakers/headsets being used the sound is either very low (on some almost not noticeable) or high, but the sound is allways there. The sound changes in pitch when ever a new scene is being loaded. Have tried it on several PC's (all with Nvidia cards though) and all of them gave this weird sound. When using OpenGL there is no problem at all.

We use the improved audio library found elsewhere here and OpenAL 1.1, but also using the original exe and OpenAL from TGB yields the same results.

Anyone has any ideas?

Edit: We are using 1.7.4 btw.

#1
06/05/2009 (5:00 pm)
Very strange. Do these pc's all use the same sound cards?
#2
06/07/2009 (10:30 pm)
I know I had a similar problem on my laptop. The sound card on it was a lot weaker than my desktop, which never made the same sound. So Kenneth could have a point.
#3
06/08/2009 (1:05 am)
I looked more into this problem and I think I have an idea of what is causing the problem. On some of the machines the sound was coming from the PC itself, guessing the graphic card, and I read on the internet when a graphic card is under load a squealling sound can be heard.

When running D3D mode it doesn't seem you can enable vsync, the setVerticalSync just returns false, so the card is under a lot more load, than when we were running OpenGL with vsync enabled.

Looking at the source code I can see that setVerticalSync in D3D mode always returns false. Is there a reason for this? And anyone know of a solution how to enable it?
#4
06/08/2009 (11:26 am)
Apparently vsync can not be disabled in D3D as microsoft enforces this. www.d-silence.com/feature.php?id=255

As a note, the d3d function should return true.
#5
06/09/2009 (1:13 am)
We are not trying to disable VSYNC, we want it enabled, as it should have been according to that link. As far as I can see TGB uses the DirectX 7 interface and VSYNC enabling/disabling isn't supported untill DirectX 8. But is there a reason why VSYNC is disabled when using DirectX 7 interface? Maybe newer graphic cards and DirectX 9 driver will just disable VSYNC per default regardless of which interface is used? Forcing VSYNC on in the graphic driver options works, but would still prefer to handle this from the engine itself.

The D3D version of setVerticalSync doesn't do anything, so I guess that's the reason why they return false:
bool D3DDevice::setVerticalSync( bool on )
{
on;
return( false );
}
That function should never be able to return true. ;)