thanks a lot for the background. I think I understand now and can figure
out a solution how to avoid the stop of the stream.
Even a glitch in my case is OK. My main reason is to prevent the APP
from stopping and throwing an error and not resuming at all.
Here's a bit of background on how the system works.
When a media class device is removed, or interfaces/connections are
removed, the AudioEndpointBuilder service will detect the change and
change the state of the associated audio endpoints to
DEVICE_STATE_NOTPRESENT. AudioEndpointBuilder will also publish new
system default endpoints as needed whenever endpoints come and go.
Applications can receive these notifications through
When playback is already in progress and an audio endpoint is removed,
the audio service will detect the condition and WASAPI based
applications will start receiving AUDCLNT_E_DEVICE_INVALIDATED errors.
WASAPI applications are expected to register for endpoint
notifications and detect and handle these errors, and recover audio.
High level audio API's, like MF and AudioGraph, do handle these
conditions, and automatically move the audio to a new audio endpoint
So, to answer your question, the driver has no way to pause audio in
this situation. Typical applications will automatically move to a new
audio endpoint and resume playback if the interfaces/connections are
If the reconfiguration can be done without affecting the published
interfaces, then audio could be stalled or dropped during the
Dropping audio will work, it will result in an audio glitch and a
period of missing audio. Whether or not it's detectible to users would
depend on the length of the glitch and how often it happens. Regular
glitching of any length would be easily detectable by users. A single
10 or 20 millisecond glitch at the beginning of playback isn't detectable.
Stalling audio can be problematic for A/V synchronization.
Microsoft Windows Audio
Sent from Outlook <http://aka.ms/weboutlook>
<wdmaudiodev-bounce@xxxxxxxxxxxxx> on behalf of K. Weller
*Sent:* Monday, September 28, 2020 6:18 AM
*To:* wdmaudiodev@xxxxxxxxxxxxx <wdmaudiodev@xxxxxxxxxxxxx>
*Subject:* [EXTERNAL] [wdmaudiodev] Keep a stream running while
my driver will unregister ( UnregisterPhysicalConnection &&
IUnregisterSubdevice ) and re-install the subedevice and register
(PcRegisterPhysicalConnection) the connection during runtime. So the
miniport driver will be reconfigured.
It can happen that there is a playback stream at the same time, which
should resume again after the port is re-configured and re-registered.
Is there a way how I can “fake” that the driver is still there and pause
the stream somehow for example, during my re-configuration?
I’m thinking about hooking into the IRP_MJ_DEVICE_CONTROL for example
IOCTL_KS_PROPERTY or IOCTL_KS_WRITE_STREAM etc.
But I’m not sure if this is the why how to do it.
Post message: mailto:wdmaudiodev@xxxxxxxxxxxxx
URL to WDMAUDIODEV page: