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

Fix atrac sound loop problem #18414

Merged
merged 1 commit into from Nov 13, 2023
Merged

Conversation

sum2012
Copy link
Collaborator

@sum2012 sum2012 commented Nov 12, 2023

Fix #14058 fix #14352
Fix all games loop which use sceAtracGetNextSample
Full of buffer so that no need more atrac data
Modify log:
https://gist.github.com/sum2012/280ebd259a338cbcccbd980caf8bbac0

@sum2012 sum2012 added the Atrac3+ Issue involves sceAtrac features. label Nov 12, 2023
@hrydgard
Copy link
Owner

Nice one, this looks really promising - I haven't checked all the logic yet, but it really does look like we were missing that extra offset there.

Will look a little bit closer and then likely merge so this can get wider testing.

@hrydgard hrydgard added this to the v1.17.0 milestone Nov 13, 2023
@hrydgard hrydgard merged commit 1920514 into hrydgard:master Nov 13, 2023
18 checks passed
@sum2012 sum2012 deleted the atrac_steam_loop_full branch November 13, 2023 12:09
Comment on lines +1632 to +1633
if (atrac->bufferState_ == ATRAC_STATUS_STREAMED_LOOP_FROM_END && numSamples + atrac->currentSample_ > atrac->endSample_) {
atrac->bufferState_ = ATRAC_STATUS_ALL_DATA_LOADED;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't really make sense.

The "loop from end" state basically means that you have a 200 KB music file but have a buffer that is 100 KB. So it can obviously never fully fit inside that buffer. ATRAC_STATUS_ALL_DATA_LOADED means the entire music file has been fit inside the provided buffer.

What led you to believe it should transition the state here?

-[Unknown]

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It just repeat that play the buffer.it would call sceAtracReleaseAtracID when play another Atrac

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
3 participants