mrehkopf / sd2snes

SD card based multi-purpose cartridge for the SNES
http://sd2snes.de
GNU General Public License v2.0
579 stars 114 forks source link

Bad MSU-1 Audio with FXPak Pro (December 2022 revision) #214

Closed speedyrules closed 10 months ago

speedyrules commented 1 year ago

Hi I am having issues with SNES MSU-1 Games Audio. Anyone else? One example is Battletoads in Battlemaniacs, where the sound is all garbled.

I did try a bit around with different setups. i used:

https://user-images.githubusercontent.com/25831136/227468916-5bbea036-ccb5-41b0-b2c9-80c606505b27.mp4

https://user-images.githubusercontent.com/25831136/227468997-a91386d6-3c8a-4d60-a67c-4c6c378cf373.mp4

mrehkopf commented 1 year ago

Can you check if you have MSU1 volume boost enabled in the chip options? It only makes sense on OG sd2snes pre-Rev.H and results in audio clipping. I set it to +6dB and now my Battletoads intro sounds exactly like in your recording.

speedyrules commented 1 year ago

i will check 👍 just give me some days, because i won't have access to my stuff the next few days. but i will do as soon as i can!

speedyrules commented 1 year ago

@mrehkopf , thank you for your patience :)

So, volume boost is set to "off". i turned it on to try (+3.5db) and it did - as expected - not get better. i also turned it off again and tried again, with no better results (i was hoping maybe my turning it on an off to trigger something.. but it didn't)

ChipOptions

SysInfo

mrehkopf commented 1 year ago

Weird. I guess you aren't using any pre-boosted PCM packs? I'll check the DAC timing for any quirks... if the samples are shifted by one bit they might clip in a similar fashion. However there should still be an audible difference between the different boost settings.

mrehkopf commented 1 year ago

Oh, right - can you check if Super Gameboy audio is distorted in the same way?

speedyrules commented 1 year ago

hmm.. not an expert.. but i can point you to the pcm pack and the patch? at the end i think it should sound like that: https://www.youtube.com/watch?v=U8zamvkZnW8

patch: http://bszelda.zeldalegends.net/stuff/Con/btbm_msu1_patch.zip pcm: https://drive.google.com/file/d/1axXYAqcdM5FXVK8RBNeyuKmtXes1SqxV/view?usp=drivesdk

i would not know how to test the super gameboy, because i would not know where to get the pcm packs and probably do not have the roms :(

speedyrules commented 1 year ago

i did some more testing

It might be that the PCMs are pre-boosted as you said. is there any easy-to-use pcm player i can test them myself?

and i was not able to get any super gameboy msu-1 games

it's annyoing to be a noob and not being able to do more technical research, sorry :(

mrehkopf commented 1 year ago

Hm, I did check the packs you linked and found nothing wrong with them, not pre-boosted either; certainly high amplitude but no clipping. Generally it seems like your audio signal is a bit hot 🤔 I got another bunch of PAL consoles to check if something might be happening in the audio path (e.g. a failing capacitor might happen on two consoles independently, albeit unlikely...)

Super Gameboy doesn't have to be MSU-1 (however there are sets on zeldix.net) - the audio path for SGB is the same as for MSU-1.

I'm afraid there is no basic MSU1 audio player on the SNES; however you could run the game in an MSU1 capable emulator or load the PCM files in an audio editor (e.g. for Audacity, select File->Import->Raw data, select the file, then set the parameters as follows): image

@qwertymodo also made a foobar2000 plugin to directly play MSU-1 PCM files: https://www.zeldix.net/t1334-msu-1-pcm-plugin-for-foobar2000

mrehkopf commented 1 year ago

It might also be worth checking this out: https://www.zeldix.net/t2068-msu-1-re-normalization-lower-pcm-volume However even with the PCM files at full blast (but not clipping) the audio should not distort, just be very loud... 🤔

qwertymodo commented 1 year ago

That Battletoads pack definitely looks like a boosted one. It's not clipping, but the title track is normalized to 0dB peak, or around -9dBFS RMS, which is almost certainly way too loud. If that pack is linked somewhere like zeldix, please comment to tell the author they need to properly normalize their tracks. Since you said it's fine on other packs, this definitely looks like an issue of a bad pack, and not a problem with the FXPAK.

mrehkopf commented 1 year ago

Still I tried the same pack and don't get any distortion. Maybe my audio path is more forgiving (like I'm using a mixer with 10dB of headroom I think...)

qwertymodo commented 1 year ago

Yeah, the fact that there's no clipping in the actual files means it's probably possible to tame it down with attenuation in your audio chain, but they definitely don't look correct to me.

speedyrules commented 1 year ago

thanks for all the input! so, i will try:

speedyrules commented 1 year ago

ok, quick update

so i tried the normalized file again with 2 snes, 3 different cables connecting straight to the tv, straight to the amplifier and a breakout cable to the amplifier (so lots of re-plugging) --> the results sty the same with the white noise.

and i found another game that has sound issues: star fox

so, since the -18 normalization plays OK in audacity but not on the fxpak pro, i cannot figure out if the PCM are broken or the fxpak pro does not play the files properly.

what is your opinion?

https://user-images.githubusercontent.com/25831136/234313791-1e5631d5-1ffe-4c75-bb7b-f546760bb4a9.MOV

mrehkopf commented 1 year ago

Hmmm, recently I did a few tests running my SNES from a bench power supply where I can control the voltage. In your sample it sounds much like when I reduce the voltage so much that the SNES barely runs at all (resets/crashes a lot). However my bench supply can only output DC and the PAL SNES usually runs on AC so the test was not really faithful.

On the SNES, supply voltage for the internal audio amplifier circuitry is derived from the AC/DC input directly because it needs 9V DC. The rest of the electronics gets 5V DC via a voltage regulator. If the amp doesn't get enough voltage, distortion will occur. It would also occur on audio coming from the internal sound chip but it might not be as pronounced because the audio is softer. You did mention sound issues with Star Fox, are those also clipping/distortion related?

Did you run your 2 PAL consoles off the same power brick? Would you happen to have another lying around that you could try? In fact, with PAL consoles, it doesn't even matter whether it's AC or DC, and for DC, the polarity doesn't matter either because PAL consoles have internal rectifiers. So any power supply with a barrel plug that outputs 9V (no more than 10V!) and at least 700mA should do. I recognize it's a bit of a leap of faith so if you feel uncomfortable doing it, you don't have to :)

I'm going to experiment with the amp voltage on my end.

speedyrules commented 1 year ago

so, here is a better quick-record where you can hear the interference better (at least on my phone that recorded it, on vlc it is hard to hear again)

https://user-images.githubusercontent.com/25831136/234329955-d9b4ad3f-1f51-4b17-8462-2cdfd5f2b619.mov

i do have at least 3 more power brick, yes. and i did not swap them out. i will try! i just not thought, that this could be the problem, because i tried also nba jam, biometal, tmnt turtles in time, final fight and they all sounded kind of smooth in my amateur-ears, i guess . however, i will give a try with other power bricks!

yes, star fox sounds also clipped/distorted ( iguess it is pcm-2). looking in audacity it sounds again not really bad from the quality i guess.. but when you look at the peaks it is problematic, i guess image

speedyrules commented 1 year ago

just also got an reply in the zeldix forum:

Relikk Re: Battletoads in Battlemaniacs

Reply with quote

Post Today at 17:08 by Relikk I seem to remember testing these when you brought it up last month and they were completely fine on my system. No distortion, whatsoever.

Did you check to see if you had the volume boost enabled in the options? I think it doesn't do anything on certain board revisions, but still worth checking. Did you contact ikari regarding a possible bug in the latest firmware for the new FPGA?

EDIT: Nevermind. I see you did both of those things, already. The fact that this doesn't happen on my set up, and neither does it on ikari's, it's either down to your cartridge having a bad amp or it's a part of your own signal chain. Apart from maybe being a little louder than they should be, there's nothing "wrong" with the PCM files.

speedyrules commented 1 year ago

furhter reply: Relikk Re: Battletoads in Battlemaniacs

Reply with quote

Post Today at 18:06 by Relikk (Online) The amp is purely speculation, as I have no technical knowledge of the workings of it where an SD2SNES is concerned, but it seems like it's sensitive to higher amplitudes.

I have an SD2SNES version of the Pro. It'd be one of the first run Pro's that wouldn't fit into a US cartridge shell, as I got it when it was originally announced.

mrehkopf commented 1 year ago

Hmm, I guess to rule out or confirm a bad DAC or amp on the FXPak some measurements would need to be done... I think I can rule out a DAC timing bug; I just shifted all samples left by one bit and the distortion is much much worse even than your initial recordings.

speedyrules commented 1 year ago

how would i make this measurements on the DAC or amp?

mrehkopf commented 1 year ago

It would involve taking a multimeter or oscilloscope to some points on the FXPak PCB while it's running - the top shell of the SNES also needs to be removed to be able to reach the points (unless you have some sort of plug-in adapter for playing imports).

speedyrules commented 1 year ago

ufff.. i am afraid this is out of my reach of abilities :(

i will try the different power bricks though ..and hope there will be a difference..

but else if that does not help, what is your suggestion? contact krikkz and and for repair?

mrehkopf commented 1 year ago

If you live in the EU I could take a look at your FXPak personally, probably easier and faster than shipping to and from krikzz. However we should explore the other possibilities first so please try your other power supplies and I'm going to rig up a SNES to simulate a weak 9V DC supply / failed capacitor.

speedyrules commented 1 year ago

+1 i live in switzerland :)

will report after i got that additional snes

mrehkopf commented 1 year ago

Hmm, Switzerland is geographically convenient but I'd still need to pay import tax when you send it to Germany 😅 I tinkered around a bit yesterday and could provoke the same distortion when running the audio amp rail (which is supposed to be 12V, not 9V, sorry) at around 3.5V. I haven't been able to reach that low a voltage even by removing a bunch of capacitors entirely so I'm wondering if it's even possible to reach that voltage by "natural" causes like aging. Some other failure modes are possible, like a specific transistor or one of 2-3 resistors failing (or, of course, the opamp itself) but how likely is that to happen on two independent consoles? So my current bet is on the power supply 🤞 Looking forward to your results :)

