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

Add AtracDecodeDataRemainFrameHack #18396

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Conversation

sum2012
Copy link
Collaborator

@sum2012 sum2012 commented Nov 4, 2023

keep return less than 1 RemainFrame in sceAtracDecodeData to get valid data .when RemainFrame = 0 ,then psp will call sceAtracAddStreamData and sceAtracGetStreamDataInfo.

Work around #15233

Modify log:
https://gist.githubusercontent.com/sum2012/2209e25bdc9cfe79f5a57337fbf67f11/raw/484d6e234e829bc393aefc8614996eba1d09497f/gistfile1.txt

Return less than 1 RemainFrame in AtracDecodeDataRemain to get valid data,then psp will call sceAtracAddStreamData and sceAtracGetStreamDataInfo.
@sum2012 sum2012 added Atrac3+ Issue involves sceAtrac features. HACK This is a temporary hack, known not to be the real PSP's behavior labels Nov 4, 2023
@anr2me
Copy link
Collaborator

anr2me commented Nov 4, 2023

I wondered whether this can also fix all of those audio issue on other games too or not, most of them seems to use atrac3+ too.

@sum2012
Copy link
Collaborator Author

sum2012 commented Nov 4, 2023

@anr2me Init test ,this hack only apply that don't always use sceAtracGetRemainFrame() (line 1661 of this pull request) and sceAtracGetNextSample() (line 1606 of this pull request)

#16904 may help but need a game save rather than save staus

@sum2012
Copy link
Collaborator Author

sum2012 commented Nov 7, 2023

I just find a game (K-ON_Houkago_Live_JPN) that jpcsp emulator decode Atrac audio also have problem (infinite loading after save )

@sum2012
Copy link
Collaborator Author

sum2012 commented Nov 8, 2023

in ppsspp side, I think that in looping with (atrac->bufferState_ == ATRAC_STATUS_STREAMED_LOOP_FROM_END) need to do something in some where because sceAtracAddStreamData give corrupt atrac data after loop 2 times

@sum2012
Copy link
Collaborator Author

sum2012 commented Nov 10, 2023

I find a reasonable fix K-ON_Houkago_Live_JPN but unlucky not match JPCSPTrace log.
Amway , I will test all games that use sceAtracGetNextSample

@sum2012
Copy link
Collaborator Author

sum2012 commented Feb 14, 2024

I find better hack which can apply more game (which replace AtracLoopHack )
But I need test more Atrac problem games

} else if (bytes_read < 0) {
ERROR_LOG_REPORT(ME, "avcodec_decode_audio4: Error decoding audio %d / %08x", bytes_read, bytes_read);
//failedDecode_ = true;
//return ATDECODE_FAILED;
packet_->size = 0;
return ATDECODE_BADFRAME;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Atrac3+ Issue involves sceAtrac features. HACK This is a temporary hack, known not to be the real PSP's behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants