IAudioClient/IAudioRenderClient may become invalid after Stop() and must be recreated. |
||||||||
Issue descriptionThis issue manifests as device changes leading to audio renderer playback errors. Essentially the IAudioClient/IAudioRendererClient interfaces may be invalidated even when they're not in use. Today we won't discover this until the next Start() call which leads to an unrecoverable error. The recommended workaround by Microsoft is to continue caching the clients, but recreate them if we detect an error during Start(). This combined with the fix for issue 751780 will resolve both errors being signaled during tear down as well as errors occurring when the new device is used.
,
Jan 19 2018
Dale can you link to the MS article about this issue and the recommended workaround?
,
Jan 19 2018
https://msdn.microsoft.com/en-us/library/windows/desktop/dd316605(v=vs.85).aspx Discussion is in private thread, but the MSDN article clearly indicates this is something that can happen and should be handled. My patch is not a full fix, but handles the majority case (device change). To fully handle this we need every IAudioClient/IAudioRenderClient method to passthrough the invalid error code and have a retry mechanism of some sort available to every call. Probably it's simpler to add implicit retry to all streams, i.e. if a AOS stream dies for any reason, try to replace it with a fresh one and continue.
,
Jan 22 2018
Thanks.
,
Jan 22 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/c297aad42b62f7f443868da28b21ded199e93996 commit c297aad42b62f7f443868da28b21ded199e93996 Author: Dale Curtis <dalecurtis@chromium.org> Date: Mon Jan 22 20:50:25 2018 Attempt recovery of WASAPI audio output driver during Start(). Per Microsoft, IAudioClient/IAudioRenderClient may be invalidated at any time; even when we're not using them. If this occurs after a Stop() event, we won't find out until the next Start() and will subsequently fail (triggering an unrecoverable playback error; we only have fallback for Open() failures). Instead if we detect that either client has an error during Start(), we will now re-attempt Open() and subsequently retry creation of the clients. If this still fails, we'll then continue down the old path of signaling an unrecoverable playback error. BUG= 803691 TEST=switching audio devices does recovers IAudioClient. Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel Change-Id: I54f0377a483bcd4dca91e8cb82fe4e46366731fa Reviewed-on: https://chromium-review.googlesource.com/875306 Commit-Queue: Dale Curtis <dalecurtis@chromium.org> Reviewed-by: Tommi <tommi@chromium.org> Cr-Commit-Position: refs/heads/master@{#530983} [modify] https://crrev.com/c297aad42b62f7f443868da28b21ded199e93996/media/audio/win/audio_low_latency_output_win.cc [modify] https://crrev.com/c297aad42b62f7f443868da28b21ded199e93996/media/audio/win/core_audio_util_win.cc
,
Jan 29 2018
,
Jan 30 2018
I'm still waiting to hear back from Microsoft, but early UMA results show a promising reduction in playbacks that end in AUDIO_RENDERER_ERROR. +strobe from YT as an FYI. https://uma.googleplex.com/p/chrome/timeline_v2/?sid=5540c8242d62a2a9b34052f273af5f47
,
Jan 31 2018
Microsoft confirms this fixed the issue. Given the positive pressure on metrics, I'm going to mark this for merge to M65.
,
Feb 1 2018
Your change meets the bar and is auto-approved for M65. Please go ahead and merge the CL to branch 3325 manually. Please contact milestone owner if you have questions. Owners: cmasso@(Android), cmasso@(iOS), bhthompson@(ChromeOS), govind@(Desktop) For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Feb 1 2018
Pls merge your change to M65 branch 3325 ASAP so we can pick it up for next M65 dev release. Thank you.
,
Feb 1 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/2abd12ca8236b4b9accfbaba284b7af470229c83 commit 2abd12ca8236b4b9accfbaba284b7af470229c83 Author: Dale Curtis <dalecurtis@chromium.org> Date: Thu Feb 01 20:07:33 2018 Merge M65: "Attempt recovery of WASAPI audio output driver during Start()." Per Microsoft, IAudioClient/IAudioRenderClient may be invalidated at any time; even when we're not using them. If this occurs after a Stop() event, we won't find out until the next Start() and will subsequently fail (triggering an unrecoverable playback error; we only have fallback for Open() failures). Instead if we detect that either client has an error during Start(), we will now re-attempt Open() and subsequently retry creation of the clients. If this still fails, we'll then continue down the old path of signaling an unrecoverable playback error. BUG= 803691 TEST=switching audio devices does recovers IAudioClient. TBR=dalecurtis@chromium.org (cherry picked from commit c297aad42b62f7f443868da28b21ded199e93996) Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel Change-Id: I54f0377a483bcd4dca91e8cb82fe4e46366731fa Reviewed-on: https://chromium-review.googlesource.com/875306 Commit-Queue: Dale Curtis <dalecurtis@chromium.org> Reviewed-by: Tommi <tommi@chromium.org> Cr-Original-Commit-Position: refs/heads/master@{#530983} Reviewed-on: https://chromium-review.googlesource.com/897964 Reviewed-by: Dale Curtis <dalecurtis@chromium.org> Cr-Commit-Position: refs/branch-heads/3325@{#243} Cr-Branched-From: bc084a8b5afa3744a74927344e304c02ae54189f-refs/heads/master@{#530369} [modify] https://crrev.com/2abd12ca8236b4b9accfbaba284b7af470229c83/media/audio/win/audio_low_latency_output_win.cc [modify] https://crrev.com/2abd12ca8236b4b9accfbaba284b7af470229c83/media/audio/win/core_audio_util_win.cc
,
Feb 1 2018
|
||||||||
►
Sign in to add a comment |
||||||||
Comment 1 by olka@chromium.org
, Jan 19 2018