mrehkopf commented 1 year ago

Ordered a Variac so I can tinker with low AC voltage. But it won't arrive before next Wednesday.

speedyrules commented 1 year ago

back amd reporting :)

i did a few things:

let me begin:

now i have 3 PAL snes to test: A. my yellow one: SNSP-001A (FRG), input AC9V 1.3A, power brick to use NES-002E B. my mint one: SNSP-001A (FRG), input 9V~ 1.3A, power brick to useNES-002E C. my buddy's one: SNSP-001A (UKV), input AC9V 1.3 A, power brick to useNES-002-GBR

Image 3

the power bricks:

  1. SNES power brick, NES-002EU, output 9V~1.3 A, measured 10.8V
  2. SNES power brick, NES-002E, output AC9/9.4V 1.3A, measured 10.7V
  3. NES power brick, NES-002ED, output AC 9V 1.3A, measured 11.3V
  4. NES power brick, NES-002ED, output AC 9V 1.3A, measured 11.3V
  5. NES power brick, NES-002ED, output AC 9V 1.3A, measured 11.3V
  6. SNES power brick, NES-002E, output AC9/9.4V 1.3A, measured 10.7V

Image 1 Image Image 2

I copied Battledoads and the firmware on a new 1GB SD-Card. I also found another game with issues: Killer Instinct (Arcade Version): This one has video issues on the left of the screen. Also copied on that SD Card to test.

