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

Play timer runs way too fast up to 50 seconds #20

Closed
pezz opened this issue Apr 21, 2023 · 20 comments · Fixed by #32
Closed

Play timer runs way too fast up to 50 seconds #20

pezz opened this issue Apr 21, 2023 · 20 comments · Fixed by #32
Labels
bug Something isn't working

Comments

@pezz
Copy link

pezz commented Apr 21, 2023

Hi there,

Wasn't sure whether to report this against the player or libsidplayfp, chose here (hope that's alright).

I've noticed a problem with the player (lib 2.4.2 and player 2.4.1) when you play a tune the timer counts super fast up to 50 seconds then appears to run normally. This causes tunes to not play to their proper length (tunes under 50 seconds end after about 3 seconds).

I've also tried the alpha lib and player for 2.5.0 and it does the same thing.

Cheers.

@pezz
Copy link
Author

pezz commented Apr 21, 2023

Never mind, I reinstalled lib 2.4.2 (from Arch repo) and recompiled the 2.4.1 player and this problem has gone away.

Sorry for the noise.

@pezz pezz closed this as completed Apr 21, 2023
@AlexKurisu
Copy link

Just got the same issue on Arch. Library v. 2.6.0, player v. 2.6.2

@AlexKurisu
Copy link

Recompiling the player didn't help

@pezz
Copy link
Author

pezz commented Jan 13, 2024

Dunno man, I saw this once and recompiling fixed it.

Try it again maybe?

@pezz pezz reopened this Jan 13, 2024
@pezz pezz closed this as completed Jan 13, 2024
@pezz
Copy link
Author

pezz commented Jan 13, 2024

Didn't mean to reopen this, apologies.

@drfiemost
Copy link
Member

Weird, it never occurred to me. What if you pass the -b0 parameter?

@AlexKurisu
Copy link

Weird, it never occurred to me. What if you pass the -b0 parameter?

That didn't help

@drfiemost
Copy link
Member

Hard to tell without reproducing...
Anyone able to isolate the problem?
Specific compiler/version? Compiler flags?

@AlexKurisu
Copy link

@drfiemost
Compiler: GCC 13.2.1, binutils 2.41
CFLAGS: -march=x86-64-v3 -mpclmul -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection
LDFLAGS: -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now

@drfiemost
Copy link
Member

Tried recompiling with the same flags, except for -march set to x86-64-v2, with gcc 13.2.0 but no sign of the issue.
Does it happens with any tune? Anything special in sidplayfp.ini or in the command line?
I suggest recompiling with a subset of the flags and see if any of those is causing the problem.

@drfiemost
Copy link
Member

Can you confirm this happens with the ALSA driver?

@AlexKurisu
Copy link

Can you confirm this happens with the ALSA driver?

How do I make sidplayfp use ALSA driver?

@AlexKurisu
Copy link

Did the same thing Gentoo does to disable pulseaudio support (sed -i -e 's:libpulse-simple >= 1.0:dIsAbLe&:' configure), the issue is still here. siplayfp fast-forwards to 01:00 on every song, which leads to songs ending minute earlier than they should be.

@AlexKurisu
Copy link

AlexKurisu commented Feb 13, 2024

the issue is still here

Oops, did this on release version for some reason. Retrying on version from master

@drfiemost
Copy link
Member

Do you have the same problem with pulseaudio?

@AlexKurisu
Copy link

Do you have the same problem with pulseaudio?

Nope, problem is gone with pulseaudio (did the sed -i -e 's:alsa >= 1.0:dIsAbLe&:' configure thing). With ALSA the problem is still here.

@AlexKurisu
Copy link

Also, looks like sidplayfp prefers ALSA if built with both PulseAudio and ALSA

@ruby-R53
Copy link
Contributor

getting the same issue here, in my case it seems to prefer pulseaudio when it has support for both, so i delete the libpulse section in configure.ac to force ALSA

probably the worst way to do it, but whatever

@drfiemost drfiemost added the bug Something isn't working label Feb 14, 2024
@drfiemost
Copy link
Member

Also, looks like sidplayfp prefers ALSA if built with both PulseAudio and ALSA

That should not happen, pulseaudio have the priority over ALSA, unless the initialization fails for some reason :/

probably the worst way to do it, but whatever

We can add a --disable-pulse option, open a new issue if needed.

Back to the problem, we have determined that it affects the ALSA driver and the effect varies with the sampling rate.
At least we have narrowed it down and have a way to reproduce it. Will dig deeper...

@drfiemost
Copy link
Member

Can you please try #32 ? The buffer size is now proportional to the sampling rate. It still eats the first frames playing at 8KHz but it seems a bit better than before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants