Well, then the program which initializes it, should terminate it on exit...
Just like a hooked/initialized pad is terminated, when 'going to OSDSYS' or 'exit' an app...
That's in a perfect world. There is no procedure for resetting/deinitializing the SPU2. As with a lot of peripherals, there is no deinitialization by the software itself.
What does this have to do with the issue being inherent by FMCB/FHDB, more specifically related to the ELF-Starting through the OSDSYS?
Any software that enables sounds effects in the specific way should cause the bug to take place. It doesn't have to be the OSDSYS program.
...this even shouldn't be an issue after an IGR, if the 'de-init' (more specifically 'cleaning state') is done properly in FMCB/FHDB, when an ELF is started through the OSDSYS!
Like I wrote, there is no deinitialization process. The game just didn't initialize libsd correctly, which resulted in some foreign settings getting carried over.
How do I know that? It's because the function for enabling digital effects will write to the necessary registers and the SPU2 should use the required region of memory. Digital effects are also disabled at initialization.
So how does it go wrong? The game does call sceSdInit() with the cold setting once. That is correct... but then it also calls it again, with the hot setting instead, which has a side effect of enabling digital effects. That was how digital effects got enabled without the function for enabling digital effects.
Right... and IMO I draw it at the exact right place!
According to you. But is it?
Your way would require new apps - which can start ELFs - , to require a fix for something which is caused by FMCB/FHDB in the first place... You would have to draw more than 'a'/one line in that case.
That's because you assume that it is a problem that can come from
only OSDSYS.
Correct... - hence my suggestion -
Which is the exact reason, why this issue of FMCB/FHDB should be fixed, where it is caused (in the way FMCB/FHDB fails to clean the state of the SPU2, when starting an ELF from the OSDSYS...).
If you think that it is a bug in the way FMCB works (i.e. it doesn't let OSDSYS clean up), then why don't you go find that missing function and tell us how to fix it?
That's unfortunate, because it actually should do that. Not sure, why Sony excluded it to a seperate function and/or lib.
More logic = more cost. But if you initialized everything you needed to a known state, it will work fine too.
After all, the exact hardware configuration is already known when the software is made. We have a finite number of hardware states as well.
Well, OPL probably needs it anyway since it has sound-support implemented now...
No, it does not. If you haven't noticed, nearly no other software was affected. OPL wasn't affected either.
But... I will keep my statement up, that FMCB/FHDB should also do a cleanup, because:
- Different behavior of ELFs/Apps because they are started from either the hacked OSDSYS or Button-/Auto-Launch, is just not good...
Then what happens if you IGR from a different game? Any software can use digital effects, not just the OSDSYS.
- There are apps which seem to have issues as well, when started through the hacked OSDSYS!
Which apps have sound problems?
- It is not happening, when an ELF is started as if it where a PS2-game... from disc... So PS2Logo does something, which is missing when an ELF is started from the OSDSYS in 'FMCB's/FHDB's way'...
Is "coincidence" not a possibility to you?
- The OSDSYS initially uses the SPU2, so it also should clear it's state (on exit), just like it is done when a disc is started...
Then it's Sony's problem, from up to even 20 years ago. You're also assuming it can do proper deinitialization of the SPU2. We're already calling the same function it uses to do deinitialization as well (I scan for it and call it when FMCB takes control) .
But even so, what about the effect of other games on such a bugged game? It's because we cannot guarantee that a game with such a compromised design will surely work well after each and every game that was booted before it, I put the additional SPU reset code within OPL, before the game is booted.