In OpenGL you can control the swap interval of your application, which will limit the frame swap to the refresh rate of the monitor (v-sync). However, the user can override this by disallowing applications to control vertical sync within the Nvidia preferences application. In such as case, you have to make a choice:
live with the issue, and inform your users that to fix any A/V de-sync they have to allow the application to control v-sync.
Cap the refresh rate in your software: have a timer event, triggered every 60th of a second (16.667ms), which will trigger a redraw. Additionally/Alternatively, after every frame draw call glFinish()
which will force every queued API call to be executed, and will prevent further queuing until complete. This means that more CPU/GPU sync is performed, thus reducing frame draws, however, on it's own is limited only by hardware performance, and thus, is unpredictable as a frame limiter.
Generally, if you cap your frame draws in the same way you would limit solver cycles for your physics engine, then you should get a controlled frame-rate unaffected by vertical sync/driver settings.
example:
void engine::run()
{
float dt = 0f;
time_t last = 0;
time_t now = 0;
float gfx_timer = 1.0f/60;
float gfx_accumulator = 0f;
while (m_running == true)
{
now = time::now();
dt = (now - last)/(float)CLOCKS_PER_SECOND;
updateGame(dt); // update gamestate
if (dt >= gfx_timer) // ensures the renderer will only call once per 16.667ms at most
{
gfx_accumulator = 0.0f;
m_renderer.renderScene();
{
else
gfx_accumulator += dt;
last = now;
}
}
In general frame capping is a good idea, to not melt people's gpus, but be warned, gamers with an expensive graphics card will not thank you for capping them at 60fps.