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

WIP: Minimal change that gets Naruto Shippuden Ultimate Ninja 3 going again. But why? #11772

Closed
wants to merge 1 commit into from

Conversation

hrydgard
Copy link
Owner

@hrydgard hrydgard commented Feb 6, 2019

The game's been broken since early post-1.3 commits, and it keeps getting reported. There's already some discussion in #9591 about possible causes.

I've confirmed that this change gets the game going again but it's unclear why - it could be two bugs cancelling each other. It's strange that the game seems to want the error to only be reported once. Anyway, I'm not really sure how to best proceed here. Some experimentation might be in order as this is difficult to accurately test on hardware..

@hrydgard hrydgard added this to the v1.8.0 milestone Feb 6, 2019
@unknownbrackets
Copy link
Collaborator

The most important problem here is that sceMpegGetAtracAu should return ERROR_MPEG_NO_DATA when there's no audio stream at all. Even if endOfAudioReached is already set because it's returned it once, it needs to keep returning it.

That mostly only affects games that play video using shared code, and sometimes the video has no audio. See #8437, I think? Or maybe it was another game too...

It also should keep returning it if you reach the end of the video. If it doesn't, some games may get stuck thinking the audio is still playing.

What actually happens in Naruto?

A) Does it call this on a video that has no audio at all, and break when it says it has no audio? Sounds like stuffing a bug under a rug.

B) Does it call this on a video after the audio stream has ended, and get angry because the audio stream ended too early / with different timing than video?

C) Does it call this on a video after doing something that should apparently reset/restart the video, but it doesn't clear the flag properly?

D) Does it call this on a video which has audio, but somehow get no audio data (perhaps because the ring buffer is not full enough)?

I think there might even be a test that shows this behavior (returning no data for a video with no audio) in pspautotests, btw.

-[Unknown]

@hrydgard
Copy link
Owner Author

hrydgard commented Feb 7, 2019

Logs below. [deleted wrong thought]. Might be that the videos lack audio indeed.

Without the hack, hang after the first video:

