Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 Apr 2026 23:28:56 +0000
From:      Vladimir Druzenko <vvd@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Cc:        Martin Filla <freebsd@sysctl.cz>
Subject:   git: 911cc855499b - main - devel/raylib: Switch to SDL backend, Fix high audio latency on FreeBSD (OSS backend)
Message-ID:  <69e56538.3d8f4.f7bffa2@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by vvd:

URL: https://cgit.FreeBSD.org/ports/commit/?id=911cc855499b3a20e84f13c44104fead37734663

commit 911cc855499b3a20e84f13c44104fead37734663
Author:     Martin Filla <freebsd@sysctl.cz>
AuthorDate: 2026-04-19 23:12:48 +0000
Commit:     Vladimir Druzenko <vvd@FreeBSD.org>
CommitDate: 2026-04-19 23:21:07 +0000

    devel/raylib: Switch to SDL backend, Fix high audio latency on FreeBSD (OSS backend)
    
    SDL has better Gamepad Support.
    
    On FreeBSD, raylib (via miniaudio) defaults to a massive buffer size
    when using the OSS backend. My logs show a "Periods size" of 32768
    samples, which creates a latency of ~680ms at 48kHz. This makes the
    library unusable for real-time applications and games on FreeBSD.
    Patch the bundled src/external/miniaudio.h to force a lower latency
    specifically for the OSS driver. By setting the default period size to
    10ms and the period count to 2, the latency is reduced to ~10ms without
    audio dropouts.
    
    PR:             294647 294627
    Tested by:      Chédotal Julien <rjdi@wanadoo.fr>
    Sponsored by:   UNIS Labs
    Co-authored-by: Chédotal Julien <rjdi@wanadoo.fr>
    Co-authored-by: Vladimir Druzenko <vvd@FreeBSD.org>
    MFH:            2026Q2
---
 devel/raylib/Makefile                             | 12 ++++++------
 devel/raylib/files/patch-src_external_miniaudio.h | 11 +++++++++++
 2 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/devel/raylib/Makefile b/devel/raylib/Makefile
index 398ebd2f0413..c25c4d523fdd 100644
--- a/devel/raylib/Makefile
+++ b/devel/raylib/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	raylib
 DISTVERSION=	5.5
+PORTREVISION=	1
 CATEGORIES=	devel education
 
 MAINTAINER=	freebsd@sysctl.cz
@@ -9,17 +10,16 @@ WWW=		https://www.raylib.com/
 LICENSE=	ZLIB
 LICENSE_FILE=	${WRKSRC}/LICENSE
 
-LIB_DEPENDS=	libglfw.so:graphics/glfw
-
-USES=		cmake gl localbase:ldflags xorg
+USES=		cmake localbase:ldflags sdl xorg
 USE_GITHUB=	yes
 GH_ACCOUNT=	raysan5
-USE_GL=		glu opengl
 USE_LDCONFIG=	yes
+USE_SDL=	sdl2
 USE_XORG=	ice sm x11 xcursor xext xi xinerama xrandr xxf86vm
 
-CMAKE_ON=	BUILD_SHARED_LIBS USE_EXTERNAL_GLFW
-CMAKE_OFF=	BUILD_EXAMPLES BUILD_GAMES STATIC
+CMAKE_ARGS=	-DPLATFORM=SDL
+CMAKE_ON=	BUILD_SHARED_LIBS
+CMAKE_OFF=	BUILD_EXAMPLES
 
 post-install:
 # Install all parts for raylib
diff --git a/devel/raylib/files/patch-src_external_miniaudio.h b/devel/raylib/files/patch-src_external_miniaudio.h
new file mode 100644
index 000000000000..70dbc08b9cb9
--- /dev/null
+++ b/devel/raylib/files/patch-src_external_miniaudio.h
@@ -0,0 +1,11 @@
+--- src/external/miniaudio.h.orig	2024-11-18 12:21:10 UTC
++++ src/external/miniaudio.h
+@@ -41648,6 +41648,8 @@ MA_API ma_device_config ma_device_config_init(ma_devic
+     MA_ZERO_OBJECT(&config);
+     config.deviceType = deviceType;
+     config.resampling = ma_resampler_config_init(ma_format_unknown, 0, 0, 0, ma_resample_algorithm_linear); /* Format/channels/rate don't matter here. */
++    config.periodSizeInMilliseconds = 10;
++    config.periods = 2;
+ 
+     return config;
+ }


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69e56538.3d8f4.f7bffa2>