irixxxx / picodrive

Fast MegaDrive/MegaCD/32X emulator
Other
49 stars 24 forks source link

[Miyoo/PocketGo] Incorrect SSG-EG sound #45

Closed freq-mod closed 2 years ago

freq-mod commented 2 years ago

just like #43 - no idea why, x86 PC build works fine. eg.zip - zip package with test ROM and recordings. wrongeg.mp3 is a recording from my Powkiddy V90 (sorry for not so good quality) and propereg.mp3 is from x86 build of Picodrive that is almost the same as MAME emulation - intended timbre that pretty much matches the original MD hardware. The difference is apparent. SSG emulation is enabled on Miyoo side, build with proper flags and CZ80 usage, no idea what makes these two differ.

irixxxx commented 2 years ago

sound rendering on ARM 32 bit platforms is done by an optimised asm renderer. There might be an error in that. I'll have a look.

irixxxx commented 2 years ago

Could you try this patch please: y.txt

freq-mod commented 2 years ago

Well, now it's MUCH closer to what it should sound like. There is some slight difference still, but good enough IMO, thanks!

irixxxx commented 2 years ago

I think there are more bugs in this than the 3 I fixed here. If you could give this some close scrutiny to narrow down problems I could have a look.

freq-mod commented 2 years ago

You mean with SSG-EG? I can make some more tests

DrUm78 commented 2 years ago

Way better for me too and close to the original, not sure whether it's perfect or not (seems to crackle a bit).

freq-mod commented 2 years ago

some small imperfections, wait a second (making a different EG test)

freq-mod commented 2 years ago

based on my tests it sounds the same or almost the same as the original YM2612. I really have no reason to raise isuue about :man_shrugging:

EDIT: some crackling/very short clicks. No idea if it's from SSG-EG emulation or CPU usage problem

irixxxx commented 2 years ago

I recorded audio with x86 and arm and compared the sample output. I definitely see differences. That's true for non-SSG output as well, so there must be some difference in the operators. I can however not really hear which one is better or make any judgement which is more correct, as I'm no expert for this kind of audio tech... Thanks anyway. Should you discover more oddities just post me.

irixxxx commented 2 years ago

Since you seem to do a lot with the sound on Sega stuff: How would you rate the sound output overall? Is there something noticeably amiss?

freq-mod commented 2 years ago

Well... YM2612 (and, to lesser extend, YM3438) suffer from ladder effect- a type of cross-over distortion. https://www.youtube.com/watch?v=bkQ_jRYUWew I don't think Picodrive emulates that, for a good reason - it takes CPU time. IIRC there is a MAME 2612 core fork used in Genesis Plus GX that emulates that, it's smowehat heavier. And there is Nuked OPN2, a perfect replication of YM2612's internal logic... very heavy. Nuked OPN2 actually struggles with quad-core ARM chipsets from ~ 5 years prior, so... Also, waveform clipping. Will check that on Picodrive, but in short: at high volumes, sound generated by YM2612 gets clipped to pseudo-square wave.