libretro / RetroArch

Cross-platform, sophisticated frontend for the libretro API. Licensed GPLv3.
http://www.libretro.com
GNU General Public License v3.0
9.85k stars 1.78k forks source link

Audio / frame rates slowly degrade over time and only fixed by a system reboot #5839

Open cmcginty opened 6 years ago

cmcginty commented 6 years ago

Not sure if this is a core issue or what. Just creating a ticket in case others are have the same problems.

Description

This is a weird issue where I noticed in retroarch that after loading/unloading multiple cores or the same cores the audio quality starts getting more glitches and framerates slow down even more.

This issue seems to be at the OS level or below because restarting retroarch does not resolve the degraded performance the only workaround is to do a complete restart of my device (Asus Chromebox running Lubuntu 17.04)

I usually hear audio pops when starting a core for the first time. It might be related to the issue, or not.

Steps to reproduce the bug

The bug is most reproducible with ParaLLEl N64 but only because I think this is running my hardware at the edge.

  1. Continuously load/close different cores or same care (i.e. ParaLLEl N64)
  2. After 20 to 30 core loads the audio continues to get worse and the frame rates drop from near 57-58fps to 53fps

I haven't try to reload the audio modules or make any other OS config changes, but I might try that next to see if I can narrow down which sub-system is causing the issue.

Bisect Results

I've noticed this all year but only now realized that loading the cores seem to be causing the issue.

Environment information

Keywords

audio degrade, stutter, glitch, reload, reboot, restart resolves

Oibaf66 commented 6 years ago

Check the satus of the used memory (RAM). It could depend on a leak memory issue.

https://en.wikipedia.org/wiki/Memory_leak

meepingsnesroms commented 6 years ago

Its not a memory leak, whether you have 3gb or 1gb of ram available as long as there is the same amount the console has or more it wont matter.

restarting retroarch does not resolve the degraded performance

Then it cant be fixed by RetroArch, I will still help you find the cause and fix it though.

What other programs are running? Can you get a full list before and after the issue, including memory used by each program, cpus used and at what percentage by each program along with total threads running.

cmcginty commented 6 years ago

It's a dedicated box for my TV. There is nothing else running the foreground except the X server window (Openbox WM) and login managers (lightdm).

I can try restarting window manager and X server to see if that fixes it. My next through was try to reload some kernel modules, specifically the audio/video. I'll try and get the list of modules.

meepingsnesroms commented 6 years ago

Is RetroArch running through xwindows?

All I can think of is loading/unloading a core reinitializes the audio/video drivers so the same result should be achieved by loading/unloading RetroArch or any other fullscreen program 30 times.

cmcginty commented 6 years ago

Right it's running from the desktop. Is there another method?

meepingsnesroms commented 6 years ago

Is it fullscreen when you launch it, what is your video driver under Settings->Drivers? You can push left and right to pick a new graphics driver if its supported just dont choose "null" or it wont load anymore.

inactive123 commented 5 years ago

Is this still an issue for you or not?

andres-asm commented 5 years ago

@meepingsnesroms of course it matters, because the mupen core particularly leaks a lot when performing savestates.

If rewind is enabled it can lead to a BSOD even in a very high end rig.

meepingsnesroms commented 5 years ago

Why does the mupen core have memory leaks, cant that be fixed?

andres-asm commented 5 years ago

The serialization code leaks that's what I can tell you

On Wed, Oct 17, 2018, 4:26 PM meepingsnesroms notifications@github.com wrote:

Why does the mupen core have memory leaks, cant that be fixed?

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/libretro/RetroArch/issues/5839#issuecomment-430795372, or mute the thread https://github.com/notifications/unsubscribe-auth/ABpC0HEluWDn5INLGxQtWFibIWmMOtxmks5ul6CdgaJpZM4Qx3-w .

meepingsnesroms commented 5 years ago

Do any other cores have this issue or just mupen?

rz5 commented 5 years ago

Yes, would be important to know if this happens to other cores. It may be due to the undo save/load stuff that I wrote in RA.

andres-asm commented 5 years ago

No it's not due to undo save state it's due to the serializer in the core.

On Wed, Oct 17, 2018 at 5:04 PM rz5 notifications@github.com wrote:

Yes, would be important to know if this happens to other cores. It may be due to the undo save/load stuff that I wrote in RA.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/libretro/RetroArch/issues/5839#issuecomment-430806122, or mute the thread https://github.com/notifications/unsubscribe-auth/ABpC0BZwRszAHBZWZgzE-GLOIK3RP_Jeks5ul6mCgaJpZM4Qx3-w .