Viewing Issue Advanced Details
ID Category [?] Severity [?] Reproducibility Date Submitted Last Update
06346 Timing Minor Always Aug 10, 2016, 20:09 Sep 1, 2016, 02:41
Tester Augusto View Status Public Platform MAME (Official Binary)
Assigned To Resolution Open OS Windows 10 (64-bit)
Status [?] Confirmed Driver pacman.cpp
Version 0.176 Fixed in Version Build
Summary 06346: mspacman: refreshspeed not work if using bgfx
Description refreshspeed not work if using opengl and bgfx.
Just work if selecting d3d.
Thanks and good night for you.
Steps To Reproduce
Additional Information
Regression Version
Affected Sets / Systems mspacman
Attached Files
There are no relationsihp linked to this issue.
User avatar
Aug 11, 2016, 13:43
This presumes you have 'waitvsync' on?
Your statement "not work" means that the audio is periodically distorted or 'skips'?
User avatar
Aug 11, 2016, 15:40
edited on: Aug 11, 2016, 16:46
``This presumes you have 'waitvsync' on?``
``Your statement "not work" means that the audio is periodically distorted or 'skips'?``
Because the framerate being more of 60 HZ. Yes the audio skip.

The system here is an Athlon 2 270 3.4 GHZ 4 GB RAM Nvidia Geforce GT 640 latest driver version and Windows 10 64 TH2.
All Nvidia settings is off less vsync allowing MAME to enable and triplebuffer enabled.
Games using more of 60 HZ not are limited to use just 60 HZ.
Without others programs in background when running MAME is how if not all frames is being rendered in screen if using bgfx even selected screen effect none instead of any effect. Not graphics issues.
Framerate not is all time 100 % even if syncrefresh is enabled.
Gameplay is 100 % and in few seconds 90 % and after is 100 % and after is 90 or 85 % with any game using more of less of 60 HZ and not see being any related with CPU because MAME setting sleep when possible is off and the CPU is being used less of half and GPU usage if less of half.
Audio skips with noise just if xaudio2 is selected. Dsound is fine.
audio sync setting was removed.
Detail is if using D3D the audio is sync fine, but OpenGL and BGFX the audio not has good sync and when the framerate not is being 100 % the audio skips.
Strange, but had one previous version that BGFX not had that issue with refreshrate. I not remember what was the MAME version. Hmmm I had used MAME using an Full HD LCD with previous versions and the issue was using current version in 1280X1024 LCD and see that if artwork are enabled with bgfx has an big slowdown in emulation using more of 75% of two cpu cores with ddragon or pacman even using MAME in same computer when before was used 1920X1080 without the issues. If artwork is cropped has the slowdown and if artwork is full not has slowdown.
Yes waitsync is on and in nvidia control panel is selected to allow vsync just if MAME has enabled.
D3D works fine without issues with framerate because games using more of 60 HZ are limited to 60 HZ and audio is sync correctly.
MAME is configurated perfectly here and using the native resolution of LCD.
Excuse if I has posted much lines here, but add information to see what is because of issue.
Perhaps both renderers is without some code to use refreshrate correctly.
God bless you for your work in help the life of mamedevs and in the project.
User avatar
Aug 14, 2016, 01:27
Added mspacman as a test game. Confirmed
User avatar
Aug 20, 2016, 02:47
Tested with current GIT.
D3D works fine with dsound, but xaudio2 is out of sync. Framerate is ahead of sound.
BGFX xaudio2 is out of sync, but not has distortion.
Audio Sync was removed from MAME.INI. Is now internally enabled ?
Perhaps is code sound core need from selected video render and BGFX not has the code to report the framerate correctly.
User avatar
Sep 1, 2016, 02:41
edited on: Sep 1, 2016, 02:49
I have tested with current version and refreshspeed was partialy fixed.
In current version if using D3D is correct and BGFX the refresh rate is being variable and not is all time in same value. Values are from 85 % to 100 % and some times is 105 %.
D3D the sound is in same speed and BGFX is out of sync even in games with less of 60 HZ.
Previous version had one option to sync the audio with refreshrate that was good to avoid sound problems, but was removed from MAME.ini.
Is how if need to be added some codes in BGFX to sync audio and video of same mode that D3D is doing.
When testing nothing of background programs running and the machine have enough cpu and gpu.