1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 01:57:45 +00:00

Kernel: Do not reset AC'97 PCM out on buffer completion

We now only reset the PCM out channel during initialization, and handle
the case where the channel's current index has passed the last valid
index properly.

This fixes issues with stuttering audio between multiple subsequent
`aplay` invocations, for example.
This commit is contained in:
Jelle Raaijmakers 2022-02-27 17:24:29 +01:00 committed by Andreas Kling
parent 694ff12272
commit 0e78e6b1e8
2 changed files with 32 additions and 24 deletions

View file

@ -128,6 +128,7 @@ private:
}
bool dma_running() const { return m_dma_running; }
void handle_dma_stopped();
StringView name() const { return m_name; }
IOAddress reg(Register reg) const { return m_channel_base.offset(reg); }
void reset();
@ -148,7 +149,6 @@ private:
AC97Channel channel(StringView name, NativeAudioBusChannel channel) { return AC97Channel(*this, name, m_io_bus_base.offset(channel)); }
ErrorOr<void> initialize();
void reset_pcm_out();
void set_master_output_volume(u8, u8, Muted);
ErrorOr<void> set_pcm_output_sample_rate(u32);
void set_pcm_output_volume(u8, u8, Muted);