Results:

Then i installed foobar2000 (32-bit) with the pcm plugin to check the pcm: same result as with audacity: the pcm plays well.

last but not least, i did check about import taxes: there are none to pay if it is declared properly as "repair" or "return":

https://www.bazg.admin.ch/bazg/de/home/information-private/interneteinkauf--post--und-kuriersendungen/einfuhr-in-die-schweiz/ruecksendung--reparatur--veredelung.html

oh.. and i also consulted chatGPT: here is its anwer: :) Hello! I'd be happy to help you with your question.

Super Nintendo consoles can experience a variety of failure scenarios, including sound issues. The likelihood of specific components failing on two independent consoles can vary based on a number of factors, such as age, usage, and environmental conditions.

However, it is not uncommon for electronic components to fail over time due to various factors such as heat, voltage surges, and general wear and tear. Some components, such as transistors and resistors, are more prone to failure than others. In addition, manufacturing defects can also contribute to failures.

That being said, it's important to note that the likelihood of two independent consoles experiencing the exact same failure scenario is relatively low, especially if the consoles were manufactured at different times or in different locations.

If you are experiencing sound issues on your Super Nintendo console, it's best to troubleshoot the issue by checking the console's connections, trying different cables or TV inputs, and testing the console with different games. If the issue persists, it may be necessary to have the console professionally repaired or replaced.

speedyrules commented 1 year ago

looking forward to your results and opinion :)

mrehkopf commented 1 year ago

👀 very thorough testing, really doesn't leave anything to be desired. Thank you 🙏 As expected after seeing your results, Variac test did not lead to any new conclusions. 😅 I was able to lower the line voltage to about 160V (~7V secondary) at which point the console started crashing, without any changes in audio. It must be the FXPak. Soo hit me up on Discord or Twitter I guess and we can discuss the further details :)

speedyrules commented 1 year ago

Contacted you on discord 👍

mrehkopf commented 1 year ago

Turned out to be a broken op-amp IC. Works great after replacing a 20ct part. ;)

speedyrules commented 10 months ago

And we might have found an issues with the "last run super nt" Thanks @mrehkopf for the awesome help!