Attempting to play any track freezes the program
Opened this issue · 6 comments
So I installed the latest version of Cygwin and compiled agbplay through that terminal. Everything was going smoothly until I tried playing a track from Lufia: The Ruins of Lore.
Whenever agbplay attempted to load a track, nothing is heard and the terminal would freeze a few seconds afterwards.
Tried again with Golden Sun 1 and the exact same thing happened.
I think I have a good hint towards what's causing this. Upon startup, the gray text box at the bottom of the terminal reads "No supported API found, falling back to: OSS". Apparently, OSS doesn't want to work with either Cygwin or agbplay, but I have no idea what APIs are -- let alone which ones are compatible with agbplay.
From my knowledge OSS is not available on Cygwin. That's probably just an artifact from the portaudio library that agbplay uses. I'm not entirely sure why it says "No supported API found". I was under the impression that MME on Cygwin should always work.
Perhaps this is an issue with newer portaudio versions or a newer Cygwin version, I'll have to test this.
I probably should've clarified that the "No supported API found" message appears upon startup. That doesn't really narrow down what's going on that much, but every bit helps.
I've added this correction to the OP.
There currently seems to be a problem with the portaudio library of Cygwin. I'll contact the package maintainers, but I'm afraid I cannot do anything in the meantime.
Okay, agbplay is able to work with the new portaudio version, but the latency is pretty bad. I'll keep you updated.
In the meantime you can change #define __STRM_BPSM ((STREAM_SAMPLERATE / 24) - 1)
in src/Constants.h
to #define __STRM_BPSM ((STREAM_SAMPLERATE / 6) - 1)
. It makes agbplay work but the latency will be really bad, but I cannot do anything about that for the moment.
I currently have a fix on my new test branch agbplay_v2. There should not be any notable bugs in this branch, but the config format has changed and is not yet documented.
I now pass portaudio a fixed buffer size. This fixes your bug, but I can imagine that the latency may now be very bad if unlucky.
See 25e1544