[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1042795: marked as done (bookworm-pu: package mgba/0.10.1+dfsg-1+deb12u1)



Your message dated Sat, 07 Oct 2023 09:59:39 +0000
with message-id <E1qp45z-00A4BN-3a@coccia.debian.org>
and subject line Released with 12.2
has caused the Debian Bug report #1042795,
regarding bookworm-pu: package mgba/0.10.1+dfsg-1+deb12u1
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
1042795: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1042795
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: release.debian.org
Severity: normal
Tags: bookworm
User: release.debian.org@packages.debian.org
Usertags: pu

I would like to update mgba in bookworm with the following changes. Both 
bugs were introduced in mgba 0.10.0 and are thus regressions in 
bookworm. The patches are cherry-picks from mgba 0.10.2.

  * Import upstream patch to fix broken audio in libretro core.
    (Closes: #1036829)

The bug subject says "Audio stutters horribly and sounds distorted". On 
my system, I just get no audio at all, with either gnome-games-app or 
retroarch as frontend. In any case, the patch is the only change to 
libretro code in 0.10.2, and does make audio work properly for me.

The short explanation of the bug is that the libretro core is maintained 
downstream (in a fork owned by the libretro folks), changes are pulled 
back to mgba upstream from time to time, and they missed one hunk during 
a resync. The patch simply restores the missing hunk of code.

I asked the submitter to test the proposed package, but they didn't 
respond.

  * Import upstream patch to fix crash on hardware incapable of OpenGL 3.2.

I actually have hardware (Intel GM45) affected by this, so I was able to 
verify it. Depending on configuration, mgba crashes either on startup, 
or when starting emulation. The patch restores support for older OpenGL 
implementations.

  * debian/gbp.conf: Set debian-branch to bookworm.

Hopefully self-explanatory.

The package does not have automated tests. I verified each fix with the 
libretro core and mgba-qt, and did some additional smoke testing to 
check for obvious regressions.

Thank you,
Ryan
diff -Nru mgba-0.10.1+dfsg/debian/changelog mgba-0.10.1+dfsg/debian/changelog
--- mgba-0.10.1+dfsg/debian/changelog	2023-01-15 10:33:17.000000000 -0800
+++ mgba-0.10.1+dfsg/debian/changelog	2023-06-26 16:51:44.000000000 -0700
@@ -1,3 +1,12 @@
+mgba (0.10.1+dfsg-1+deb12u1) UNRELEASED; urgency=medium
+
+  * Import upstream patch to fix broken audio in libretro core.
+    (Closes: #1036829)
+  * Import upstream patch to fix crash on hardware incapable of OpenGL 3.2.
+  * debian/gbp.conf: Set debian-branch to bookworm.
+
+ -- Ryan Tandy <ryan@nardis.ca>  Mon, 26 Jun 2023 16:51:44 -0700
+
 mgba (0.10.1+dfsg-1) unstable; urgency=medium
 
   * New upstream release.
diff -Nru mgba-0.10.1+dfsg/debian/gbp.conf mgba-0.10.1+dfsg/debian/gbp.conf
--- mgba-0.10.1+dfsg/debian/gbp.conf	2023-01-15 10:33:17.000000000 -0800
+++ mgba-0.10.1+dfsg/debian/gbp.conf	2023-06-26 16:51:44.000000000 -0700
@@ -1,5 +1,6 @@
 [DEFAULT]
 pristine-tar = True
+debian-branch = bookworm
 
 [pq]
 patch-numbers = False
diff -Nru mgba-0.10.1+dfsg/debian/patches/Libretro-Add-back-missing-audio-overkill-fixes-2734.patch mgba-0.10.1+dfsg/debian/patches/Libretro-Add-back-missing-audio-overkill-fixes-2734.patch
--- mgba-0.10.1+dfsg/debian/patches/Libretro-Add-back-missing-audio-overkill-fixes-2734.patch	1969-12-31 16:00:00.000000000 -0800
+++ mgba-0.10.1+dfsg/debian/patches/Libretro-Add-back-missing-audio-overkill-fixes-2734.patch	2023-06-26 16:51:44.000000000 -0700
@@ -0,0 +1,56 @@
+From 71d1f122f9ecc0e4d85bf64a9fead6cdfc11dbd8 Mon Sep 17 00:00:00 2001
+From: Vicki Pfau <vi@endrift.com>
+Date: Tue, 29 Nov 2022 02:20:02 -0800
+Subject: [PATCH] Libretro: Add back missing audio overkill (fixes #2734)
+
+---
+ src/platform/libretro/libretro.c | 33 ++++++++++++++++++++++++++++++++
+ 1 file changed, 33 insertions(+)
+
+diff --git a/src/platform/libretro/libretro.c b/src/platform/libretro/libretro.c
+index 9bbd55ae6..2c0184d99 100644
+--- a/src/platform/libretro/libretro.c
++++ b/src/platform/libretro/libretro.c
+@@ -617,6 +617,39 @@ void retro_run(void) {
+ 	core->desiredVideoDimensions(core, &width, &height);
+ 	videoCallback(outputBuffer, width, height, BYTES_PER_PIXEL * 256);
+ 
++#ifdef M_CORE_GBA
++	if (core->platform(core) == mPLATFORM_GBA) {
++		blip_t *audioChannelLeft  = core->getAudioChannel(core, 0);
++		blip_t *audioChannelRight = core->getAudioChannel(core, 1);
++		int samplesAvail          = blip_samples_avail(audioChannelLeft);
++		if (samplesAvail > 0) {
++			/* Update 'running average' of number of
++			 * samples per frame.
++			 * Note that this is not a true running
++			 * average, but just a leaky-integrator/
++			 * exponential moving average, used because
++			 * it is simple and fast (i.e. requires no
++			 * window of samples). */
++			audioSamplesPerFrameAvg = (SAMPLES_PER_FRAME_MOVING_AVG_ALPHA * (float)samplesAvail) +
++					((1.0f - SAMPLES_PER_FRAME_MOVING_AVG_ALPHA) * audioSamplesPerFrameAvg);
++			size_t samplesToRead = (size_t)(audioSamplesPerFrameAvg);
++			/* Resize audio output buffer, if required */
++			if (audioSampleBufferSize < (samplesToRead * 2)) {
++				audioSampleBufferSize = (samplesToRead * 2);
++				audioSampleBuffer     = realloc(audioSampleBuffer, audioSampleBufferSize * sizeof(int16_t));
++			}
++			int produced = blip_read_samples(audioChannelLeft, audioSampleBuffer, samplesToRead, true);
++			blip_read_samples(audioChannelRight, audioSampleBuffer + 1, samplesToRead, true);
++			if (produced > 0) {
++				if (audioLowPassEnabled) {
++					_audioLowPassFilter(audioSampleBuffer, produced);
++				}
++				audioCallback(audioSampleBuffer, (size_t)produced);
++			}
++		}
++	}
++#endif
++
+ 	if (rumbleCallback) {
+ 		if (rumbleUp) {
+ 			rumbleCallback(0, RETRO_RUMBLE_STRONG, rumbleUp * 0xFFFF / (rumbleUp + rumbleDown));
+-- 
+2.30.2
+
diff -Nru mgba-0.10.1+dfsg/debian/patches/Qt-Fix-crash-when-attempting-to-use-OpenGL-2.1-to-3.1.patch mgba-0.10.1+dfsg/debian/patches/Qt-Fix-crash-when-attempting-to-use-OpenGL-2.1-to-3.1.patch
--- mgba-0.10.1+dfsg/debian/patches/Qt-Fix-crash-when-attempting-to-use-OpenGL-2.1-to-3.1.patch	1969-12-31 16:00:00.000000000 -0800
+++ mgba-0.10.1+dfsg/debian/patches/Qt-Fix-crash-when-attempting-to-use-OpenGL-2.1-to-3.1.patch	2023-06-26 16:51:44.000000000 -0700
@@ -0,0 +1,65 @@
+From df6ae1883cc7d4d67a21fba2f8eaff6644bd152d Mon Sep 17 00:00:00 2001
+From: Vicki Pfau <vi@endrift.com>
+Date: Thu, 26 Jan 2023 05:57:08 -0800
+Subject: [PATCH] Qt: Fix crash when attempting to use OpenGL 2.1 to 3.1 (fixes
+ #2794)
+
+---
+ src/platform/qt/DisplayGL.cpp | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/src/platform/qt/DisplayGL.cpp b/src/platform/qt/DisplayGL.cpp
+index 7a4f73858..469b7e315 100644
+--- a/src/platform/qt/DisplayGL.cpp
++++ b/src/platform/qt/DisplayGL.cpp
+@@ -513,10 +513,10 @@ void PainterGL::create() {
+ 
+ #if defined(BUILD_GLES2) || defined(BUILD_GLES3)
+ 	if (m_supportsShaders) {
+-		QOpenGLFunctions_Baseline* fn = m_gl->versionFunctions<QOpenGLFunctions_Baseline>();
+ 		gl2Backend = static_cast<mGLES2Context*>(malloc(sizeof(mGLES2Context)));
+ 		mGLES2ContextCreate(gl2Backend);
+ 		m_backend = &gl2Backend->d;
++		QOpenGLFunctions* fn = m_gl->functions();
+ 		fn->glGenTextures(m_bridgeTexes.size(), m_bridgeTexes.data());
+ 		for (auto tex : m_bridgeTexes) {
+ 			m_freeTex.enqueue(tex);
+@@ -543,7 +543,7 @@ void PainterGL::create() {
+ #if defined(BUILD_GLES2) || defined(BUILD_GLES3)
+ 		mGLES2Context* gl2Backend = reinterpret_cast<mGLES2Context*>(painter->m_backend);
+ 		if (painter->m_widget && painter->supportsShaders()) {
+-			QOpenGLFunctions_Baseline* fn = painter->m_gl->versionFunctions<QOpenGLFunctions_Baseline>();
++			QOpenGLFunctions* fn = painter->m_gl->functions();
+ 			fn->glFinish();
+ 			painter->m_widget->setTex(painter->m_finalTex[painter->m_finalTexIdx]);
+ 			painter->m_finalTexIdx ^= 1;
+@@ -589,7 +589,7 @@ void PainterGL::destroy() {
+ 	}
+ 	makeCurrent();
+ #if defined(BUILD_GLES2) || defined(BUILD_GLES3)
+-	QOpenGLFunctions_Baseline* fn = m_gl->versionFunctions<QOpenGLFunctions_Baseline>();
++	QOpenGLFunctions* fn = m_gl->functions();
+ 	if (m_shader.passes) {
+ 		mGLES2ShaderFree(&m_shader);
+ 	}
+@@ -680,7 +680,7 @@ void PainterGL::start() {
+ 	if (glContextHasBug(OpenGLBug::GLTHREAD_BLOCKS_SWAP)) {
+ 		// Suggested on Discord as a way to strongly hint that glthread should be disabled
+ 		// See https://gitlab.freedesktop.org/mesa/mesa/-/issues/8035
+-		QOpenGLFunctions_Baseline* fn = m_gl->versionFunctions<QOpenGLFunctions_Baseline>();
++		QOpenGLFunctions* fn = m_gl->functions();
+ 		fn->glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS);
+ 	}
+ #endif
+@@ -972,7 +972,7 @@ QOpenGLContext* PainterGL::shareContext() {
+ }
+ 
+ void PainterGL::updateFramebufferHandle() {
+-	QOpenGLFunctions_Baseline* fn = m_gl->versionFunctions<QOpenGLFunctions_Baseline>();
++	QOpenGLFunctions* fn = m_gl->functions();
+ 	// TODO: Figure out why glFlush doesn't work here on Intel/Windows
+ 	if (glContextHasBug(OpenGLBug::CROSS_THREAD_FLUSH)) {
+ 		fn->glFinish();
+-- 
+2.30.2
+
diff -Nru mgba-0.10.1+dfsg/debian/patches/series mgba-0.10.1+dfsg/debian/patches/series
--- mgba-0.10.1+dfsg/debian/patches/series	2023-01-15 10:33:17.000000000 -0800
+++ mgba-0.10.1+dfsg/debian/patches/series	2023-06-26 16:51:44.000000000 -0700
@@ -1,2 +1,4 @@
 exclude-rapidjson.patch
 exclude-inih.patch
+Libretro-Add-back-missing-audio-overkill-fixes-2734.patch
+Qt-Fix-crash-when-attempting-to-use-OpenGL-2.1-to-3.1.patch

--- End Message ---
--- Begin Message ---
Version: 12.2

The upload requested in this bug has been released as part of 12.2.

--- End Message ---

Reply to: