Skip to content
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

Code Lyoko stuck at "No problem screen" #2539

Closed
sum2012 opened this issue Jun 30, 2013 · 57 comments · Fixed by #8356
Closed

Code Lyoko stuck at "No problem screen" #2539

sum2012 opened this issue Jun 30, 2013 · 57 comments · Fixed by #8356
Labels
Atrac3+ Issue involves sceAtrac features.

Comments

@sum2012
Copy link
Collaborator

sum2012 commented Jun 30, 2013

PPSSPP v0.8.1-109
1
It just replay sound voice in the screen

JPCSP also have this probrem.
(and It can solved by disable decode audio by SonicStage)

PPSSPP Debug log:
(I have disabled log in hle\scekerneltime.cpp:67 /DEBUG_LOG(HLE, "sceKernelGetSystemTime(out:%16llx)", t);)

https://docs.google.com/file/d/0B3OaSdeV0L8kclhHR2czaGtuZGM/edit?usp=sharing

@sum2012
Copy link
Collaborator Author

sum2012 commented Nov 17, 2013

@unknownbrackets I hope you have idea to fix
In sceIo.cpp I change DEBUG_LOG to NOTICE_LOG

1:
Orignal log:(Stop when no more log)
https://gist.github.com/sum2012/736c023d31ab744d055a

2:
in int sceIoPollAsync(int id, u32 address) { sceIo.cpp 's function
I comment Memory::Write_U64((u64) f->asyncResult, address);
I can pass the screen,but the Dialogue have no sound (and feeze in the boss)
Here is just pass the screen log.
https://gist.github.com/sum2012/f0e53be2f539fa6ed8d6

3:
JPCSPtrace log of sceIoPollAsync and sceIoReadAsync
https://gist.github.com/sum2012/d8370087c38b18ad3208

edit:correct sceIoPollAsync name

@unknownbrackets
Copy link
Collaborator

Hmm, weird, it's reading a different amount of data (and alternating size) on the PSP.

I notice that the second param to sceAtracSetDataAndGetID is 0x800. Can you JpcspTrace that func and sceIoRead as well?

-[Unknown]

@sum2012
Copy link
Collaborator Author

sum2012 commented Nov 17, 2013

@unknownbrackets
Copy link
Collaborator

Hmm. I wonder if this is actually atrac related.

-[Unknown]

@sum2012
Copy link
Collaborator Author

sum2012 commented Dec 15, 2013

PPSSPP v0.9.6-57 same problem
In sceAtrac.cpp I change all DEBUG_LOG to NOTICE_LOG.
The log stop in just repeat voice
https://gist.github.com/sum2012/fbf2c0389de689baca71

@sum2012
Copy link
Collaborator Author

sum2012 commented Dec 15, 2013

In the dialog loop,it just call sceAtracDecodeData
edit:do not call sceAtracAddStreamData and sceAtracGetRemainFrame

@thedax
Copy link
Collaborator

thedax commented Jan 29, 2014

How is this game looking now? Still hanging?

@sum2012
Copy link
Collaborator Author

sum2012 commented Jan 29, 2014

@sum2012
Copy link
Collaborator Author

sum2012 commented Apr 3, 2014

@sum2012
Copy link
Collaborator Author

sum2012 commented May 14, 2014

ppsspp-v0.9.8-661-g2d12eb3 same problem
https://gist.github.com/sum2012/c0e17eb15089c9770e39

New finding ,remains always -1 when stuck
@unknownbrackets do your JPCSPTrace can modify to see it's value (don't just see the addreess)?

59:12:133 ATRAC3 play D[ME]: HLE\sceAtrac.cpp:702 00000000=sceAtracDecodeData(0, 08a7c480, 0bfb7aa8[00000800], 0bfb7aac[00000000], 0bfb7abc[-1])
59:12:154 ATRAC3 play D[ME]: HLE\sceAtrac.cpp:702 00000000=sceAtracDecodeData(0, 08a7e480, 0bfb7aa8[00000800], 0bfb7aac[00000000], 0bfb7abc[-1])

