-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When seeking to atrac positions, force alignment and start from zero #6976
Conversation
Break BGM in GTA . |
When, is that after a seek? Does the same audio also have GHA phase shifting? Maybe it needs that "forcing" because it's seeking by overwriting frames in the buffer (even though it seems to try to reconstruct the entire file.) But that means we'll never get the right data out of ffmpeg's demuxer. -[Unknown] |
What is after a seek? But the BGM seems no GHA phase shifting. |
Well, should I close this pull? As long as I'm going to have to create one pull request that simultaneously fixes every bug in sceAtrac, I'm not going to waste my free time on it. This game already logs and reports this error with or without these changes merged, so it's clearly already broken. And there's no test case or data showing anything except that my change is correct. So, I'm not going to waste my time further on sceAtrac. -[Unknown] |
Sorry about that. I was hoping to find time to fix it or make a test case before merging, but I just haven't and then forgot. I'll give it another shot really soon and then probably merge either way... I agree that it looks like the game is already broken but superficially it actually does appear to work correctly with the current code, which is why I've been dreading the resulting complains flood on a merge... |
I think that we can merge after v1.0. |
f5731f3
to
70a3d0f
Compare
Break bgm in Kurohyou 2 |
Hmm, is that reproducible in the demo? It seems to be working, but I have some debugging code in. In other news, I finally understood enough to beat the first fight in that demo. -[Unknown] |
Seems not happen in demo,the bug happen in the savedata screen. |
Radiant Mythology 2 and Kurohyou 2 broken in unknownbrackets@ad3ab88 unknownbrackets@70a3d0f also break Radiant Mythology 2? or the previous? |
What if you add before if (packet->size < (int)atracBytesPerFrame) {
return ATDECODE_FEEDME;
} And add after: memcpy(tempPacket.data + initialSize, packet->data, to_copy); This: NOTICE_LOG(HLE, "Pulling %d bytes into packet, need %d", to_copy, needed); I assume some values of to_copy are less than needed, just wondering how they look. -[Unknown] |
That may fixes the Radiant Mythology 2,but not Kurohyou 2,I don't see any NOTICE_LOG when running these games |
In Kurohyou 2 demo,hit a GHA phase shift,the bgm would stop,the master buid won't. |
I did some special move and the screen turned black while it asked me to press buttons like triangle and square. Pretty sure that's a bug but not directly related... probably more depal problems in this game. Hmm, I let the fight last a pretty long time, still can't get a GHA phase shift. It's the first fight after selecting the second item, right? I don't have to go find anyone? -[Unknown] |
Just the first battle,possiable different BGM?it happen when going to the battle.could make a savestate in the "VS" screen,after pressing circle, the BGM of the battle play a sound and then stop,it get that error. |
Surely cound have different bgm in that battle,try serveral times savestate could get it. |
A savestate for the GHA phase shift in Kurohyou 2 demo. |
This pull request makes no change to Monster Hunter Freedom Unite, there is still the same message in the log console as I stated in this comment : #7323 (comment) |
Fixes the crash after title BGM looping in Aliens Vs Predator Requiem. |
The Kurohyou 2 demo is good now with the GHA phase shift fix.The retail verson is still not good.
|
I found some errors happen in the Kurohyou 2 demo.It happen when you entrying or exiting the shop
Load the savestate and press circle button. |
a7764b3
to
8d40561
Compare
It seems like we can only (safely) seek to sample boundaries, which makes sense. Also, we get wrong data unless we "warm" it by seeking from 0, it seems like. This makes looping produce correct data. Fixes hrydgard#6970.
Otherwise we also get incorrect data.
Otherwise we may ask for more than is possible at the end.
8d40561
to
7a974b3
Compare
I use v1.0.1-31-g5ebfa57 + this pull request, 01:29:820 ATRAC3 play D[ME]: HLE\sceAtrac.cpp:998 00000000=sceAtracDecodeData(0, 08e29500, 0bfd4e40[00000800], 0bfd4e54[00000000], 0bfd4e44[694]) full log:https://gist.github.com/sum2012/b9bf90aa6355dff03b31 |
@unknownbrackets |
I'm not going to worry specifically about how JPCSP has chosen to implement things. Instead, my concern is making the decoded atrac data match (with some fuzz, since the decode is not precisely the same) what the PSP firmware generates with the same syscalls. We currently generate the correct first and second chunk of samples. So any addition of memory moving would probably make it incorrect. It looks like JPCSP is decoding the entire chunk, and then moving that decoded data to skip the initial bytes. This is actually incorrect (fyi, @gid15), since that sounds like it would overwrite memory after the chunk that would not be overwritten on a real PSP. It may cause problems in games like Resistance: Retribution, iirc. Memory should not be modified beyond the returned sample count. -[Unknown] |
Right, I almost forgot ...... it's time to merge this and break stuff. Will play with it a bit and merge soon. |
Hope we can fix GTA before major release |
Let's take the plunge and hope we can make progress towards a proper solution. If we fail, might go back, but as this matches the tests better it is a step in the right direction, even if some stuff breaks for a little while. |
When seeking to atrac positions, force alignment and start from zero
Yes,we do not afraid merge this,if before major version do not solved Gta ,I pull request the commit again(hack?) |
…dio work in GTA again. Hopefully we will find a better fix in the future. Also see issue #7863.
Add a compatibility flag to revert sceAtrac to before #6976. Makes audio work in GTA again.
Starting from zero allows us to actually get the correct data. Otherwise, whether forwards or backwards, we get junk for a frame or two.
This fixes some sound artifacts when looping.
-[Unknown]