3

I have a simple block rotation app (basically a d3d11 Hello World!), but whenever I run it I can hear an audible noise.

I attempted to step through the code to see the call that makes the noise 'happen', but I wasn't able to find it in any of the D3Dinit.

This is the code I am using to initialize:

    HRESULT hr = D3D11CreateDevice(
        0,                 // default adapter
        md3dDriverType,
        0,                 // no software device
        createDeviceFlags, 
        0, 0,              // default feature level array
        D3D11_SDK_VERSION,
        &md3dDevice,
        &featureLevel,
        &md3dImmediateContext);

Here's where I attach the interface and create the swap buffer (note HR() is just a macro that will display HRESULTS if debug is on)

    IDXGIDevice* dxgiDevice = 0;
HR(md3dDevice->QueryInterface(__uuidof(IDXGIDevice), (void**)&dxgiDevice));

IDXGIAdapter* dxgiAdapter = 0;
HR(dxgiDevice->GetParent(__uuidof(IDXGIAdapter), (void**)&dxgiAdapter));

IDXGIFactory* dxgiFactory = 0;
HR(dxgiAdapter->GetParent(__uuidof(IDXGIFactory), (void**)&dxgiFactory));

HR(dxgiFactory->CreateSwapChain(md3dDevice, &sd, &mSwapChain));

Does anyone know what would cause this audible noise to happen?

Shafik Yaghmour
  • 154,301
  • 39
  • 440
  • 740
  • On my computer it seems like the graphics card sometimes causes some interference with the sound card or speakers, causing some noise when e.g. I scroll or drag windows around. Could it be something like that? – Thomas Apr 20 '13 at 15:55
  • Is it a whining/quiet screetching/squealing noise? My graphics card does that under certain conditions - the chokes in it's PSU get a bit unhappy – Bojangles Apr 20 '13 at 15:57
  • @Thomas - perhaps... the noise stops when I move the window around Bojangles - It is a whining/quiet screetching noise yes. – user1940412 Apr 20 '13 at 16:17
  • The strange thing is that it doesn't seem to happen when I play other (assumedly) DirectX enhanced games. – user1940412 Apr 20 '13 at 16:18
  • 1
    Is vsync enabled? I noticed this on some cards when the frame rate is crazy high(500+) – Barış Uşaklı Apr 20 '13 at 17:52
  • @BarışUşaklı Thank you very much! Disabling Vsync was the solution :) – user1940412 Apr 20 '13 at 22:15
  • @BarışUşaklı you should post that as an answer. – Shafik Yaghmour Jan 03 '14 at 03:01

1 Answers1

2

I noticed this on some graphics cards when the frame rate is really high. Enabling vsync usually gets rid of this sound.

http://www.techpowerup.com/forums/threads/whine-from-gpu-under-high-frame-rate.157681/

Hard to hear in the video but its noticable

http://www.youtube.com/watch?v=3ibkMvhMlgs

Barış Uşaklı
  • 13,440
  • 7
  • 40
  • 66