51:23:240 movie_decode D[ME]: hle\scempeg.cpp:1090 video: bufferAddr = 08cde930, *buffer = 0936c520, *init = 090d6d80
51:23:240 movie_decode D[ME]: hle\scempeg.cpp:1151 sceMpegAvcDecode(08cde974, 08cdea88, 512, 08cde930, 09fa0248)
51:23:273 movie_decode D[ME]: hle\scempeg.cpp:1603 0=sceMpegGetAvcAu(08cde974, 00000001, 08cdea88, 09fa0244)
51:23:273 movie_decode D[ME]: hle\scempeg.cpp:1090 video: bufferAddr = 08cde930, *buffer = 093f4540, *init = 090d6d80
51:23:274 movie_decode D[ME]: hle\scempeg.cpp:1151 sceMpegAvcDecode(08cde974, 08cdea88, 512, 08cde930, 09fa0248)
51:23:307 movie_decode D[ME]: hle\scempeg.cpp:1603 0=sceMpegGetAvcAu(08cde974, 00000001, 08cdea88, 09fa0244)
51:23:307 movie_decode D[ME]: hle\scempeg.cpp:1090 video: bufferAddr = 08cde930, *buffer = 0936c520, *init = 090d6d80
51:23:307 movie_decode D[ME]: hle\scempeg.cpp:1151 sceMpegAvcDecode(08cde974, 08cdea88, 512, 08cde930, 09fa0248)
51:23:341 movie_decode D[ME]: hle\scempeg.cpp:1421 960=sceMpegRingbufferAvailableSize(08cde978)
51:23:341 movie_decode D[ME]: hle\scempeg.cpp:1174 sceMpegAvcDecodeStop(08cde974, 00000200, 08cde930, 09fa0244)
51:23:377 movie_decode D[ME]: hle\scempeg.cpp:725 sceMpegFreeAvcEsBuf(08cde974, 1)
51:23:378 movie_decode D[ME]: hle\scempeg.cpp:555 sceMpegDelete(08cde974)
51:25:362 movie_decode D[ME]: hle\scempeg.cpp:1954 sceMpegRingbufferDestruct(08cde978)
51:25:362 movie_decode I[ME]: hle\scempeg.cpp:1616 sceMpegFinish(...)
51:33:589 movie_decode I[ME]: hle\scempeg.cpp:429 sceMpegInit()
51:33:589 movie_decode D[ME]: hle\scempeg.cpp:441 2065920 = sceMpegRingbufferQueryMemSize(960)
51:33:589 movie_decode D[ME]: hle\scempeg.cpp:1625 00010000=sceMpegQueryMemSize()
51:33:589 movie_decode D[ME]: hle\scempeg.cpp:467 sceMpegRingbufferConstruct(08cde978, 960, 09173f10, 001f8600, 088cb164, 08cdeb08)
51:33:589 movie_decode I[ME]: hle\scempeg.cpp:543 0909c5a0=sceMpegCreate(08cde974, 0909c570, 65536, 08cde978, 512, 0, 0)
51:33:607 movie_decode D[ME]: hle\scempeg.cpp:602 sceMpegQueryStreamOffset(08cde974, 09f9fa40, 09f9fa3c)
51:33:610 movie_decode I[ME]: hle\scempeg.cpp:354 Stream offset: 2048, Stream size: 0x55800
51:33:610 movie_decode I[ME]: hle\scempeg.cpp:355 First timestamp: 90000, Last timestamp: 360270
51:33:610 movie_decode D[ME]: hle\scempeg.cpp:632 sceMpegQueryStreamSize(09f9fa40, 09f9fa38)
51:33:610 movie_decode I[ME]: hle\scempeg.cpp:354 Stream offset: 2048, Stream size: 0x55800
51:33:610 movie_decode I[ME]: hle\scempeg.cpp:355 First timestamp: 90000, Last timestamp: 360270
51:33:610 movie_decode I[ME]: hle\scempeg.cpp:661 sceMpegRegistStream(08cde974, 0, 0)
51:33:610 movie_decode I[ME]: hle\scempeg.cpp:661 sceMpegRegistStream(08cde974, 0, 1)
51:33:610 movie_decode I[ME]: hle\scempeg.cpp:661 sceMpegRegistStream(08cde974, 1, 0)
51:33:611 movie_decode I[ME]: hle\scempeg.cpp:661 sceMpegRegistStream(08cde974, 1, 1)
51:33:611 movie_decode D[ME]: hle\scempeg.cpp:704 sceMpegMallocAvcEsBuf(08cde974)
51:33:611 movie_decode D[ME]: hle\scempeg.cpp:1351 sceMpegInitAu(08cde974, 1, 08cdea88)
51:33:611 movie_decode D[ME]: hle\scempeg.cpp:1351 sceMpegInitAu(08cde974, 1, 08cdeac8)
51:33:611 movie_decode D[ME]: hle\scempeg.cpp:1393 sceMpegQueryAtracEsSize(08cde974, 09fa027c, 09fa0278)
51:33:611 movie_decode D[ME]: hle\scempeg.cpp:1351 sceMpegInitAu(08cde974, 151700864, 08cdea08)
51:33:611 movie_decode D[ME]: hle\scempeg.cpp:1351 sceMpegInitAu(08cde974, 151700864, 08cdea48)
51:33:611 movie_decode D[ME]: hle\scempeg.cpp:1741 UNIMPL sceMpegChangeGetAuMode(08cde974, 3, 0): changing type=0
51:33:611 movie_decode D[ME]: hle\scempeg.cpp:1741 UNIMPL sceMpegChangeGetAuMode(08cde974, 4, 1): changing type=0
51:33:612 movie_decode D[ME]: hle\scempeg.cpp:1741 UNIMPL sceMpegChangeGetAuMode(08cde974, 5, 0): changing type=1
51:33:623 movie_decode D[ME]: hle\scempeg.cpp:1515 sceMpegRingbufferPut(08cde978, 32, 960)
51:33:623 movie_decode I[ME]: hle\scempeg.cpp:354 Stream offset: 2048, Stream size: 0x55800
51:33:623 movie_decode I[ME]: hle\scempeg.cpp:355 First timestamp: 90000, Last timestamp: 360270
51:33:627 movie_decode W[ME]: hw\mediaengine.cpp:315 Bad video stream 1
51:33:636 movie_decode D[ME]: hle\scempeg.cpp:1485 packetAdded: 32 packetsRead: 32 packetsTotal: 960
51:33:637 movie_decode W[ME]: hle\scempeg.cpp:1683 Audio end reach. pts: 85820 dts: 270270
51:33:637 movie_decode D[ME]: hle\scempeg.cpp:1697 80618001=sceMpegGetAtracAu(08cde974, 00000005, 08cdea08, 09fa024c)
51:33:638 movie_decode D[ME]: hle\scempeg.cpp:1603 0=sceMpegGetAvcAu(08cde974, 00000003, 08cdea88, 09fa0244)
51:33:638 movie_decode D[ME]: hle\scempeg.cpp:1090 video: bufferAddr = 08cde930, *buffer = 0936c520, *init = 00055800
51:33:638 movie_decode D[ME]: hw\mediaengine.cpp:84 FF: Current profile doesn't provide more RBSP data in PPS, skipping
51:33:639 movie_decode D[ME]: hw\mediaengine.cpp:84 FF: Current profile doesn't provide more RBSP data in PPS, skipping
51:33:642 movie_decode D[ME]: hw\mediaengine.cpp:84 FF: Current profile doesn't provide more RBSP data in PPS, skipping
51:33:643 movie_decode I[ME]: hw\mediaengine.cpp:86 FF: No accelerated colorspace conversion found from yuv420p to rgba.
51:33:644 movie_decode I[ME]: hw\mediaengine.cpp:86 FF: error while decoding MB 12 6, bytestream -28
51:33:644 movie_decode I[ME]: hw\mediaengine.cpp:86 FF: concealing 367 DC, 367 AC, 367 MV errors in P frame
51:33:644 movie_decode D[ME]: hle\scempeg.cpp:1151 sceMpegAvcDecode(08cde974, 08cdea88, 512, 08cde930, 09fa0248)
51:33:644 movie_decode D[ME]: hle\scempeg.cpp:1421 956=sceMpegRingbufferAvailableSize(08cde978)
51:33:644 movie_decode D[ME]: hle\scempeg.cpp:1515 sceMpegRingbufferPut(08cde978, 32, 956)
51:33:645 movie_decode D[ME]: hle\scempeg.cpp:1485 packetAdded: 32 packetsRead: 64 packetsTotal: 960
51:33:645 movie_decode D[ME]: hle\scempeg.cpp:1697 80618001=sceMpegGetAtracAu(08cde974, 00000005, 08cdea08, 09fa024c)
51:33:645 movie_decode D[ME]: hle\scempeg.cpp:1603 0=sceMpegGetAvcAu(08cde974, 00000003, 08cdea88, 09fa0244)
51:33:645 movie_decode D[ME]: hle\scempeg.cpp:1090 video: bufferAddr = 08cde930, *buffer = 093f4540, *init = 00055800
51:33:645 movie_decode I[ME]: hw\mediaengine.cpp:86 FF: non-existing PPS 0 referenced
51:33:646 movie_decode D[ME]: hle\scempeg.cpp:1151 sceMpegAvcDecode(08cde974, 08cdea88, 512, 08cde930, 09fa0248)
51:33:647 movie_decode D[ME]: hle\scempeg.cpp:1421 932=sceMpegRingbufferAvailableSize(08cde978)
51:33:647 movie_decode D[ME]: hle\scempeg.cpp:1515 sceMpegRingbufferPut(08cde978, 32, 932)
51:33:647 movie_decode D[ME]: hle\scempeg.cpp:1485 packetAdded: 32 packetsRead: 96 packetsTotal: 960
51:33:647 movie_decode D[ME]: hle\scempeg.cpp:1697 80618001=sceMpegGetAtracAu(08cde974, 00000005, 08cdea08, 09fa024c)
51:33:647 movie_decode D[ME]: hle\scempeg.cpp:1421 900=sceMpegRingbufferAvailableSize(08cde978)
51:33:647 movie_decode D[ME]: hle\scempeg.cpp:1515 sceMpegRingbufferPut(08cde978, 32, 900)
51:33:648 movie_decode D[ME]: hle\scempeg.cpp:1485 packetAdded: 32 packetsRead: 128 packetsTotal: 960
51:33:648 movie_decode D[ME]: hle\scempeg.cpp:1697 80618001=sceMpegGetAtracAu(08cde974, 00000005, 08cdea08, 09fa024c)
51:33:648 movie_decode D[ME]: hle\scempeg.cpp:1421 868=sceMpegRingbufferAvailableSize(08cde978)
51:33:648 movie_decode D[ME]: hle\scempeg.cpp:1515 sceMpegRingbufferPut(08cde978, 32, 868)
51:33:648 movie_decode D[ME]: hle\scempeg.cpp:1485 packetAdded: 32 packetsRead: 160 packetsTotal: 960
51:33:648 movie_decode D[ME]: hle\scempeg.cpp:1697 80618001=sceMpegGetAtracAu(08cde974, 00000005, 08cdea08, 09fa024c)
51:33:648 movie_decode D[ME]: hle\scempeg.cpp:1421 836=sceMpegRingbufferAvailableSize(08cde978)
51:33:648 movie_decode D[ME]: hle\scempeg.cpp:1515 sceMpegRingbufferPut(08cde978, 32, 836)
51:33:648 movie_decode D[ME]: hle\scempeg.cpp:1485 packetAdded: 11 packetsRead: 171 packetsTotal: 960
51:33:648 movie_decode D[ME]: hle\scempeg.cpp:1697 80618001=sceMpegGetAtracAu(08cde974, 00000005, 08cdea08, 09fa024c)
51:33:649 movie_decode D[ME]: hle\scempeg.cpp:1421 825=sceMpegRingbufferAvailableSize(08cde978)
51:33:649 movie_decode D[ME]: hle\scempeg.cpp:1697 80618001=sceMpegGetAtracAu(08cde974, 00000005, 08cdea08, 09fa024c)
51:33:649 movie_decode D[ME]: hle\scempeg.cpp:1697 80618001=sceMpegGetAtracAu(08cde974, 00000005, 08cdea08, 09fa024c)
51:33:649 movie_decode D[ME]: hle\scempeg.cpp:1697 80618001=sceMpegGetAtracAu(08cde974, 00000005, 08cdea08, 09fa024c)
51:33:649 movie_decode D[ME]: hle\scempeg.cpp:1697 80618001=sceMpegGetAtracAu(08cde974, 00000005, 08cdea08, 09fa024c)
51:33:649 movie_decode D[ME]: hle\scempeg.cpp:1697 80618001=sceMpegGetAtracAu(08cde974, 00000005, 08cdea08, 09fa024c)
51:33:649 movie_decode D[ME]: hle\scempeg.cpp:1697 80618001=sceMpegGetAtracAu(08cde974, 00000005, 08cdea08, 09fa024c)
51:33:649 movie_decode D[ME]: hle\scempeg.cpp:1697 80618001=sceMpegGetAtracAu(08cde974, 00000005, 08cdea08, 09fa024c)
51:33:649 movie_decode D[ME]: hle\scempeg.cpp:1697 80618001=sceMpegGetAtracAu(08cde974, 00000005, 08cdea08, 09fa024c)
51:33:649 movie_decode D[ME]: hle\scempeg.cpp:1697 80618001=sceMpegGetAtracAu(08cde974, 00000005, 08cdea08, 09fa024c)
51:33:649 movie_decode D[ME]: hle\scempeg.cpp:1697 80618001=sceMpegGetAtracAu(08cde974, 00000005, 08cdea08, 09fa024c)
51:33:649 movie_decode D[ME]: hle\scempeg.cpp:1697 80618001=sceMpegGetAtracAu(08cde974, 00000005, 08cdea08, 09fa024c)
51:33:649 movie_decode D[ME]: hle\scempeg.cpp:1697 80618001=sceMpegGetAtracAu(08cde974, 00000005, 08cdea08, 09fa024c)
51:33:649 movie_decode D[ME]: hle\scempeg.cpp:1697 80618001=sceMpegGetAtracAu(08cde974, 00000005, 08cdea08, 09fa024c)
51:33:649 movie_decode D[ME]: hle\scempeg.cpp:1697 80618001=sceMpegGetAtracAu(08cde974, 00000005, 08cdea08, 09fa024c)

