ThKattanek / emu64

C64 Emulator
https://www.thorsten-kattanek.de/index.php/projekte/emu64
GNU General Public License v2.0
37 stars 5 forks source link

high cpu usage #254

Open netpipe opened 5 months ago

netpipe commented 5 months ago

its eating over 100% cpu to emulate 1mhz cpu , when i click debug it usually stops.i noticed there were some SDL_Delays() in the sdlrender thread already but maybe there is more places to put them like in sound.

ThKattanek commented 5 months ago

What is your system. cpu, ram, os ? For me, emu64 only uses 2.4%

grafik

netpipe commented 5 months ago
inxi -Fxxxrz
System:
  Kernel: 6.5.0-14-generic x86_64 bits: 64 compiler: N/A Desktop: MATE 1.26.0
    info: mate-panel wm: marco 1.26.0 vt: 2 dm: GDM3 42.0
    Distro: Ubuntu 22.04.3 LTS (Jammy Jellyfish)
Machine:
  Type: Laptop System: LENOVO product: 20B2000KUS v: ThinkPad Edge E545
    serial: <superuser required> Chassis: type: 10 serial: <superuser required>
  Mobo: LENOVO model: 20B2000KUS v: 0B98401 Pro
    serial: <superuser required> UEFI: LENOVO v: HRET30WW (1.18)
    date: 04/24/2018
CPU:
  Info: quad core model: AMD A8-5550M APU with Radeon HD Graphics bits: 64
    type: MT MCP smt: enabled arch: Piledriver rev: 1 cache: L1: 192 KiB
    L2: 4 MiB
  Speed (MHz): avg: 2060 high: 2079 min/max: 1400/2100 boost: enabled
    cores: 1: 2033 2: 2073 3: 2056 4: 2079 bogomips: 16767
  Flags: avx ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
Graphics:
  Device-1: AMD Richland [Radeon HD 8550G] vendor: Lenovo driver: radeon
    v: kernel ports: active: HDMI-A-1 empty: VGA-1 bus-ID: 00:01.0
    chip-ID: 1002:990d class-ID: 0300
Zirias commented 5 months ago

The only way I can force emu64 to consume a considerable amount of CPU time here is setting LIBGL_ALWAYS_SOFTWARE=1.

Are you sure your DRM drivers work correctly and your user has the required privileges to use direct rendering? What's the output of glxinfo | grep "OpenGL renderer"?

netpipe commented 5 months ago

OpenGL renderer string: AMD ARUBA (DRM 2.50.0 / 6.5.0-14-generic, LLVM 15.0.7) Screenshot at 2024-01-21 06-05-29

might be the sound playing thats using up somuch cpu, maybe its normal for this sortof thing.

netpipe commented 5 months ago

another way to speed things up i have seen on other emulators was to set the fps to 30 FPS for rendering and input /sound? but step the emulator at 50 FPS

netpipe commented 5 months ago

Frodo is the fastest emulator i've tried on linux sofar, in 4.1b i just had to change a int16 to int32 for the compile error on linux.