Version in base suite: 0.10.1+dfsg-1 Base version: mgba_0.10.1+dfsg-1 Target version: mgba_0.10.1+dfsg-1+deb12u1 Base file: /srv/ftp-master.debian.org/ftp/pool/main/m/mgba/mgba_0.10.1+dfsg-1.dsc Target file: /srv/ftp-master.debian.org/policy/pool/main/m/mgba/mgba_0.10.1+dfsg-1+deb12u1.dsc changelog | 9 + gbp.conf | 1 patches/Libretro-Add-back-missing-audio-overkill-fixes-2734.patch | 56 ++++++++ patches/Qt-Fix-crash-when-attempting-to-use-OpenGL-2.1-to-3.1.patch | 65 ++++++++++ patches/series | 2 5 files changed, 133 insertions(+) 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 18:33:17.000000000 +0000 +++ mgba-0.10.1+dfsg/debian/changelog 2023-06-26 23:51:44.000000000 +0000 @@ -1,3 +1,12 @@ +mgba (0.10.1+dfsg-1+deb12u1) bookworm; 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 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 18:33:17.000000000 +0000 +++ mgba-0.10.1+dfsg/debian/gbp.conf 2023-06-26 23:51:44.000000000 +0000 @@ -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 1970-01-01 00:00:00.000000000 +0000 +++ mgba-0.10.1+dfsg/debian/patches/Libretro-Add-back-missing-audio-overkill-fixes-2734.patch 2023-06-26 23:51:44.000000000 +0000 @@ -0,0 +1,56 @@ +From 71d1f122f9ecc0e4d85bf64a9fead6cdfc11dbd8 Mon Sep 17 00:00:00 2001 +From: Vicki Pfau +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 1970-01-01 00:00:00.000000000 +0000 +++ mgba-0.10.1+dfsg/debian/patches/Qt-Fix-crash-when-attempting-to-use-OpenGL-2.1-to-3.1.patch 2023-06-26 23:51:44.000000000 +0000 @@ -0,0 +1,65 @@ +From df6ae1883cc7d4d67a21fba2f8eaff6644bd152d Mon Sep 17 00:00:00 2001 +From: Vicki Pfau +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(); + gl2Backend = static_cast(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(painter->m_backend); + if (painter->m_widget && painter->supportsShaders()) { +- QOpenGLFunctions_Baseline* fn = painter->m_gl->versionFunctions(); ++ 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* 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* 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* 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 18:33:17.000000000 +0000 +++ mgba-0.10.1+dfsg/debian/patches/series 2023-06-26 23:51:44.000000000 +0000 @@ -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