https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e45bacda07bd73be9e630f...
commit e45bacda07bd73be9e630fcd795640ad978c2c54 Author: Michael Stamper michaelstamper1@gmail.com AuthorDate: Tue Sep 22 13:49:34 2020 +0000 Commit: GitHub noreply@github.com CommitDate: Tue Sep 22 15:49:34 2020 +0200
[PORTCLS] Fix audio stutter with official AC97 driver (#3225)
Replace call to AllocatedBufferSize(), with BufferSize().
Indeed (quoting https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/portcls/nf-por... ):
> The BufferSize() method returns the buffer size that was set by the previous call to IDmaChannel::SetBufferSize(). If SetBufferSize() has not been called since the IDmaChannel::AllocateBuffer() call, BufferSize returns the allocated buffer size. The DMA-channel object does not actually use this value internally. This value is maintained by the object to **allow its various clients to communicate the intended size of the buffer**.
And this is exactly what we want to do. --- drivers/wdm/audio/backpln/portcls/pin_wavecyclic.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.cpp b/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.cpp index e57fbefda74..31d787d08b0 100644 --- a/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.cpp +++ b/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.cpp @@ -1300,7 +1300,7 @@ CPortPinWaveCyclic::Init( m_Stream->SetState(KSSTATE_STOP); m_State = KSSTATE_STOP; m_CommonBufferOffset = 0; - m_CommonBufferSize = m_DmaChannel->AllocatedBufferSize(); + m_CommonBufferSize = m_DmaChannel->BufferSize(); m_CommonBuffer = m_DmaChannel->SystemAddress(); m_Capture = Capture; // delay of 10 millisec