Build Your Own Arcade Controls Forum
Main => Software Forum => Topic started by: GaryMcT on August 04, 2009, 02:45:33 am
-
This isn't a slam-dunk fix. You will still see a bit of tearing now and again, but it's a good compromise for when you are having audio sync problem with triple-buffering enabled. I haven't made this configurable yet. . I'll do that later.
The initial version is a patch off of 133u1 sources. It doesn't looks like the code that I'm changing has changed much lately, so it'll likely work with other recent versions:
http://home.comcast.net/~g.mctaggart/0133u1_garymct_d3d_triple_buffer_fix.diff (http://home.comcast.net/~g.mctaggart/0133u1_garymct_d3d_triple_buffer_fix.diff)
Here's the MameDev page on how to apply patches to the source code for Mame:
http://mamedev.org/updates.html (http://mamedev.org/updates.html)
I'd be happy to get feedback on this. I'll likely fix the problems with the pixel not lining up perfectly in D3D mode and put that here too.
I don't think this patch is appropriate for Mame proper since there will be some tearing.
Gary
-
Thanks for your contribution!
-
Is this only for D3D Gary?
-
D3D-only for now. I'll see if it is possible with ddraw, but I'm more likely to take the time to make D3D pixel-accurate since I know how to do that.
-
The more I think about it the more I think that this is a big hack. I'll look at getting the sound to work properly with triple buffering without tearing. This is a good short-term solution though.
-
but I'm more likely to take the time to make D3D pixel-accurate since I know how to do that.
That would be lovely. I know there is a patch out there by 'wpcmame' for so-called clean-stretch with D3D, but it was rejected for whatever reason by mamedev. Not sure if that patch has been kept up to date with the latest MAME releases.
-
but I'm more likely to take the time to make D3D pixel-accurate since I know how to do that.
That would be lovely. I know there is a patch out there by 'wpcmame' for so-called clean-stretch with D3D, but it was rejected for whatever reason by mamedev. Not sure if that patch has been kept up to date with the latest MAME releases.
Are you the arcade ambiance guy? If so, would you be interested in some quadraphonic recordings of a real arcade that I recorded down at Ground Kontrol a few weeks ago? I don't know when I'm going to get a chance to do anything with them.
On a related note, they were playing your track out the front door to entice people in. :)
-
Are you the arcade ambiance guy? If so, would you be interested in some quadraphonic recordings of a real arcade that I recorded down at Ground Kontrol a few weeks ago? I don't know when I'm going to get a chance to do anything with them.
Yes and yes please! :)
What kind of equipment did you use to record that?
On a related note, they were playing your track out the front door to entice people in. :)
Neat!
-
Are you the arcade ambiance guy? If so, would you be interested in some quadraphonic recordings of a real arcade that I recorded down at Ground Kontrol a few weeks ago? I don't know when I'm going to get a chance to do anything with them.
Yes and yes please! :)
What kind of equipment did you use to record that?
On a related note, they were playing your track out the front door to entice people in. :)
Neat!
I borrowed a friend's Zoom H2 field recorder. I'll put the files up sometime soon for you and send you a link.
-
Did some more digging tonight. It looks like the sound hitching with triple buffering is always the case that the rendering is going too fast. I'm assuming that when you aren't vsyncing or triple-buffering, there is a manual timer in there somewhere to throttle everything. . . maybe that isn't happening with triple buffering and it should be happening. Going to dig some more.
-
Keep digging! :applaud:
-
any luck on this? :cheers:
-
This fix should already be Incorporated in Cabmame.
You can also download .diff separately and compile your own version.
http://community.arcadeinfo.de/showthread.php?t=9555
-
This fix should already be Incorporated in Cabmame.
You can also download .diff separately and compile your own version.
http://community.arcadeinfo.de/showthread.php?t=9555
Really? I'm running cabmame and have this problem.
Oh, you must be talking about the pitch-shifting stuff to fix the problem. I don't care for the results of that. The problem should be fixable without resorting to degrading audio quality.
-
In more detail, with triple buffering, you should be able to run the frame loop at a different rate than the refresh rate of your display without having problems. The only exception is that D3D doesn't let the hardware get more than 3 frames behind the app, which is what I think is happening with Mame. I suspect hat early on in the app run a ton of frames are getting sent down to D3D and it is never allowed to get "caught up". I have some more digging to see if I can fix it. I haven't had a lot of time lately. A similar fix or the same fix may apply to ddraw as well.
-
I think I might know what it is. Haven't tested it out yet though.
Since D3D/DDraw doesn't have a triple buffer mode that throws away frames (I don't think), there needs to be something like autoframeskip, but for when the GPU is behind, not the CPU. Pacman has been my test case, and the original runs at ~60.60 Hz and my monitor is running at 60Hz. The game will need to skip rendering of some frames (or at least swap of those frames) so that the GPU can catch up. If the GPU isn't allowed to catch up, the CPU will be forced to block once the app gets more than 3 frames behind.
I don't have much time to work on this now, but if someone wants to test the theory, see if all games that have sound skipping problems in triple buffer mode have an original refresh rate that is higher than the refresh rate that your monitor is running at. You can run with -verbose on the mame command-line to see what resolution you are actually running at, and look in the tab menu under "game information" to see what the original resolution was.
-
Wow, if you can truly fix this without any sound warping, screen tearing, or audio glitches you will be a HERO.
-
Gary any update??
-
Not yet. I have a plan, but finishing up the game that I'm working on at work and adding modifier key support to mame has taken higher priority.
-
Found this topic interesting, since I've just noticed that I having been running my cab with the triple buffer option on. With it enabled I get occasional sound stutter.
Any progress on this?
D
-
Found this topic interesting, since I've just noticed that I having been running my cab with the triple buffer option on. With it enabled I get occasional sound stutter.
Any progress on this?
D
Sorry. I've totally flaked on this since I've stopped using Mame for arcade cabs.
-
What are you using on your cabs instead of MAME?
Encryptor
-
What are you using on your cabs instead of MAME?
Encryptor
I'm using a combination of the original PCBs (Defender, Omega Race, Asteroids Deluxe, Centipede), the JROK fpga mult-williams board for all the early Williams stuff, and I'm learning how to write code for fpga devices so that I can work on getting more games that I care about working (http://fpgaarcade.com (http://fpgaarcade.com) has good info on this process). I also have Pac-Man from fpgaarcade.com working on an arcade monitor. . works great!
I'm extremely sensitive to latency, and the Windows version of Mame didn't feel responsive enough to me. It's Window's fault, not Mame's fault from what I can tell. It would make sense to get modern Mame working on Linux on modern hardware with all the correct refresh rates and resolutions (like Advance Mame did), but that feels too much like work for me to work on that, so I'm going to work on the longer term fpga thing. It's going to take me a while to get to the point where I can implement a whole PCB/game though.
-
It sounds very interesting. Are you doing coding for this?
Encryptor
-
It sounds very interesting. Are you doing coding for this?
Encryptor
I haven't submitted anything, but I'm learning how to do this. It may take a while since I'm new with hardware (I'm a software guy.)
-
I was wondering if you've tried GroovyMAME to see if it works any better for you.