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

Attempting to play any track freezes the program #63

Open
jonespianist opened this issue Sep 20, 2023 · 6 comments
Open

Attempting to play any track freezes the program #63

jonespianist opened this issue Sep 20, 2023 · 6 comments
Milestone

Comments

@jonespianist
Copy link

jonespianist commented Sep 20, 2023

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
Copy link
Owner

ipatix commented Sep 21, 2023

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.

@jonespianist
Copy link
Author

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
Copy link
Owner

ipatix commented Sep 29, 2023

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
Copy link
Owner

ipatix commented Sep 30, 2023

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.

@ipatix
Copy link
Owner

ipatix commented Jul 2, 2024

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

@ipatix
Copy link
Owner

ipatix commented Aug 25, 2024

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.

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

2 participants