You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When testing SYSVAD by sending audio to Speaker in WASAPI exclusive mode, the generated file is not correct (noise is added).
If analyzing the method used in minwavertstream.cpp, we see no way to get something working.
When sending audio to SYSVAD Speaker in exclusive mode, the function CMiniportWaveRTStream::AllocateBufferWithNotification is called
REM: it makes no sense to test if the buffer size is multiple of NotificationCount_ (2) while the buffer is expected to be multiple of m_pWfExt->Format.nBlockAlign if ((NotificationCount_ == 0) || (RequestedSize_ % NotificationCount_ != 0))
buffer size must be converted in sample before...
Anyway, the method is expected to be simple: AllocateBufferWithNotification is called to allocate a buffer multiple of 2 (NotificationCount_ ) in order to be able to manage the entire DMA Buffer in 2 equal size buffers to make a simple double buffering process: while one process is reading a buffer, the other process is writing in the second buffer...
However this method is not implemented correctly.
First because the buffer timing is wrong per definition m_ulNotificationIntervalMs introduces a jitter of 0.99 ms in the buffer duration
In this render exclusive mode the function TimerNotifyRT is called every ms to check if a notification must be sent, that we could call the “buffer swap”. But the condition is wrong by design: if (TimeElapsedInMS < _this->m_ulNotificationIntervalMs)
the first buffer is surely not finished at this time, because missing up to 0.99 ms… it means there is no chance to be sure that the HALF DMABuffer is processed at this time.
Secondly because the timer does not survey any position regarding the DMABuffer management: nor m_ullPlayPosition (managed by UpdatePosition()), nor m_ulCurrentWritePosition (set by SetCurrentWritePosition by the system I guess).
So, how this example of code could work? Did anyone test this mode successfully yet ?
The text was updated successfully, but these errors were encountered:
When testing SYSVAD by sending audio to Speaker in WASAPI exclusive mode, the generated file is not correct (noise is added).
If analyzing the method used in minwavertstream.cpp, we see no way to get something working.
When sending audio to SYSVAD Speaker in exclusive mode, the function
CMiniportWaveRTStream::AllocateBufferWithNotification
is calledREM: it makes no sense to test if the buffer size is multiple of NotificationCount_ (2) while the buffer is expected to be multiple of m_pWfExt->Format.nBlockAlign
if ((NotificationCount_ == 0) || (RequestedSize_ % NotificationCount_ != 0))
buffer size must be converted in sample before...
Anyway, the method is expected to be simple: AllocateBufferWithNotification is called to allocate a buffer multiple of 2 (NotificationCount_ ) in order to be able to manage the entire DMA Buffer in 2 equal size buffers to make a simple double buffering process: while one process is reading a buffer, the other process is writing in the second buffer...
However this method is not implemented correctly.
First because the buffer timing is wrong per definition m_ulNotificationIntervalMs introduces a jitter of 0.99 ms in the buffer duration
In this render exclusive mode the function TimerNotifyRT is called every ms to check if a notification must be sent, that we could call the “buffer swap”. But the condition is wrong by design:
if (TimeElapsedInMS < _this->m_ulNotificationIntervalMs)
the first buffer is surely not finished at this time, because missing up to 0.99 ms… it means there is no chance to be sure that the HALF DMABuffer is processed at this time.
Secondly because the timer does not survey any position regarding the DMABuffer management: nor m_ullPlayPosition (managed by UpdatePosition()), nor m_ulCurrentWritePosition (set by SetCurrentWritePosition by the system I guess).
So, how this example of code could work? Did anyone test this mode successfully yet ?
The text was updated successfully, but these errors were encountered: