ipatix/agbplay

"Pa_OpenDefaultStream: Invalid sample rate"

Closed this issue · 9 comments

i've compiled agbplay directly from github on my arch linux machine. it does run absolutely fine at first, but when i try running again, this message shown in the title appears on the white box at the bottom of the app.
when i hit the space key for playing the song, it just hangs on the first frame, and after that, any other input makes it freeze entirely, forcing me to kill it with ^c.
but not only that, i also get this on the console, it appears right when agbplay fires up, so i can only see it after closing agbplay:
https://pastebin.com/2vMj9Qap
it seems to be more related to alsa itself though, and i use pipewire. is it actually pipewire's fault? just a guess.

ipatix commented

From what I know these alsa error messages are 'normal' when using the portaudio library.

Which pipewire version do you have? Do you have JACK client libraries enabled in your pipewire instance? If yes, which samplerate do you have configured?

i have pipewire version 0.3.71, the latest one. i also have the jack client libraries enabled, and it uses a 192 khz sampling rate, the same from the global pipewire config.

ipatix commented

Yup, with JACK only 48 kHz works at the moment. So either I'd have to use a fallback API (e.g. ALSA) if JACK fails or I'd have the sample rate changed. Though, currently the sample rate is fixed at compile time.

ah, i see it now. sorry if it's a dumb question but, how can i use a fallback api, like you mentioned?

ipatix commented

You can swap the paALSA and paJACK lines.

const std::vector<PaHostApiTypeId> PlayerInterface::hostApiPriority = {

it seems to work fine now! thank you!

ipatix commented

I will keep this open since I think it'd be better if agbplay automatically falls back to another API if one with higher priority doesn't work. Will fix this if I have motivation and time.

true. hopefully you manage to get motivation and time.

ipatix commented

agbplay should now use ALSA when JACK cannot be used.