@unknownbrackets
Copy link
Collaborator

Use "p" for the parameter instead of x for that. From the readme:

  - x: log the parameter value as an hexadecimal number without leading zero's, e.g. 0x12345
  - d: log the parameter value as a decimal number without leading zero's, e.g. 12345
  - s: log the parameter value as a pointer to a zero-terminated string, e.g.
       0x08812345('This is a string')
  - p: log the parameter value as a pointer to a 32-bit value, e.g.
       0x08812345(0x12345)    (when the 32-bit value at address 0x08812345 is 0x00012345)
  - v: log the parameter value as a pointer to a variable-length structure.
       The first 32-bit value is the total length of the structure. E.g.:
       0x08812345(0x00000008 0x00012345)

-[Unknown]

@sum2012
Copy link
Collaborator Author

sum2012 commented May 14, 2014

Thanks @unknownbrackets
New finding

03:47:06.294248 ATRAC3 play thread - -> sceAtracDecodeData 0, 0x8A7C380, 0x09FB35A8(0xFFFFFFFF), 0x09FB35AC(0x0), 0x09FB35BC(0x2) = 0x0
03:47:06.297522 ATRAC3 play thread - <- sceAtracDecodeData 0, 0x8A7C380, 0x09FB35A8(0x363), 0x09FB35AC(0x0), 0x09FB35BC(0x1) = 0x0

03:47:06.305863 ATRAC3 play thread - -> sceAtracGetStreamDataInfo 0, 0x9FB35B8, 0x09FB35B4(0xFFFFFFFF), 0x09FB35B0(0xFFFFFFFF) = 0x0
03:47:06.305942 ATRAC3 play thread - <- sceAtracGetStreamDataInfo 0, 0x9FB35B8, 0x09FB35B4(0x438), 0x09FB35B0(0x800) = 0x0

sceAtracDecodeData remains never -1

full log:
https://gist.github.com/sum2012/6b3454f1248486cda10d

@unknownbrackets
Copy link
Collaborator

sceAtracSetLoopNum(0, -1)

So, then this is most likely because of the incorrect buffer management in sceAtrac. As mentioned, games can opt to use a fixed (smaller sized) buffer to store atrac data, using a sliding window. This game is most likely doing that, i.e. there are always remaining frames because all frames are never within memory.

Although I'm not really sure, I have not done much testing on sceAtrac.

-[Unknown]

@sum2012
Copy link
Collaborator Author

sum2012 commented Jun 6, 2014

Update JPCSPTrace log:
add
sceAtracReleaseAtracID 0x61eb33f5 1 x
sceAtracSetDataAndGetID 0x7a20e7af 2 xx
sceAtracSetLoopNum 0x868120b5 2 xx

https://gist.github.com/sum2012/d17308329ee6cb3b5c85

@sum2012
Copy link
Collaborator Author

sum2012 commented Sep 7, 2014

Update @unknownbrackets JPCSPTrace:
https://gist.github.com/sum2012/341ec200de6b93405ef3

ppsspp-v0.9.9.1-241-gf2c50f5 log:
https://gist.github.com/sum2012/e38ba14301f6c441ebe7

Another finding
sceAtracGetStreamDataInfo write wrong value of readOffsetAddr

@sum2012 sum2012 changed the title Code Lyoko stuck at "No probrem screen" Code Lyoko stuck at "No problem screen" Sep 7, 2014
@sum2012
Copy link
Collaborator Author

sum2012 commented Sep 7, 2014

Hmm
14:21:12.465389 ATRAC3 play thread - -> sceAtracGetStreamDataInfo 0, 0x09FB33B8(0x8A5C40C), 0x09FB33B4(0x438), 0x09FB33B0(0x800) = 0x0
14:21:12.465518 ATRAC3 play thread - <- sceAtracGetStreamDataInfo 0, 0x09FB33B8(0x8A5C844), 0x09FB33B4(0x18C), 0x09FB33B0(0xC38) = 0x0
0x8A5C844 - 0x8A5C40C = 0x438
0xC38- 0x800= 0x438
0x438- 0x18C= 0x2AC

