From ab40cc60d1304cba602edf648a2bda79aed1485c Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 31 May 2020 03:38:54 +0200 Subject: [PATCH] Kernel: Fix glitched audio output in SB16 driver We were not setting the DMA transfer mode correctly. I have absolutely no clue how this could ever have worked, but it did work for months until it suddenly didn't. Anyways, this fixes that. The sound is still a little bit glitchy and that could probably be fixed by using the SB16's auto-initialized mode. --- Kernel/Devices/SB16.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kernel/Devices/SB16.cpp b/Kernel/Devices/SB16.cpp index e2966da334..a6d889bf55 100644 --- a/Kernel/Devices/SB16.cpp +++ b/Kernel/Devices/SB16.cpp @@ -181,7 +181,7 @@ void SB16::dma_start(uint32_t length) { const auto addr = m_dma_region->physical_page(0)->paddr().get(); const u8 channel = 5; // 16-bit samples use DMA channel 5 (on the master DMA controller) - const u8 mode = 0; + const u8 mode = 0x48; // Disable the DMA channel IO::out8(0xd4, 4 + (channel % 4));