libretro / libretro/RetroArch

MacOS : When Retroarch is fullscreen, WindowServer consumes 190% CPU

Open
#17,480 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

platform: osx
Dominant language
C
Stars
14.1k
Forks
2.2k
Avg merge
7h 35m
Merged PRs (30d)
51

Description

Is there an existing issue for this?
  • This is a bug in RetroArch frontend
  • I have searched the existing issues
Description

When Retroarch is fullscreen, WindowServer consumes 190% CPU, while when Retroarch is in windowed mode, WindowServer consumes 25% CPU.

I have an external monitor attached to my MacBook Pro.

My setup :

Hardware Overview:

Model Name: MacBook Pro
Model Identifier: MacBookPro12,1
Processor Name: Dual-Core Intel Core i5
Processor Speed: 2,7 GHz
Number of Processors: 1
Total Number of Cores: 2
L2 Cache (per Core): 256 KB
L3 Cache: 3 MB
Hyper-Threading Technology: Enabled
Memory: 8 GB
System Firmware Version: 489.0.0.0.0
OS Loader Version: 540.120.3~37
SMC Version (system): 2.28f7

Intel Iris Graphics 6100:

Chipset Model: Intel Iris Graphics 6100
Type: GPU
Bus: Built-In
VRAM (Dynamic, Max): 1536 MB
Vendor: Intel
Device ID: 0x162b
Revision ID: 0x0009
Metal Family: Supported, Metal GPUFamily macOS 1
Displays:
Colour LCD:
Display Type: Built-In Retina LCD
Resolution: 2560x1600 Retina
Framebuffer Depth: 24-Bit Colour (ARGB8888)
Main Display: Yes
Mirror: Off
Online: Yes
Automatically Adjust Brightness: No
Connection Type: Internal
Acer V247Y:
Resolution: 1920x1080 (1080p FHD - Full High Definition)
UI Looks like: 1920 x 1080 @ 60.00Hz
Framebuffer Depth: 24-Bit Colour (ARGB8888)
Mirror: Off
Online: Yes
Rotation: Supported
Adapter Type: Apple Mini DisplayPort To VGA Adapter
Adapter Firmware Version: 1,03

System Software Overview:

System Version: macOS 12.7.6 (21H1320)
Kernel Version: Darwin 21.6.0
Boot Volume: Macintosh HD
Boot Mode: Normal
Secure Virtual Memory: Enabled
System Integrity Protection: Enabled
Time since boot: 7:48

Expected behavior

WindowServer should stay at 25% CPU whether retroarch is in fullscreen mode or in windowed mode.

Steps to reproduce the bug

MacBook pro with external display

Launch retroarch in windowed mode on the external display

Image

Check Activity monitor, WindowServer process is around 25% CPU

Image

Set Retroarch fullscreen on external display

Image

Check Activity monitor, WindowServer process is around 190% CPU

Image

Version/Commit

1.20.0 (Git 6412f4fee)

Bisect Results

No response

Present in the nightly version

I don't know

Platform & operating system

MacOS 12.7.6 (21H1320)

Affected Cores

No response

Environment information

Hardware Overview:

Model Name: MacBook Pro
Model Identifier: MacBookPro12,1
Processor Name: Dual-Core Intel Core i5
Processor Speed: 2,7 GHz
Number of Processors: 1
Total Number of Cores: 2
L2 Cache (per Core): 256 KB
L3 Cache: 3 MB
Hyper-Threading Technology: Enabled
Memory: 8 GB
System Firmware Version: 489.0.0.0.0
OS Loader Version: 540.120.3~37
SMC Version (system): 2.28f7

Intel Iris Graphics 6100:

Chipset Model: Intel Iris Graphics 6100
Type: GPU
Bus: Built-In
VRAM (Dynamic, Max): 1536 MB
Vendor: Intel
Device ID: 0x162b
Revision ID: 0x0009
Metal Family: Supported, Metal GPUFamily macOS 1
Displays:
Colour LCD:
Display Type: Built-In Retina LCD
Resolution: 2560x1600 Retina
Framebuffer Depth: 24-Bit Colour (ARGB8888)
Main Display: Yes
Mirror: Off
Online: Yes
Automatically Adjust Brightness: No
Connection Type: Internal
Acer V247Y:
Resolution: 1920x1080 (1080p FHD - Full High Definition)
UI Looks like: 1920 x 1080 @ 60.00Hz
Framebuffer Depth: 24-Bit Colour (ARGB8888)
Mirror: Off
Online: Yes
Rotation: Supported
Adapter Type: Apple Mini DisplayPort To VGA Adapter
Adapter Firmware Version: 1,03