Alright ,write this first
edit:Don't know how to get this magic value 0x438,0x2AC

@sum2012
Copy link
Collaborator Author

sum2012 commented Sep 19, 2014

@LPatamon
Copy link

LPatamon commented Oct 4, 2014

I hope this is okay to mention. Just to say that the stuck problem is still present on v0.9.9.1-566-gc2a462c

I thought in mentioning, so we can keep a record of this issue and its progress.

@sum2012
Copy link
Collaborator Author

sum2012 commented Oct 4, 2014

Update the log to v0.9.9.1-588-g8a2ad02
https://gist.github.com/sum2012/50ab02c06bc2f43cb49c

@sum2012
Copy link
Collaborator Author

sum2012 commented Oct 4, 2014

@unknownbrackets if I change to
u32 sceAtracGetStreamDataInfo(int atracID, u32 writeAddr, u32 writableBytesAddr, u32 readOffsetAddr) {
...
if (Memory::IsValidAddress(writeAddr))
Memory::Write_U32(atrac->first.addr, writeAddr);
Change to Memory::Write_U16 work without BGM.Do you have idea to correct fix ?

Modify log:
https://gist.github.com/sum2012/054dbbcadc6cebc987b7

edit:Comment that two line seem safer for modify.

@LPatamon
Copy link

LPatamon commented Oct 4, 2014

This game sure has showed to be tricky to make it work correctly huh? No doubt that the atrac sound sure is very complex.

Game still with the stuck thing and voices sound loop on the latest github version v0.9.9.1-588-g8a2ad02.

@sum2012
Copy link
Collaborator Author

sum2012 commented Jan 20, 2015

Update debug log to v0.9.9.1-1576-g4100163
https://drive.google.com/file/d/0B3OaSdeV0L8kZXVDU21mMTRFdXc/view?usp=sharing

@metal5621
Copy link

Um, hi there. I just wanted to ask is there something that you can do to fix this problem? I would really love to play this game but it keeps occurring no matter what i try :(

@sum2012
Copy link
Collaborator Author

sum2012 commented Jan 21, 2015

@metal5621
Copy link

Oh my god, thank you so much, i almost cried. You made one girl's day, sir.

@sum2012
Copy link
Collaborator Author

sum2012 commented Jan 25, 2015

Update the log to v0.9.9.1-1599-g53510f5
https://gist.github.com/sum2012/838230d97693866924dc

@sum2012
Copy link
Collaborator Author

sum2012 commented Nov 6, 2015

ppsspp-v1.1.1-223-ga581de7 same problem
log:
https://gist.github.com/sum2012/86f459b4e6cd4803ca03

@sum2012
Copy link
Collaborator Author

sum2012 commented Nov 8, 2015

v1.1.1-240-gb9f703d still same problem
In the sceAtracDecodeData, remain frame not -1 now,but the game still don't get signal to stop looping
full log:
https://gist.github.com/sum2012/f8c58e2e836287213494

@sum2012
Copy link
Collaborator Author

sum2012 commented Nov 8, 2015

Compare again JpcspTrace log
Real psp (in this game) do not return "remain 3" in sceAtracDecodeData

@unknownbrackets
Copy link
Collaborator

That's because sceAtracGetStreamDataInfo() is supposed to request 0x438 bytes, but is requesting 0x800. The remain frame value is correct based on the amount of data, but the amount of data is still incorrect.

-[Unknown]

@sum2012
Copy link
Collaborator Author

sum2012 commented Nov 8, 2015

Update JPCSPTrace log with sceAtracGetRemainFrame 0x9ae849a7 2 xp
https://gist.github.com/sum2012/d9a19dc2abddf0fdc01f

@unknownbrackets unknownbrackets added the Atrac3+ Issue involves sceAtrac features. label Jan 1, 2016
@daniel229
Copy link
Collaborator

#8354 broke this game more,the bgm in other scene is missing.

@unknownbrackets
Copy link
Collaborator

Hmm. Could you try an #define HLE_LOG_FORCE before and after for just that area (ideally including it loading the background and then playing)?

-[Unknown]

@unknownbrackets
Copy link
Collaborator

Hmm. What if you try this for FillPacket() instead?

    bool FillPacket() {
        u32 off = getFileOffsetBySample(currentSample);
        if (off + atracBytesPerFrame <= first.size) {
#ifdef USE_FFMPEG
            av_init_packet(packet);
#endif // USE_FFMPEG
            packet->data = data_buf + off;
            packet->size = atracBytesPerFrame;
            packet->pos = off;

            return true;
        } else {
            return false;
        }

        return true;
    }

Which might be more correct, I wasn't really sure.

-[Unknown]

@daniel229
Copy link
Collaborator

That sounds stuttering

@unknownbrackets
Copy link
Collaborator

Did #8361 fix that? With #8361 + #8356, is this fixed?

-[Unknown]

@sum2012
Copy link
Collaborator Author

sum2012 commented Jan 2, 2016

#8361 have been merged so that I just download v1.1.1-569-g1a6217b to test
v1.1.1-569-g1a6217b still stuck at "No problem screen"
log:
https://gist.github.com/sum2012/eda3d1d8f3bcfc8cedfb

@unknownbrackets
Copy link
Collaborator

Okay, but it doesn't have stuttering / missing BGM in the other places?

#8356 isn't merged yet.

-[Unknown]

@sum2012
Copy link
Collaborator Author

sum2012 commented Jan 2, 2016

Doesn't have stuttering / missing BGM
I am testing #8356

@sum2012
Copy link
Collaborator Author

sum2012 commented Jan 2, 2016

Well done @unknownbrackets
#8356 finally correctly fixed this crazy game
log:
https://gist.github.com/sum2012/97b695ee4f2c8ee5b629

@thedax
Copy link
Collaborator

thedax commented Jan 3, 2016

Nice to see a two year old issue finally get fixed.

@LPatamon
Copy link

LPatamon commented Jan 3, 2016

I say the same. At last we can go past the "no problem" part when starting a new game :D

@unknownbrackets
Copy link
Collaborator

Yep, it was "no problem" at all. Okay, sorry.

-[Unknown]

@punysub
Copy link

punysub commented Jan 25, 2017

can you just say very simple how to fix it,i dont understand what are all you saying to fix this game

@sum2012
Copy link
Collaborator Author

sum2012 commented Jan 25, 2017

@punysub download newest version in http://buildbot.orphis.net/ppsspp/

@punysub
Copy link

punysub commented Jan 29, 2017

the window become black,whats wrong?

@sum2012
Copy link
Collaborator Author

sum2012 commented Jan 29, 2017

1

@sum2012
Copy link
Collaborator Author

sum2012 commented Jan 29, 2017

@punysub
Test on my phone,the screen is total bad,I will open a new issue

@Adeiyan
Copy link

Adeiyan commented Jul 9, 2017

hi
iam trying to play this game. but I get problem like this. and I try to searching for information in Google. and this is only one information I can get.
so...
is there any way to fix this bug?
iam sorry I don't understand what u all talking about up there.
can u make video how to fix it?
I want to playing this game. Please help me.
thanks

@unknownbrackets
Copy link
Collaborator

unknownbrackets commented Jul 10, 2017

Step 1: Update to ideally PPSSPP v1.4.2, or at least v1.2.2 or higher.
Step 2: Play the game.
Step 3: Profit?

https://www.ppsspp.org/downloads.html

-[Unknown]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Atrac3+ Issue involves sceAtrac features.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants