MegaCD Redbook Audio Pop Issue

fedor
Posts: 10
Joined: Fri Feb 26, 2021 1:33 am
Has thanked: 2 times
Been thanked: 2 times

MegaCD Redbook Audio Pop Issue

Unread post by fedor »

Hey all, sorry for the long post but recently i've been playing some games on the MegaCD core and i've experienced some audio issues with Redbook audio playback. For example while playing Ecco the Dolphin (the USA version) i was hearing some noticeable audio popping with the Redbook audio. Below you can listen to a recording of what i was hearing:



My initial thought was that my game dump was corrupt, so i checked all the tracks checksum on redump.org (http://redump.org/disc/4104/) and all of the tracks matched the correct dump checksums. Just to be sure i also tried the dump with Kega Fusion and there was no audio popping there.
Then i tried the PAL version of the game, and still i was hearing the audio popping. So i went back to the original USA dump and tried playing the tracks with the BIOS audio CD player, still the same issue there.

But i did notice something weird, if i would rewind the track a few seconds the audio popping would go away. Below you can listen to a recording of what i was hearing when i would rewind the track a few seconds:



This is a list of the things i tried to find the source of this issue, some of them totally not making sense or related to the issue but just trying all of the options, without success and with the same result:

-Tried the analogue 3,5 mm output on IO board
-Tried the mini TOSlink output on IO board
-Removed the IO board and tried the HDMI audio output (48kHz and 96kHz)
-Enabled CD Audio filter in the core
-Switched between Model 1, Model 2 and Minimal Audio filters in the core
-Switched between YM2612 and YM3438 FM Chip in the core
-Enabled HiFi PCM in the core
-Loaded game from USB instead of SD card
-Tried another dump of the same game
-Tried another dump from another region of the same game
-Asked a friend to try the game on his MiSTer setup (he also experienced the same issue)
-Tried another PSU
-Tried another SD card
-Tried different BIOS versions of the MegaCD
-Minimal amount of USB devices connected to the USB board (1 controller only)
-Tried another DAC converter
-Tried another amplifier
-Played the same dump on Kega Fusion (no audio popping there)
-Converted BIN tracks to WAV and played it back on PC (no audio popping)
-Checked the checksums of the BIN files on redump.org (my dump matched verified correct dump values)

I googled and also read through all the MegaCD posts here but i couldn't find anyone else experiencing this. So i'm kind of lost why the audio popping occurs, something on my side or maybe something in the core. The audio popping only occurs with Redbook audio, all the other audio plays just fine.
The fact that by rewinding the tracks a bit the popping would go away makes me think that maybe it's a buffering issue but i might be totally wrong.

Does someone have some suggestions that i could try? maybe i'm overlooking something, thanks in advance.


EDIT: i've found some footage of somebody else with the same issue:
Fuzzy_Dunlop
Posts: 5
Joined: Sun Aug 09, 2020 1:59 pm
Has thanked: 2 times
Been thanked: 1 time

Re: MegaCD Redbook Audio Pop Issue

Unread post by Fuzzy_Dunlop »

I've experienced the same issue with Ecco with the Mega CD core. Like you I tried switching audio output from HDMI, to analog to toslink and it was the same on all three sources. Unfortunately I don't have anything else to add, other than confirm your issue.
fedor
Posts: 10
Joined: Fri Feb 26, 2021 1:33 am
Has thanked: 2 times
Been thanked: 2 times

Re: MegaCD Redbook Audio Pop Issue

Unread post by fedor »

Fuzzy_Dunlop wrote: Sat Mar 06, 2021 9:07 pm I've experienced the same issue with Ecco with the Mega CD core. Like you I tried switching audio output from HDMI, to analog to toslink and it was the same on all three sources. Unfortunately I don't have anything else to add, other than confirm your issue.
Hey Fuzzy, thanks for confirming that the issue is not a local issue. I think i'll report this issue on the github repo of the MegaCD core, maybe the devs take a look at it.

BTW, nice Wire reference with the nickname :lol:
Blitzwing
Posts: 103
Joined: Sat Sep 05, 2020 9:52 pm
Has thanked: 11 times
Been thanked: 24 times

Re: MegaCD Redbook Audio Pop Issue

Unread post by Blitzwing »

I had been suffering redbook audio hitching issues with all games on mine, certainly different than your popping issue (longer pauses I think) which sounds almost like it's being played from vinyl. Eventually figured that it was because I'm using USB storage, a 1TB external SSD, while the SD card was just for boot. Solved it by moving all MegaCD games to the SD card and 'symlinked' the directory via a script that runs at boot so it shows up on the USB storage.

Obviously that doesn't help with your problem but I'll leave this here in case others have a similar setup to mine and wonder why MegaCD hitches like that... Doesn't cause problems with TGFXCD though which is strange.

Edit. The problem manifested just like yours though where rewinding or replaying a track would make the problem go away.
Blitzwing
Posts: 103
Joined: Sat Sep 05, 2020 9:52 pm
Has thanked: 11 times
Been thanked: 24 times

Re: MegaCD Redbook Audio Pop Issue

Unread post by Blitzwing »

Well that's interesting. I've got two MiSTers one with the USB storage the other just the SD, they both have that exact hitching that you have, which is definitely different to the issue I worked around that I mentioned in my other post. I swear it wasn't there before.

Could this be a new issue in the more recent cores, I've ran out of time today so can't test older ones.
fedor
Posts: 10
Joined: Fri Feb 26, 2021 1:33 am
Has thanked: 2 times
Been thanked: 2 times

Re: MegaCD Redbook Audio Pop Issue

Unread post by fedor »

Blitzwing wrote: Tue Mar 16, 2021 2:39 pm Well that's interesting. I've got two MiSTers one with the USB storage the other just the SD, they both have that exact hitching that you have, which is definitely different to the issue I worked around that I mentioned in my other post. I swear it wasn't there before.

Could this be a new issue in the more recent cores, I've ran out of time today so can't test older ones.
I did try out some older versions of the core, the problem was still there. I could do a test run with all the versions released for the core when i've the time. In the meanwhile, i've reported the issue to the devs: https://github.com/MiSTer-devel/MegaCD_MiSTer/issues/80

If more people chime in maybe they take a look at it.
fedor
Posts: 10
Joined: Fri Feb 26, 2021 1:33 am
Has thanked: 2 times
Been thanked: 2 times

Re: MegaCD Redbook Audio Pop Issue

Unread post by fedor »

tried all 17 releases of the core all with the same result, tried it with some other games (final fight, terminator) and I could hear it there too. Too bad I don't have any verilog experience yet, otherwise i'd start tinkering away on my own. Also it's been almost 20 years ago that I played MegaCD games on real hardware, maybe it's been there all along.
zakk4223
Posts: 270
Joined: Sun May 24, 2020 10:55 pm
Been thanked: 107 times

Re: MegaCD Redbook Audio Pop Issue

Unread post by zakk4223 »

Try different versions of Main too. Although from the video linked in the original post it predates any of the chd work. I never noticed it in all the testing I did during the chd work, but I wasn't really listening for it either. I wonder if it might be related to SD card speed?

One thing to try: does it persist if you convert the bin/cue to CHD? The chd library reads from disk in hunks so there's a bit of a memory buffer there. Wondering if that makes a difference.

I'll see if I can reproduce it myself.

edit: one other question. does it still happen if you just play redbook audio tracks from the bios cd player?
fedor
Posts: 10
Joined: Fri Feb 26, 2021 1:33 am
Has thanked: 2 times
Been thanked: 2 times

Re: MegaCD Redbook Audio Pop Issue

Unread post by fedor »

zakk4223 wrote: Wed Mar 17, 2021 10:31 pm Try different versions of Main too. Although from the video linked in the original post it predates any of the chd work. I never noticed it in all the testing I did during the chd work, but I wasn't really listening for it either. I wonder if it might be related to SD card speed?

One thing to try: does it persist if you convert the bin/cue to CHD? The chd library reads from disk in hunks so there's a bit of a memory buffer there. Wondering if that makes a difference.

I'll see if I can reproduce it myself.

edit: one other question. does it still happen if you just play redbook audio tracks from the bios cd player?
Thnx for your tips, tried some of it.
If I'm not mistaken CHD support was added since the 20210103 release right? Tried the releases from then on with my dump converted to CHD format (with the chdman tool from MAME, if you've another suggestion for converting tool let me know!) and the matching Main versions, the issue was still there.

Checked also some older versions of Main before CHD implementation, made sure the core was from the same period. Still the issue was there.

All of the above tested in bios cd player and in-game, with just one game tho (Ecco the Dolphin USA version). I'll try tomorrow with some other games, since previous tests with different core versions all had the most recent Main at the time of posting.

But good thinking on the SD card speed, right now I'm using a Sandisk SDXC Ultra 128GB Class10 UHS-1 card...do you think I should upgrade the card or is the reading speed (100 MB/s) sufficient?

Thnx again for your reply.
Fuzzy_Dunlop
Posts: 5
Joined: Sun Aug 09, 2020 1:59 pm
Has thanked: 2 times
Been thanked: 1 time

Re: MegaCD Redbook Audio Pop Issue

Unread post by Fuzzy_Dunlop »

I would think that read speed is more than sufficient. Real Sega CD hardware read speed is a tiny fraction of that. Well under 1MB per second so it's impossible the read speed of your SD card is to blame.
User avatar
darksakul
Posts: 352
Joined: Mon May 25, 2020 4:34 pm
Has thanked: 397 times
Been thanked: 73 times

Re: MegaCD Redbook Audio Pop Issue

Unread post by darksakul »

I also think certain SD cards can cause noise on its own.

MDFourier did a paper on the topic