System Software Overview:

System Version: macOS 12.7.6 (21H1320)
Kernel Version: Darwin 21.6.0
Boot Volume: Macintosh HD
Boot Mode: Normal
Secure Virtual Memory: Enabled
System Integrity Protection: Enabled
Time since boot: 7:48

Relevant log output
[INFO] RetroArch 1.20.0 (Git 6412f4fee)
[INFO] === Build =======================================
[INFO] CPU Model Name: Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz
[INFO] Capabilities: MMX MMXEXT SSE SSE2 SSE3 SSSE3 SSE4 SSE42 AES AVX AVX2 
[INFO] Version: 1.20.0
[INFO] Git: 6412f4fee
[INFO] Built: Jan  4 2025
[INFO] =================================================
[INFO] [Input]: Found input driver: "cocoa".
[INFO] [Environ]: SET_PIXEL_FORMAT: RGB565.
[INFO] [Core]: Version of libretro API: 1, Compiled against API: 1
[INFO] [Core]: Geometry: 320x240, Aspect: 1.333, FPS: 60.00, Sample rate: 48000.00 Hz.
[INFO] [Video]: Set video size to: 960x720.
[INFO] [Video]: Graphics driver did not initialize an input driver. Attempting to pick a suitable driver.
[INFO] [Joypad]: Found joypad driver: "mfi".
[INFO] [Video]: Found display server: "apple".
[INFO] [Audio]: Set audio input rate to: 48000.00 Hz.
[INFO] [CoreAudio3]: Using buffer size of 24576 bytes: (latency = 64 ms)
[INFO] [Audio]: Started synchronous audio driver.
[INFO] [Microphone]: Initialized microphone driver.
[INFO] [Display]: Found display driver: "metal".
[INFO] [Playlist]: Loading history file: "/Users/Laurent/Library/Application Support/RetroArch/config/content_history.lpl".
[INFO] [Playlist]: Loading history file: "/Users/Laurent/Library/Application Support/RetroArch/config/content_music_history.lpl".
[INFO] [Playlist]: Loading history file: "/Users/Laurent/Library/Application Support/RetroArch/config/content_video_history.lpl".
[INFO] [Playlist]: Loading history file: "/Users/Laurent/Library/Application Support/RetroArch/config/content_image_history.lpl".
[INFO] [Playlist]: Loading favorites file: "/Users/Laurent/Library/Application Support/RetroArch/config/content_favorites.lpl".
[DEBUG] [Audio]: Started audio driver "coreaudio3" (is_shutdown=false)
[INFO] [CloudSync] begin succeeded
[DEBUG] [Audio]: Stopped audio driver "coreaudio3"
[DEBUG] [iCloud] found 1 results looking for manifest.server
[DEBUG] [iCloud] successfully fetched manifest.server, size 6973
[INFO] [CloudSync] server manifest fetch succeeded
[INFO] [CloudSync] created manifest with 65 files
[WARN] [CloudSync] opened local manifest
[INFO] [CloudSync] created manifest with 65 files
[INFO] [CloudSync] created in-memory manifest of current disk state
[INFO] [CloudSync] finished processing manifests
[INFO] [CloudSync] wrote /Users/Laurent/Library/Application Support/RetroArch/downloads/manifest.local
[INFO] [CloudSync] finished after 3.057751 seconds, 0 files uploaded, 0 files downloaded
[INFO] [Config]: Saved new config to "/Users/Laurent/Library/Application Support/RetroArch/config/retroarch.cfg".
[DEBUG] [Audio]: Started audio driver "coreaudio3" (is_shutdown=true)
[DEBUG] [Audio]: Started audio driver "coreaudio3" (is_shutdown=true)
[INFO] [Core]: Content ran for a total of: 00 hours, 00 minutes, 00 seconds.
[DEBUG] [Audio]: Stopped audio driver "coreaudio3"
[INFO] [Core]: Unloading core..
[INFO] [Core]: Unloading core symbols..
[DEBUG] [Video]: Does not have enough samples for monitor refresh rate estimation. Requires to run for at least 4096 frames.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue on macOS 12.7.6 with an external display, comparing windowed and fullscreen modes while watching WindowServer CPU usage. Start from the Cocoa input, Apple display-server, and Metal display-driver paths named in the log. Done means fullscreen mode no longer causes the reported CPU increase relative to windowed mode.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, macos
Domain
desktop, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.