With the hack, it succeeds starting up a second video, directly afterwards:

4:34:669 movie_decode D[ME]: hle\scempeg.cpp:1603 0=sceMpegGetAvcAu(08cde974, 00000001, 08cdea88, 09fa0244)
54:34:669 movie_decode D[ME]: hle\scempeg.cpp:1090 video: bufferAddr = 08cde930, *buffer = 0936c520, *init = 090d6d80
54:34:669 movie_decode D[ME]: hle\scempeg.cpp:1151 sceMpegAvcDecode(08cde974, 08cdea88, 512, 08cde930, 09fa0248)
54:34:701 movie_decode D[ME]: hle\scempeg.cpp:1603 0=sceMpegGetAvcAu(08cde974, 00000001, 08cdea88, 09fa0244)
54:34:701 movie_decode D[ME]: hle\scempeg.cpp:1090 video: bufferAddr = 08cde930, *buffer = 093f4540, *init = 090d6d80
54:34:702 movie_decode D[ME]: hle\scempeg.cpp:1151 sceMpegAvcDecode(08cde974, 08cdea88, 512, 08cde930, 09fa0248)
54:34:735 movie_decode D[ME]: hle\scempeg.cpp:1603 0=sceMpegGetAvcAu(08cde974, 00000001, 08cdea88, 09fa0244)
54:34:735 movie_decode D[ME]: hle\scempeg.cpp:1090 video: bufferAddr = 08cde930, *buffer = 0936c520, *init = 090d6d80
54:34:735 movie_decode D[ME]: hle\scempeg.cpp:1151 sceMpegAvcDecode(08cde974, 08cdea88, 512, 08cde930, 09fa0248)
54:34:768 movie_decode D[ME]: hle\scempeg.cpp:1421 960=sceMpegRingbufferAvailableSize(08cde978)
54:34:769 movie_decode D[ME]: hle\scempeg.cpp:1174 sceMpegAvcDecodeStop(08cde974, 00000200, 08cde930, 09fa0244)
54:34:804 movie_decode D[ME]: hle\scempeg.cpp:725 sceMpegFreeAvcEsBuf(08cde974, 1)
54:34:805 movie_decode D[ME]: hle\scempeg.cpp:555 sceMpegDelete(08cde974)
54:34:851 movie_decode D[ME]: hle\scempeg.cpp:1958 sceMpegRingbufferDestruct(08cde978)
54:34:851 movie_decode I[ME]: hle\scempeg.cpp:1616 sceMpegFinish(...)
54:35:451 movie_decode I[ME]: hle\scempeg.cpp:429 sceMpegInit()
54:35:451 movie_decode D[ME]: hle\scempeg.cpp:441 2065920 = sceMpegRingbufferQueryMemSize(960)
54:35:451 movie_decode D[ME]: hle\scempeg.cpp:1625 00010000=sceMpegQueryMemSize()
54:35:451 movie_decode D[ME]: hle\scempeg.cpp:467 sceMpegRingbufferConstruct(08cde978, 960, 09173f10, 001f8600, 088cb164, 08cdeb08)
54:35:451 movie_decode I[ME]: hle\scempeg.cpp:543 0909c5a0=sceMpegCreate(08cde974, 0909c570, 65536, 08cde978, 512, 0, 0)
54:35:468 movie_decode D[ME]: hle\scempeg.cpp:602 sceMpegQueryStreamOffset(08cde974, 09f9fa40, 09f9fa3c)
54:35:471 movie_decode I[ME]: hle\scempeg.cpp:354 Stream offset: 2048, Stream size: 0x55800
54:35:471 movie_decode I[ME]: hle\scempeg.cpp:355 First timestamp: 90000, Last timestamp: 360270
54:35:471 movie_decode D[ME]: hle\scempeg.cpp:632 sceMpegQueryStreamSize(09f9fa40, 09f9fa38)
54:35:471 movie_decode I[ME]: hle\scempeg.cpp:354 Stream offset: 2048, Stream size: 0x55800
54:35:471 movie_decode I[ME]: hle\scempeg.cpp:355 First timestamp: 90000, Last timestamp: 360270
54:35:471 movie_decode I[ME]: hle\scempeg.cpp:661 sceMpegRegistStream(08cde974, 0, 0)
54:35:471 movie_decode I[ME]: hle\scempeg.cpp:661 sceMpegRegistStream(08cde974, 0, 1)
54:35:471 movie_decode I[ME]: hle\scempeg.cpp:661 sceMpegRegistStream(08cde974, 1, 0)
54:35:472 movie_decode I[ME]: hle\scempeg.cpp:661 sceMpegRegistStream(08cde974, 1, 1)
54:35:472 movie_decode D[ME]: hle\scempeg.cpp:704 sceMpegMallocAvcEsBuf(08cde974)
54:35:472 movie_decode D[ME]: hle\scempeg.cpp:1351 sceMpegInitAu(08cde974, 1, 08cdea88)
54:35:472 movie_decode D[ME]: hle\scempeg.cpp:1351 sceMpegInitAu(08cde974, 1, 08cdeac8)
54:35:472 movie_decode D[ME]: hle\scempeg.cpp:1393 sceMpegQueryAtracEsSize(08cde974, 09fa027c, 09fa0278)
54:35:472 movie_decode D[ME]: hle\scempeg.cpp:1351 sceMpegInitAu(08cde974, 151700864, 08cdea08)
54:35:472 movie_decode D[ME]: hle\scempeg.cpp:1351 sceMpegInitAu(08cde974, 151700864, 08cdea48)
54:35:473 movie_decode D[ME]: hle\scempeg.cpp:1745 UNIMPL sceMpegChangeGetAuMode(08cde974, 3, 0): changing type=0
54:35:473 movie_decode D[ME]: hle\scempeg.cpp:1745 UNIMPL sceMpegChangeGetAuMode(08cde974, 4, 1): changing type=0
54:35:473 movie_decode D[ME]: hle\scempeg.cpp:1745 UNIMPL sceMpegChangeGetAuMode(08cde974, 5, 0): changing type=1
54:35:487 movie_decode D[ME]: hle\scempeg.cpp:1515 sceMpegRingbufferPut(08cde978, 32, 960)
54:35:487 movie_decode I[ME]: hle\scempeg.cpp:354 Stream offset: 2048, Stream size: 0x55800
54:35:487 movie_decode I[ME]: hle\scempeg.cpp:355 First timestamp: 90000, Last timestamp: 360270
54:35:492 movie_decode W[ME]: hw\mediaengine.cpp:315 Bad video stream 1
54:35:503 movie_decode D[ME]: hle\scempeg.cpp:1485 packetAdded: 32 packetsRead: 32 packetsTotal: 960
54:35:504 movie_decode W[ME]: hle\scempeg.cpp:1683 Audio end reach. pts: 85820 dts: 270270
54:35:504 movie_decode W[ME]: hle\scempeg.cpp:1700 80618001=sceMpegGetAtracAu(08cde974, 00000005, 08cdea08, 09fa024c)
54:35:505 movie_decode D[ME]: hle\scempeg.cpp:1603 0=sceMpegGetAvcAu(08cde974, 00000003, 08cdea88, 09fa0244)
54:35:505 movie_decode D[ME]: hle\scempeg.cpp:1090 video: bufferAddr = 08cde930, *buffer = 0936c520, *init = 00055800
54:35:505 movie_decode D[ME]: hw\mediaengine.cpp:84 FF: Current profile doesn't provide more RBSP data in PPS, skipping
54:35:506 movie_decode D[ME]: hw\mediaengine.cpp:84 FF: Current profile doesn't provide more RBSP data in PPS, skipping
54:35:509 movie_decode D[ME]: hw\mediaengine.cpp:84 FF: Current profile doesn't provide more RBSP data in PPS, skipping
54:35:510 movie_decode I[ME]: hw\mediaengine.cpp:86 FF: No accelerated colorspace conversion found from yuv420p to rgba.
54:35:511 movie_decode I[ME]: hw\mediaengine.cpp:86 FF: error while decoding MB 12 6, bytestream -28
54:35:511 movie_decode I[ME]: hw\mediaengine.cpp:86 FF: concealing 367 DC, 367 AC, 367 MV errors in P frame
54:35:511 movie_decode D[ME]: hle\scempeg.cpp:1151 sceMpegAvcDecode(08cde974, 08cdea88, 512, 08cde930, 09fa0248)
54:35:511 movie_decode D[ME]: hle\scempeg.cpp:1421 956=sceMpegRingbufferAvailableSize(08cde978)
54:35:511 movie_decode D[ME]: hle\scempeg.cpp:1515 sceMpegRingbufferPut(08cde978, 32, 956)
54:35:512 movie_decode D[ME]: hle\scempeg.cpp:1485 packetAdded: 32 packetsRead: 64 packetsTotal: 960
54:35:512 movie_decode D[ME]: hle\scempeg.cpp:1698 0=sceMpegGetAtracAu(08cde974, 00000005, 08cdea08, 09fa024c)
54:35:512 movie_decode D[ME]: hle\scempeg.cpp:1903 sceMpegAtracDecode(08cde974, 08cdea08, 090ace00, 1)
54:35:513 movie_decode D[ME]: hle\scempeg.cpp:1603 0=sceMpegGetAvcAu(08cde974, 00000003, 08cdea88, 09fa0244)
54:35:513 movie_decode D[ME]: hle\scempeg.cpp:1090 video: bufferAddr = 08cde930, *buffer = 093f4540, *init = 090ace00
54:35:513 movie_decode I[ME]: hw\mediaengine.cpp:86 FF: non-existing PPS 0 referenced
54:35:513 movie_decode D[ME]: hle\scempeg.cpp:1151 sceMpegAvcDecode(08cde974, 08cdea88, 512, 08cde930, 09fa0248)
54:35:514 movie_decode D[ME]: hle\scempeg.cpp:1421 932=sceMpegRingbufferAvailableSize(08cde978)
54:35:514 movie_decode D[ME]: hle\scempeg.cpp:1515 sceMpegRingbufferPut(08cde978, 32, 932)
54:35:514 movie_decode D[ME]: hle\scempeg.cpp:1485 packetAdded: 32 packetsRead: 96 packetsTotal: 960
54:35:514 movie_decode D[ME]: hle\scempeg.cpp:1698 0=sceMpegGetAtracAu(08cde974, 00000005, 08cdea08, 09fa024c)
54:35:514 movie_decode D[ME]: hle\scempeg.cpp:1903 sceMpegAtracDecode(08cde974, 08cdea08, 090ace00, 0)
54:35:516 movie_decode D[ME]: hle\scempeg.cpp:1421 900=sceMpegRingbufferAvailableSize(08cde978)
54:35:516 movie_decode D[ME]: hle\scempeg.cpp:1515 sceMpegRingbufferPut(08cde978, 32, 900)
54:35:516 movie_decode D[ME]: hle\scempeg.cpp:1485 packetAdded: 32 packetsRead: 128 packetsTotal: 960
54:35:516 movie_decode D[ME]: hle\scempeg.cpp:1698 0=sceMpegGetAtracAu(08cde974, 00000005, 08cdea08, 09fa024c)

