feat: audio mixer, Audio app, fix Installer crash

This commit is contained in:
2026-05-19 07:48:09 +02:00
parent 14da61bb0e
commit 8b8c8cee95
26 changed files with 1272 additions and 373 deletions
+9
View File
@@ -5,6 +5,7 @@
*/
#include "IntelHda.hpp"
#include "Mixer.hpp"
#include <Memory/PageFrameAllocator.hpp>
#include <Memory/HHDM.hpp>
#include <Memory/Paging.hpp>
@@ -840,12 +841,14 @@ namespace Drivers::Audio::IntelHda {
static void HandleInterrupt(uint8_t /*irq*/) {
uint32_t intsts = Read32(REG_INTSTS);
bool bufferCompleted = false;
// Handle stream interrupts (bits 0-29 correspond to stream descriptors)
if (g_stream.Active) {
uint8_t si = g_stream.StreamIndex;
if (intsts & (1u << si)) {
uint8_t sts = ReadSD8(si, SD_STS);
if (sts & SD_STS_BCIS) bufferCompleted = true;
WriteSD8(si, SD_STS, sts);
}
}
@@ -858,6 +861,12 @@ namespace Drivers::Audio::IntelHda {
uint8_t rirbSts = Read8(REG_RIRBSTS);
Write8(REG_RIRBSTS, rirbSts);
}
// Notify the mixer so it can refill the DMA ring with the next mix
// window. Done after clearing status bits so re-entry can't latch.
if (bufferCompleted) {
Mixer::OnHdaBufferComplete();
}
}
// =========================================================================