From 0de0077d50cfed73c4323f9b7665013546cdeb62 Mon Sep 17 00:00:00 2001 From: Ionen Wolkens Date: Sun, 26 Apr 2026 23:31:38 -0400 Subject: [PATCH] games-emulation/pcsx2: fix cubeb alsa UB Couldn't reproduce, but this seems to be UB and may cause all sort of problems randomly. Hopefully upstream cubeb will look at it eventually (still not merged). Signed-off-by: Ionen Wolkens --- .../pcsx2/files/pcsx2-2.6.3-cubeb-alsa.patch | 15 +++++++++++++++ .../{pcsx2-2.6.3.ebuild => pcsx2-2.6.3-r1.ebuild} | 1 + games-emulation/pcsx2/pcsx2-9999.ebuild | 1 + 3 files changed, 17 insertions(+) create mode 100644 games-emulation/pcsx2/files/pcsx2-2.6.3-cubeb-alsa.patch rename games-emulation/pcsx2/{pcsx2-2.6.3.ebuild => pcsx2-2.6.3-r1.ebuild} (99%) diff --git a/games-emulation/pcsx2/files/pcsx2-2.6.3-cubeb-alsa.patch b/games-emulation/pcsx2/files/pcsx2-2.6.3-cubeb-alsa.patch new file mode 100644 index 0000000000000..a66fbe0a642bd --- /dev/null +++ b/games-emulation/pcsx2/files/pcsx2-2.6.3-cubeb-alsa.patch @@ -0,0 +1,15 @@ +A user reported crashes while interacting with menus while a game +is running and using ALSA, and that this fixes it for them. + +https://github.com/mozilla/cubeb/pull/829 +--- a/3rdparty/cubeb/src/cubeb.c ++++ b/3rdparty/cubeb/src/cubeb.c +@@ -741,4 +741,8 @@ + + rv = context->ops->enumerate_devices(context, devtype, collection); ++ if (rv != CUBEB_OK) { ++ collection->device = NULL; ++ collection->count = 0; ++ } + + if (cubeb_log_get_callback()) { diff --git a/games-emulation/pcsx2/pcsx2-2.6.3.ebuild b/games-emulation/pcsx2/pcsx2-2.6.3-r1.ebuild similarity index 99% rename from games-emulation/pcsx2/pcsx2-2.6.3.ebuild rename to games-emulation/pcsx2/pcsx2-2.6.3-r1.ebuild index d89d107c226b9..8fa771e48886c 100644 --- a/games-emulation/pcsx2/pcsx2-2.6.3.ebuild +++ b/games-emulation/pcsx2/pcsx2-2.6.3-r1.ebuild @@ -90,6 +90,7 @@ PATCHES=( "${FILESDIR}"/${PN}-1.7.5913-musl-cache.patch "${FILESDIR}"/${PN}-2.5.317-flags.patch "${FILESDIR}"/${PN}-2.6.3-climits.patch + "${FILESDIR}"/${PN}-2.6.3-cubeb-alsa.patch ) CMAKE_QA_COMPAT_SKIP=1 #957976 diff --git a/games-emulation/pcsx2/pcsx2-9999.ebuild b/games-emulation/pcsx2/pcsx2-9999.ebuild index cdf1913c9206d..ca62f5dd76778 100644 --- a/games-emulation/pcsx2/pcsx2-9999.ebuild +++ b/games-emulation/pcsx2/pcsx2-9999.ebuild @@ -92,6 +92,7 @@ PATCHES=( "${FILESDIR}"/${PN}-1.7.5913-musl-cache.patch "${FILESDIR}"/${PN}-2.5.317-flags.patch "${FILESDIR}"/${PN}-2.6.3-climits.patch + "${FILESDIR}"/${PN}-2.6.3-cubeb-alsa.patch ) CMAKE_QA_COMPAT_SKIP=1 #957976