Mortal Kombat 2/3/UMK3 Audio
-
I got into RGUI. The DCS speed hack was already enabled so I disabled it, yet still the same issue. It happens right around the same time every time. I just let it go this time and the audio eventually came back around. It has to be a timing/sync thing (IMO).
I played with lowering sample rate and increasing audio latency but same exact issue.
-
re-enable the speed hack.
then try lowering the volume a bit in these games via the service menu: https://github.com/RetroPie/RetroPie-Setup/wiki/lr-mame2003#service-menu
-
Thanks @dankcushions , I was thinking the same thing at this moment (lowering the volume in service). I will try that later when I get home. When I setup MK2 I did turn the Volume in service up to like 75%. I'll dial it back to 50% and even lesser if I still get it.
Remember this isn't the whole time, it's only extended playing after like 10-15min, then it goes away and comes back in the same amount of time.
-
@GreenHawk84 yeah that is strange! I will have to test the same on my setup (I only played these games briefly). If not it could be a performance thing as I think these games are particularly intensive to emulate. it took the pi3 before MK1 was good in mame2003 (it is fine in mame4all on pi2, FYI). if so it may need overclocks to help out if there are still issues.
-
MK1 runs fantastic on my RPi3. As a matter of fact most everything does run amazing (Sega Genesis, SNES, NES, most arcade titles). I have yet to experience a single issue with most games. I will go back and play extensively on MK1 and see if anything turns up. I hope that arcade MK2 and MK3 continue to get support in order to run best on RPi3. I know that it can be done, it's already so close. Seems like it's just the audio issues.
-
Okay so I made a little video to show what is happening. I turned the volume down in the service menu to <50% and just turned my amp up.
-
I tested a few things to try and weed it out. I tried "alsathread" and "sdl2" drivers, same problem. Whats the default sound driver for arcade anyway? I tried disabling smoothing, no dice. I am convinced smoothing doesn't have such a huge hit on the system. Not sure where to go from here.. hopefully someone can figure it out or within an update to Retropie. Mortal Kombat was one of the main reasons I built my cabinet. Anyway, I'll continue to search and try things.
-
Do games ever improve on a core from updates or will this game forever be this way?
-
@GreenHawk84 said in Mortal Kombat 2/3/UMK3 Audio:
Do games ever improve on a core from updates or will this game forever be this way?
it depends on your issue. i've done some updates to mame2003.
anyway, i could recreate it - it briefly did the distortion for one round. CPU useage wasn't that high so i don't think it is performance. not sure.
-
@dankcushions , I wonder why yours was brief vs. mine being a couple rounds worth.
-
Thought maybe I would get lucky and have it be OK when I updated Retropie. I think I'll always hope that the next update will fix it.
-
well, i had a go at investigating this:
https://github.com/libretro/mame2003-libretro/issues/43Tested on Raspberry Pi 3 and OSX x64, and the DCS speedhack on/off, with same results.
If you play MK2 for around 10 minutes, it will start to distort the audio (heavy buzzing and overlapping samples), for about a minute, before eventually settling down, but with an ever increasing audio latency. if you keep playing for another 10 minutes, the process will repeat, with the latency getting worse and worse.
i debugged this by enabling all the various logs in dcs.c here https://github.com/libretro/mame2003-libretro/blob/master/src/sndhrdw/dcs.c#L13, and replacing all
logerror(..)
withprintf(..)
. this prints a variety of info to the console. mostly a lot of this:DCS dac update: bytes in buffer = 398 DCS dac update: bytes in buffer = 531 DCS dac update: bytes in buffer = 424 DCS dac update: bytes in buffer = 557 DCS dac update: bytes in buffer = 449 DCS dac update: bytes in buffer = 342 DCS dac update: bytes in buffer = 475 DCS dac update: bytes in buffer = 368 DCS dac update: bytes in buffer = 500 DCS dac update: bytes in buffer = 393
i noticed that during the periods of distortion, the bytes used by the buffer, reported by https://github.com/libretro/mame2003-libretro/blob/master/src/sndhrdw/dcs.c#L915, are close to the defined DCS_BUFFER_SIZE of 4096 (https://github.com/libretro/mame2003-libretro/blob/master/src/sndhrdw/dcs.c#L23). the distortion goes away as it begins to go over 4096 bytes, and then will start up again as it reaches 8192, etc.
if you raise DCS_BUFFER_SIZE to 8192, it takes longer for the issues to start, but it still has the same problem, as the bytes in the buffer will continue to rise forever.
i don't know ANYTHING about audio programming, but i would have thought the buffer size should act as a limit, which cannot be exceeded? it seems this is quite happy to go above the buffer :) i want to try and preempt this behavior and reset the buffer before it reaches of DCS_BUFFER_SIZE, but i'm not sure if this is the right approach, or how to do it.
PS, if you want to quickly recreate this, just set DCS_BUFFER_SIZE to 1024 or something lower, and it will start happening in a few minutes.
(so that's about as far as I got... i'll need help from someone who knows audio programming to get much further)
-
Wow man, nice find. Hopefully this can be resolved, but sounds like it needs an audio specialist as you speculated. Maybe this issue was inherent with the emulators back in 2003 and was since fixed in new Mame iterations. Although the audio in MK is even worse with other cores.
-
@dankcushions , or anyone, how do I get into service menus with lr-mame4all? It's F2 on lr-mame2003 but I get no response while in lr-mame4all. The reason I ask is because I am trying to test audio for MK games on mame4all but it is so quiet. Also, my controls are seriously jacked in mame4all. Mame2003 has the "tab" button feature to just remap per game.
-
@GreenHawk84 i don't think any of that stuff works on lr-imame4all i'm afraid.
-
@dankcushions, so is there no way to access the service menu in mame4all?
-
@GreenHawk84 that's what i said...
-
@dankcushions , I see you have made discoveries recently regarding this issue. Awesome, so glad you continue to investigate. I wish I could buy you a beer !
-
@dankcushions , I see you updated both MK3 and UMK3 in the Mame2003 compatibility list. These had poor audio for me as well, but I will go back in and play them extensively and report back.
-
@GreenHawk84 said in Mortal Kombat 2/3/UMK3 Audio:
@dankcushions , I see you updated both MK3 and UMK3 in the Mame2003 compatibility list. These had poor audio for me as well, but I will go back in and play them extensively and report back.
i didn't... i had them all as 'has issues' someone seems to have turned both to 'ok' on the pi3, despite the issue log linked in the notes.
i've now reverted the all back to 'has issues'
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.