http://junkerhq.net/MDFourier/notes/MDF ... Card-3.pdf

Here a more easier to read breakdown for people
https://www.retrorgb.com/mdfourier-sd-card-testing.html
It is my great regret that we live in an age that is proud of machines that think and suspicious of people who try to.
fedor
Posts: 10
Joined: Fri Feb 26, 2021 1:33 am
Has thanked: 2 times
Been thanked: 2 times

Re: MegaCD Redbook Audio Pop Issue

Unread post by fedor »

Good read that paper on SD card noise, but if it would be caused by the SD card one would assume that the problem would also be present with the PC Engine core which for me is not the case during Redbook audio playback. Also the fact that it disappears once you rewind the tracks and isn't audible then kinda confirms that the problem is caused by something else than the SD card.
RogerWilco
Posts: 2
Joined: Tue Jun 29, 2021 11:41 pm
Been thanked: 1 time

Re: MegaCD Redbook Audio Pop Issue

Unread post by RogerWilco »

I've had the same problem, which I've noticed for several months. I've tried many things to see if it was an issue on my end, but nothing has worked, so far. I think the audio pops/cracks are more noticeable in certain games, particularly Ecco and Lunar. It's especially apparent for me in the first town in Lunar, and it's also very noticeable on the world map.

I thought it might be the SD card, but I've tried others, and have also tried loading the games from a USB hard drive. I usually use the optical audio out on the analog I/O board, and I tried using different DACs, but that didn't fix the problem. It also occurs over HDMI audio. I thought turning down the core or global volume down in the OSD might help, if the volume was too high and causing clipping, but that didn't seem to help. Within the Mega CD core, I have tried every setting possible, and I can still hear the cracks in the audio. I also upgraded to a 4 amp power supply, but that didn't help.

The problem only occurs with Redbook audio, and it's only with the Mega CD core. I don't have the same problem with other CD-based cores, such as TG-16 CD. After watching a lot of Youtube footage of this core running, it's hard to tell if everyone experiences this issue or not. I'm really not sure if its a core issue, or something with my setup.

There is also the possibility that original hardware is just supposed to sound like that. Maybe I couldn't hear the pops and cracks over the loud signal noise on original hardware, when I played Lunar 15 years ago. Maybe it's possible to hear the flaws with the clean audio signal that the MiSTer provides.

I was also reading a post on the Sega 16 forums, where some people noticed similar issues with real Sega CD hardware. There are some potentiometers that can be adjusted inside the unit, which apparently helped get cleaner audio streaming without cracks or pops. I have no idea if that same circuitry exists on the FPGA side of things, or if such a thing could be adjusted in a future core release.

Hopefully more attention is brought to this issue, and maybe the devs will take a look at it.
paintbox
Posts: 5
Joined: Tue Jun 22, 2021 7:28 pm
Been thanked: 1 time

Re: MegaCD Redbook Audio Pop Issue

Unread post by paintbox »

Not that it seems to need more confirmation, but +1 for another person bothered by this in Ecco. I didn't have a ton of experience with this hardware back in the day, and MiSTer is the first time I've gone back to it. So I have a limited perspective, but it's hard to believe in the late stages of the popular hi-fi stereo craze, this was how the original hardware handled the commercial Red Book music CDs everyone was buying. Or if that was the case, it wasn't a snafu that everyone heard about.

Speaking of which, how do I get to the BIOS CD player? Probably I need a different BIOS, I think I'm using a multiregion that starts the game with no chance to input anything, I wasn't able to make it open a player. I considered ripping a commercial CD to bin/cue to see what would happen. But I need to find my CD drive...

It sounds to me like a sync issue. In terms of audio, without knowing much under the hood of the original hardware or FPGAs, there seems to be potential for sync issues because Red Book audio is 44.1 while MiSTer's output and perhaps (probably?) the console's sound hardware run at a different sample rate.

If I understand correctly, with the original hardware the audio outputs of the Sega CD and Genesis hardware were combined as analog signals, which could have bypassed such a sync issue.

But this is speculation...
User avatar
aberu
Core Developer
Posts: 1144
Joined: Tue Jun 09, 2020 8:34 pm
Location: Longmont, CO
Has thanked: 244 times
Been thanked: 388 times
Contact:

Re: MegaCD Redbook Audio Pop Issue

Unread post by aberu »

darksakul wrote: Fri Mar 19, 2021 8:31 am I also think certain SD cards can cause noise on its own.

MDFourier did a paper on the topic

http://junkerhq.net/MDFourier/notes/MDF ... Card-3.pdf

Here a more easier to read breakdown for people
https://www.retrorgb.com/mdfourier-sd-card-testing.html
The noise is measurable, that doesn't mean it's necessarily that perceptible however. The access noise is perceptible over analog audio on the analog IO board, but not perceptible over hdmi or optical audio. I remember hearing the SD access over analog audio when I had the Analog IO board, it is what it is. That's what I stopped using it :P

If the redbook audio popping by the OP is experienced over HDMI and optical, then this is probably unrelated to the thing in the MDFourier article.

I could potentially test to see if the issue is present on the mega everdrive on my original hardware with it's CD emulation as well. If it is I would assume it happens on OG hardware, but maybe not. Then I could see if I could burn a CD of ecco the dolphin to test on my jvc x'eye. I think I'm out of good CDs though.
birdybro~
paintbox
Posts: 5
Joined: Tue Jun 22, 2021 7:28 pm
Been thanked: 1 time

Re: MegaCD Redbook Audio Pop Issue

Unread post by paintbox »

If the original hardware had a problem with Red Book it should show up with any proper music CD, not just with game discs.
graffias79
Posts: 3
Joined: Fri Mar 19, 2021 2:40 pm
Has thanked: 1 time

Re: MegaCD Redbook Audio Pop Issue

Unread post by graffias79 »

I've experienced this random clicking/popping with Sonic CD. My ISO images are all on an external USB drive. Would that possibly have an effect?
fedor
Posts: 10
Joined: Fri Feb 26, 2021 1:33 am
Has thanked: 2 times
Been thanked: 2 times

Re: MegaCD Redbook Audio Pop Issue

Unread post by fedor »

aberu wrote: Tue Jul 13, 2021 3:02 pm
darksakul wrote: Fri Mar 19, 2021 8:31 am I also think certain SD cards can cause noise on its own.

MDFourier did a paper on the topic

http://junkerhq.net/MDFourier/notes/MDF ... Card-3.pdf

Here a more easier to read breakdown for people
https://www.retrorgb.com/mdfourier-sd-card-testing.html
If the redbook audio popping by the OP is experienced over HDMI and optical, then this is probably unrelated to the thing in the MDFourier article.
OP here, the audio popping is noticable on all outputs. Like described in the (long and messy) first post:
-Tried the analogue 3,5 mm output on IO board
-Tried the mini TOSlink output on IO board
-Removed the IO board and tried the HDMI audio output (48kHz and 96kHz)
It might be an OG hardware issue if the volume is above certain level, for example the manual of Terraonion's MegaSD cartridge says the following:
• CDDA audio volume: (default 80%) Allows setting the CD audio volume in the final mix.
• RF5c164 PCM audio volume: (default 80%) Allows setting the CD hardware PCM chip volume in the final mix. Both CDDA and PCM audio at 80% mimics the same audio volume levels as found on an actual Sega CD/Mega-CD unit. Setting them above 80% may lead to audio distortion.
maybe in the core the levels are above 80%, and changing the volume on the Mister wont change this behaviour since it's tapping from the same (distorted and above 80%) signal.

If you are able to test it on your everdrive, or jvc unit, could you be so kind to test if rewinding the track for a seconds will make the issue go away for that track specifically?
Vicosku
Posts: 14
Joined: Sat Sep 19, 2020 5:47 pm
Has thanked: 5 times
Been thanked: 3 times

Re: MegaCD Redbook Audio Pop Issue

Unread post by Vicosku »

Since there hasn't been a post in a while, I'll just say that this is still a problem. Occurs with Ecco the same as in the examples. So far I've loaded ISO/CUE and CHD from local SD and CIFS over USB Wifi. Will be switching to ethernet next week, but I expect the issue will remain.
mario64
Posts: 119
Joined: Sun May 24, 2020 6:50 pm
Has thanked: 18 times
Been thanked: 10 times

Re: MegaCD Redbook Audio Pop Issue

Unread post by mario64 »

Is there an open ticket on GitHub for this issue?
dshadoff
Core Developer
Posts: 534
Joined: Sun May 24, 2020 9:30 pm
Has thanked: 19 times
Been thanked: 141 times

Re: MegaCD Redbook Audio Pop Issue

Unread post by dshadoff »

Yes, there are two: issues 22 and 80
klausfelix
Posts: 1
Joined: Mon Mar 07, 2022 6:30 pm

Re: MegaCD Redbook Audio Pop Issue

Unread post by klausfelix »

I thought it might be the SD card but I've tried others, and have also tried loading the games from a USB hard drive.
I usually use the optical audio out on the analog I/O board, and I tried using different DACs, but that didn't fix the problem. It also occurs over HDMI audio.

I thought turning down the core or global volume down in the OSD might help, if the volume was too high and causing clipping, but that didn't seem to help. Within the Mega CD core, I have tried every setting possible, and I can still hear the cracks in the audio.I also upgraded to a 4 amp power supply, but that didn't help.

The problem only occurs with Redbook audio, and it's only with the Mega CD core. I don't have the same problem with other CD-based cores, such as TG-16 CD. After watching a lot of Youtube footage of this core running, it's hard to tell if everyone experiences this issue or not.
I'm really not sure if its a core issue, or something with my setup.

There is also the possibility that original hardware is just supposed to sound like that.
Maybe I couldn't hear the pops and cracks over the loud signal noise on original hardware, when I played Lunar 15 years ago.
Maybe it's possible to hear the flaws with the clean audio signal that the MiSTer provides.

I was also reading a post on the Sega 16 forums where some people noticed similar issues with real Sega CD hardware.
There are some potentiometers that can be adjusted inside the unit, which apparently helped get cleaner audio streaming without cracks or pops.
I have no idea if that same circuitry exists on the FPGA side of things, or if such a thing could be adjusted in a future core release.
User avatar
aberu
Core Developer
Posts: 1144
Joined: Tue Jun 09, 2020 8:34 pm
Location: Longmont, CO
Has thanked: 244 times
Been thanked: 388 times
Contact:

