Skip to content

Renderer created without SDL_RENDERER_PRESENTVSYNC can cause log entries “Invalid actual_host_time received from display” on macOS #11569

Open
@Rinzwind

Description

@Rinzwind

When I run the ‘test’ program given below using SDL v2.30.9, the following ‘log’ command shows entries saying “Invalid actual_host_time received from display” being logged if I use the --no-vsync option, which is not the case when I use the --vsync option:

$ log stream --style compact --predicate 'eventMessage contains "Invalid actual_host_time received from display"'
Filtering the log data using "composedMessage CONTAINS "Invalid actual_host_time received from display""
Timestamp               Ty Process[PID:TID]
2024-12-02 20:34:11.318 E  WindowServer[193:383] [com.apple.SkyLight:default] Invalid actual_host_time received from display: 0x4280f80  new time: 57868763623536 last time: 57868745776911
2024-12-02 20:34:11.351 E  WindowServer[193:383] [com.apple.SkyLight:default] Invalid actual_host_time received from display: 0x4280f80  new time: 57868796955034 last time: 57868780289426
2024-12-02 20:34:11.370 E  WindowServer[193:383] [com.apple.SkyLight:default] Invalid actual_host_time received from display: 0x4280f80  new time: 57868813567455 last time: 57868796948342
2024-12-02 20:34:11.373 E  WindowServer[193:383] [com.apple.SkyLight:default] Invalid actual_host_time received from display: 0x4280f80  new time: 57868813625177 last time: 57868813567455
2024-12-02 20:34:11.385 E  WindowServer[193:383] [com.apple.SkyLight:default] Invalid actual_host_time received from display: 0x4280f80  new time: 57868830290377 last time: 57868813625177
2024-12-02 20:34:11.387 E  WindowServer[193:383] [com.apple.SkyLight:default] Invalid actual_host_time received from display: 0x4280f80  new time: 57868830291967 last time: 57868830290377
2024-12-02 20:34:11.401 E  WindowServer[193:383] [com.apple.SkyLight:default] Invalid actual_host_time received from display: 0x4280f80  new time: 57868846954649 last time: 57868830291967
[…]

Are these log entries an expected consequence of not setting the SDL_RENDERER_PRESENTVSYNC flag? I’m not that familiar with SDL but am having a seemingly related problem with an application that uses it: Pharo issue #16454. I’m still using the same MacBook Pro (13-inch, 2020, Four Thunderbolt 3 ports) mentioned in that issue, now with macOS v14.7.1. I’ve asked two colleagues to try running ‘test’, the one with the same model of MacBook Pro with macOS v14.6.1 gets the log entries as well, while the one with a MacBook Air (M2, 2022) with macOS 14.5 does not get them. We each used the built-in display and installed SDL through the ‘sdl2’ Homebrew formula.

test.c: (based on the test code given in issue #11384)

#include <SDL2/SDL.h>
int main(int argc, char *argv[]) {
	int vsync;
	if (!(argc == 2 && ((vsync = !strcmp(argv[1], "--vsync")) || !strcmp(argv[1], "--no-vsync"))))
		return 1;
	SDL_Init(SDL_INIT_VIDEO);
	SDL_version version;
	SDL_GetVersion(&version);
	printf("SDL version: %i.%i.%i\n", version.major, version.minor, version.patch);
	SDL_Window* window = SDL_CreateWindow(NULL, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 800, 600, 0);
	SDL_Renderer* renderer = SDL_CreateRenderer(window, -1, vsync ? SDL_RENDERER_PRESENTVSYNC : 0);
	SDL_Event event;
	int running = 1;
	while (running) {
		while (SDL_PollEvent(&event)) {
			if (event.type == SDL_QUIT) {
				running = 0;
			}
		}
		SDL_RenderClear(renderer);
		SDL_RenderPresent(renderer);
	}
	SDL_DestroyRenderer(renderer);
	SDL_DestroyWindow(window);
	SDL_Quit();
	return 0;
}

Makefile:

test: test.c
	cc -I/opt/homebrew/include -L/opt/homebrew/lib -o test -lsdl2 test.c

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions