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

Audio queueing is not optimal #20095

Open
hrydgard opened this issue Mar 8, 2025 · 1 comment
Open

Audio queueing is not optimal #20095

hrydgard opened this issue Mar 8, 2025 · 1 comment
Labels
Milestone

Comments

@hrydgard
Copy link
Owner

hrydgard commented Mar 8, 2025

I've accidentally proved (while working on hrydgard/pspautotests#235) that sceAudioOutputBlocking and similar functions enqueue address ranges, rather than reading the actual samples directly and putting the samples on an external queue.

Because if you try to enqueue and overwrite the same range over and over, it'll play with bad artifacts, while if you double or triple buffer, playback is smooth.

This means that with the current implementation, games are already doing double buffering and then we maintain an extra buffer queue on top, instead of just reading from the already enqueued data. I believe that this causes us to delay audio by 1 buffer. In general, these buffers are generally fairly short, but it's still a matter of multiple milliseconds of unnecessary audio latency, so we should fix this.

Also, there's a possibility that this has something to do with audio being broken in #15485 , but really not sure about that.

@hrydgard hrydgard added the Audio label Mar 8, 2025
@hrydgard hrydgard added this to the v1.20 milestone Mar 8, 2025
@anr2me
Copy link
Collaborator

anr2me commented Mar 8, 2025

May be should copy the data and include the data in the queue, just like what i did on adhoc matching callbacks due to the data address usually shared.
Then again, adhoc matching data is usually small (1024 or less), while audio data can be large, and could cause more delay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants