libretro / QuickNES_Core

The QuickNES core library, originally by Shay Green, heavily modified
GNU General Public License v2.0
22 stars 34 forks source link

Audio crackles on PSP #72

Closed bmaupin closed 5 years ago

bmaupin commented 5 years ago

The audio sounds crackly/staticky on the PSP. It seems to occur in every game but seems to be more noticeable in certain games like The Legend of Zelda and Mega Man 2.

My first guess is that it's due to the PSP not being able to run the core at the full framerate. I'll see if I can confirm.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/79463209-audio-crackles-on-psp?utm_campaign=plugin&utm_content=tracker%2F1029493&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F1029493&utm_medium=issues&utm_source=github).
inactive123 commented 5 years ago

Years ago this definitely ran at fullspeed. I think both aliaspider and me can confirm that.

On Tue, 27 Aug 2019, 20:06 Bryan Maupin, notifications@github.com wrote:

The audio sounds crackly/staticky on the PSP. It seems to occur in every game but seems to be more noticeable in certain games like The Legend of Zelda and Mega Man 2.

My first guess is that it's due to the PSP not being able to run the core at the full framerate. I'll see if I can confirm.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/libretro/QuickNES_Core/issues/72?email_source=notifications&email_token=AAIGQSURYLGQNLDIIEXP3CDQGVUIVA5CNFSM4IQH5JHKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HHXCM6A, or mute the thread https://github.com/notifications/unsubscribe-auth/AAIGQSWROH4EHJ3DQAJSMFTQGVUIVANCNFSM4IQH5JHA .

bmaupin commented 5 years ago

I hacked the video to skip every other frame and the crackling doesn't go away. So as best as I can tell it doesn't seem to be related the the video framerate.

bmaupin commented 5 years ago

I downloaded a bunch of older versions of RetroArch that I found scattered across the internet (since the buildbot only goes back to 1.6.7).

QuickNES on RetroArch 1.3.2 ran Zelda with no crackling audio.

1.7.0 has crackling audio.

Every version I found between those two failed to load the core or the game.

So in theory I should be able to find the commit where this started happening. Wish me luck :)

negativeExponent commented 5 years ago

see if any of the audio options works better. are you using palettes as well? that was recently added.

bmaupin commented 5 years ago

see if any of the audio options works better. are you using palettes as well? that was recently added.

I don't remember offhand what I tried, but I tried as many combinations of the new audio options as I could and none seemed to have any affect.

I tested the core in Linux and I didn't have the audio crackling issue, so I'm guessing this is limited to the PSP (and maybe some other less popular devices).

The difficult thing is from what I tell this core was more or less broken on PSP from RA v1.3.2 to v1.7.0, which is nearly 2 years. So it hasn't been as simple as a git bisect.

One interesting data point is that 58e77db works without any crackling with RA v1.3.2, but has crackling in RA v1.7.8. So until I'm better able to narrow the issue down, it looks like the cause may be RetroArch itself.

negativeExponent commented 5 years ago

nope i don't think that PR can break it. since it only deals with msvc compatibility, literallity some variables has to be on top, nothing functional has changed. It could be the mapper specific. can you check with roms using basic mapper? balloon fight or battle city perhaps.

bmaupin commented 5 years ago

nope i don't think that PR can break it. since it only deals with msvc compatibility, literallity some variables has to be on top, nothing functional has changed.

My apologies if I wasn't very clear, but I actually meant that because 58e77db has crackling with RA 1.7.8 but not with RA 1.3.2, to me that indicates the problem might not be with the QuickNES core but with RetroArch itself.

As such my current approach is to try to figure out the first commit in RetroArch when the crackling audio started happening.

bmaupin commented 5 years ago

Phew, finally found the bad commit!

https://github.com/libretro/RetroArch/commit/ed3d75738ca07f376960a373ee4e6cefd37b17f3

$ git bisect bad
ed3d75738ca07f376960a373ee4e6cefd37b17f3 is the first bad commit
commit ed3d75738ca07f376960a373ee4e6cefd37b17f3
Author: twinaphex <libretro@gmail.com>
Date:   Tue Jan 31 07:33:58 2017 +0100

    Simplify audio conversion code

:040000 040000 b049239880a9f41e2f0c264cc4883b7a8d0dd37c 3f28deae43e30c9d9add2c8fc6243923a9a565c2 M  libretro-common