@unknownbrackets
Copy link
Collaborator

unknownbrackets commented Feb 8, 2019

Looks like the problem is that m_audioStream needs to be updated in sceMpegGetAtracAu() so that it checks that the CORRECT audio stream has ended.

It registers two video and two audio streams. Video stream 1 doesn't even exist, so probably audio stream 1 doesn't exist either. But when registered, we set that as the current audio stream (possibly incorrect.)

We then call IsNoAudioData() without changing the audio stream. Once it actually calls sceMpegAtracDecode() everything is fine, the stream is selected, so future calls to sceMpegGetAtracAu() would in theory return the correct value because they won't switch back to the incorrect stream.

This is possibly also an issue for sceMpegGetAvcAu(). I guess it "works" (but for the wrong video stream potentially, if there are multiple) because adding packets hacks the video stream to the right value (hence "Bad video stream 1".)

-[Unknown]

@hrydgard
Copy link
Owner Author

hrydgard commented Feb 8, 2019

Right, that makes sense. So should we change sceMpegRegistStream to only set the current audio/video stream if one of that kind isn't already set? Or simply not set the current stream at all and let sceMpegAtracDecode figure out which one should be played? It seems most logical to me that sceMpegRegistStream shouldn't actually change the current stream at all, that doesn't sound like what it's for.

@unknownbrackets
Copy link
Collaborator

Probably, but I think both sceMpegGetAtracAu() and sceMpegAtracDecode() should set the audio stream, which might make it a moot point.

-[Unknown]

@hrydgard
Copy link
Owner Author

hrydgard commented Feb 9, 2019

Closing this in favor of #11780.

@hrydgard hrydgard closed this Feb 9, 2019
@hrydgard hrydgard deleted the naruto3-fix-attempt branch February 9, 2019 09:15
@unknownbrackets unknownbrackets removed this from the v1.8.0 milestone Feb 9, 2019
hrydgard added a commit that referenced this pull request Feb 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants