ipatix/agbplay

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.

ipatix commented

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.

ipatix commented

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.

ipatix commented

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

This commit should fix it. At least it now resolves any issues for me on Windows:
b61ce2d

However, note that this is still on agbplay_v2 branch and not on master.