Re: MegaCD Redbook Audio Pop Issue

Unread post by aberu »

Please try this build to see if you notice the same popping. Thank you.
MegaCDbirdybro.rbf
(4.01 MiB) Downloaded 186 times
birdybro~
Cheststrongwell
Posts: 2
Joined: Sun Jul 10, 2022 2:52 am
Has thanked: 3 times

Re: MegaCD Redbook Audio Pop Issue

Unread post by Cheststrongwell »

aberu wrote: Sun Jun 26, 2022 2:03 am Please try this build to see if you notice the same popping. Thank you.
I just tried it. Exactly the same popping issues. Very noticeable on the Keio Flying Squadron title screen and the "zoom into town" intro in Lunar. I really hope this gets fixed someday. Thank you very much for trying.
User avatar
aberu
Core Developer
Posts: 1144
Joined: Tue Jun 09, 2020 8:34 pm
Location: Longmont, CO
Has thanked: 244 times
Been thanked: 388 times
Contact:

Re: MegaCD Redbook Audio Pop Issue

Unread post by aberu »

After discussion with Zakk and Kitrinx it appears the buffer could be the cause of this, there is a mismatch in the timing of the fill of the buffer and the dump of the buffer, leading to occasional gaps. At least, that's likely what is happening, but we don't know for sure.
birdybro~
Cheststrongwell
Posts: 2
Joined: Sun Jul 10, 2022 2:52 am
Has thanked: 3 times

Re: MegaCD Redbook Audio Pop Issue

Unread post by Cheststrongwell »

aberu wrote: Sun Jul 10, 2022 3:18 pm After discussion with Zakk and Kitrinx it appears the buffer could be the cause of this, there is a mismatch in the timing of the fill of the buffer and the dump of the buffer, leading to occasional gaps. At least, that's likely what is happening, but we don't know for sure.
Thanks for following up with them. I just hope it's something that isn't difficult to fix.
rhester72
Top Contributor
Posts: 1107
Joined: Thu Jun 11, 2020 2:31 am
Has thanked: 13 times
Been thanked: 169 times

Re: MegaCD Redbook Audio Pop Issue

Unread post by rhester72 »

That might well explain the CD+G weirdness as well.
Deadsaint
Posts: 15
Joined: Mon Dec 06, 2021 2:08 am
Has thanked: 8 times
Been thanked: 1 time

Re: MegaCD Redbook Audio Pop Issue

Unread post by Deadsaint »

Was there any development on this issue? Just tried Ecco and indeed, the popping is there. Compared to some examples posted above, the popping seems to be less frequent and not as loud, although definitely still there. Tried the BIOS CD player, same deal.

rhester72
Top Contributor
Posts: 1107
Joined: Thu Jun 11, 2020 2:31 am
Has thanked: 13 times
Been thanked: 169 times

Re: MegaCD Redbook Audio Pop Issue

Unread post by rhester72 »

Does the popping appear during the intro without gameplay? How can it be triggered?

Deadsaint
Posts: 15
Joined: Mon Dec 06, 2021 2:08 am
Has thanked: 8 times
Been thanked: 1 time

Re: MegaCD Redbook Audio Pop Issue

Unread post by Deadsaint »

rhester72 wrote: Mon Jan 23, 2023 5:34 pm

Does the popping appear during the intro without gameplay? How can it be triggered?

Yes, but the sound effects make it harder to notice. Going into the gameplay and staying still while only the music plays or playing the music trough the bios CD player is the best way to tell, listening with headphones at a decent volume will make it more noticeable. It is not as loud or as frequent as some of the old examples posted above, at least for me. The longer the music plays, the popping becomes less frequent until it seems like it stops. The same behavior happens both ingame and BIOS cd player. The first 10-15 seconds of any track seem to be the worst.

Post Reply