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

Occasional white noise with XMI looping #148

Closed
afritz1 opened this issue Jul 27, 2016 · 9 comments
Closed

Occasional white noise with XMI looping #148

afritz1 opened this issue Jul 27, 2016 · 9 comments

Comments

@afritz1
Copy link
Contributor

afritz1 commented Jul 27, 2016

Hi, I'm developing an open-source remake of The Elder Scrolls I: Arena (link). @psi29a directed me here from this comment regarding a split second of white noise I occasionally hear when some XMI songs loop.

I ran wildmidi.exe version 0.4.0 with VISION.XMI (Dropbox link) in cmd.exe on Windows 7. I used the eawpats library and Timidity/Gravis config for wildmidi.cfg. I haven't been able to reproduce the white noise there because I don't see a way to make the song loop on the command line. However, when playing VISION.XMI in OpenTESArena during the cinematic with Ria Silmane, it always has a split second of white noise upon looping the first time, maybe 150ms to 250ms long, and it happens maybe every third or fourth loop after, so it's reproducible there.

As a side note, wildmidi.exe also crashes when VISION.XMI (or any XMI, really) finishes, with the "wildmidi.exe has stopped working" message. There are no problems with WildMIDI crashing in OpenTESArena, though.

@chrisisonwildcode
Copy link
Contributor

Hi Aaron,

Can you please explain how you are doing the looping (so we can reproduce accurately). This will help to resolve the issue reported much faster.

Chris

Sent from my iPhone

On 28 Jul 2016, at 3:33 AM, Aaron [email protected] wrote:

Hi, I'm developing an open-source remake of The Elder Scrolls I: Arena (link). @psi29a directed me here from this comment regarding a split second of white noise I occasionally hear when some XMI songs loop.

I ran wildmidi.exe version 0.4.0 with VISION.XMI (Dropbox link) in cmd.exe on Windows 7. I used the eawpats library and Timidity/Gravis config for wildmidi.cfg. I haven't been able to reproduce the white noise there because I don't see a way to make the song loop on the command line. However, when playing VISION.XMI in OpenTESArena during the cinematic with Ria Silmane, it always has a split second of white noise upon looping the first time, maybe 150ms to 250ms long, and it happens maybe every third or fourth loop after, so it's reproducible there.

As a side note, wildmidi.exe also crashes when VISION.XMI (or any XMI, really) finishes, with the "wildmidi.exe has stopped working" message. There are no problems with WildMIDI crashing in OpenTESArena, though.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@afritz1
Copy link
Contributor Author

afritz1 commented Jul 28, 2016

The WildMIDI code and OpenAL Soft code in my project was written by @kcat. I'm afraid I don't know as much about MIDI code as I should (I just switched from FMOD a few weeks ago), but I can try pointing out a few places that seem relevant, though:

AudioManager.cpp#L301
WildMidi.cpp#L51
WildMidi.cpp#L62

I hope this helps. kcat would be able to explain it better. Thanks for your time.

@chrisisonwildcode
Copy link
Contributor

@kcat My CPP knowledge is limited however have some basic understanding of it.

Looking at the read in your AudioManager.cpp below Line 301. Is it the way I'm reading it or is it reading past the end of the data?

Sent from my iPhone

On 28 Jul 2016, at 10:37 AM, Aaron [email protected] wrote:

The WildMIDI code and OpenAL Soft code in my project was written by @kcat. I'm afraid I don't know as much about MIDI code as I should (I just switched from FMOD a few weeks ago), but I can try pointing out a few places that seem relevant, though:

AudioManager.cpp#L301
WildMidi.cpp#L51
WildMidi.cpp#L62

I hope this helps. kcat would be able to explain it better. Thanks for your time.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.

@kcat
Copy link

kcat commented Jul 28, 2016

@chrisisonwildcode It's not reading past the end of the data. Although I do see the problem now. It's your typical bytes vs samples mixup. It's offsetting the buffer pointer for the looped read according to how many sample frames it got, even though it's a byte pointer, so it's not being incremented enough and is being written to incorrectly. Sorry the for noise (pun not intended), it's not a problem with WildMIDI.

@afritz1
Copy link
Contributor Author

afritz1 commented Jul 28, 2016

The white noise is fixed! Thanks, @kcat. It was a problem with our code, not WildMIDI's.

@sezero
Copy link
Contributor

sezero commented Jul 28, 2016

Closing.

@sezero sezero closed this as completed Jul 28, 2016
@psi29a
Copy link
Member

psi29a commented Jul 28, 2016

\o/ thanks @kcat and @chrisisonwildcode

Another satisfied customer! ;)

@afritz1
Copy link
Contributor Author

afritz1 commented Jul 28, 2016

Almost satisfied. Just need the XMI looping now, and then WildMIDI will get my star :)

@psi29a
Copy link
Member

psi29a commented Jul 28, 2016

hah! challenge accepted!

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

No branches or pull requests

5 participants