Tiny Sound Crackling with NTSC games in 60Hz interlaced & progressive modes

Issue #108 resolved
Former user created an issue

Original [issue 108](https://code.google.com/p/genplus-gx/issues/detail?id=108) created by gora.patrick on 2010-07-28T16:06:18.000Z:

What steps will reproduce the problem? just try any game. in most of the games i tried there is some tiny soundcrackling and popping here & there. tried to turn on/off HQ Sound, Low Pass Filter etc. nothing helped. for example phantasy star 2: the intro music crackles a bit at the beginning.

What is the expected output? What do you see instead? clear sound all along

What version of the emulator are you using (official, SVN revision,...)? 1.40 beta

Please provide any additional information below (Video settings, Console region,...) PAL Wii, playing on LCD 480p. All my roms are NTSC Games.

Comments (37)

  1. Former user Account Deleted

    Comment # 1 originally posted by ekeeke31 on 2010-07-28T17:04:29.000Z:

    I'm not experimenting any of this and I'm a little surprised since I actually did a lot of work around that to make sure sound emulation should be perfect.

    what is exactly 1.40 beta ? where and when did you get it ?

  2. Former user Account Deleted

    Comment # 3 originally posted by ekeeke31 on 2010-07-28T17:33:25.000Z:

    Can someone else confirm this ? I have the same setup (PAL wii & mostly NTSC games) and never noticed any sound crackling or pops...

    Can you point some other examples that i could test, with detailled description where it happens ? Also, what video options are you using ?

  3. Former user Account Deleted

    Comment # 4 originally posted by gora.patrick on 2010-07-28T17:55:51.000Z:

    Video Settings Progressive, 60Hz, Bilinear & VI Trap Filter ON, NTSC Filter Off, no Borders and 16:9 AR.

    one more example: Red Zone: while the developer logos etc + intro are shown. (the screen with all the gfx features + the introscene where that guy raises his fist).

  4. Former user Account Deleted

    Comment # 5 originally posted by ekeeke31 on 2010-07-28T20:48:53.000Z:

    Ok, I can hear it too. The reason I didn't noticed it until know is that it only happens in INTERLACED (and apparently PROGRESSIVE but I cannot test it) mode, I always use ORIGINAL (non-interlaced) mode and it's crystal clear in comparison.

    It also only happen with games running at 60hz in NTSC, which means it's probably an issue with video synchronization in this mode only, I need to investigate.

  5. Former user Account Deleted

    Comment # 6 originally posted by gora.patrick on 2010-07-28T20:59:59.000Z:

    yup, just tested ORIGNAL mode and all the crackling and popping is gone. only appears in INTERLACED & PROGRESSIVE mode. hope you can fix it, since PROGRESSIVE brings a much better & smoother image quality on a LCD.

  6. Former user Account Deleted

    Comment # 7 originally posted by gora.patrick on 2010-07-28T21:29:27.000Z:

    just tried some PAL Games (50hz) with Progressive and they all sound clear. NTSC only Games running with Interlaced 50Hz sound clear as well. So it seems to really only affect NTSC Games running Interlaced 60hz or Progressive.

  7. Former user Account Deleted

    Comment # 8 originally posted by ekeeke31 on 2010-07-29T06:40:28.000Z:

    Yes, what I said. When the wii is using 60hz mode and emulating a NTSC genesis, emulation is synchronized with the video interrupt, otherwise it is synchronized with the audio interrupt. Always syncing with audio playback fix the issue (I just checked) but in 60hz mode, it gives occasional frameskipping (because of tiny differences between audio & video timings in the Wii), hence why emulation needed to be rather synced with video hardware, while audio processing was very precisely adjusted to ensure audio hardware will always have samples when it needs new ones.

    Anyway, it seems like the timings also differ between interlaced/progressive and non-interlaced modes, will have to find another solution for this special case. Duh.

  8. Former user Account Deleted

    Comment # 9 originally posted by ekeeke31 on 2010-07-29T12:38:48.000Z:

    Could you please test this modified version ? It logs the delay between each video interrupt and store the result in a file.

    Procedure:

    (1) pick a display mode in video options (ORIGINAL,INTERLACED, PROGRESSIVE) and make sure TV Mode is set to 50/60Hz or 60Hz

    (2) load a NTSC game

    (3) let the game run a few seconds then return to menu

    (4) go back to the game and repeat (3) several time (5x) to get enough test data

    (5) go back to (1) and test the next display mode

    Please post the content of the file logtiming.txt that should have been created at the root of your sd(or usb device).

    I'm especially interested in getting the result for PROGRESSIVE video mode, as well as the results on a NTSC Wii in all modes to see if there are any differences with PAL Wii running at 60Hz.

  9. Former user Account Deleted

    Comment # 10 originally posted by gora.patrick on 2010-07-29T14:25:47.000Z:

    here's my file. tested Red Zone and Phantasy Star 2 in all 3 modes.

  10. Former user Account Deleted

    Comment # 11 originally posted by ekeeke31 on 2010-07-29T14:48:23.000Z:

    Thank you, it matches with my own result the game you use to test does not really matter).

    So basically, the interval between video frame interrupts in 480i/480p modes is 16683 usec which makes 59.94 frames per seconds.

    However, in non-interlaced mode (240p), it seems that the average framerate is slower, with an interval value of 16715 usec (this is the value I actually measured and which I'm using to synchronize audio/video). The fact the minimal value is still approx. 16683 msec could be explained by the fact that the video hardware need to resynchronize fields when switching from interlaced/progressive (which the menu is using) to non-interlaced, so it's very likely the first frame is running at the previous rate.

    Sadly, using the first value when using interlaced or progressive mode does not seem to fix the issue :-(

  11. Former user Account Deleted

    Comment # 12 originally posted by gora.patrick on 2010-07-29T15:18:32.000Z:

    ok. so i guess i'll have to play in original mode for now. hope you find a fix for it soon. :)

  12. Former user Account Deleted

    Comment # 13 originally posted by ekeeke31 on 2010-07-29T15:55:54.000Z:

    For the record, the difference is due to the fact that there are always 263 lines per field in non-interlaced mode, while in interlaced mode, there are alternatively 262 and 263 lines per fields (one NTSC frame is 525 lines).

    In progressive mode, the clock runs 2x faster and process all 525 lines in one field so the average framerate is the same as in interlaced mode.

  13. Former user Account Deleted

    Comment # 14 originally posted by Darkone180 on 2010-07-31T02:37:20.000Z:

    same thing happens in original video mode with like say sonic 2 but im on a ntsc-u tv and 480i /=

  14. Former user Account Deleted

    Comment # 15 originally posted by ekeeke31 on 2010-07-31T08:47:59.000Z:

    In sonic 2 vs mode ? Would he the same problem

  15. Former user Account Deleted

    Comment # 16 originally posted by ekeeke31 on 2010-07-31T13:35:19.000Z:

    I mean, sonic 2 vs mode switches into interlaced mode, even when using original display setting (its 240i actually) so it can actually have the same issue (occasional sound buffer desync)

    Since you have a ntsc wii, please try a game (not sonic 2 vs mode though) with the special version i posted above, just make sure to follow the test procedure i described and test all 3 display mode if you can, its interesting data for me.

  16. Former user Account Deleted

    Comment # 17 originally posted by Darkone180 on 2010-07-31T18:10:51.000Z:

    oh ok for me its only during the intro of "sonic 2(ntsc-u)" and "aero the acrobat 2" rare but randomly,in original mode the sound issue seems to be corrected in sonic 2,interlaced it'll do like very soft pop sound then stop for abit,same thing happens in aero 2,except not in the intro more so in the middle of the game/=

  17. Former user Account Deleted

    Comment # 18 originally posted by gora.patrick on 2010-07-31T18:49:05.000Z:

    as mentioned above, just do a test with any ntsc game with the test version in comment 9, to get the timings from a ntsc wii.

  18. Former user Account Deleted

    Comment # 19 originally posted by ekeeke31 on 2010-08-01T08:31:02.000Z:

    where exactly in the middle of the game ? if you aren't precise, it doesn't help at all fixing issues, especially when I can't reproduce them. At least, please do the test as I've asked, it can help clearing some things up.

    now, I've played these 2 games quite extensively in original mode and didn't notice any unusual pops or hicups with sound. In sonic 2, it happens in vs mode but it's barely noticeable. Sound is perfect on title screen (btw, "sega" scream is supposed to be a little scratchy sometime if that's what you are referring to). Aero 2 does not switch to interlaced mode and had perfect sound during the whole first level.

  19. Former user Account Deleted

    Comment # 20 originally posted by Darkone180 on 2010-08-01T13:51:49.000Z:

    right by the ramp type thing in aero 2 fist lvl it'll happen there sometimes with the interlaced mode turned on,it also happens when you jump on one of the bed springs with interlaced turned on i think in lvl's 1 and 2?

  20. Former user Account Deleted

    Comment # 21 originally posted by ekeeke31 on 2010-08-01T15:40:54.000Z:

    I am aware of issues with sound in interlaced mode, it's what this talk is all about. And that's why i need timing data in all modes, are you going to try the test .dol i posted in comment comment 9\. or not ?

  21. Former user Account Deleted

    Comment # 22 originally posted by Darkone180 on 2010-08-02T06:37:41.000Z:

    no,i am using a compiled one i got from gbatemp,i asked you in the post about the tmss bios not working if you wanted me to send you the dol,well anyways

  22. Former user Account Deleted

    Comment # 23 originally posted by ekeeke31 on 2010-08-02T08:46:48.000Z:

    For the last time, I don't care about your dol

    .read comment comment 9\. on this page and download the attached boot.dol .follow the steps and test a NTSC game in all 3 modes (ORIGINAL,INTERLACED,PROGRESSIVE) .upload the file logtiming.txt that has been created on your SD

    I know my english is not perfect but is that so hard to understand ???

  23. Former user Account Deleted

    Comment # 24 originally posted by geno11140@yahoo.com on 2010-08-03T23:06:55.000Z:

    Here is my logtiming file ekeeke31. Tested with Michael Jackson's Moon Walker

  24. Former user Account Deleted

    Comment # 25 originally posted by geno11140@yahoo.com on 2010-08-03T23:07:29.000Z:

    I could not get progressive scan. Sorry :<

  25. Former user Account Deleted

    Comment # 26 originally posted by geno11140@yahoo.com on 2010-08-03T23:13:53.000Z:

    Sorry for the 3rd post. My HDTV always have crackling sounds though if the sound is loud. Vizio 26inch Tv

  26. Former user Account Deleted

    Comment # 27 originally posted by ekeeke31 on 2010-08-04T09:16:56.000Z:

    Thanks for the input, is it from a NTSC Wii ?

  27. Former user Account Deleted

    Comment # 28 originally posted by geno11140@yahoo.com on 2010-08-04T14:51:03.000Z:

    Yes, it is from a NTSC-U Wii.

  28. Former user Account Deleted

    Comment # 29 originally posted by ekeeke31 on 2010-08-04T16:44:09.000Z:

    ok, this confirms NTSC and PAL Wii have the same timings when using 60 hz interlaced modes (and most probably 480p as well). I know have to figure why using this timing for audio/video sync (48000 samples per second / 59.94 frames per second = 800.8 samples per frame) does not work as expected.

  29. Former user Account Deleted

    Comment # 30 originally posted by ekeeke31 on 2010-08-07T17:50:26.000Z:

    I think I fixed it, please give a try to the attached .dol

    The solution was indeed to run sound emulation exactly at 59.94 frames per seconds in interlaced (or progressive) modes, but I also had to fix how I was syncing sound chips when FM resampling was used (High Quality FM mode).

    Since I'm not sure if the changes I made could not break in very specific conditions and since I cannot test every sensitive game again, please report any sound issues or crash when running games with High-Quality FM enable (in original mode as well).

  30. Former user Account Deleted

    Comment # 31 originally posted by gora.patrick on 2010-08-07T18:45:17.000Z:

    tried a couple of ntsc games in progressive mode + HQ FM and no sound crackling or any other bugs far and wide anymore. :) one question: is this fixed version based on r471 or newer, in other words does it include all other improvements, so that i can now use this dol here as the most accurate?

  31. Former user Account Deleted

    Comment # 32 originally posted by gora.patrick on 2010-08-07T19:01:04.000Z:

    ahh just found a bug in this version, but it has nothing to do with sound. in Gynoug Level 1 when the screens is shaking, there are graphical glitches on the left side.

  32. Former user Account Deleted

    Comment # 33 originally posted by ekeeke31 on 2010-08-07T19:15:27.000Z:

    This is actually not a bug, happens on real hardware as well (i verified it).

    This version is based on my latest build yes (and also includes some stuff that are not commited yet, i.e a new -but not working atm- cheat menu),

  33. Former user Account Deleted

    Comment # 35 originally posted by gora.patrick on 2010-08-07T19:26:20.000Z:

    True. Just hooked up my Megadrive. Wow, i never noticed it.

  34. Former user Account Deleted

    Comment # 36 originally posted by ekeeke31 on 2010-08-07T19:38:37.000Z:

    Yes, genplus gx is actually the only emulator which emulates this accurately ;-)

    Other games making use of this behavior: Kawasaki Superbike and F1 from Domark (left-most column is fine on genplus-gx and real hardware but glitchy on Kega, Gens, etc)

  35. Former user Account Deleted

    Comment # 37 originally posted by gora.patrick on 2010-08-07T19:42:17.000Z:

    now if only there would be sega cd emulation for Snatcher & Co i could finally say byebye to my old xbox. ;)

  36. Log in to comment