[GH-ISSUE #2075] Delay with playing atrac3plus radiostations in GTA Liberty City Stories & GTA Vice City Stories #717

Closed
opened 2026-03-17 15:47:53 +03:00 by kerem · 22 comments
Owner

Originally created by @majesticR3 on GitHub (Jun 4, 2013).
Original GitHub issue: https://github.com/hrydgard/ppsspp/issues/2075

if atrac3+ audio file have longer duration then it starts to play with delay about 1-5 secs, and FPS reduced at that delay time.

Sorry for horrible English

Originally created by @majesticR3 on GitHub (Jun 4, 2013). Original GitHub issue: https://github.com/hrydgard/ppsspp/issues/2075 if atrac3+ audio file have longer duration then it starts to play with delay about 1-5 secs, and FPS reduced at that delay time. Sorry for horrible English
kerem 2026-03-17 15:47:53 +03:00
  • closed this issue
  • added the
    Atrac3+
    label
Author
Owner

@Squall-Leonhart commented on GitHub (Jun 7, 2013):

Expand on the scenario where you see this occuring

<!-- gh-comment-id:19087844 --> @Squall-Leonhart commented on GitHub (Jun 7, 2013): Expand on the scenario where you see this occuring
Author
Owner

@dbz400 commented on GitHub (Jun 7, 2013):

Still happening in latest git build ?

<!-- gh-comment-id:19106101 --> @dbz400 commented on GitHub (Jun 7, 2013): Still happening in latest git build ?
Author
Owner

@majesticR3 commented on GitHub (Jun 7, 2013):

Squall-Leonhart

This problem exists in GTA Liberty City Stories and GTA Vice City Stories. Delay occurs when game trying to load radio stations which in atrac3plus format. Cutscene audio starts to play without delay. I think delay occurs when atrac3plus library trying to decode long duration audio files (all radios duration are about 30-40 min of music) and that takes a time and processor resources and causes lowering game FPS

raven02

Yeah. :(

<!-- gh-comment-id:19114296 --> @majesticR3 commented on GitHub (Jun 7, 2013): Squall-Leonhart This problem exists in GTA Liberty City Stories and GTA Vice City Stories. Delay occurs when game trying to load radio stations which in atrac3plus format. Cutscene audio starts to play without delay. I think delay occurs when atrac3plus library trying to decode long duration audio files (all radios duration are about 30-40 min of music) and that takes a time and processor resources and causes lowering game FPS raven02 Yeah. :(
Author
Owner

@Squall-Leonhart commented on GitHub (Jun 7, 2013):

I'm not sure if you recall, but the console and PC versions both had the same problem.

<!-- gh-comment-id:19122168 --> @Squall-Leonhart commented on GitHub (Jun 7, 2013): I'm not sure if you recall, but the console and PC versions both had the same problem.
Author
Owner

@majesticR3 commented on GitHub (Jun 7, 2013):

Original PSP has maximum 1 sec delay before radio starts to play, but emulator has about 4-7 secs. PS2 version of GTA on PCSX2 don't have that problem - youtube videos proove that

<!-- gh-comment-id:19125549 --> @majesticR3 commented on GitHub (Jun 7, 2013): Original PSP has maximum 1 sec delay before radio starts to play, but emulator has about 4-7 secs. PS2 version of GTA on PCSX2 don't have that problem - youtube videos proove that
Author
Owner

@hrydgard commented on GitHub (Jun 7, 2013):

It's definitely an issue, really not sure about the cause though.

<!-- gh-comment-id:19128508 --> @hrydgard commented on GitHub (Jun 7, 2013): It's definitely an issue, really not sure about the cause though.
Author
Owner

@Squall-Leonhart commented on GitHub (Jun 7, 2013):

is ppsspp doing a full seek of the file prior to playing or just playing as streamed through the decoder?

<!-- gh-comment-id:19129308 --> @Squall-Leonhart commented on GitHub (Jun 7, 2013): is ppsspp doing a full seek of the file prior to playing or just playing as streamed through the decoder?
Author
Owner

@oioitff commented on GitHub (Jun 8, 2013):

@majesticR3 Could you show a detail logs? Thanks.
The decoding step for atrac3plus is just on the fly, so it means following codes takes about 4-7 secs:

atrac->data_buf = new u8[atrac->first.filesize];
Memory::Memcpy(atrac->data_buf, buffer, std::min(bufferSize, atrac->first.filesize));

That's really crazy and unbelievable!

<!-- gh-comment-id:19143378 --> @oioitff commented on GitHub (Jun 8, 2013): @majesticR3 Could you show a detail logs? Thanks. The decoding step for atrac3plus is just on the fly, so it means following codes takes about 4-7 secs: ``` atrac->data_buf = new u8[atrac->first.filesize]; Memory::Memcpy(atrac->data_buf, buffer, std::min(bufferSize, atrac->first.filesize)); ``` That's really crazy and unbelievable!
Author
Owner

@EZtouch commented on GitHub (Jun 8, 2013):

If it takes time to decode the at3+ audios , can we add an option under audio to decode the whole at3+ files from a selected game and save it in ppsspp directory so next time it will play instantly without the need to be decoded?
There is a way to decode and batch at3+ for jpcsp, it loads the already decoded audio files from a folder not the game cant we do this?

*************************** :: Method A :: JPCSP Connector *************************** supported formats = Atrac3, Atrac3+, pmf

  1. A Real PSP [Required]
    ATRAC3 audio is saved under tmp
    \ATRAC
    To decode the audio, copy the files to your REAL
    PSP memcard under ms0/tmp and run JPCSPConnector on your REAL PSP then follow the
    onscreen instructions.
    After decoding on the PSP, move the files back to
    Jpcsp under" tmp\ATRAC" you can
    delete the files on the PSP.
    JPCSP Connector can be found under ms0\PSP \GAME\JpcspConnector\ in the Jpcsp Release.
<!-- gh-comment-id:19144240 --> @EZtouch commented on GitHub (Jun 8, 2013): If it takes time to decode the at3+ audios , can we add an option under audio to decode the whole at3+ files from a selected game and save it in ppsspp directory so next time it will play instantly without the need to be decoded? There is a way to decode and batch at3+ for jpcsp, it loads the already decoded audio files from a folder not the game cant we do this? **************************\* :: Method A :: JPCSP Connector **************************\* supported formats = Atrac3, Atrac3+, pmf 1. A Real PSP [Required] ATRAC3 audio is saved under tmp<GAME ID> \ATRAC To decode the audio, copy the files to your REAL PSP memcard under ms0/tmp and run JPCSPConnector on your REAL PSP then follow the onscreen instructions. After decoding on the PSP, move the files back to Jpcsp under" tmp<GAME ID>\ATRAC" you can delete the files on the PSP. JPCSP Connector can be found under ms0\PSP \GAME\JpcspConnector\ in the Jpcsp Release.
Author
Owner

@oioitff commented on GitHub (Jun 8, 2013):

@EZtouch Actually the decoding step for atrac3plus only take little time, because it just need to decode current frame ( less than 1Kb ). It might be ever faster than load wav files from disk.

<!-- gh-comment-id:19144424 --> @oioitff commented on GitHub (Jun 8, 2013): @EZtouch Actually the decoding step for atrac3plus only take little time, because it just need to decode current frame ( less than 1Kb ). It might be ever faster than load wav files from disk.
Author
Owner

@hrydgard commented on GitHub (Jun 8, 2013):

Yes, it's fast, exporting to wav files is useless.

This sound delay must have another cause - if those two lines really took 5s, then the game would be completely frozen for those 5s, it wouldn't just slow down, like @majesticR3 describes it.

<!-- gh-comment-id:19144560 --> @hrydgard commented on GitHub (Jun 8, 2013): Yes, it's fast, exporting to wav files is useless. This sound delay must have another cause - if those two lines really took 5s, then the game would be completely frozen for those 5s, it wouldn't just slow down, like @majesticR3 describes it.
Author
Owner

@EZtouch commented on GitHub (Jun 8, 2013):

Maybe it has something to do with #2104 ?

<!-- gh-comment-id:19144583 --> @EZtouch commented on GitHub (Jun 8, 2013): Maybe it has something to do with #2104 ?
Author
Owner

@majesticR3 commented on GitHub (Jun 8, 2013):

Log from Liberty City Stories:
lcs_vcs

Log from Vice City Stories:
lcs_vcs2

<!-- gh-comment-id:19147347 --> @majesticR3 commented on GitHub (Jun 8, 2013): Log from Liberty City Stories: ![lcs_vcs](https://f.cloud.github.com/assets/4470186/627429/52b1b33c-d02f-11e2-8c1a-569c8cf53fe5.png) Log from Vice City Stories: ![lcs_vcs2](https://f.cloud.github.com/assets/4470186/627458/aec1597a-d034-11e2-8a6d-e87238c6c476.png)
Author
Owner

@unknownbrackets commented on GitHub (Jun 8, 2013):

Could easily be some syscall not rescheduling when it should or something.

-[Unknown]

<!-- gh-comment-id:19147602 --> @unknownbrackets commented on GitHub (Jun 8, 2013): Could easily be some syscall not rescheduling when it should or something. -[Unknown]
Author
Owner

@oioitff commented on GitHub (Jun 8, 2013):

Hmm, probably sceAtracAddStreamData needs hleDelayResult.

<!-- gh-comment-id:19153648 --> @oioitff commented on GitHub (Jun 8, 2013): Hmm, probably sceAtracAddStreamData needs hleDelayResult.
Author
Owner

@majesticR3 commented on GitHub (Jun 8, 2013):

I think I know why that delay appears.

As we know, GTA have timer for all radiostations and when we switch radiostations music starts to play not from start position, but from position according to that timer

After few experiments I noticed what time of delay depends of current position in atrac3plus file from which game starts to play music - if that position is near of beginning of atrac3plus file - delay is very small, if position is near of end of file - delay is very big, because atrac3plus library needs to skip many samples from beginning of file to reach position according to timer.

Sorry for my English :)

<!-- gh-comment-id:19155309 --> @majesticR3 commented on GitHub (Jun 8, 2013): I think I know why that delay appears. As we know, GTA have timer for all radiostations and when we switch radiostations music starts to play not from start position, but from position according to that timer After few experiments I noticed what time of delay depends of current position in atrac3plus file from which game starts to play music - if that position is near of beginning of atrac3plus file - delay is very small, if position is near of end of file - delay is very big, because atrac3plus library needs to skip many samples from beginning of file to reach position according to timer. Sorry for my English :)
Author
Owner

@hrydgard commented on GitHub (Jun 8, 2013):

@majesticR3 , good thinking! I think that's the best theory yet - that would mean that ResetPlayPosition might be a bit off, or something.

<!-- gh-comment-id:19155465 --> @hrydgard commented on GitHub (Jun 8, 2013): @majesticR3 , good thinking! I think that's the best theory yet - that would mean that ResetPlayPosition might be a bit off, or something.
Author
Owner

@majesticR3 commented on GitHub (Jun 8, 2013):

Probably this is more global issue, and solving it take effect in other games with similar problem
It is hard to fix this?

<!-- gh-comment-id:19156095 --> @majesticR3 commented on GitHub (Jun 8, 2013): Probably this is more global issue, and solving it take effect in other games with similar problem It is hard to fix this?
Author
Owner

@Squall-Leonhart commented on GitHub (Jul 12, 2013):

im sorry, but it is absolutely imposible to measure 0.1 seconds of latency.

even the most sensitive of people cannot feel the delay till about 0.7s

<!-- gh-comment-id:20874586 --> @Squall-Leonhart commented on GitHub (Jul 12, 2013): im sorry, but it is absolutely imposible to measure 0.1 seconds of latency. even the most sensitive of people cannot feel the delay till about 0.7s
Author
Owner

@hrydgard commented on GitHub (Jul 12, 2013):

That's absolutely not true (talking general audio latency). If I connect a MIDI keyboard to my PC and use it play a softsynth, and have a draggable latency setting (like in Propellerheads Reason), I can feel latency down to 10ms.

Of course, hearing exactly when a background music radio station starts in GTA is another thing entirely, and it doesn't really matter. But in Patapon where the Atrac music is integrated to other rhythmic audio events, it's really easy to hear when it's wrong if you've heard how it's supposed to sound when it's right before. So I believe him.

<!-- gh-comment-id:20880127 --> @hrydgard commented on GitHub (Jul 12, 2013): That's absolutely not true (talking general audio latency). If I connect a MIDI keyboard to my PC and use it play a softsynth, and have a draggable latency setting (like in Propellerheads Reason), I can feel latency down to 10ms. Of course, hearing exactly when a background music radio station starts in GTA is another thing entirely, and it doesn't really matter. But in Patapon where the Atrac music is integrated to other rhythmic audio events, it's really easy to hear when it's wrong if you've heard how it's supposed to sound when it's right before. So I believe him.
Author
Owner

@majesticR3 commented on GitHub (Jul 12, 2013):

It is possible to fix current issue? This delay is still exists.

<!-- gh-comment-id:20898653 --> @majesticR3 commented on GitHub (Jul 12, 2013): It is possible to fix current issue? This delay is still exists.
Author
Owner

@majesticR3 commented on GitHub (Oct 20, 2013):

With new atrac3+ codec radio stations starts to play immediately without delay as meant to be (I tested GTA Liberty City Stories) but there are rare random short-term FPS slowdowns when I switch radio stations. Anyway thanks for developers for their awesome work :-)

<!-- gh-comment-id:26674127 --> @majesticR3 commented on GitHub (Oct 20, 2013): With new atrac3+ codec radio stations starts to play immediately without delay as meant to be (I tested GTA Liberty City Stories) but there are rare random short-term FPS slowdowns when I switch radio stations. Anyway thanks for developers for their awesome work :-)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ppsspp#717
No description provided.