Jump to content
  • Advertisement
Sign in to follow this  
AteneoUW

Triple Buffering can solve the sync problem?

This topic is 2122 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, im new to the forum and Direct3d as well.

 

The thing is that my app syncs frames to DirectSound and im not using a static buffer in DirectSound. I.E the app generates sound and the dynamic buffer gets filled with this data when there is enough room.

If i enable Direct3d 9 VSync support the sound buffer gets scratched and stop hearing well.

Im Using Direct3d 9 texture quads tu render a 2d texture to screen (this texture is filled with data every frame).

The images tears and i need to stop that. I heard that using triple buffering could solve my problem but i don't know how to do it!!

I have googled but i can't find a answer.

 

Thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement

The image-tearing should be fixed by VSync.

If audio-problems appear by v-syncing you probably buffer too little sound per frame, so that 60 FPS (or what your vsync interval is) is too long to keep up with the sound playing. Buffer more data each frame if that is the case.

Share this post


Link to post
Share on other sites
You should increase the buffer length or move the directsound system to another thread. The audio stutters because vsync is halting your cpu, thus the audio buffer does not get feed and runs out of data before the cpu resumes execution

Share this post


Link to post
Share on other sites

You cannot synchronize a circular audio buffer with screen vsync, each chipset has its own rythm. When vsync flip occurs, you cannot read the byte position played by audio chip, and when audiobuffer swap occurs, you cannot read the index of currently drawn screen scanline.

 

That's why old machines emulators have problems of sound latency and cleaness... have a look at their sources, audio and video sync is based on complex workarounds in intermediate elastic buffer.

Edited by punkcoders

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!