1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:48:11 +00:00

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.
This commit is contained in:
Andreas Kling 2020-05-31 03:38:54 +02:00
parent e33820b557
commit ab40cc60d1

View file

@ -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));