-
Notifications
You must be signed in to change notification settings - Fork 34
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 buffer overflow #12
Comments
Oops, sorry. The issue is that the resampler only allocates enough memory for outputting 0.1 seconds. You're rendering 7560 samples, i.e. 0.17 seconds, so we get a buffer overflow. (I need to admit that this is one of the parts from the original VGMPlay that I barely worked on.) I'll put that on my TODO list. (There are additional issues if you change the sample rate mid-song.) Suggestions on how to fix this in a nice way are welcome though. |
It's a conclusion I came to while examining briefly this part of code, thanks for confirming.
Seems a very unwise thing to do; at least for my case, sample rate will be kept fixed.
The cleanest I had in mind, this would be to repeat work in smaller buffer sizes at resampler level. |
I encountered this issue with I just submitted #114 that (hopefully) fixes this. (It fixes the issues I had with some VGM files, at least.) |
Hi. When I instanciate either the DRO or S98 player, the
Render
method is going to overflow the output buffer and crash the program. It does not happen with VGM.Diagnosing the problem, I discovered that it would be resolved, in a non-optimal way, when the
smplStep
is forced to1
.libvgm/player/droplayer.cpp
Line 549 in 07c6cc7
Indeed, a difference between VGM and DRO/S98 is that the former always uses the step value
1
.The issue does not happen in libvgm's own player. (possibly, due to allocating sufficient buffer so it doesn't happen)
It has occurred in this context.
Also it probably doesn't matter but those were the files used: https://github.com/Wohlstand/OPL3BankEditor/tree/master/Bank_Examples/DOSBox
EDIT
These have been values logged from
DROPlayer
before a situation of crash.curSmpl=0 smplCnt=7560 smplStep=7560
Valgrind trace
The text was updated successfully, but these errors were encountered: