milkytracker / MilkyTracker

An FT2 compatible music tracker
http://milkytracker.github.io/
Other
1.7k stars 160 forks source link

Playback animations only update on mouse move #296

Closed rdebeasi closed 1 year ago

rdebeasi commented 1 year ago

When I play a song, the scroll position and scopes don't update unless I move the mouse. The audio playback works fine. I'm on Fedora 36 and am using the rpm package of MilkyTracker from fedoraproject.org.

Screencast from 10-10-2022 06:41:57 PM.webm

If there's anything that I can do to help troubleshoot, just let me know. Thank you!! :smile:

ghost commented 1 year ago

@rdebeasi I don't have a Linux available, so it's hard to say what's going on. The refresh is triggered by a timer event that is raised from SDL_Main.cpp (line 683). Any chance you can compile from the sources and put a printf statement in order to see if this event is properly triggered periodically?

rdebeasi commented 1 year ago

Thanks for taking a look! I added a printf on that line, and it looks like the event is only triggered when I move the mouse.

case SDLUserEventTimer:
  {
    printf("\nSDLUserEventTimer is happening!!");
    timestamp();

I'm not very good at C++, so I borrowed this timestamp function from Stack Overflow. :sweat_smile:

Screencast from 10-25-2022 08:57:27 PM.webm

ghost commented 1 year ago

Thanks for taking a look! I added a printf on that line, and it looks like the event is only triggered when I move the mouse.

case SDLUserEventTimer:
  {
    printf("\nSDLUserEventTimer is happening!!");
    timestamp();

I'm not very good at C++, so I borrowed this timestamp function from Stack Overflow. 😅

Screencast.from.10-25-2022.08.57.27.PM.webm

This is very weird behaviour. But since we are using the SDL library to generate those continuous events (which in turn refresh the screen when it's playing) could it be a problem inside SDL? But nobody ever complained about this. I looked closer into the code, can you move the timestamp log function here before the if statement: https://github.com/milkytracker/MilkyTracker/blob/caa8169574b0df8e5fb822b89edbbbfe3f5f584e/src/tracker/sdl/SDL_Main.cpp#L169 If this is not continuously outputting a log statement, the timer is basically broken.

rdebeasi commented 1 year ago

I'll take a look and let you know what I find!

I wonder if this is a Wayland compatibility issue. Looks like SDL released stable Wayland support in summer 2021: https://www.gamingonlinux.com/2021/08/sdl-version-2016-is-out-now-with-much-improved-wayland-support/

rdebeasi commented 1 year ago

I added the timestamp before that line, and it does continuously output a log statement.

Side note: I have SDL 2.24.0 installed, so the issue is probably not related to an old version of SDL.

ghost commented 1 year ago

Yeah, so this confirms that the SDL timer is working. Must be more like a bug on our side then. Maybe next week I'll find the time to setup a VM running Fedora 36 to take a closer look.

rdebeasi commented 1 year ago

I updated to Fedora 37, and this problem no longer occurs. Would you like me to close this issue?

ghost commented 1 year ago

I updated to Fedora 37, and this problem no longer occurs. Would you like me to close this issue?

Thanks for reporting back. I'm currently doing Linux related stuff for work, so I was really about to look into this issue, but I'm glad it solved itself.