libretro / picodrive

Fast MegaDrive/MegaCD/32X emulator
Other
40 stars 61 forks source link

32x CD Fahrenheit audio/video out of sync and sound glitches #131

Open mario-64 opened 4 years ago

mario-64 commented 4 years ago

Using lr-picodrive to play 32x and 32x CD games on a RPi 4. Most seem to work fine but I've noticed that the audio and video in the 32x CD version of Fahrenheit are out of sync. In addition, the audio has glitches and dropouts. I tried adjusting many different settings but can't get it to run properly.

irixxxx commented 3 years ago

Could you probably check this again with the current master (picodrive version v1.97)? If so, please enable the fps display and check if the frame rate is dropping.

mario-64 commented 3 years ago

Will do yes and report back

mario-64 commented 3 years ago

Just ran Retropie update script and it still shows Picodrive 1.8.8 as the latest

irixxxx commented 3 years ago

Are you talking about the Retroarch or the Picodrive version? Anyway, I don't know how cores are updated in Retropie. It might be a while before you can test this.

mario-64 commented 3 years ago

lr-picodrive is the version used by Retropie. That's the one I'm referring to. It shows nothing newer than 1.8.8

irixxxx commented 3 years ago

Would you nonetheless please enable the frame rate display and check the frame rate with the old version? I suspect a cpu overload problem, which wouldn't be any wonder if all 5 cpus of the system are in full operation.

irixxxx commented 3 years ago

I would very much appreciate if you could check the framerate with the latest available version with this image. Apart from the audio not sounding particularly nice, I have the impression at least the intro appears ok on retroarch linux x86.

mario-64 commented 3 years ago

Sorry forgot to reply. Tried to enable frame rate but don’t see the ‘display frame rate’ option in video settings

irixxxx commented 3 years ago

It's in Settings/On-Screen Display/On-Screen-Notifications. Enable "On-Screen Notifications", then enable "Display Framerate"

mario-64 commented 3 years ago

Sorry for the delay. FPS runs from 59.97 to 60.25 all while the audio is skipping and out of sync

wn2000 commented 3 years ago

Can confirm the same issue on my RK3328 board, with the latest code pulled on 1/10/2021.

irixxxx commented 3 years ago

I've done some investigation on this.

First, the sound in the 32x version is really bad. That's not due to errors in the emulation, though.

All sound is output via PCM by the sub-CPU in the CD unit. It's completely botched in the 32X version. What you hear is quantization noise - they have turned up the amplification in the PCM chip to the max, and in turn tuned down the samples to avoid clipping, to the extend that the sample values are basically always in the range of +-8, effectively reducing the sample range to 4 bits. With those few quantization levels I reckon noise is unavoidable.

The standard SegaCD version has a much higher sample level, hence the quantization noise is much more bearable, but the developers have turned up the amplification too far. You hear lots of clipping due to that. Turning the amplification down by a factor of 10 is massively reducing the clipping, of course at the expense of volume.

So, audio artifacts you are hearing are due to those problems in the game's production.

However, I cannot reproduce desynchronization problems. If @mario-64 @wn2000 or anyone else can tell me exactly where that happens with the current core I'll have a look.

UndefineRender commented 2 years ago

Recently I started playing 32x games and came across this game. I'm using Pico for 32x emulation and learned about disc changing on 32x Sega Cd games. The problem with myself also is the sound clipping out, repeating and just not being synced up. So I'm having the same problems as with the others before me posting on this title. I'm not sure if its the same on other 32x Sega CD games. I'm on windows 10 and will list my specs. I have also made a video of my experience with my system with this title using Retroarch and the Pico core. The audio is messed up the entire time.

My Specs:

Mobo: Rog Strix X570-I Gaming Memory: GSkill Neo 32gb GPU: NVIDIA GeForce RTX 2060 Processor: AMD 5600x

https://www.youtube.com/watch?v=iCUyMgcM7dM

irixxxx commented 1 year ago

@UndefineRender I recently worked on CPU synchronisation which might have some impact here too. Could you please check this again with a recent build from commit a4f2721 or newer?

mario-64 commented 1 year ago

Happy to yes. Can I get that just by updating the package in Retropie?

irixxxx commented 1 year ago

No, it will possibly not be in before their next release. I guess you'd need to compile it yourself from the lr-picodrive master branch sources, or you could try using one of the lr-picodrive nightlies from here