DecodedAudioReady: Reconfigure sink on channel count change [chromium/src : main]

0 views
Skip to first unread message

Dale Curtis (Gerrit)

unread,
Jul 28, 2025, 2:18:58 PMJul 28
to Michael Chan, AyeAye, Ying Zheng, Diego Valenzuela, Thomas Guilbert, Yule Wu, Dean Wheatley, feature-me...@chromium.org
Attention needed from Diego Valenzuela, Michael Chan, Thomas Guilbert and Ying Zheng

Dale Curtis added 5 comments

File media/audio/audio_manager_base.cc
Line 420, Patchset 1 (Latest): // Do not override input parameters if we are allowing sink reconfiguration based on
Dale Curtis . unresolved

You'd still only want to do this inside the IsValid() check below since this data comes from an untrusted process. You likely also only want to do this for `params.latency_tag() == AudioLatency::Type::kPlayback` otherwise this will effect things like WebRTC/WebAudio/etc.

The switch is fine for now, however does Android automotive have a custom build that can override the ContentRendererClient?
https://source.chromium.org/chromium/chromium/src/+/main:content/public/renderer/content_renderer_client.h;l=99;drc=10439bb6ee979d32a29e66937e2e5e2cb15d6bcf

If so we'd want to move this behavior there so it's embedder controlled instead of done via base::Feature flag (which is intended to be short lived).

File media/base/media_switches.h
Line 414, Patchset 1 (Latest):MEDIA_EXPORT BASE_DECLARE_FEATURE(kSourceChannelCountChangedSinkReconfigure);
Dale Curtis . unresolved

How about `kMatchSourceAudioChannelLayout`?

File media/renderers/audio_renderer_impl.cc
Line 429, Patchset 1 (Latest): sink_->Start();
Dale Curtis . unresolved

This needs to handle the case that `StopRendering_Locked()` occurs while device info is being requested.

Line 972, Patchset 1 (Latest): DLOG(INFO) << __func__ << "() reconfiguring sink for channel count:" << buffer->channel_count();
Dale Curtis . unresolved

Possibly you need a new state:
`ChangeState_Locked(kReinitializingSink)`

That way you can handle the case where other calls occurs while the async portion of this method is going on.

Line 982, Patchset 1 (Latest): }
Dale Curtis . unresolved

Note: Since you fall through here, the current buffer is likely converted to the original parameters and dropped on the floor before it gets a chance to play out.

It's probably better to just explicitly return here if that's the case (or reset the algorithm now and let it be appended into the new queue).

Open in Gerrit

Related details

Attention is currently required from:
  • Diego Valenzuela
  • Michael Chan
  • Thomas Guilbert
  • Ying Zheng
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I897e3e9b4565bdf25f9ac06fb0f3d3dedb721398
Gerrit-Change-Number: 6785873
Gerrit-PatchSet: 1
Gerrit-Owner: Michael Chan <mzc...@dolby.com>
Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
Gerrit-Reviewer: Diego Valenzuela <dvale...@google.com>
Gerrit-Reviewer: Thomas Guilbert <tgui...@chromium.org>
Gerrit-Reviewer: Ying Zheng <yiz...@google.com>
Gerrit-CC: Dean Wheatley <dw...@dolby.com>
Gerrit-CC: Yule Wu <y...@dolby.com>
Gerrit-Attention: Michael Chan <mzc...@dolby.com>
Gerrit-Attention: Thomas Guilbert <tgui...@chromium.org>
Gerrit-Attention: Ying Zheng <yiz...@google.com>
Gerrit-Attention: Diego Valenzuela <dvale...@google.com>
Gerrit-Comment-Date: Mon, 28 Jul 2025 18:18:51 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Michael Chan (Gerrit)

unread,
Aug 1, 2025, 4:15:08 AMAug 1
to AyeAye, Dale Curtis, Ying Zheng, Diego Valenzuela, Thomas Guilbert, Yule Wu, Dean Wheatley, feature-me...@chromium.org
Attention needed from Dale Curtis, Diego Valenzuela, Thomas Guilbert and Ying Zheng

Michael Chan added 6 comments

Patchset-level comments
File-level comment, Patchset 1 (Latest):
Michael Chan . resolved

Hi Dale,

I've addressed all your comments and pushed up my changes here:

https://chromium-review.googlesource.com/c/chromium/src/+/6811046

Unfortunately, after I added a Change-Id to the commit message, it resulted in a new Gerrit review so I will abandon this one and we can hop onto the new one.

Regards,
Michael

File media/audio/audio_manager_base.cc
Line 420, Patchset 1 (Latest): // Do not override input parameters if we are allowing sink reconfiguration based on
Dale Curtis . resolved

You'd still only want to do this inside the IsValid() check below since this data comes from an untrusted process. You likely also only want to do this for `params.latency_tag() == AudioLatency::Type::kPlayback` otherwise this will effect things like WebRTC/WebAudio/etc.

The switch is fine for now, however does Android automotive have a custom build that can override the ContentRendererClient?
https://source.chromium.org/chromium/chromium/src/+/main:content/public/renderer/content_renderer_client.h;l=99;drc=10439bb6ee979d32a29e66937e2e5e2cb15d6bcf

If so we'd want to move this behavior there so it's embedder controlled instead of done via base::Feature flag (which is intended to be short lived).

Michael Chan

Acknowledged

File media/base/media_switches.h
Line 414, Patchset 1 (Latest):MEDIA_EXPORT BASE_DECLARE_FEATURE(kSourceChannelCountChangedSinkReconfigure);
Dale Curtis . resolved

How about `kMatchSourceAudioChannelLayout`?

Michael Chan

Acknowledged

File media/renderers/audio_renderer_impl.cc
Dale Curtis . resolved

This needs to handle the case that `StopRendering_Locked()` occurs while device info is being requested.

Michael Chan

Acknowledged

Line 972, Patchset 1 (Latest): DLOG(INFO) << __func__ << "() reconfiguring sink for channel count:" << buffer->channel_count();
Dale Curtis . resolved

Possibly you need a new state:
`ChangeState_Locked(kReinitializingSink)`

That way you can handle the case where other calls occurs while the async portion of this method is going on.

Michael Chan

Acknowledged

Dale Curtis . resolved

Note: Since you fall through here, the current buffer is likely converted to the original parameters and dropped on the floor before it gets a chance to play out.

It's probably better to just explicitly return here if that's the case (or reset the algorithm now and let it be appended into the new queue).

Michael Chan

Acknowledged

Open in Gerrit

Related details

Attention is currently required from:
  • Dale Curtis
  • Diego Valenzuela
  • Thomas Guilbert
  • Ying Zheng
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I897e3e9b4565bdf25f9ac06fb0f3d3dedb721398
Gerrit-Change-Number: 6785873
Gerrit-PatchSet: 1
Gerrit-Owner: Michael Chan <mzc...@dolby.com>
Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
Gerrit-Reviewer: Diego Valenzuela <dvale...@google.com>
Gerrit-Reviewer: Thomas Guilbert <tgui...@chromium.org>
Gerrit-Reviewer: Ying Zheng <yiz...@google.com>
Gerrit-CC: Dean Wheatley <dw...@dolby.com>
Gerrit-CC: Yule Wu <y...@dolby.com>
Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
Gerrit-Attention: Thomas Guilbert <tgui...@chromium.org>
Gerrit-Attention: Ying Zheng <yiz...@google.com>
Gerrit-Attention: Diego Valenzuela <dvale...@google.com>
Gerrit-Comment-Date: Fri, 01 Aug 2025 08:14:40 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Dale Curtis <dalec...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Michael Chan (Gerrit)

unread,
Aug 1, 2025, 4:17:20 AMAug 1
to AyeAye, Dale Curtis, Ying Zheng, Diego Valenzuela, Thomas Guilbert, Yule Wu, Dean Wheatley, feature-me...@chromium.org

Michael Chan abandoned this change

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: abandon
satisfied_requirement
unsatisfied_requirement
open
diffy

Dale Curtis (Gerrit)

unread,
Aug 1, 2025, 4:12:58 PMAug 1
to Michael Chan, Maya Jelonkiewicz, AyeAye, Thomas Guilbert, Ying Zheng, Diego Valenzuela, Dean Wheatley, Yule Wu, feature-me...@chromium.org
Attention needed from Diego Valenzuela, Maya Jelonkiewicz, Michael Chan, Thomas Guilbert and Ying Zheng

Dale Curtis added 13 comments

File media/audio/android/aaudio_stream_wrapper.cc
Line 206, Patchset 1 (Latest): // For multichannel PCM playback, do not use power saving
Dale Curtis . unresolved

Interesting. Is it the case that we aren't opening true multi-channel streams without this flag even on normal Android devices?

For now at least, can we instead do something like `if !on_battery_power` or just always avoid power saving if ANDROID_AUTOMOTIVE? We wouldn't want this kicking in on normal devices until we understand it a bit more.

@mj...@google.com

File media/audio/audio_manager_base.cc
Line 425, Patchset 1 (Latest): // Do not override input parameters if we allow reconfiguring sink based on
Dale Curtis . unresolved

I don't think we need this here, the client can just open the request with whatever params they want.

Line 429, Patchset 1 (Latest): output_params = params;
Dale Curtis . unresolved

I think you only want to change the channel layout/count right? If you also want to use the source sample rate ARI needs some different changes.

File media/base/media_switches.cc
Line 1222, Patchset 1 (Latest): "kMatchSourceAudioChannelLayout",
Dale Curtis . unresolved

No k prefix in the string name

File media/renderers/audio_renderer_impl.cc
Line 433, Patchset 1 (Latest): (void)output_device_info; // Unused.
Dale Curtis . unresolved

Just put `/* output_device_info */` in the method declaration.

Line 434, Patchset 1 (Latest): base::AutoLock auto_lock(lock_);
Dale Curtis . unresolved

Don't hold the lock while calling into the sink_ since it may be reentrant. You'll want to changeState first, then start the sink.

Line 839, Patchset 1 (Latest): if (state_ == kPlaying || state_ == kReinitializingSink) {
Dale Curtis . unresolved

Shouldn't this be checking Uninit/Init/Reinit?

Line 1109, Patchset 1 (Latest): } else if (state_ == kPlaying || state_ == kReinitializingSink ) {
Dale Curtis . unresolved

Run `git cl format` to ensure formatting is correct. There shouldn't be a space after the conditional.

Line 1171, Patchset 1 (Latest): return !AttemptResumePlayback_Locked(should_render_end_of_stream);
Dale Curtis . unresolved

Why change this? It seems like just adding `kReinitializingSink` here would be okay.

Line 1318, Patchset 1 (Latest): if (state_ != kPlaying && state_ != kReinitializingSink) {
Dale Curtis . unresolved

This shouldn't occur if you call sink->Stop() before calling ChangeState_Locked() when you receive the buffer with a new channel count. We can instead add a `DCHECK_NE(state_, kReinitializingSink);` at the top of this method.

Line 1417, Patchset 1 (Latest): } else if ((state_ == kPlaying || state_ == kReinitializingSink) &&
Dale Curtis . unresolved

Ditto.

Line 1427, Patchset 1 (Latest): (state_ == kPlaying || state_ == kReinitializingSink) &&
Dale Curtis . unresolved

Ditto.

Line 1491, Patchset 1 (Latest): case kReinitializingSink:
Dale Curtis . unresolved

I think this needs to go with kPlaying below since you could get this error during this time.

Open in Gerrit

Related details

Attention is currently required from:
  • Diego Valenzuela
  • Maya Jelonkiewicz
  • Michael Chan
  • Thomas Guilbert
  • Ying Zheng
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I24aaa5d8e962f5e1218d71ce063c7e7ec18b3a53
    Gerrit-Change-Number: 6811046
    Gerrit-PatchSet: 1
    Gerrit-Owner: Michael Chan <mzc...@dolby.com>
    Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
    Gerrit-Reviewer: Diego Valenzuela <dvale...@google.com>
    Gerrit-Reviewer: Thomas Guilbert <tgui...@chromium.org>
    Gerrit-Reviewer: Ying Zheng <yiz...@google.com>
    Gerrit-CC: Dean Wheatley <dw...@dolby.com>
    Gerrit-CC: Maya Jelonkiewicz <mj...@google.com>
    Gerrit-CC: Yule Wu <y...@dolby.com>
    Gerrit-Attention: Michael Chan <mzc...@dolby.com>
    Gerrit-Attention: Thomas Guilbert <tgui...@chromium.org>
    Gerrit-Attention: Maya Jelonkiewicz <mj...@google.com>
    Gerrit-Attention: Ying Zheng <yiz...@google.com>
    Gerrit-Attention: Diego Valenzuela <dvale...@google.com>
    Gerrit-Comment-Date: Fri, 01 Aug 2025 20:12:49 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Maya Jelonkiewicz (Gerrit)

    unread,
    Aug 4, 2025, 7:48:40 AMAug 4
    to Michael Chan, AyeAye, Dale Curtis, Thomas Guilbert, Ying Zheng, Diego Valenzuela, Dean Wheatley, Yule Wu, feature-me...@chromium.org
    Attention needed from Diego Valenzuela, Michael Chan, Thomas Guilbert and Ying Zheng

    Maya Jelonkiewicz added 2 comments

    File media/audio/android/aaudio_stream_wrapper.cc
    Line 206, Patchset 1 (Latest): // For multichannel PCM playback, do not use power saving
    Dale Curtis . unresolved

    Interesting. Is it the case that we aren't opening true multi-channel streams without this flag even on normal Android devices?

    For now at least, can we instead do something like `if !on_battery_power` or just always avoid power saving if ANDROID_AUTOMOTIVE? We wouldn't want this kicking in on normal devices until we understand it a bit more.

    @mj...@google.com

    Maya Jelonkiewicz

    `AAUDIO_PERFORMANCE_MODE_POWER_SAVING` is loosely defined. Maybe it is possible for it alone to cause internal downmixing, though I'd find that unexpected. I'm curious what the automotive folks have observed here.

    File media/base/media_switches.h
    Line 413, Patchset 1 (Latest):MEDIA_EXPORT BASE_DECLARE_FEATURE(kMatchSourceAudioChannelLayout);
    Maya Jelonkiewicz . unresolved

    @dalec...@chromium.org Do we have a preference between adding features to `media_switches.*` vs `audio_features.*`?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Diego Valenzuela
    Gerrit-Attention: Ying Zheng <yiz...@google.com>
    Gerrit-Attention: Diego Valenzuela <dvale...@google.com>
    Gerrit-Comment-Date: Mon, 04 Aug 2025 11:48:24 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Dale Curtis <dalec...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Dean Wheatley (Gerrit)

    unread,
    Aug 4, 2025, 9:45:54 AMAug 4
    to Michael Chan, Maya Jelonkiewicz, AyeAye, Dale Curtis, Thomas Guilbert, Ying Zheng, Diego Valenzuela, Yule Wu, feature-me...@chromium.org
    Attention needed from Diego Valenzuela, Michael Chan, Thomas Guilbert and Ying Zheng

    Dean Wheatley added 1 comment

    File media/audio/android/aaudio_stream_wrapper.cc
    Line 206, Patchset 1 (Latest): // For multichannel PCM playback, do not use power saving
    Dale Curtis . unresolved

    Interesting. Is it the case that we aren't opening true multi-channel streams without this flag even on normal Android devices?

    For now at least, can we instead do something like `if !on_battery_power` or just always avoid power saving if ANDROID_AUTOMOTIVE? We wouldn't want this kicking in on normal devices until we understand it a bit more.

    @mj...@google.com

    Maya Jelonkiewicz

    `AAUDIO_PERFORMANCE_MODE_POWER_SAVING` is loosely defined. Maybe it is possible for it alone to cause internal downmixing, though I'd find that unexpected. I'm curious what the automotive folks have observed here.

    Dean Wheatley

    See https://issuetracker.google.com/issues/395919023 for the problem (power saving mode && multi-channel direct output && Android Automotive dynamic audio policy are not mutually compatible) introduced in Android 15 (https://android.googlesource.com/platform/frameworks/av/+/806170e2a6532a42b34230fe7208cabee2aa5caa) and carried over to Android 16. Prior to Android 15, power saving (deep buffer) and direct output were permitted.

    Many Android Automotive (and other) devices support multi-channel PCM output (without channel fidelity loss) to audio HAL via direct outputs only. To avoid the possible restriction in these AOSP audio framework versions, we avoid the power saving mode.

    Not sure how many of these quirks you want to bake in.

    Gerrit-Comment-Date: Mon, 04 Aug 2025 13:45:28 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Dale Curtis <dalec...@chromium.org>
    Comment-In-Reply-To: Maya Jelonkiewicz <mj...@google.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Michael Chan (Gerrit)

    unread,
    Aug 4, 2025, 5:14:14 PMAug 4
    to Maya Jelonkiewicz, AyeAye, Dale Curtis, Thomas Guilbert, Ying Zheng, Diego Valenzuela, Dean Wheatley, Yule Wu, feature-me...@chromium.org
    Attention needed from Dale Curtis, Dean Wheatley, Diego Valenzuela, Maya Jelonkiewicz, Thomas Guilbert and Ying Zheng

    Michael Chan added 13 comments

    File media/audio/android/aaudio_stream_wrapper.cc
    Line 206, Patchset 1 (Latest): // For multichannel PCM playback, do not use power saving
    Dale Curtis . unresolved

    Interesting. Is it the case that we aren't opening true multi-channel streams without this flag even on normal Android devices?

    For now at least, can we instead do something like `if !on_battery_power` or just always avoid power saving if ANDROID_AUTOMOTIVE? We wouldn't want this kicking in on normal devices until we understand it a bit more.

    @mj...@google.com

    Michael Chan

    Yes, on an AAOS15 emulator, I observe that a stereo non-direct mixer output is opened instead of a direct multichannel output.

    I'll add in a guard on whether we are running on an automotive device to avoid power saving mode for now.

    File media/audio/audio_manager_base.cc
    Line 425, Patchset 1 (Latest): // Do not override input parameters if we allow reconfiguring sink based on
    Dale Curtis . resolved

    I don't think we need this here, the client can just open the request with whatever params they want.

    Michael Chan

    Acknowledged

    Line 429, Patchset 1 (Latest): output_params = params;
    Dale Curtis . unresolved

    I think you only want to change the channel layout/count right? If you also want to use the source sample rate ARI needs some different changes.

    Michael Chan

    Yes, I only want to change the channel layout/count here. I'll update accordingly.

    File media/base/media_switches.cc
    Line 1222, Patchset 1 (Latest): "kMatchSourceAudioChannelLayout",
    Dale Curtis . resolved

    No k prefix in the string name

    Michael Chan

    Acknowledged

    File media/renderers/audio_renderer_impl.cc
    Line 433, Patchset 1 (Latest): (void)output_device_info; // Unused.
    Dale Curtis . resolved

    Just put `/* output_device_info */` in the method declaration.

    Michael Chan

    Acknowledged

    Line 434, Patchset 1 (Latest): base::AutoLock auto_lock(lock_);
    Dale Curtis . resolved

    Don't hold the lock while calling into the sink_ since it may be reentrant. You'll want to changeState first, then start the sink.

    Michael Chan

    Acknowledged

    Line 839, Patchset 1 (Latest): if (state_ == kPlaying || state_ == kReinitializingSink) {
    Dale Curtis . unresolved

    Shouldn't this be checking Uninit/Init/Reinit?

    Michael Chan

    This looks incorrect, I will revert.

    Line 1109, Patchset 1 (Latest): } else if (state_ == kPlaying || state_ == kReinitializingSink ) {
    Dale Curtis . resolved

    Run `git cl format` to ensure formatting is correct. There shouldn't be a space after the conditional.

    Michael Chan

    Acknowledged

    Line 1171, Patchset 1 (Latest): return !AttemptResumePlayback_Locked(should_render_end_of_stream);
    Dale Curtis . unresolved

    Why change this? It seems like just adding `kReinitializingSink` here would be okay.

    Michael Chan

    I am reusing these lines in OnSourceChannelCountChanged() so I refactored this code into the new function AttemptResumePlayback_Locked() to avoid duplicating it. I'm okay to revert this here to minimize changes.

    Line 1318, Patchset 1 (Latest): if (state_ != kPlaying && state_ != kReinitializingSink) {
    Dale Curtis . resolved

    This shouldn't occur if you call sink->Stop() before calling ChangeState_Locked() when you receive the buffer with a new channel count. We can instead add a `DCHECK_NE(state_, kReinitializingSink);` at the top of this method.

    Michael Chan

    Acknowledged

    Line 1417, Patchset 1 (Latest): } else if ((state_ == kPlaying || state_ == kReinitializingSink) &&
    Dale Curtis . resolved

    Ditto.

    Michael Chan

    Acknowledged

    Line 1427, Patchset 1 (Latest): (state_ == kPlaying || state_ == kReinitializingSink) &&
    Dale Curtis . resolved

    Ditto.

    Michael Chan

    Acknowledged

    Line 1491, Patchset 1 (Latest): case kReinitializingSink:
    Dale Curtis . resolved

    I think this needs to go with kPlaying below since you could get this error during this time.

    Michael Chan

    Acknowledged

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Dale Curtis
    • Dean Wheatley
    • Diego Valenzuela
    • Maya Jelonkiewicz
    • Thomas Guilbert
    • Ying Zheng
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I24aaa5d8e962f5e1218d71ce063c7e7ec18b3a53
    Gerrit-Change-Number: 6811046
    Gerrit-PatchSet: 1
    Gerrit-Owner: Michael Chan <mzc...@dolby.com>
    Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
    Gerrit-Reviewer: Diego Valenzuela <dvale...@google.com>
    Gerrit-Reviewer: Thomas Guilbert <tgui...@chromium.org>
    Gerrit-Reviewer: Ying Zheng <yiz...@google.com>
    Gerrit-CC: Dean Wheatley <dw...@dolby.com>
    Gerrit-CC: Maya Jelonkiewicz <mj...@google.com>
    Gerrit-CC: Yule Wu <y...@dolby.com>
    Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
    Gerrit-Attention: Thomas Guilbert <tgui...@chromium.org>
    Gerrit-Attention: Maya Jelonkiewicz <mj...@google.com>
    Gerrit-Attention: Dean Wheatley <dw...@dolby.com>
    Gerrit-Attention: Ying Zheng <yiz...@google.com>
    Gerrit-Attention: Diego Valenzuela <dvale...@google.com>
    Gerrit-Comment-Date: Mon, 04 Aug 2025 21:13:42 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Dale Curtis (Gerrit)

    unread,
    Aug 5, 2025, 4:27:52 PMAug 5
    to Michael Chan, Maya Jelonkiewicz, AyeAye, Thomas Guilbert, Ying Zheng, Diego Valenzuela, Dean Wheatley, Yule Wu, feature-me...@chromium.org
    Attention needed from Dean Wheatley, Diego Valenzuela, Maya Jelonkiewicz, Michael Chan, Thomas Guilbert and Ying Zheng

    Dale Curtis added 8 comments

    File media/audio/android/aaudio_stream_wrapper.cc
    Line 211, Patchset 2 (Latest): if (params_.channels() > 2 && manager->IsAutomotive()) {
    Dale Curtis . unresolved

    No need to get this from AudioManager, you can get it from `base::android::BuildInfo::GetInstance()->is_automotive()`

    File media/audio/audio_manager_base.cc
    Line 429, Patchset 1: output_params = params;
    Dale Curtis . resolved

    I think you only want to change the channel layout/count right? If you also want to use the source sample rate ARI needs some different changes.

    Michael Chan

    Yes, I only want to change the channel layout/count here. I'll update accordingly.

    Dale Curtis

    Done

    File media/renderers/audio_renderer_impl.cc
    Line 446, Patchset 2 (Latest): {
    Dale Curtis . unresolved

    This part should be happening automatically as buffers come in I think.

    Line 839, Patchset 1: if (state_ == kPlaying || state_ == kReinitializingSink) {
    Dale Curtis . resolved

    Shouldn't this be checking Uninit/Init/Reinit?

    Michael Chan

    This looks incorrect, I will revert.

    Dale Curtis

    Done

    Line 997, Patchset 2 (Latest): sink_->Stop();
    Dale Curtis . unresolved

    Don't call into `sink_` while holding `lock_`. Call this before ChangeState

    Line 1005, Patchset 2 (Latest): // new channel count and layout parameters.
    Dale Curtis . unresolved

    Add a note here that this drops all in progress audio and will cause glitches, but is deemed acceptable for this use case.

    Line 1016, Patchset 2 (Latest): // Asynchronously reconfigure the sink with the new parameters.
    Dale Curtis . unresolved

    Again, don't call into `sink_` while holding the lock.

    Line 1171, Patchset 1: return !AttemptResumePlayback_Locked(should_render_end_of_stream);
    Dale Curtis . unresolved

    Why change this? It seems like just adding `kReinitializingSink` here would be okay.

    Michael Chan

    I am reusing these lines in OnSourceChannelCountChanged() so I refactored this code into the new function AttemptResumePlayback_Locked() to avoid duplicating it. I'm okay to revert this here to minimize changes.

    Dale Curtis

    I don't see why the code needs to be duplicated? Isn't it enough to just add kReinitializingSink to the kPlaying case?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Dean Wheatley
    • Diego Valenzuela
    • Maya Jelonkiewicz
    • Michael Chan
    • Thomas Guilbert
    • Ying Zheng
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I24aaa5d8e962f5e1218d71ce063c7e7ec18b3a53
    Gerrit-Change-Number: 6811046
    Gerrit-PatchSet: 2
    Gerrit-Owner: Michael Chan <mzc...@dolby.com>
    Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
    Gerrit-Reviewer: Diego Valenzuela <dvale...@google.com>
    Gerrit-Reviewer: Thomas Guilbert <tgui...@chromium.org>
    Gerrit-Reviewer: Ying Zheng <yiz...@google.com>
    Gerrit-CC: Dean Wheatley <dw...@dolby.com>
    Gerrit-CC: Maya Jelonkiewicz <mj...@google.com>
    Gerrit-CC: Yule Wu <y...@dolby.com>
    Gerrit-Attention: Michael Chan <mzc...@dolby.com>
    Gerrit-Attention: Thomas Guilbert <tgui...@chromium.org>
    Gerrit-Attention: Maya Jelonkiewicz <mj...@google.com>
    Gerrit-Attention: Dean Wheatley <dw...@dolby.com>
    Gerrit-Attention: Ying Zheng <yiz...@google.com>
    Gerrit-Attention: Diego Valenzuela <dvale...@google.com>
    Gerrit-Comment-Date: Tue, 05 Aug 2025 20:27:43 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Dale Curtis <dalec...@chromium.org>
    Comment-In-Reply-To: Michael Chan <mzc...@dolby.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Michael Chan (Gerrit)

    unread,
    Aug 5, 2025, 8:51:02 PMAug 5
    to Maya Jelonkiewicz, AyeAye, Dale Curtis, Thomas Guilbert, Ying Zheng, Diego Valenzuela, Dean Wheatley, Yule Wu, feature-me...@chromium.org
    Attention needed from Dale Curtis, Dean Wheatley, Diego Valenzuela, Maya Jelonkiewicz, Thomas Guilbert and Ying Zheng

    Michael Chan added 6 comments

    File media/audio/android/aaudio_stream_wrapper.cc
    Line 211, Patchset 2 (Latest): if (params_.channels() > 2 && manager->IsAutomotive()) {
    Dale Curtis . resolved

    No need to get this from AudioManager, you can get it from `base::android::BuildInfo::GetInstance()->is_automotive()`

    Michael Chan

    Acknowledged

    File media/renderers/audio_renderer_impl.cc
    Dale Curtis . unresolved

    This part should be happening automatically as buffers come in I think.

    Michael Chan

    Without this, what I observe is that after my initial playback completes to the end and I wait approximately 60 seconds before pressing play again, the progress bar stays at 0:00 after pressing play and playback doesn't proceed.

    Dale Curtis . resolved

    Don't call into `sink_` while holding `lock_`. Call this before ChangeState

    Michael Chan

    Acknowledged

    Line 1005, Patchset 2 (Latest): // new channel count and layout parameters.
    Dale Curtis . resolved

    Add a note here that this drops all in progress audio and will cause glitches, but is deemed acceptable for this use case.

    Michael Chan

    Acknowledged

    Line 1016, Patchset 2 (Latest): // Asynchronously reconfigure the sink with the new parameters.
    Dale Curtis . resolved

    Again, don't call into `sink_` while holding the lock.

    Michael Chan

    Acknowledged

    Line 1171, Patchset 1: return !AttemptResumePlayback_Locked(should_render_end_of_stream);
    Dale Curtis . unresolved

    Why change this? It seems like just adding `kReinitializingSink` here would be okay.

    Michael Chan

    I am reusing these lines in OnSourceChannelCountChanged() so I refactored this code into the new function AttemptResumePlayback_Locked() to avoid duplicating it. I'm okay to revert this here to minimize changes.

    Dale Curtis

    I don't see why the code needs to be duplicated? Isn't it enough to just add kReinitializingSink to the kPlaying case?

    Michael Chan

    Please see above comment about issue starting playback.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Dale Curtis
    • Dean Wheatley
    • Diego Valenzuela
    • Maya Jelonkiewicz
    • Thomas Guilbert
    • Ying Zheng
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I24aaa5d8e962f5e1218d71ce063c7e7ec18b3a53
    Gerrit-Change-Number: 6811046
    Gerrit-PatchSet: 2
    Gerrit-Owner: Michael Chan <mzc...@dolby.com>
    Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
    Gerrit-Reviewer: Diego Valenzuela <dvale...@google.com>
    Gerrit-Reviewer: Thomas Guilbert <tgui...@chromium.org>
    Gerrit-Reviewer: Ying Zheng <yiz...@google.com>
    Gerrit-CC: Dean Wheatley <dw...@dolby.com>
    Gerrit-CC: Maya Jelonkiewicz <mj...@google.com>
    Gerrit-CC: Yule Wu <y...@dolby.com>
    Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
    Gerrit-Attention: Thomas Guilbert <tgui...@chromium.org>
    Gerrit-Attention: Maya Jelonkiewicz <mj...@google.com>
    Gerrit-Attention: Dean Wheatley <dw...@dolby.com>
    Gerrit-Attention: Ying Zheng <yiz...@google.com>
    Gerrit-Attention: Diego Valenzuela <dvale...@google.com>
    Gerrit-Comment-Date: Wed, 06 Aug 2025 00:50:34 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Dale Curtis (Gerrit)

    unread,
    Aug 6, 2025, 1:44:03 PMAug 6
    to Michael Chan, Maya Jelonkiewicz, AyeAye, Thomas Guilbert, Ying Zheng, Diego Valenzuela, Dean Wheatley, Yule Wu, feature-me...@chromium.org
    Attention needed from Dean Wheatley, Diego Valenzuela, Maya Jelonkiewicz, Michael Chan, Thomas Guilbert and Ying Zheng

    Dale Curtis added 1 comment

    File media/renderers/audio_renderer_impl.cc
    Dale Curtis . unresolved

    This part should be happening automatically as buffers come in I think.

    Michael Chan

    Without this, what I observe is that after my initial playback completes to the end and I wait approximately 60 seconds before pressing play again, the progress bar stays at 0:00 after pressing play and playback doesn't proceed.

    Dale Curtis

    Hmm, is end of stream not rendering correctly? You might need to reset `first_packet_timestamp_` to point to the first packet played on the new sink. I.e., the one given at the time you call Stop() and reinitialize the sink.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Dean Wheatley
    • Diego Valenzuela
    • Maya Jelonkiewicz
    • Michael Chan
    • Thomas Guilbert
    • Ying Zheng
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I24aaa5d8e962f5e1218d71ce063c7e7ec18b3a53
    Gerrit-Change-Number: 6811046
    Gerrit-PatchSet: 3
    Gerrit-Owner: Michael Chan <mzc...@dolby.com>
    Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
    Gerrit-Reviewer: Diego Valenzuela <dvale...@google.com>
    Gerrit-Reviewer: Thomas Guilbert <tgui...@chromium.org>
    Gerrit-Reviewer: Ying Zheng <yiz...@google.com>
    Gerrit-CC: Dean Wheatley <dw...@dolby.com>
    Gerrit-CC: Maya Jelonkiewicz <mj...@google.com>
    Gerrit-CC: Yule Wu <y...@dolby.com>
    Gerrit-Attention: Michael Chan <mzc...@dolby.com>
    Gerrit-Attention: Thomas Guilbert <tgui...@chromium.org>
    Gerrit-Attention: Maya Jelonkiewicz <mj...@google.com>
    Gerrit-Attention: Dean Wheatley <dw...@dolby.com>
    Gerrit-Attention: Ying Zheng <yiz...@google.com>
    Gerrit-Attention: Diego Valenzuela <dvale...@google.com>
    Gerrit-Comment-Date: Wed, 06 Aug 2025 17:43:54 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Michael Chan (Gerrit)

    unread,
    Aug 6, 2025, 6:29:43 PMAug 6
    to Maya Jelonkiewicz, AyeAye, Dale Curtis, Thomas Guilbert, Ying Zheng, Diego Valenzuela, Dean Wheatley, Yule Wu, feature-me...@chromium.org
    Attention needed from Dale Curtis, Dean Wheatley, Diego Valenzuela, Maya Jelonkiewicz, Thomas Guilbert and Ying Zheng

    Michael Chan added 1 comment

    File media/renderers/audio_renderer_impl.cc
    Dale Curtis . unresolved

    This part should be happening automatically as buffers come in I think.

    Michael Chan

    Without this, what I observe is that after my initial playback completes to the end and I wait approximately 60 seconds before pressing play again, the progress bar stays at 0:00 after pressing play and playback doesn't proceed.

    Dale Curtis

    Hmm, is end of stream not rendering correctly? You might need to reset `first_packet_timestamp_` to point to the first packet played on the new sink. I.e., the one given at the time you call Stop() and reinitialize the sink.

    Michael Chan

    I tried your suggestion but the behavior is the same.

    Below shows the last couple of logs from AttemptResumePlayback_Locked(), up to the end of playback:

        08-07 08:08:46.092  3387  3475 I chromium: [INFO:media/renderers/audio_renderer_impl.cc:417] AttemptResumePlayback_Locked mzchan: buffering_state=1 received_end_of_stream=0 should_render_end_of_stream=0 algorithm_->IsQueueAdequateForPlayback()=1
    08-07 08:08:46.136 3387 3475 I chromium: [INFO:media/renderers/audio_renderer_impl.cc:417] AttemptResumePlayback_Locked mzchan: buffering_state=1 received_end_of_stream=0 should_render_end_of_stream=0 algorithm_->IsQueueAdequateForPlayback()=1
    08-07 08:08:46.181 3387 3475 I chromium: [INFO:media/renderers/audio_renderer_impl.cc:417] AttemptResumePlayback_Locked mzchan: buffering_state=1 received_end_of_stream=0 should_render_end_of_stream=0 algorithm_->IsQueueAdequateForPlayback()=0
    08-07 08:08:46.181 3387 3475 I chromium: [INFO:media/renderers/audio_renderer_impl.cc:417] AttemptResumePlayback_Locked mzchan: buffering_state=1 received_end_of_stream=0 should_render_end_of_stream=0 algorithm_->IsQueueAdequateForPlayback()=1
    08-07 08:08:46.224 3387 3475 I chromium: [INFO:media/renderers/audio_renderer_impl.cc:417] AttemptResumePlayback_Locked mzchan: buffering_state=1 received_end_of_stream=1 should_render_end_of_stream=0 algorithm_->IsQueueAdequateForPlayback()=0


    However, when I attempt to play again after waiting 60 seconds, I do not get any more of these logs.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Dale Curtis
    • Dean Wheatley
    • Diego Valenzuela
    • Maya Jelonkiewicz
    • Thomas Guilbert
    • Ying Zheng
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I24aaa5d8e962f5e1218d71ce063c7e7ec18b3a53
    Gerrit-Change-Number: 6811046
    Gerrit-PatchSet: 3
    Gerrit-Owner: Michael Chan <mzc...@dolby.com>
    Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
    Gerrit-Reviewer: Diego Valenzuela <dvale...@google.com>
    Gerrit-Reviewer: Thomas Guilbert <tgui...@chromium.org>
    Gerrit-Reviewer: Ying Zheng <yiz...@google.com>
    Gerrit-CC: Dean Wheatley <dw...@dolby.com>
    Gerrit-CC: Maya Jelonkiewicz <mj...@google.com>
    Gerrit-CC: Yule Wu <y...@dolby.com>
    Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
    Gerrit-Attention: Thomas Guilbert <tgui...@chromium.org>
    Gerrit-Attention: Maya Jelonkiewicz <mj...@google.com>
    Gerrit-Attention: Dean Wheatley <dw...@dolby.com>
    Gerrit-Attention: Ying Zheng <yiz...@google.com>
    Gerrit-Attention: Diego Valenzuela <dvale...@google.com>
    Gerrit-Comment-Date: Wed, 06 Aug 2025 22:29:15 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Dale Curtis (Gerrit)

    unread,
    Aug 6, 2025, 7:15:57 PMAug 6
    to Michael Chan, Maya Jelonkiewicz, AyeAye, Thomas Guilbert, Ying Zheng, Diego Valenzuela, Dean Wheatley, Yule Wu, feature-me...@chromium.org
    Attention needed from Dean Wheatley, Diego Valenzuela, Maya Jelonkiewicz, Michael Chan, Thomas Guilbert and Ying Zheng

    Dale Curtis added 1 comment

    File media/renderers/audio_renderer_impl.cc
    Dale Curtis . unresolved

    This part should be happening automatically as buffers come in I think.

    Michael Chan

    Without this, what I observe is that after my initial playback completes to the end and I wait approximately 60 seconds before pressing play again, the progress bar stays at 0:00 after pressing play and playback doesn't proceed.

    Dale Curtis

    Hmm, is end of stream not rendering correctly? You might need to reset `first_packet_timestamp_` to point to the first packet played on the new sink. I.e., the one given at the time you call Stop() and reinitialize the sink.

    Michael Chan

    I tried your suggestion but the behavior is the same.

    Below shows the last couple of logs from AttemptResumePlayback_Locked(), up to the end of playback:

        08-07 08:08:46.092  3387  3475 I chromium: [INFO:media/renderers/audio_renderer_impl.cc:417] AttemptResumePlayback_Locked mzchan: buffering_state=1 received_end_of_stream=0 should_render_end_of_stream=0 algorithm_->IsQueueAdequateForPlayback()=1
    08-07 08:08:46.136 3387 3475 I chromium: [INFO:media/renderers/audio_renderer_impl.cc:417] AttemptResumePlayback_Locked mzchan: buffering_state=1 received_end_of_stream=0 should_render_end_of_stream=0 algorithm_->IsQueueAdequateForPlayback()=1
    08-07 08:08:46.181 3387 3475 I chromium: [INFO:media/renderers/audio_renderer_impl.cc:417] AttemptResumePlayback_Locked mzchan: buffering_state=1 received_end_of_stream=0 should_render_end_of_stream=0 algorithm_->IsQueueAdequateForPlayback()=0
    08-07 08:08:46.181 3387 3475 I chromium: [INFO:media/renderers/audio_renderer_impl.cc:417] AttemptResumePlayback_Locked mzchan: buffering_state=1 received_end_of_stream=0 should_render_end_of_stream=0 algorithm_->IsQueueAdequateForPlayback()=1
    08-07 08:08:46.224 3387 3475 I chromium: [INFO:media/renderers/audio_renderer_impl.cc:417] AttemptResumePlayback_Locked mzchan: buffering_state=1 received_end_of_stream=1 should_render_end_of_stream=0 algorithm_->IsQueueAdequateForPlayback()=0


    However, when I attempt to play again after waiting 60 seconds, I do not get any more of these logs.

    Dale Curtis

    Ended should be rendered here https://source.chromium.org/chromium/chromium/src/+/main:media/renderers/audio_renderer_impl.cc;l=1407;drc=4af27b5b2abb0db430e4d326c26a74a6c34dcfa8 so I'd guess that's not happening for some reason.

    Try also resetting the audio clock after stopping the sinkl.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Dean Wheatley
    • Diego Valenzuela
    • Maya Jelonkiewicz
    • Michael Chan
    • Thomas Guilbert
    • Ying Zheng
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I24aaa5d8e962f5e1218d71ce063c7e7ec18b3a53
    Gerrit-Change-Number: 6811046
    Gerrit-PatchSet: 3
    Gerrit-Owner: Michael Chan <mzc...@dolby.com>
    Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
    Gerrit-Reviewer: Diego Valenzuela <dvale...@google.com>
    Gerrit-Reviewer: Thomas Guilbert <tgui...@chromium.org>
    Gerrit-Reviewer: Ying Zheng <yiz...@google.com>
    Gerrit-CC: Dean Wheatley <dw...@dolby.com>
    Gerrit-CC: Maya Jelonkiewicz <mj...@google.com>
    Gerrit-CC: Yule Wu <y...@dolby.com>
    Gerrit-Attention: Michael Chan <mzc...@dolby.com>
    Gerrit-Attention: Thomas Guilbert <tgui...@chromium.org>
    Gerrit-Attention: Maya Jelonkiewicz <mj...@google.com>
    Gerrit-Attention: Dean Wheatley <dw...@dolby.com>
    Gerrit-Attention: Ying Zheng <yiz...@google.com>
    Gerrit-Attention: Diego Valenzuela <dvale...@google.com>
    Gerrit-Comment-Date: Wed, 06 Aug 2025 23:15:48 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Michael Chan (Gerrit)

    unread,
    Aug 6, 2025, 8:09:50 PMAug 6
    to Maya Jelonkiewicz, AyeAye, Dale Curtis, Thomas Guilbert, Ying Zheng, Diego Valenzuela, Dean Wheatley, Yule Wu, feature-me...@chromium.org
    Attention needed from Dale Curtis, Dean Wheatley, Diego Valenzuela, Maya Jelonkiewicz, Thomas Guilbert and Ying Zheng

    Michael Chan added 1 comment

    File media/renderers/audio_renderer_impl.cc
    Dale Curtis . unresolved

    This part should be happening automatically as buffers come in I think.

    Michael Chan

    Without this, what I observe is that after my initial playback completes to the end and I wait approximately 60 seconds before pressing play again, the progress bar stays at 0:00 after pressing play and playback doesn't proceed.

    Dale Curtis

    Hmm, is end of stream not rendering correctly? You might need to reset `first_packet_timestamp_` to point to the first packet played on the new sink. I.e., the one given at the time you call Stop() and reinitialize the sink.

    Michael Chan

    I tried your suggestion but the behavior is the same.

    Below shows the last couple of logs from AttemptResumePlayback_Locked(), up to the end of playback:

        08-07 08:08:46.092  3387  3475 I chromium: [INFO:media/renderers/audio_renderer_impl.cc:417] AttemptResumePlayback_Locked mzchan: buffering_state=1 received_end_of_stream=0 should_render_end_of_stream=0 algorithm_->IsQueueAdequateForPlayback()=1
    08-07 08:08:46.136 3387 3475 I chromium: [INFO:media/renderers/audio_renderer_impl.cc:417] AttemptResumePlayback_Locked mzchan: buffering_state=1 received_end_of_stream=0 should_render_end_of_stream=0 algorithm_->IsQueueAdequateForPlayback()=1
    08-07 08:08:46.181 3387 3475 I chromium: [INFO:media/renderers/audio_renderer_impl.cc:417] AttemptResumePlayback_Locked mzchan: buffering_state=1 received_end_of_stream=0 should_render_end_of_stream=0 algorithm_->IsQueueAdequateForPlayback()=0
    08-07 08:08:46.181 3387 3475 I chromium: [INFO:media/renderers/audio_renderer_impl.cc:417] AttemptResumePlayback_Locked mzchan: buffering_state=1 received_end_of_stream=0 should_render_end_of_stream=0 algorithm_->IsQueueAdequateForPlayback()=1
    08-07 08:08:46.224 3387 3475 I chromium: [INFO:media/renderers/audio_renderer_impl.cc:417] AttemptResumePlayback_Locked mzchan: buffering_state=1 received_end_of_stream=1 should_render_end_of_stream=0 algorithm_->IsQueueAdequateForPlayback()=0


    However, when I attempt to play again after waiting 60 seconds, I do not get any more of these logs.

    Dale Curtis

    Ended should be rendered here https://source.chromium.org/chromium/chromium/src/+/main:media/renderers/audio_renderer_impl.cc;l=1407;drc=4af27b5b2abb0db430e4d326c26a74a6c34dcfa8 so I'd guess that's not happening for some reason.

    Try also resetting the audio clock after stopping the sinkl.

    Michael Chan

    I just tried out resetting the audio clock. In any case, it looks like that does happen and we are invoking OnPlaybackEnded(). Still the problem persists:

        08-07 09:57:18.446 11816 11947 I chromium: [INFO:media/renderers/audio_renderer_impl.cc:1489] Render() mzchan: audio_clock_->front_timestamp(): 31.9192 s, ended_timestamp_: 31.968 s, rendered_end_of_stream_: 0
    08-07 09:57:18.490 11816 11947 I chromium: [INFO:media/renderers/audio_renderer_impl.cc:1489] Render() mzchan: audio_clock_->front_timestamp(): 31.9632 s, ended_timestamp_: 31.968 s, rendered_end_of_stream_: 0
    08-07 09:57:18.534 11816 11947 I chromium: [INFO:media/renderers/audio_renderer_impl.cc:1489] Render() mzchan: audio_clock_->front_timestamp(): 31.9709 s, ended_timestamp_: 31.968 s, rendered_end_of_stream_: 0
    08-07 09:57:18.534 11816 11947 I chromium: [INFO:media/renderers/audio_renderer_impl.cc:1497] Render() mzchan: calling OnPlaybackEnded() with front_timestamp: 31.9709 s, ended_timestamp_: 31.968 s
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Dale Curtis
    • Dean Wheatley
    • Diego Valenzuela
    • Maya Jelonkiewicz
    • Thomas Guilbert
    • Ying Zheng
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I24aaa5d8e962f5e1218d71ce063c7e7ec18b3a53
    Gerrit-Change-Number: 6811046
    Gerrit-PatchSet: 3
    Gerrit-Owner: Michael Chan <mzc...@dolby.com>
    Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
    Gerrit-Reviewer: Diego Valenzuela <dvale...@google.com>
    Gerrit-Reviewer: Thomas Guilbert <tgui...@chromium.org>
    Gerrit-Reviewer: Ying Zheng <yiz...@google.com>
    Gerrit-CC: Dean Wheatley <dw...@dolby.com>
    Gerrit-CC: Maya Jelonkiewicz <mj...@google.com>
    Gerrit-CC: Yule Wu <y...@dolby.com>
    Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
    Gerrit-Attention: Thomas Guilbert <tgui...@chromium.org>
    Gerrit-Attention: Maya Jelonkiewicz <mj...@google.com>
    Gerrit-Attention: Dean Wheatley <dw...@dolby.com>
    Gerrit-Attention: Ying Zheng <yiz...@google.com>
    Gerrit-Attention: Diego Valenzuela <dvale...@google.com>
    Gerrit-Comment-Date: Thu, 07 Aug 2025 00:09:28 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Dale Curtis (Gerrit)

    unread,
    Aug 7, 2025, 1:23:52 PMAug 7
    to Michael Chan, Maya Jelonkiewicz, AyeAye, Thomas Guilbert, Ying Zheng, Diego Valenzuela, Dean Wheatley, Yule Wu, feature-me...@chromium.org
    Attention needed from Dean Wheatley, Diego Valenzuela, Maya Jelonkiewicz, Michael Chan, Thomas Guilbert and Ying Zheng

    Dale Curtis added 1 comment

    File media/renderers/audio_renderer_impl.cc
    Dale Curtis

    Hmmm, is something setting BUFFERING_HAVE_NOTHING? The code you have uploaded resets to BUFFERING_HAVE_ENOUGH, which seems to be the only difference with your approach if OnPlaybackEnded is being called.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Dean Wheatley
    • Diego Valenzuela
    • Maya Jelonkiewicz
    • Michael Chan
    • Thomas Guilbert
    • Ying Zheng
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I24aaa5d8e962f5e1218d71ce063c7e7ec18b3a53
    Gerrit-Change-Number: 6811046
    Gerrit-PatchSet: 3
    Gerrit-Owner: Michael Chan <mzc...@dolby.com>
    Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
    Gerrit-Reviewer: Diego Valenzuela <dvale...@google.com>
    Gerrit-Reviewer: Thomas Guilbert <tgui...@chromium.org>
    Gerrit-Reviewer: Ying Zheng <yiz...@google.com>
    Gerrit-CC: Dean Wheatley <dw...@dolby.com>
    Gerrit-CC: Maya Jelonkiewicz <mj...@google.com>
    Gerrit-CC: Yule Wu <y...@dolby.com>
    Gerrit-Attention: Michael Chan <mzc...@dolby.com>
    Gerrit-Attention: Thomas Guilbert <tgui...@chromium.org>
    Gerrit-Attention: Maya Jelonkiewicz <mj...@google.com>
    Gerrit-Attention: Dean Wheatley <dw...@dolby.com>
    Gerrit-Attention: Ying Zheng <yiz...@google.com>
    Gerrit-Attention: Diego Valenzuela <dvale...@google.com>
    Gerrit-Comment-Date: Thu, 07 Aug 2025 17:23:40 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Michael Chan (Gerrit)

    unread,
    Aug 10, 2025, 7:54:07 PMAug 10
    to Maya Jelonkiewicz, AyeAye, Dale Curtis, Thomas Guilbert, Ying Zheng, Diego Valenzuela, Dean Wheatley, Yule Wu, feature-me...@chromium.org
    Attention needed from Dale Curtis, Dean Wheatley, Diego Valenzuela, Maya Jelonkiewicz, Thomas Guilbert and Ying Zheng

    Michael Chan added 1 comment

    File media/renderers/audio_renderer_impl.cc
    Michael Chan

    What I am observing is that AudioRendererImpl itself is getting destructed after approximately 15 seconds of inactivity. On attempting playback, a new AudioRenderImpl is created and therefore initializes buffering_state_ to BUFFERING_HAVE_NOTHING:

        08-11 09:46:37.235 32742 32757 I chromium: [INFO:media/renderers/audio_renderer_impl.cc:82] AudioRendererImpl() mzchan: Constructed
    08-11 09:46:37.307 32742 32766 I chromium: [INFO:media/renderers/audio_renderer_impl.cc:458] OnSourceChannelCountChanged() mzchan: received_end_of_stream_=0 algorithm_->IsQueueAdequateForPlayback()=1 buffering_state_=0 first_packet_timestamp_ == kNoTimestamp:0 sink_playing_=0
    08-11 09:46:37.307 32742 32766 I chromium: [INFO:media/renderers/audio_renderer_impl.cc:466] OnSourceChannelCountChanged() mzchan: Resuming playback, setting buffering state to BUFFERING_HAVE_ENOUGH
    08-11 09:46:37.307 32742 32766 V chromium: [VERBOSE1:media/renderers/audio_renderer_impl.cc:1604] SetBufferingState_Locked : 0 -> 1
    08-11 09:46:52.218 32742 32766 I chromium: [INFO:media/renderers/audio_renderer_impl.cc:118] ~AudioRendererImpl() mzchan: Destructed
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Dale Curtis
    • Dean Wheatley
    • Diego Valenzuela
    • Maya Jelonkiewicz
    • Thomas Guilbert
    • Ying Zheng
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I24aaa5d8e962f5e1218d71ce063c7e7ec18b3a53
    Gerrit-Change-Number: 6811046
    Gerrit-PatchSet: 3
    Gerrit-Owner: Michael Chan <mzc...@dolby.com>
    Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
    Gerrit-Reviewer: Diego Valenzuela <dvale...@google.com>
    Gerrit-Reviewer: Thomas Guilbert <tgui...@chromium.org>
    Gerrit-Reviewer: Ying Zheng <yiz...@google.com>
    Gerrit-CC: Dean Wheatley <dw...@dolby.com>
    Gerrit-CC: Maya Jelonkiewicz <mj...@google.com>
    Gerrit-CC: Yule Wu <y...@dolby.com>
    Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
    Gerrit-Attention: Thomas Guilbert <tgui...@chromium.org>
    Gerrit-Attention: Maya Jelonkiewicz <mj...@google.com>
    Gerrit-Attention: Dean Wheatley <dw...@dolby.com>
    Gerrit-Attention: Ying Zheng <yiz...@google.com>
    Gerrit-Attention: Diego Valenzuela <dvale...@google.com>
    Gerrit-Comment-Date: Sun, 10 Aug 2025 23:53:41 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Dale Curtis (Gerrit)

    unread,
    Aug 11, 2025, 1:33:41 PMAug 11
    to Michael Chan, Maya Jelonkiewicz, AyeAye, Thomas Guilbert, Ying Zheng, Diego Valenzuela, Dean Wheatley, Yule Wu, feature-me...@chromium.org
    Attention needed from Dean Wheatley, Diego Valenzuela, Maya Jelonkiewicz, Michael Chan, Thomas Guilbert and Ying Zheng

    Dale Curtis added 1 comment

    File media/renderers/audio_renderer_impl.cc
    Dale Curtis

    Hmm, that's strange. It sounds like the first playback is completing okay, but when you restart with the old params the new audio renderer isn't working.

    So PlaybackEnded() is being called, we're setting HAVE_ENOUGH for ended correctly, and the pipeline is correctly suspending after inactivity. The sink is reused, but seems to be in a bad state.

    Destruction of the renderer should stop the sink though: https://source.chromium.org/chromium/chromium/src/+/main:media/renderers/audio_renderer_impl.cc;l=108;drc=4af27b5b2abb0db430e4d326c26a74a6c34dcfa8

    When the new renderer is created, does it complete GetOutputDeviceInfoAsync() correctly? Is it just that no new Render() calls come in when the new sink starts? Can you provide the full chrome://media-internals log? If you can't use chrome://media-internals dev tools media panel should have the log as well.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Dean Wheatley
    • Diego Valenzuela
    • Maya Jelonkiewicz
    • Michael Chan
    • Thomas Guilbert
    • Ying Zheng
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I24aaa5d8e962f5e1218d71ce063c7e7ec18b3a53
    Gerrit-Change-Number: 6811046
    Gerrit-PatchSet: 3
    Gerrit-Owner: Michael Chan <mzc...@dolby.com>
    Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
    Gerrit-Reviewer: Diego Valenzuela <dvale...@google.com>
    Gerrit-Reviewer: Thomas Guilbert <tgui...@chromium.org>
    Gerrit-Reviewer: Ying Zheng <yiz...@google.com>
    Gerrit-CC: Dean Wheatley <dw...@dolby.com>
    Gerrit-CC: Maya Jelonkiewicz <mj...@google.com>
    Gerrit-CC: Yule Wu <y...@dolby.com>
    Gerrit-Attention: Michael Chan <mzc...@dolby.com>
    Gerrit-Attention: Thomas Guilbert <tgui...@chromium.org>
    Gerrit-Attention: Maya Jelonkiewicz <mj...@google.com>
    Gerrit-Attention: Dean Wheatley <dw...@dolby.com>
    Gerrit-Attention: Ying Zheng <yiz...@google.com>
    Gerrit-Attention: Diego Valenzuela <dvale...@google.com>
    Gerrit-Comment-Date: Mon, 11 Aug 2025 17:33:31 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Michael Chan (Gerrit)

    unread,
    Aug 12, 2025, 9:53:48 PMAug 12
    to Sandeep Vijayasekar, Simeon Anfinrud, Maya Jelonkiewicz, AyeAye, Dale Curtis, Thomas Guilbert, Ying Zheng, Diego Valenzuela, Dean Wheatley, Yule Wu, feature-me...@chromium.org
    Attention needed from Dale Curtis, Dean Wheatley, Diego Valenzuela, Maya Jelonkiewicz and Thomas Guilbert

    Michael Chan added 1 comment

    File media/renderers/audio_renderer_impl.cc
    Michael Chan

    To answer your previous questions:

    • GetOutputDeviceInfoAsync() completed correctly as I see both OnDeviceInfoReceived() and OnSourceChannelCountChanged() logs.
    • No Render() calls were observed when the new sink starts.
    • I'll email you the media-internals.txt file.

    Here's some additional observations:

    • Sometimes, I observe ~AudioRendererImpl() getting called 4 minutes after the AudioRendererImpl() constructor is invoked.
    • Playback not starting issue occurs even on first attempt to play back, and also before ~AudioRendererImpl() gets called. Waiting ~30 seconds is sufficient. Please see the log below.
    • In this case, I'm not seeing any DecodedAudioReady() nor Render() calls coming through on pressing play after waiting ~30 seconds after the AudioRendererImpl() constructor is invoked.

    08-13 10:26:05.063 2990 3011 I chromium: [INFO:media/renderers/audio_renderer_impl.cc:81] AudioRendererImpl() mzchan: constructor state_:0 sink_:0x77f573745a58
    08-13 10:26:05.990 2990 3317 I chromium: [INFO:media/renderers/audio_renderer_impl.cc:393] Initialize() mzchan: sink_:0x77f573745a58 null_sink_:0 state_:0
    08-13 10:26:06.007 2990 3317 V chromium: [VERBOSE1:media/renderers/audio_renderer_impl.cc:462] OnDeviceInfoReceived
    08-13 10:26:06.007 2990 3317 V chromium: [VERBOSE1:media/renderers/audio_renderer_impl.cc:495] OnDeviceInfoReceived: format: PCM_LOW_LATENCY, channel_layout: 3, channels: 2, sample_rate: 48000, frames_per_buffer: 2116, effects: NONE, mic_positions: , hw_capabilities: min_frames_per_buffer: 0, max_frames_per_buffer: 0, bitstream_formats:0, require_encapsulation:0, require_audio_offload:0
    08-13 10:26:06.007 2990 3317 V chromium: [VERBOSE1:media/renderers/audio_renderer_impl.cc:675] OnDeviceInfoReceived: is_passthrough_=0 codec=eac3 stream->audio_decoder_config().sample_format=2
    08-13 10:26:06.071 2990 3317 V chromium: [VERBOSE1:media/renderers/audio_renderer_impl.cc:942] DecodedAudioReady(0)
    08-13 10:26:06.071 2990 3317 V chromium: [VERBOSE1:media/renderers/audio_renderer_impl.cc:1013] DecodedAudioReady Reconfiguring sink for channel count from 6 to 8
    08-13 10:26:06.071 2990 3317 V chromium: [VERBOSE1:media/renderers/audio_renderer_impl.cc:942] DecodedAudioReady(0)
    08-13 10:26:06.074 2990 3317 V chromium: [VERBOSE1:media/renderers/audio_renderer_impl.cc:942] DecodedAudioReady(0)
    08-13 10:26:06.078 2990 3317 V chromium: [VERBOSE1:media/renderers/audio_renderer_impl.cc:942] DecodedAudioReady(0)
    08-13 10:26:06.078 2990 3317 V chromium: [VERBOSE1:media/renderers/audio_renderer_impl.cc:942] DecodedAudioReady(0)
    08-13 10:26:06.082 2990 3317 V chromium: [VERBOSE1:media/renderers/audio_renderer_impl.cc:942] DecodedAudioReady(0)
    08-13 10:26:06.089 2990 3317 V chromium: [VERBOSE1:media/renderers/audio_renderer_impl.cc:942] DecodedAudioReady(0)
    08-13 10:26:06.105 2990 3317 V chromium: [VERBOSE1:media/renderers/audio_renderer_impl.cc:446] OnSourceChannelCountChanged() Reconfiguring sink for channel count:8
        <Play pressed approximately 30 seconds after above log; No further DecodedAudioReady() logs>
        08-13 10:30:05.883  2990  3317 I chromium: [INFO:media/renderers/audio_renderer_impl.cc:106] ~AudioRendererImpl() mzchan: destructor sink_:0x77f573745a58 null_sink_:0x77f573747f10 state_:5
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Dale Curtis
    • Dean Wheatley
    • Diego Valenzuela
    • Maya Jelonkiewicz
    • Thomas Guilbert
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I24aaa5d8e962f5e1218d71ce063c7e7ec18b3a53
    Gerrit-Change-Number: 6811046
    Gerrit-PatchSet: 3
    Gerrit-Owner: Michael Chan <mzc...@dolby.com>
    Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
    Gerrit-Reviewer: Diego Valenzuela <dvale...@google.com>
    Gerrit-Reviewer: Thomas Guilbert <tgui...@chromium.org>
    Gerrit-Reviewer: Ying Zheng <yiz...@google.com>
    Gerrit-CC: Dean Wheatley <dw...@dolby.com>
    Gerrit-CC: Maya Jelonkiewicz <mj...@google.com>
    Gerrit-CC: Sandeep Vijayasekar <sa...@chromium.org>
    Gerrit-CC: Simeon Anfinrud <san...@chromium.org>
    Gerrit-CC: Yule Wu <y...@dolby.com>
    Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
    Gerrit-Attention: Thomas Guilbert <tgui...@chromium.org>
    Gerrit-Attention: Maya Jelonkiewicz <mj...@google.com>
    Gerrit-Attention: Dean Wheatley <dw...@dolby.com>
    Gerrit-Attention: Diego Valenzuela <dvale...@google.com>
    Gerrit-Comment-Date: Wed, 13 Aug 2025 01:53:19 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Dale Curtis (Gerrit)

    unread,
    Aug 13, 2025, 12:50:07 PMAug 13
    to Michael Chan, Sandeep Vijayasekar, Simeon Anfinrud, Maya Jelonkiewicz, AyeAye, Thomas Guilbert, Ying Zheng, Diego Valenzuela, Dean Wheatley, Yule Wu, feature-me...@chromium.org
    Attention needed from Dean Wheatley, Diego Valenzuela, Maya Jelonkiewicz, Michael Chan and Thomas Guilbert

    Dale Curtis added 2 comments

    File media/renderers/audio_renderer_impl.cc
    Dale Curtis

    The ~AudioRendererImpl should just be the pipeline getting suspended on idle timeout or other behaviors (backgrounding a paused player, frame frozen, etc) that are normal, but could also happen if an error is occurring. All this should be in the media-internals log though (suspended, closed for error, etc).

    If no Render() calls are coming in, it's not unexpected to see no more DecodedAudioReady() calls, since we're not exhausting the buffer and it probably filled up.

    My next guess would be RendererImpl has called StopTicking() due to receiving a HAVE_NOTHING at some point (possibly from the VideoRendererImpl as time skips). Can you add logging to RendererImpl to see when buffering states are changing and when it's calling StopTicking/StartTicking().

    Possibly your version of the patch is the one we want with one small modification: deliver a HAVE_NOTHING to the renderer while we go through the output device change (this may be happening automatically and explain a lot of this behavior). This would stop the video renderer and prevent any confusion on timings.

    Can you e-mail a link to the sample stream which changes channel counts like this? I can test it locally early next week if we can't figure this out via the review.

    Line 1171, Patchset 1: return !AttemptResumePlayback_Locked(should_render_end_of_stream);
    Dale Curtis . unresolved

    Why change this? It seems like just adding `kReinitializingSink` here would be okay.

    Michael Chan

    I am reusing these lines in OnSourceChannelCountChanged() so I refactored this code into the new function AttemptResumePlayback_Locked() to avoid duplicating it. I'm okay to revert this here to minimize changes.

    Dale Curtis

    I don't see why the code needs to be duplicated? Isn't it enough to just add kReinitializingSink to the kPlaying case?

    Michael Chan

    Please see above comment about issue starting playback.

    Dale Curtis

    To be clear, the logs you've provided via e-mail are from adding `case kReinitializingSink` to `case kPlaying`? Was that a playback all the way to the end w/ the playback not restarting error you described? I don't see an ended status in the log (or even a HAVE_NOTHING) which is surprising in that case if so.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Dean Wheatley
    • Diego Valenzuela
    • Maya Jelonkiewicz
    • Michael Chan
    • Thomas Guilbert
    Gerrit-Attention: Michael Chan <mzc...@dolby.com>
    Gerrit-Attention: Thomas Guilbert <tgui...@chromium.org>
    Gerrit-Attention: Maya Jelonkiewicz <mj...@google.com>
    Gerrit-Attention: Dean Wheatley <dw...@dolby.com>
    Gerrit-Attention: Diego Valenzuela <dvale...@google.com>
    Gerrit-Comment-Date: Wed, 13 Aug 2025 16:49:55 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Michael Chan (Gerrit)

    unread,
    Aug 13, 2025, 5:08:21 PMAug 13
    to Sandeep Vijayasekar, Simeon Anfinrud, Maya Jelonkiewicz, AyeAye, Dale Curtis, Thomas Guilbert, Ying Zheng, Diego Valenzuela, Dean Wheatley, Yule Wu, feature-me...@chromium.org
    Attention needed from Dale Curtis, Dean Wheatley, Diego Valenzuela, Maya Jelonkiewicz and Thomas Guilbert

    Michael Chan added 1 comment

    File media/renderers/audio_renderer_impl.cc
    Line 1171, Patchset 1: return !AttemptResumePlayback_Locked(should_render_end_of_stream);
    Dale Curtis . unresolved

    Why change this? It seems like just adding `kReinitializingSink` here would be okay.

    Michael Chan

    I am reusing these lines in OnSourceChannelCountChanged() so I refactored this code into the new function AttemptResumePlayback_Locked() to avoid duplicating it. I'm okay to revert this here to minimize changes.

    Dale Curtis

    I don't see why the code needs to be duplicated? Isn't it enough to just add kReinitializingSink to the kPlaying case?

    Michael Chan

    Please see above comment about issue starting playback.

    Dale Curtis

    To be clear, the logs you've provided via e-mail are from adding `case kReinitializingSink` to `case kPlaying`? Was that a playback all the way to the end w/ the playback not restarting error you described? I don't see an ended status in the log (or even a HAVE_NOTHING) which is surprising in that case if so.

    Michael Chan

    The media-internals.txt file I've provided is based on the code in this CL with the exception of commenting out the AttemptResumePlayback_Locked() call in OnSourceChannelCountChanged().

    I've resent the media-internals.txt file via email with the initial observation of playback to the end and attempting playback again afterwards.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Dale Curtis
    • Dean Wheatley
    • Diego Valenzuela
    • Maya Jelonkiewicz
    • Thomas Guilbert
    Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
    Gerrit-Attention: Thomas Guilbert <tgui...@chromium.org>
    Gerrit-Attention: Maya Jelonkiewicz <mj...@google.com>
    Gerrit-Attention: Dean Wheatley <dw...@dolby.com>
    Gerrit-Attention: Diego Valenzuela <dvale...@google.com>
    Gerrit-Comment-Date: Wed, 13 Aug 2025 21:07:46 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Dale Curtis (Gerrit)

    unread,
    Aug 13, 2025, 6:26:49 PMAug 13
    to Michael Chan, Sandeep Vijayasekar, Simeon Anfinrud, Maya Jelonkiewicz, AyeAye, Thomas Guilbert, Ying Zheng, Diego Valenzuela, Dean Wheatley, Yule Wu, feature-me...@chromium.org
    Attention needed from Dean Wheatley, Diego Valenzuela, Maya Jelonkiewicz, Michael Chan and Thomas Guilbert

    Dale Curtis added 1 comment

    File media/renderers/audio_renderer_impl.cc
    Line 1171, Patchset 1: return !AttemptResumePlayback_Locked(should_render_end_of_stream);
    Dale Curtis . unresolved

    Why change this? It seems like just adding `kReinitializingSink` here would be okay.

    Michael Chan

    I am reusing these lines in OnSourceChannelCountChanged() so I refactored this code into the new function AttemptResumePlayback_Locked() to avoid duplicating it. I'm okay to revert this here to minimize changes.

    Dale Curtis

    I don't see why the code needs to be duplicated? Isn't it enough to just add kReinitializingSink to the kPlaying case?

    Michael Chan

    Please see above comment about issue starting playback.

    Dale Curtis

    To be clear, the logs you've provided via e-mail are from adding `case kReinitializingSink` to `case kPlaying`? Was that a playback all the way to the end w/ the playback not restarting error you described? I don't see an ended status in the log (or even a HAVE_NOTHING) which is surprising in that case if so.

    Michael Chan

    The media-internals.txt file I've provided is based on the code in this CL with the exception of commenting out the AttemptResumePlayback_Locked() call in OnSourceChannelCountChanged().

    I've resent the media-internals.txt file via email with the initial observation of playback to the end and attempting playback again afterwards.

    Dale Curtis

    Thanks, replied via e-mail.

    If you comment out that call in OnSourceChannelCountChanged() you do need to merge the kPlaying and kReinitializeSink states in this block. Otherwise we're never handling ended correctly.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Dean Wheatley
    • Diego Valenzuela
    • Maya Jelonkiewicz
    • Michael Chan
    • Thomas Guilbert
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      • requirement satisfiedRecitation-Check
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I24aaa5d8e962f5e1218d71ce063c7e7ec18b3a53
      Gerrit-Change-Number: 6811046
      Gerrit-PatchSet: 3
      Gerrit-Owner: Michael Chan <mzc...@dolby.com>
      Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
      Gerrit-Reviewer: Diego Valenzuela <dvale...@google.com>
      Gerrit-Reviewer: Thomas Guilbert <tgui...@chromium.org>
      Gerrit-Reviewer: Ying Zheng <yiz...@google.com>
      Gerrit-CC: Dean Wheatley <dw...@dolby.com>
      Gerrit-CC: Maya Jelonkiewicz <mj...@google.com>
      Gerrit-CC: Sandeep Vijayasekar <sa...@chromium.org>
      Gerrit-CC: Simeon Anfinrud <san...@chromium.org>
      Gerrit-CC: Yule Wu <y...@dolby.com>
      Gerrit-Attention: Michael Chan <mzc...@dolby.com>
      Gerrit-Attention: Thomas Guilbert <tgui...@chromium.org>
      Gerrit-Attention: Maya Jelonkiewicz <mj...@google.com>
      Gerrit-Attention: Dean Wheatley <dw...@dolby.com>
      Gerrit-Attention: Diego Valenzuela <dvale...@google.com>
      Gerrit-Comment-Date: Wed, 13 Aug 2025 22:26:39 +0000
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Michael Chan (Gerrit)

      unread,
      Aug 14, 2025, 5:50:52 AMAug 14
      to Sandeep Vijayasekar, Simeon Anfinrud, Maya Jelonkiewicz, AyeAye, Dale Curtis, Thomas Guilbert, Ying Zheng, Diego Valenzuela, Dean Wheatley, Yule Wu, feature-me...@chromium.org
      Attention needed from Dale Curtis, Dean Wheatley, Diego Valenzuela, Maya Jelonkiewicz and Thomas Guilbert

      Michael Chan added 1 comment

      File media/renderers/audio_renderer_impl.cc
      Michael Chan

      Please see logs which I obtained when playing back for the first time to the end, then attempting to play again afterwards but encountering the issue:

          08-14 19:07:02.181  8794  8815 I chromium: [INFO:media/renderers/audio_renderer_impl.cc:81] AudioRendererImpl() mzchan: constructor state_:0 sink_:0x7cb8ecb930d8
      08-14 19:07:02.187 8794 8870 I chromium: [INFO:media/renderers/audio_renderer_impl.cc:393] Initialize() mzchan: sink_:0x7cb8ecb930d8 null_sink_:0 state_:0
      08-14 19:07:02.230 8794 8870 V chromium: [VERBOSE1:media/renderers/audio_renderer_impl.cc:461] OnDeviceInfoReceived
      08-14 19:07:02.230 8794 8870 V chromium: [VERBOSE1:media/renderers/audio_renderer_impl.cc:494] OnDeviceInfoReceived: format: PCM_LOW_LATENCY, channel_layout: 3, channels: 2, sample_rate: 48000, frames_per_buffer: 2116, effects: NONE, mic_positions: , hw_capabilities: min_frames_per_buffer: 0, max_frames_per_buffer: 0, bitstream_formats:0, require_encapsulation:0, require_audio_offload:0
      08-14 19:07:02.230 8794 8870 V chromium: [VERBOSE1:media/renderers/audio_renderer_impl.cc:674] OnDeviceInfoReceived: is_passthrough_=0 codec=eac3 stream->audio_decoder_config().sample_format=2
      08-14 19:07:02.941 8794 8870 I chromium: [INFO:media/renderers/video_renderer_impl.cc:372] OnBufferingStateChange() mzchan: Buffering state changed to BUFFERING_HAVE_ENOUGH
      08-14 19:07:02.941 8794 8870 I chromium: [INFO:media/renderers/renderer_impl.cc:54] OnBufferingStateChange() mzchan: Buffering state changed to 1 reason: 0
      08-14 19:07:02.941 8794 8870 V chromium: [VERBOSE1:media/renderers/renderer_impl.cc:731] OnBufferingStateChange mzchan: video BUFFERING_HAVE_NOTHING -> BUFFERING_HAVE_ENOUGH
      08-14 19:07:02.968 8794 8870 V chromium: [VERBOSE1:media/renderers/audio_renderer_impl.cc:1587] SetBufferingState_Locked : 0 -> 1
      08-14 19:07:02.968 8794 8870 I chromium: [INFO:media/renderers/renderer_impl.cc:54] OnBufferingStateChange() mzchan: Buffering state changed to 1 reason: 0
      08-14 19:07:02.968 8794 8870 V chromium: [VERBOSE1:media/renderers/renderer_impl.cc:731] OnBufferingStateChange mzchan: audio BUFFERING_HAVE_NOTHING -> BUFFERING_HAVE_ENOUGH
      08-14 19:07:02.968 8794 8870 I chromium: [INFO:media/renderers/renderer_impl.cc:874] StartPlayback() mzchan: Start time source ticking
      08-14 19:07:39.395 8794 8870 I chromium: [INFO:media/renderers/renderer_impl.cc:856] PausePlayback() mzchan: Stopping time source ticking
      08-14 19:07:54.399 8794 8870 I chromium: [INFO:media/renderers/audio_renderer_impl.cc:106] ~AudioRendererImpl() mzchan: destructor sink_:0x7cb8ecb930d8 null_sink_:0x7cb8ecbad070 state_:5
          <Attempt to play again after first playback has ended>
          08-14 19:07:58.824  8794  8815 I chromium: [INFO:media/renderers/audio_renderer_impl.cc:81] AudioRendererImpl() mzchan: constructor state_:0 sink_:0x7cb8ecb930d8
      08-14 19:07:58.826 8794 8870 I chromium: [INFO:media/renderers/audio_renderer_impl.cc:393] Initialize() mzchan: sink_:0x7cb8ecb930d8 null_sink_:0 state_:0
      08-14 19:07:58.831 8794 8870 V chromium: [VERBOSE1:media/renderers/audio_renderer_impl.cc:461] OnDeviceInfoReceived
      08-14 19:07:58.831 8794 8870 V chromium: [VERBOSE1:media/renderers/audio_renderer_impl.cc:494] OnDeviceInfoReceived: format: PCM_LOW_LATENCY, channel_layout: 3, channels: 2, sample_rate: 48000, frames_per_buffer: 2116, effects: NONE, mic_positions: , hw_capabilities: min_frames_per_buffer: 0, max_frames_per_buffer: 0, bitstream_formats:0, require_encapsulation:0, require_audio_offload:0
      08-14 19:07:58.831 8794 8870 V chromium: [VERBOSE1:media/renderers/audio_renderer_impl.cc:674] OnDeviceInfoReceived: is_passthrough_=0 codec=eac3 stream->audio_decoder_config().sample_format=2
      08-14 19:07:58.859 8794 8870 I chromium: [INFO:media/renderers/video_renderer_impl.cc:372] OnBufferingStateChange() mzchan: Buffering state changed to BUFFERING_HAVE_ENOUGH
      08-14 19:07:58.859 8794 8870 I chromium: [INFO:media/renderers/renderer_impl.cc:54] OnBufferingStateChange() mzchan: Buffering state changed to 1 reason: 0
      08-14 19:07:58.859 8794 8870 V chromium: [VERBOSE1:media/renderers/renderer_impl.cc:731] OnBufferingStateChange mzchan: video BUFFERING_HAVE_NOTHING -> BUFFERING_HAVE_ENOUGH

      Note that the above was reproduced with this CL with the only modification of commenting out AttemptResumePlayback_Locked() in OnSourceChannelCountChanged(). I did try to merge "case kReinitializingSink" with "case kPlaying", but I got the same assert failure I saw earlier (see below), which got fixed after introducing the kReinitializingSink state:
          08-14 13:11:38.753  3374  3432 F DEBUG   : Abort message: '[FATAL:third_party/blink/renderer/platform/media/web_audio_source_provider_impl.cc:298] DCHECK failed: state_ == kStarted (0 vs. 1)'

      The asset that I am using is available here, however I am relying on an integrated Dolby Digital Plus MediaCodec decoder to enable playback:

      https://ott.dolby.com/OnDelKits/DDP/Dolby_Digital_Plus_Online_Delivery_Kit_v1.5/Test_Signals/muxed_streams/MP4/Example/Audio_ID_720p_50fps_h264_6ch_640kbps_ddp_joc.mp4

      I wonder if concatenating AAC streams with different channel counts could trigger this behavior but would need some experimentation.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Dale Curtis
      • Dean Wheatley
      • Diego Valenzuela
      • Maya Jelonkiewicz
      • Thomas Guilbert
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I24aaa5d8e962f5e1218d71ce063c7e7ec18b3a53
      Gerrit-Change-Number: 6811046
      Gerrit-PatchSet: 3
      Gerrit-Owner: Michael Chan <mzc...@dolby.com>
      Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
      Gerrit-Reviewer: Diego Valenzuela <dvale...@google.com>
      Gerrit-Reviewer: Thomas Guilbert <tgui...@chromium.org>
      Gerrit-Reviewer: Ying Zheng <yiz...@google.com>
      Gerrit-CC: Dean Wheatley <dw...@dolby.com>
      Gerrit-CC: Maya Jelonkiewicz <mj...@google.com>
      Gerrit-CC: Sandeep Vijayasekar <sa...@chromium.org>
      Gerrit-CC: Simeon Anfinrud <san...@chromium.org>
      Gerrit-CC: Yule Wu <y...@dolby.com>
      Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
      Gerrit-Attention: Thomas Guilbert <tgui...@chromium.org>
      Gerrit-Attention: Maya Jelonkiewicz <mj...@google.com>
      Gerrit-Attention: Dean Wheatley <dw...@dolby.com>
      Gerrit-Attention: Diego Valenzuela <dvale...@google.com>
      Gerrit-Comment-Date: Thu, 14 Aug 2025 09:50:25 +0000
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Dale Curtis (Gerrit)

      unread,
      Aug 19, 2025, 6:00:56 PMAug 19
      to Michael Chan, Sandeep Vijayasekar, Simeon Anfinrud, Maya Jelonkiewicz, AyeAye, Thomas Guilbert, Ying Zheng, Diego Valenzuela, Dean Wheatley, Yule Wu, feature-me...@chromium.org
      Attention needed from Dean Wheatley, Diego Valenzuela, Maya Jelonkiewicz, Michael Chan and Thomas Guilbert

      Dale Curtis added 10 comments

      File media/base/media_switches.h
      Line 414, Patchset 3 (Latest):#endif // BUILDFLAG(IS_ANDROID)
      Dale Curtis . unresolved

      Don't guard this feature behind IS_ANDROID or you need to guard the whole thing. Prefer to just let this build on all platforms.

      Line 413, Patchset 1:MEDIA_EXPORT BASE_DECLARE_FEATURE(kMatchSourceAudioChannelLayout);
      Maya Jelonkiewicz . unresolved

      @dalec...@chromium.org Do we have a preference between adding features to `media_switches.*` vs `audio_features.*`?

      Dale Curtis

      I think this one has to go in media_switches since Media/renderers needs access to it.

      File media/renderers/audio_renderer_impl.cc
      Line 414, Patchset 3 (Latest):bool AudioRendererImpl::AttemptResumePlayback_Locked(
      Dale Curtis . unresolved

      Revert this function change.

      Line 445, Patchset 3 (Latest): }
      Dale Curtis . unresolved

      This needs `else { sink_->Play(); }` to resolve the hung sink issues. The rest of AttemptResumePlayback_Locked() can be folded into the switch statement down below and things seem to work fine.

      Dale Curtis

      See the play() addition below, it should fix all these issues. When the AudioRendererMixerInput powering the sink is reused it doesn't auto-start. The new code doesn't handle that case.

      Line 938, Patchset 3 (Latest): {
      Dale Curtis . unresolved

      Revert all these changes.

      Line 976, Patchset 3 (Latest): bool allow_config_changes = false;
      Dale Curtis . unresolved

      Please revert this hunk.

      Line 1002, Patchset 3 (Latest): // If the incoming buffer's channel count has changed,
      Dale Curtis . unresolved

      Use a pair of base::AutoUnlock within this function when calling into the sink instead of changing the locks elsewhere in this function.

      Line 1008, Patchset 3 (Latest): sink_->Stop();
      Dale Curtis . unresolved

      This also needs to cleanup the `null_sink_` and make sure it's behaving correctly. I.e., stays on the nullsink as the channel count changes when muted, etc.

      Line 1171, Patchset 1: return !AttemptResumePlayback_Locked(should_render_end_of_stream);
      Dale Curtis . unresolved

      Why change this? It seems like just adding `kReinitializingSink` here would be okay.

      Michael Chan

      I am reusing these lines in OnSourceChannelCountChanged() so I refactored this code into the new function AttemptResumePlayback_Locked() to avoid duplicating it. I'm okay to revert this here to minimize changes.

      Dale Curtis

      I don't see why the code needs to be duplicated? Isn't it enough to just add kReinitializingSink to the kPlaying case?

      Michael Chan

      Please see above comment about issue starting playback.

      Dale Curtis

      To be clear, the logs you've provided via e-mail are from adding `case kReinitializingSink` to `case kPlaying`? Was that a playback all the way to the end w/ the playback not restarting error you described? I don't see an ended status in the log (or even a HAVE_NOTHING) which is surprising in that case if so.

      Michael Chan

      The media-internals.txt file I've provided is based on the code in this CL with the exception of commenting out the AttemptResumePlayback_Locked() call in OnSourceChannelCountChanged().

      I've resent the media-internals.txt file via email with the initial observation of playback to the end and attempting playback again afterwards.

      Dale Curtis

      Thanks, replied via e-mail.

      If you comment out that call in OnSourceChannelCountChanged() you do need to merge the kPlaying and kReinitializeSink states in this block. Otherwise we're never handling ended correctly.

      Dale Curtis

      As noted this section can be reverted.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Dean Wheatley
      • Diego Valenzuela
      • Maya Jelonkiewicz
      • Michael Chan
      • Thomas Guilbert
      Gerrit-Attention: Michael Chan <mzc...@dolby.com>
      Gerrit-Attention: Thomas Guilbert <tgui...@chromium.org>
      Gerrit-Attention: Maya Jelonkiewicz <mj...@google.com>
      Gerrit-Attention: Dean Wheatley <dw...@dolby.com>
      Gerrit-Attention: Diego Valenzuela <dvale...@google.com>
      Gerrit-Comment-Date: Tue, 19 Aug 2025 22:00:46 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Dale Curtis <dalec...@chromium.org>
      Comment-In-Reply-To: Michael Chan <mzc...@dolby.com>
      Comment-In-Reply-To: Maya Jelonkiewicz <mj...@google.com>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Michael Chan (Gerrit)

      unread,
      Aug 20, 2025, 5:35:02 PMAug 20
      to Sandeep Vijayasekar, Simeon Anfinrud, Maya Jelonkiewicz, AyeAye, Dale Curtis, Thomas Guilbert, Ying Zheng, Diego Valenzuela, Dean Wheatley, Yule Wu, feature-me...@chromium.org
      Attention needed from Dale Curtis, Dean Wheatley, Diego Valenzuela, Maya Jelonkiewicz and Thomas Guilbert

      Michael Chan added 10 comments

      Patchset-level comments
      File-level comment, Patchset 4 (Latest):
      Michael Chan . resolved

      Hi Dale,

      I've addressed your comments in the latest patchset, but I have held off on null sink handling for now because I am getting DCHECK failures in null_audio_sink.cc.

      Nevertheless, I am still getting the same DCHECK failure in web_audio_source_provider_impl.cc:

          08-21 07:14:43.753 15030 15110 F DEBUG   : Abort message: '[FATAL:third_party/blink/renderer/platform/media/web_audio_source_provider_impl.cc:298] DCHECK failed: state_ == kStarted (0 vs. 1)'
      File media/base/media_switches.h
      Line 414, Patchset 3:#endif // BUILDFLAG(IS_ANDROID)
      Dale Curtis . resolved

      Don't guard this feature behind IS_ANDROID or you need to guard the whole thing. Prefer to just let this build on all platforms.

      Michael Chan

      Done

      Line 413, Patchset 1:MEDIA_EXPORT BASE_DECLARE_FEATURE(kMatchSourceAudioChannelLayout);
      Maya Jelonkiewicz . resolved

      @dalec...@chromium.org Do we have a preference between adding features to `media_switches.*` vs `audio_features.*`?

      Dale Curtis

      I think this one has to go in media_switches since Media/renderers needs access to it.

      Michael Chan

      Acknowledged

      File media/renderers/audio_renderer_impl.cc
      Line 414, Patchset 3:bool AudioRendererImpl::AttemptResumePlayback_Locked(
      Dale Curtis . resolved

      Revert this function change.

      Michael Chan

      Done

      Line 445, Patchset 3: }
      Dale Curtis . resolved

      This needs `else { sink_->Play(); }` to resolve the hung sink issues. The rest of AttemptResumePlayback_Locked() can be folded into the switch statement down below and things seem to work fine.

      Michael Chan

      Done

      Line 446, Patchset 2: {
      Dale Curtis . resolved
      Michael Chan

      Acknowledged

      Line 938, Patchset 3: {
      Dale Curtis . resolved

      Revert all these changes.

      Michael Chan

      Done

      Line 976, Patchset 3: bool allow_config_changes = false;
      Dale Curtis . resolved

      Please revert this hunk.

      Michael Chan

      Done

      Line 1002, Patchset 3: // If the incoming buffer's channel count has changed,
      Dale Curtis . resolved

      Use a pair of base::AutoUnlock within this function when calling into the sink instead of changing the locks elsewhere in this function.

      Michael Chan

      Done

      Line 1171, Patchset 1: return !AttemptResumePlayback_Locked(should_render_end_of_stream);
      Dale Curtis . resolved

      Why change this? It seems like just adding `kReinitializingSink` here would be okay.

      Michael Chan

      I am reusing these lines in OnSourceChannelCountChanged() so I refactored this code into the new function AttemptResumePlayback_Locked() to avoid duplicating it. I'm okay to revert this here to minimize changes.

      Dale Curtis

      I don't see why the code needs to be duplicated? Isn't it enough to just add kReinitializingSink to the kPlaying case?

      Michael Chan

      Please see above comment about issue starting playback.

      Dale Curtis

      To be clear, the logs you've provided via e-mail are from adding `case kReinitializingSink` to `case kPlaying`? Was that a playback all the way to the end w/ the playback not restarting error you described? I don't see an ended status in the log (or even a HAVE_NOTHING) which is surprising in that case if so.

      Michael Chan

      The media-internals.txt file I've provided is based on the code in this CL with the exception of commenting out the AttemptResumePlayback_Locked() call in OnSourceChannelCountChanged().

      I've resent the media-internals.txt file via email with the initial observation of playback to the end and attempting playback again afterwards.

      Dale Curtis

      Thanks, replied via e-mail.

      If you comment out that call in OnSourceChannelCountChanged() you do need to merge the kPlaying and kReinitializeSink states in this block. Otherwise we're never handling ended correctly.

      Dale Curtis

      As noted this section can be reverted.

      Michael Chan

      Done

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Dale Curtis
      • Dean Wheatley
      • Diego Valenzuela
      • Maya Jelonkiewicz
      • Thomas Guilbert
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I24aaa5d8e962f5e1218d71ce063c7e7ec18b3a53
      Gerrit-Change-Number: 6811046
      Gerrit-PatchSet: 4
      Gerrit-Owner: Michael Chan <mzc...@dolby.com>
      Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
      Gerrit-Reviewer: Diego Valenzuela <dvale...@google.com>
      Gerrit-Reviewer: Thomas Guilbert <tgui...@chromium.org>
      Gerrit-Reviewer: Ying Zheng <yiz...@google.com>
      Gerrit-CC: Dean Wheatley <dw...@dolby.com>
      Gerrit-CC: Maya Jelonkiewicz <mj...@google.com>
      Gerrit-CC: Sandeep Vijayasekar <sa...@chromium.org>
      Gerrit-CC: Simeon Anfinrud <san...@chromium.org>
      Gerrit-CC: Yule Wu <y...@dolby.com>
      Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
      Gerrit-Attention: Thomas Guilbert <tgui...@chromium.org>
      Gerrit-Attention: Maya Jelonkiewicz <mj...@google.com>
      Gerrit-Attention: Dean Wheatley <dw...@dolby.com>
      Gerrit-Attention: Diego Valenzuela <dvale...@google.com>
      Gerrit-Comment-Date: Wed, 20 Aug 2025 21:34:33 +0000
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Dale Curtis (Gerrit)

      unread,
      Aug 20, 2025, 6:52:12 PMAug 20
      to Michael Chan, Sandeep Vijayasekar, Simeon Anfinrud, Maya Jelonkiewicz, AyeAye, Thomas Guilbert, Ying Zheng, Diego Valenzuela, Dean Wheatley, Yule Wu, feature-me...@chromium.org
      Attention needed from Dean Wheatley, Diego Valenzuela, Maya Jelonkiewicz, Michael Chan and Thomas Guilbert

      Dale Curtis added 2 comments

      Patchset-level comments
      Michael Chan . unresolved

      Hi Dale,

      I've addressed your comments in the latest patchset, but I have held off on null sink handling for now because I am getting DCHECK failures in null_audio_sink.cc.

      Nevertheless, I am still getting the same DCHECK failure in web_audio_source_provider_impl.cc:

          08-21 07:14:43.753 15030 15110 F DEBUG   : Abort message: '[FATAL:third_party/blink/renderer/platform/media/web_audio_source_provider_impl.cc:298] DCHECK failed: state_ == kStarted (0 vs. 1)'
      Dale Curtis

      Hmm, I'm not getting that same DCHECK over here. Are you able to reproduce that with https://storage.googleapis.com/dalecurtis/mse.html?src=aac_change_layout.adts&type=adts ? If so what are your repro steps?

      File media/renderers/audio_renderer_impl.h
      Line 179, Patchset 4 (Latest): // Attempt to resume playback depending on buffering and playback state.
      Dale Curtis . unresolved

      Delete this function

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Dean Wheatley
      • Diego Valenzuela
      • Maya Jelonkiewicz
      • Michael Chan
      • Thomas Guilbert
      Gerrit-Attention: Michael Chan <mzc...@dolby.com>
      Gerrit-Attention: Thomas Guilbert <tgui...@chromium.org>
      Gerrit-Attention: Maya Jelonkiewicz <mj...@google.com>
      Gerrit-Attention: Dean Wheatley <dw...@dolby.com>
      Gerrit-Attention: Diego Valenzuela <dvale...@google.com>
      Gerrit-Comment-Date: Wed, 20 Aug 2025 22:52:01 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Michael Chan <mzc...@dolby.com>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Dale Curtis (Gerrit)

      unread,
      Aug 20, 2025, 6:59:24 PMAug 20
      to Michael Chan, Sandeep Vijayasekar, Simeon Anfinrud, Maya Jelonkiewicz, AyeAye, Thomas Guilbert, Ying Zheng, Dean Wheatley, Yule Wu, feature-me...@chromium.org
      Attention needed from Dean Wheatley, Maya Jelonkiewicz, Michael Chan and Thomas Guilbert

      Dale Curtis added 1 comment

      File media/renderers/audio_renderer_impl.cc
      Line 305, Patchset 4 (Latest): DCHECK_EQ(state_, kPlaying);
      Dale Curtis . unresolved

      I am able to trigger this DCHECK by seeking while the reinitialize is in flight, so you do need to figure out how to handle a Flush() occurring during state kReinitializingSink. I suspect you just need to run the flush like normal.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Dean Wheatley
      • Maya Jelonkiewicz
      • Michael Chan
      • Thomas Guilbert
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I24aaa5d8e962f5e1218d71ce063c7e7ec18b3a53
      Gerrit-Change-Number: 6811046
      Gerrit-PatchSet: 4
      Gerrit-Owner: Michael Chan <mzc...@dolby.com>
      Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
      Gerrit-Reviewer: Thomas Guilbert <tgui...@chromium.org>
      Gerrit-Reviewer: Ying Zheng <yiz...@google.com>
      Gerrit-CC: Dean Wheatley <dw...@dolby.com>
      Gerrit-CC: Maya Jelonkiewicz <mj...@google.com>
      Gerrit-CC: Sandeep Vijayasekar <sa...@chromium.org>
      Gerrit-CC: Simeon Anfinrud <san...@chromium.org>
      Gerrit-CC: Yule Wu <y...@dolby.com>
      Gerrit-Attention: Michael Chan <mzc...@dolby.com>
      Gerrit-Attention: Thomas Guilbert <tgui...@chromium.org>
      Gerrit-Attention: Maya Jelonkiewicz <mj...@google.com>
      Gerrit-Attention: Dean Wheatley <dw...@dolby.com>
      Gerrit-Comment-Date: Wed, 20 Aug 2025 22:59:14 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Michael Chan (Gerrit)

      unread,
      Aug 20, 2025, 7:27:53 PMAug 20
      to Sandeep Vijayasekar, Simeon Anfinrud, Maya Jelonkiewicz, AyeAye, Dale Curtis, Thomas Guilbert, Ying Zheng, Dean Wheatley, Yule Wu, feature-me...@chromium.org
      Attention needed from Dale Curtis, Dean Wheatley, Maya Jelonkiewicz and Thomas Guilbert

      Michael Chan added 3 comments

      Patchset-level comments
      Michael Chan . unresolved

      Hi Dale,

      I've addressed your comments in the latest patchset, but I have held off on null sink handling for now because I am getting DCHECK failures in null_audio_sink.cc.

      Nevertheless, I am still getting the same DCHECK failure in web_audio_source_provider_impl.cc:

          08-21 07:14:43.753 15030 15110 F DEBUG   : Abort message: '[FATAL:third_party/blink/renderer/platform/media/web_audio_source_provider_impl.cc:298] DCHECK failed: state_ == kStarted (0 vs. 1)'
      Dale Curtis

      Hmm, I'm not getting that same DCHECK over here. Are you able to reproduce that with https://storage.googleapis.com/dalecurtis/mse.html?src=aac_change_layout.adts&type=adts ? If so what are your repro steps?

      Michael Chan

      I am unable to start playback of that asset - it shows a spinning play icon and pressing play doesn't start playback and the icon continues to spin.

      With the Dolby Digital Plus asset, I can play through the first time but again, waiting like ~60 seconds before attempting to play again will cause the DCHECK failure above on AAOS15 emulator.

      File media/renderers/audio_renderer_impl.h
      Line 179, Patchset 4 (Latest): // Attempt to resume playback depending on buffering and playback state.
      Dale Curtis . resolved

      Delete this function

      Michael Chan

      Acknowledged

      File media/renderers/audio_renderer_impl.cc
      Line 305, Patchset 4 (Latest): DCHECK_EQ(state_, kPlaying);
      Dale Curtis . unresolved

      I am able to trigger this DCHECK by seeking while the reinitialize is in flight, so you do need to figure out how to handle a Flush() occurring during state kReinitializingSink. I suspect you just need to run the flush like normal.

      Michael Chan

      Are you suggesting we just allow state_ == kReinitializingSink here as well and continue flushing?

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Dale Curtis
      • Dean Wheatley
      • Maya Jelonkiewicz
      • Thomas Guilbert
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I24aaa5d8e962f5e1218d71ce063c7e7ec18b3a53
      Gerrit-Change-Number: 6811046
      Gerrit-PatchSet: 4
      Gerrit-Owner: Michael Chan <mzc...@dolby.com>
      Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
      Gerrit-Reviewer: Thomas Guilbert <tgui...@chromium.org>
      Gerrit-Reviewer: Ying Zheng <yiz...@google.com>
      Gerrit-CC: Dean Wheatley <dw...@dolby.com>
      Gerrit-CC: Maya Jelonkiewicz <mj...@google.com>
      Gerrit-CC: Sandeep Vijayasekar <sa...@chromium.org>
      Gerrit-CC: Simeon Anfinrud <san...@chromium.org>
      Gerrit-CC: Yule Wu <y...@dolby.com>
      Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
      Gerrit-Attention: Thomas Guilbert <tgui...@chromium.org>
      Gerrit-Attention: Maya Jelonkiewicz <mj...@google.com>
      Gerrit-Attention: Dean Wheatley <dw...@dolby.com>
      Gerrit-Comment-Date: Wed, 20 Aug 2025 23:27:28 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Dale Curtis (Gerrit)

      unread,
      Aug 20, 2025, 7:49:31 PMAug 20
      to Michael Chan, Sandeep Vijayasekar, Simeon Anfinrud, Maya Jelonkiewicz, AyeAye, Thomas Guilbert, Ying Zheng, Dean Wheatley, Yule Wu, feature-me...@chromium.org
      Attention needed from Dean Wheatley, Maya Jelonkiewicz, Michael Chan and Thomas Guilbert

      Dale Curtis added 2 comments

      Patchset-level comments
      Michael Chan . unresolved

      Hi Dale,

      I've addressed your comments in the latest patchset, but I have held off on null sink handling for now because I am getting DCHECK failures in null_audio_sink.cc.

      Nevertheless, I am still getting the same DCHECK failure in web_audio_source_provider_impl.cc:

          08-21 07:14:43.753 15030 15110 F DEBUG   : Abort message: '[FATAL:third_party/blink/renderer/platform/media/web_audio_source_provider_impl.cc:298] DCHECK failed: state_ == kStarted (0 vs. 1)'
      Dale Curtis

      Hmm, I'm not getting that same DCHECK over here. Are you able to reproduce that with https://storage.googleapis.com/dalecurtis/mse.html?src=aac_change_layout.adts&type=adts ? If so what are your repro steps?

      Michael Chan

      I am unable to start playback of that asset - it shows a spinning play icon and pressing play doesn't start playback and the icon continues to spin.

      With the Dolby Digital Plus asset, I can play through the first time but again, waiting like ~60 seconds before attempting to play again will cause the DCHECK failure above on AAOS15 emulator.

      Dale Curtis

      Hmm, the asset is just AAC. Are you building with proprietary_codecs=true and ffmpeg_branding=Chrome?

      File media/renderers/audio_renderer_impl.cc
      Line 305, Patchset 4 (Latest): DCHECK_EQ(state_, kPlaying);
      Dale Curtis . unresolved

      I am able to trigger this DCHECK by seeking while the reinitialize is in flight, so you do need to figure out how to handle a Flush() occurring during state kReinitializingSink. I suspect you just need to run the flush like normal.

      Michael Chan

      Are you suggesting we just allow state_ == kReinitializingSink here as well and continue flushing?

      Dale Curtis

      Maybe, it's a bit complicated by the fact that Flush() will change state to kFlushing, so you may need to give it some more thought.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Dean Wheatley
      • Maya Jelonkiewicz
      • Michael Chan
      • Thomas Guilbert
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I24aaa5d8e962f5e1218d71ce063c7e7ec18b3a53
      Gerrit-Change-Number: 6811046
      Gerrit-PatchSet: 4
      Gerrit-Owner: Michael Chan <mzc...@dolby.com>
      Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
      Gerrit-Reviewer: Thomas Guilbert <tgui...@chromium.org>
      Gerrit-Reviewer: Ying Zheng <yiz...@google.com>
      Gerrit-CC: Dean Wheatley <dw...@dolby.com>
      Gerrit-CC: Maya Jelonkiewicz <mj...@google.com>
      Gerrit-CC: Sandeep Vijayasekar <sa...@chromium.org>
      Gerrit-CC: Simeon Anfinrud <san...@chromium.org>
      Gerrit-CC: Yule Wu <y...@dolby.com>
      Gerrit-Attention: Michael Chan <mzc...@dolby.com>
      Gerrit-Attention: Thomas Guilbert <tgui...@chromium.org>
      Gerrit-Attention: Maya Jelonkiewicz <mj...@google.com>
      Gerrit-Attention: Dean Wheatley <dw...@dolby.com>
      Gerrit-Comment-Date: Wed, 20 Aug 2025 23:49:22 +0000
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Michael Chan (Gerrit)

      unread,
      Aug 20, 2025, 8:32:10 PMAug 20
      to Sandeep Vijayasekar, Simeon Anfinrud, Maya Jelonkiewicz, AyeAye, Dale Curtis, Thomas Guilbert, Ying Zheng, Dean Wheatley, Yule Wu, feature-me...@chromium.org
      Attention needed from Dale Curtis, Dean Wheatley, Maya Jelonkiewicz and Thomas Guilbert

      Michael Chan added 1 comment

      Patchset-level comments
      Michael Chan . unresolved

      Hi Dale,

      I've addressed your comments in the latest patchset, but I have held off on null sink handling for now because I am getting DCHECK failures in null_audio_sink.cc.

      Nevertheless, I am still getting the same DCHECK failure in web_audio_source_provider_impl.cc:

          08-21 07:14:43.753 15030 15110 F DEBUG   : Abort message: '[FATAL:third_party/blink/renderer/platform/media/web_audio_source_provider_impl.cc:298] DCHECK failed: state_ == kStarted (0 vs. 1)'
      Dale Curtis

      Hmm, I'm not getting that same DCHECK over here. Are you able to reproduce that with https://storage.googleapis.com/dalecurtis/mse.html?src=aac_change_layout.adts&type=adts ? If so what are your repro steps?

      Michael Chan

      I am unable to start playback of that asset - it shows a spinning play icon and pressing play doesn't start playback and the icon continues to spin.

      With the Dolby Digital Plus asset, I can play through the first time but again, waiting like ~60 seconds before attempting to play again will cause the DCHECK failure above on AAOS15 emulator.

      Dale Curtis

      Hmm, the asset is just AAC. Are you building with proprietary_codecs=true and ffmpeg_branding=Chrome?

      Michael Chan

      Yes, I have those flags in my args.gn:

      target_os = "android"
      target_cpu = "x64" # See "Figuring out target_cpu" below
      android_static_analysis = "build_server"
      proprietary_codecs=true
      enable_platform_ac3_eac3_audio=true
      ffmpeg_branding="Chrome"
      is_debug=true
      dcheck_always_on = true

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Dale Curtis
      • Dean Wheatley
      • Maya Jelonkiewicz
      • Thomas Guilbert
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I24aaa5d8e962f5e1218d71ce063c7e7ec18b3a53
      Gerrit-Change-Number: 6811046
      Gerrit-PatchSet: 4
      Gerrit-Owner: Michael Chan <mzc...@dolby.com>
      Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
      Gerrit-Reviewer: Thomas Guilbert <tgui...@chromium.org>
      Gerrit-Reviewer: Ying Zheng <yiz...@google.com>
      Gerrit-CC: Dean Wheatley <dw...@dolby.com>
      Gerrit-CC: Maya Jelonkiewicz <mj...@google.com>
      Gerrit-CC: Sandeep Vijayasekar <sa...@chromium.org>
      Gerrit-CC: Simeon Anfinrud <san...@chromium.org>
      Gerrit-CC: Yule Wu <y...@dolby.com>
      Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
      Gerrit-Attention: Thomas Guilbert <tgui...@chromium.org>
      Gerrit-Attention: Maya Jelonkiewicz <mj...@google.com>
      Gerrit-Attention: Dean Wheatley <dw...@dolby.com>
      Gerrit-Comment-Date: Thu, 21 Aug 2025 00:31:40 +0000
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Dale Curtis (Gerrit)

      unread,
      Aug 21, 2025, 2:26:25 PMAug 21
      to Michael Chan, Sandeep Vijayasekar, Simeon Anfinrud, Maya Jelonkiewicz, AyeAye, Thomas Guilbert, Ying Zheng, Dean Wheatley, Yule Wu, feature-me...@chromium.org
      Attention needed from Dean Wheatley, Maya Jelonkiewicz, Michael Chan and Thomas Guilbert

      Dale Curtis added 1 comment

      Patchset-level comments
      Michael Chan . unresolved

      Hi Dale,

      I've addressed your comments in the latest patchset, but I have held off on null sink handling for now because I am getting DCHECK failures in null_audio_sink.cc.

      Nevertheless, I am still getting the same DCHECK failure in web_audio_source_provider_impl.cc:

          08-21 07:14:43.753 15030 15110 F DEBUG   : Abort message: '[FATAL:third_party/blink/renderer/platform/media/web_audio_source_provider_impl.cc:298] DCHECK failed: state_ == kStarted (0 vs. 1)'
      Dale Curtis

      Hmm, I'm not getting that same DCHECK over here. Are you able to reproduce that with https://storage.googleapis.com/dalecurtis/mse.html?src=aac_change_layout.adts&type=adts ? If so what are your repro steps?

      Michael Chan

      I am unable to start playback of that asset - it shows a spinning play icon and pressing play doesn't start playback and the icon continues to spin.

      With the Dolby Digital Plus asset, I can play through the first time but again, waiting like ~60 seconds before attempting to play again will cause the DCHECK failure above on AAOS15 emulator.

      Dale Curtis

      Hmm, the asset is just AAC. Are you building with proprietary_codecs=true and ffmpeg_branding=Chrome?

      Michael Chan

      Yes, I have those flags in my args.gn:

      target_os = "android"
      target_cpu = "x64" # See "Figuring out target_cpu" below
      android_static_analysis = "build_server"
      proprietary_codecs=true
      enable_platform_ac3_eac3_audio=true
      ffmpeg_branding="Chrome"
      is_debug=true
      dcheck_always_on = true

      Dale Curtis

      That all looks right. I'm not sure why the linked stream wouldn't work for you then. I'll try to poke at this more tomorrow when I have more time. That sink state does mean that there's some missing state case not being handled.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Dean Wheatley
      • Maya Jelonkiewicz
      • Michael Chan
      • Thomas Guilbert
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I24aaa5d8e962f5e1218d71ce063c7e7ec18b3a53
      Gerrit-Change-Number: 6811046
      Gerrit-PatchSet: 4
      Gerrit-Owner: Michael Chan <mzc...@dolby.com>
      Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
      Gerrit-Reviewer: Thomas Guilbert <tgui...@chromium.org>
      Gerrit-Reviewer: Ying Zheng <yiz...@google.com>
      Gerrit-CC: Dean Wheatley <dw...@dolby.com>
      Gerrit-CC: Maya Jelonkiewicz <mj...@google.com>
      Gerrit-CC: Sandeep Vijayasekar <sa...@chromium.org>
      Gerrit-CC: Simeon Anfinrud <san...@chromium.org>
      Gerrit-CC: Yule Wu <y...@dolby.com>
      Gerrit-Attention: Michael Chan <mzc...@dolby.com>
      Gerrit-Attention: Thomas Guilbert <tgui...@chromium.org>
      Gerrit-Attention: Maya Jelonkiewicz <mj...@google.com>
      Gerrit-Attention: Dean Wheatley <dw...@dolby.com>
      Gerrit-Comment-Date: Thu, 21 Aug 2025 18:26:15 +0000
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Michael Chan (Gerrit)

      unread,
      Sep 9, 2025, 8:04:38 PM (11 days ago) Sep 9
      to Sandeep Vijayasekar, Simeon Anfinrud, Maya Jelonkiewicz, AyeAye, Dale Curtis, Thomas Guilbert, Ying Zheng, Dean Wheatley, Yule Wu, feature-me...@chromium.org
      Attention needed from Dale Curtis, Dean Wheatley, Maya Jelonkiewicz and Thomas Guilbert

      Michael Chan added 4 comments

      Patchset-level comments
      File-level comment, Patchset 8 (Latest):
      Michael Chan . resolved

      Hi Dale,

      I've added a unit test: AudioRendererImplTest.SinkReconfiguredOnChannelCountChange

      Thanks,
      Michael

      File media/audio/android/aaudio_stream_wrapper.cc
      Line 206, Patchset 1: // For multichannel PCM playback, do not use power saving
      Dale Curtis . resolved

      Interesting. Is it the case that we aren't opening true multi-channel streams without this flag even on normal Android devices?

      For now at least, can we instead do something like `if !on_battery_power` or just always avoid power saving if ANDROID_AUTOMOTIVE? We wouldn't want this kicking in on normal devices until we understand it a bit more.

      @mj...@google.com

      Michael Chan

      Yes, on an AAOS15 emulator, I observe that a stereo non-direct mixer output is opened instead of a direct multichannel output.

      I'll add in a guard on whether we are running on an automotive device to avoid power saving mode for now.

      Michael Chan

      Done

      File media/renderers/audio_renderer_impl.cc
      Line 305, Patchset 4: DCHECK_EQ(state_, kPlaying);
      Dale Curtis . resolved

      I am able to trigger this DCHECK by seeking while the reinitialize is in flight, so you do need to figure out how to handle a Flush() occurring during state kReinitializingSink. I suspect you just need to run the flush like normal.

      Michael Chan

      Are you suggesting we just allow state_ == kReinitializingSink here as well and continue flushing?

      Dale Curtis

      Maybe, it's a bit complicated by the fact that Flush() will change state to kFlushing, so you may need to give it some more thought.

      Michael Chan

      Done

      Line 1008, Patchset 3: sink_->Stop();
      Dale Curtis . resolved

      This also needs to cleanup the `null_sink_` and make sure it's behaving correctly. I.e., stays on the nullsink as the channel count changes when muted, etc.

      Michael Chan

      Acknowledged

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Dale Curtis
      • Dean Wheatley
      • Maya Jelonkiewicz
      • Thomas Guilbert
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I24aaa5d8e962f5e1218d71ce063c7e7ec18b3a53
      Gerrit-Change-Number: 6811046
      Gerrit-PatchSet: 8
      Gerrit-Owner: Michael Chan <mzc...@dolby.com>
      Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
      Gerrit-Reviewer: Thomas Guilbert <tgui...@chromium.org>
      Gerrit-Reviewer: Ying Zheng <yiz...@google.com>
      Gerrit-CC: Dean Wheatley <dw...@dolby.com>
      Gerrit-CC: Maya Jelonkiewicz <mj...@google.com>
      Gerrit-CC: Sandeep Vijayasekar <sa...@chromium.org>
      Gerrit-CC: Simeon Anfinrud <san...@chromium.org>
      Gerrit-CC: Yule Wu <y...@dolby.com>
      Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
      Gerrit-Attention: Thomas Guilbert <tgui...@chromium.org>
      Gerrit-Attention: Maya Jelonkiewicz <mj...@google.com>
      Gerrit-Attention: Dean Wheatley <dw...@dolby.com>
      Gerrit-Comment-Date: Wed, 10 Sep 2025 00:04:15 +0000
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Dale Curtis (Gerrit)

      unread,
      Sep 10, 2025, 7:14:17 PM (10 days ago) Sep 10
      to Michael Chan, Sandeep Vijayasekar, Simeon Anfinrud, Maya Jelonkiewicz, AyeAye, Thomas Guilbert, Ying Zheng, Dean Wheatley, Yule Wu, feature-me...@chromium.org
      Attention needed from Dean Wheatley, Maya Jelonkiewicz, Michael Chan and Thomas Guilbert

      Dale Curtis added 15 comments

      Patchset-level comments
      Dale Curtis . resolved

      The state machine for ARI is already pretty complicated, we want to avoid adding more complexity for this side-feature.

      File media/audio/android/aaudio_stream_wrapper.cc
      Line 226, Patchset 8 (Latest): }
      Dale Curtis . unresolved

      Lets make this an else with the clause above.

      File media/audio/audio_manager_base.cc
      Line 425, Patchset 8 (Latest): // Use input source audio channel count/layout if allowing
      Dale Curtis . unresolved

      Do we really need to keep just the channel count the same? I.e., if we prefer the stream sample rate, is that okay? I think it would let us drop this clause here and instead just add a new conditional to:

      File media/renderers/audio_renderer_impl.h
      Line 379, Patchset 8 (Latest): bool sink_in_playing_state_;
      Dale Curtis . unresolved

      Ditto, this should be removed.

      Line 294, Patchset 8 (Latest): // True if |sink_| was undergoing reinitialization prior to playing.
      Dale Curtis . unresolved

      I don't think we need this new state. The point of having a `state_` variable is to avoid the need for additional bool multipliers on the state diagram.

      File media/renderers/audio_renderer_impl.cc
      Line 149, Patchset 8 (Latest): if ((state_ == kPlaying && was_reinitializing_sink_) ||
      Dale Curtis . unresolved

      Just early return with state == kReinitalizingSink.

      Line 188, Patchset 8 (Latest):
      Dale Curtis . unresolved

      Likewise early return if state == reinitializing after setting sink_playing_ = false.

      Line 208, Patchset 8 (Latest): DCHECK(state_ == kFlushed || state_ == kReinitializingSink ||
      Dale Curtis . unresolved

      This should only be state_ == kFlushed, Flush() during Reinitalize should defer the flush callback such that this call isn't possible until it completes.

      Line 321, Patchset 8 (Latest): was_reinitializing_sink_ = (state_ == kReinitializingSink);
      Dale Curtis . unresolved

      This should early return if state == kReinitializingSink and execute the flush_cb_ only when reinitailize completes.

      Line 338, Patchset 8 (Latest): DCHECK((state_ == kFlushed && !pending_read_) ||
      Dale Curtis . unresolved

      Shouldn't be possible after above advice.

      Line 351, Patchset 8 (Latest): DCHECK(state_ == kFlushed || state_ == kReinitializingSink ||
      Dale Curtis . unresolved

      Shouldn't be possible after above advice.

      Line 375, Patchset 8 (Latest): DCHECK(state_ == kFlushed || state_ == kReinitializingSink ||
      Dale Curtis . unresolved

      Shouldn't be possible after above advice.

      Line 462, Patchset 8 (Latest):}
      Dale Curtis . unresolved

      This needs to execute the flush process if flush_cb_ exists.

      Line 831, Patchset 8 (Latest): if ((state_ == kPlaying || state_ == kReinitializingSink) &&
      Dale Curtis . unresolved

      This should just early return if we're in the reinitializing state since playback is already paused for the sink switch -- it'll be called again if we still don't have enough data once playback starts on the new sink.

      Line 1253, Patchset 8 (Latest): case kReinitializingSink:
      Dale Curtis . unresolved

      Probably this should be true to ensure we keep buffering while waiting for the sink change. It does mean you'd need to handle a case where a second config change comes in before the first completes though, so maybe too much trouble.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Dean Wheatley
      • Maya Jelonkiewicz
      • Michael Chan
      • Thomas Guilbert
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I24aaa5d8e962f5e1218d71ce063c7e7ec18b3a53
      Gerrit-Change-Number: 6811046
      Gerrit-PatchSet: 8
      Gerrit-Owner: Michael Chan <mzc...@dolby.com>
      Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
      Gerrit-Reviewer: Thomas Guilbert <tgui...@chromium.org>
      Gerrit-Reviewer: Ying Zheng <yiz...@google.com>
      Gerrit-CC: Dean Wheatley <dw...@dolby.com>
      Gerrit-CC: Maya Jelonkiewicz <mj...@google.com>
      Gerrit-CC: Sandeep Vijayasekar <sa...@chromium.org>
      Gerrit-CC: Simeon Anfinrud <san...@chromium.org>
      Gerrit-CC: Yule Wu <y...@dolby.com>
      Gerrit-Attention: Michael Chan <mzc...@dolby.com>
      Gerrit-Attention: Thomas Guilbert <tgui...@chromium.org>
      Gerrit-Attention: Maya Jelonkiewicz <mj...@google.com>
      Gerrit-Attention: Dean Wheatley <dw...@dolby.com>
      Gerrit-Comment-Date: Wed, 10 Sep 2025 23:14:06 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Michael Chan (Gerrit)

      unread,
      Sep 14, 2025, 11:53:31 PM (5 days ago) Sep 14
      to Sandeep Vijayasekar, Simeon Anfinrud, Maya Jelonkiewicz, AyeAye, Dale Curtis, Thomas Guilbert, Ying Zheng, Dean Wheatley, Yule Wu, feature-me...@chromium.org
      Attention needed from Dale Curtis, Dean Wheatley, Maya Jelonkiewicz and Thomas Guilbert

      Michael Chan added 14 comments

      File media/audio/android/aaudio_stream_wrapper.cc
      Dale Curtis . resolved

      Lets make this an else with the clause above.

      Michael Chan

      Acknowledged

      File media/audio/audio_manager_base.cc
      Line 425, Patchset 8 (Latest): // Use input source audio channel count/layout if allowing
      Dale Curtis . unresolved

      Do we really need to keep just the channel count the same? I.e., if we prefer the stream sample rate, is that okay? I think it would let us drop this clause here and instead just add a new conditional to:

      Michael Chan

      Without this change here, the output is locked to the default channel count, even when I add an additional conditional to the above "use_stream_params".

      File media/renderers/audio_renderer_impl.h
      Line 379, Patchset 8 (Latest): bool sink_in_playing_state_;
      Dale Curtis . resolved

      Ditto, this should be removed.

      Michael Chan

      Acknowledged

      Line 294, Patchset 8 (Latest): // True if |sink_| was undergoing reinitialization prior to playing.
      Dale Curtis . resolved

      I don't think we need this new state. The point of having a `state_` variable is to avoid the need for additional bool multipliers on the state diagram.

      Michael Chan

      Acknowledged

      File media/renderers/audio_renderer_impl.cc
      Line 149, Patchset 8 (Latest): if ((state_ == kPlaying && was_reinitializing_sink_) ||
      Dale Curtis . resolved

      Just early return with state == kReinitalizingSink.

      Michael Chan

      Acknowledged

      Dale Curtis . resolved

      Likewise early return if state == reinitializing after setting sink_playing_ = false.

      Michael Chan

      Acknowledged

      Line 208, Patchset 8 (Latest): DCHECK(state_ == kFlushed || state_ == kReinitializingSink ||
      Dale Curtis . resolved

      This should only be state_ == kFlushed, Flush() during Reinitalize should defer the flush callback such that this call isn't possible until it completes.

      Michael Chan

      Acknowledged

      Line 321, Patchset 8 (Latest): was_reinitializing_sink_ = (state_ == kReinitializingSink);
      Dale Curtis . resolved

      This should early return if state == kReinitializingSink and execute the flush_cb_ only when reinitailize completes.

      Michael Chan

      Acknowledged

      Line 338, Patchset 8 (Latest): DCHECK((state_ == kFlushed && !pending_read_) ||
      Dale Curtis . resolved

      Shouldn't be possible after above advice.

      Michael Chan

      Acknowledged

      Line 351, Patchset 8 (Latest): DCHECK(state_ == kFlushed || state_ == kReinitializingSink ||
      Dale Curtis . resolved

      Shouldn't be possible after above advice.

      Michael Chan

      Acknowledged

      Line 375, Patchset 8 (Latest): DCHECK(state_ == kFlushed || state_ == kReinitializingSink ||
      Dale Curtis . resolved

      Shouldn't be possible after above advice.

      Michael Chan

      Acknowledged

      Dale Curtis . resolved

      This needs to execute the flush process if flush_cb_ exists.

      Michael Chan

      Acknowledged

      Line 831, Patchset 8 (Latest): if ((state_ == kPlaying || state_ == kReinitializingSink) &&
      Dale Curtis . resolved

      This should just early return if we're in the reinitializing state since playback is already paused for the sink switch -- it'll be called again if we still don't have enough data once playback starts on the new sink.

      Michael Chan

      Acknowledged

      Line 1253, Patchset 8 (Latest): case kReinitializingSink:
      Dale Curtis . resolved

      Probably this should be true to ensure we keep buffering while waiting for the sink change. It does mean you'd need to handle a case where a second config change comes in before the first completes though, so maybe too much trouble.

      Michael Chan

      Acknowledged

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Dale Curtis
      • Dean Wheatley
      • Maya Jelonkiewicz
      • Thomas Guilbert
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I24aaa5d8e962f5e1218d71ce063c7e7ec18b3a53
      Gerrit-Change-Number: 6811046
      Gerrit-PatchSet: 8
      Gerrit-Owner: Michael Chan <mzc...@dolby.com>
      Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
      Gerrit-Reviewer: Thomas Guilbert <tgui...@chromium.org>
      Gerrit-Reviewer: Ying Zheng <yiz...@google.com>
      Gerrit-CC: Dean Wheatley <dw...@dolby.com>
      Gerrit-CC: Maya Jelonkiewicz <mj...@google.com>
      Gerrit-CC: Sandeep Vijayasekar <sa...@chromium.org>
      Gerrit-CC: Simeon Anfinrud <san...@chromium.org>
      Gerrit-CC: Yule Wu <y...@dolby.com>
      Gerrit-Attention: Dean Wheatley <dw...@dolby.com>
      Gerrit-Attention: Thomas Guilbert <tgui...@chromium.org>
      Gerrit-Attention: Maya Jelonkiewicz <mj...@google.com>
      Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
      Gerrit-Comment-Date: Mon, 15 Sep 2025 03:53:07 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Dale Curtis <dalec...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Dale Curtis (Gerrit)

      unread,
      Sep 15, 2025, 5:50:41 PM (5 days ago) Sep 15
      to Michael Chan, Sandeep Vijayasekar, Simeon Anfinrud, Maya Jelonkiewicz, AyeAye, Thomas Guilbert, Ying Zheng, Dean Wheatley, Yule Wu, feature-me...@chromium.org
      Attention needed from Dean Wheatley, Maya Jelonkiewicz, Michael Chan and Thomas Guilbert

      Dale Curtis added 5 comments

      File media/audio/audio_manager_base.cc
      Line 425, Patchset 8: // Use input source audio channel count/layout if allowing
      Dale Curtis . unresolved

      Do we really need to keep just the channel count the same? I.e., if we prefer the stream sample rate, is that okay? I think it would let us drop this clause here and instead just add a new conditional to:

      Michael Chan

      Without this change here, the output is locked to the default channel count, even when I add an additional conditional to the above "use_stream_params".

      Dale Curtis

      Hmm, that's surprising. Are you hitting this clause here:

      Android should allow resampling passthrough, that combined with use_stream_params should mean you're able to use the stream params here.

      File media/base/media_switches.cc
      Line 950, Patchset 9 (Latest):BASE_FEATURE(kMatchSourceAudioChannelLayout,
      Dale Curtis . unresolved

      Can you file a bug for this feature that we can link to a "TODO(crbug.com/##): This should be replaced with a MediaClient mechanism if it works as intended"

      File media/renderers/audio_renderer_impl.cc
      Line 435, Patchset 9 (Latest): } else {
      Dale Curtis . unresolved

      Initialize and return here since the sink should be stopped during Flush(). You can add a DCHECK(!sink_playing_) to confirm.

      Line 441, Patchset 9 (Latest): real_sink_needs_start_ = false;
      Dale Curtis . unresolved
      Do things work fine if you just copy the section from Initialize()? Maybe extract into a new InitializeSink() method that both can call?
      ```
      sink_->Initialize(audio_parameters_, this);
      if (null_sink_) {
      null_sink_->Initialize(audio_parameters_, this);
      null_sink_->Start(); // Does nothing but reduce state bookkeeping.
      real_sink_needs_start_ = true;
      } else {
      // Even when kSuspendMutedAudio is enabled, we can hit this path if we are
      // exclusively using NullAudioSink due to OnDeviceInfoReceived() failure.
      sink_->Start();
      sink_->Pause(); // Sinks play on start.
      }
      SetVolume(volume_);
      ```
      Line 1676, Patchset 9 (Latest): sink_->Pause(); // Avoid issuing play if already playing.
      Dale Curtis . unresolved

      I think you can drop this if you switch to the method I suggested above.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Dean Wheatley
      • Maya Jelonkiewicz
      • Michael Chan
      • Thomas Guilbert
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I24aaa5d8e962f5e1218d71ce063c7e7ec18b3a53
      Gerrit-Change-Number: 6811046
      Gerrit-PatchSet: 9
      Gerrit-Owner: Michael Chan <mzc...@dolby.com>
      Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
      Gerrit-Reviewer: Thomas Guilbert <tgui...@chromium.org>
      Gerrit-Reviewer: Ying Zheng <yiz...@google.com>
      Gerrit-CC: Dean Wheatley <dw...@dolby.com>
      Gerrit-CC: Maya Jelonkiewicz <mj...@google.com>
      Gerrit-CC: Sandeep Vijayasekar <sa...@chromium.org>
      Gerrit-CC: Simeon Anfinrud <san...@chromium.org>
      Gerrit-CC: Yule Wu <y...@dolby.com>
      Gerrit-Attention: Michael Chan <mzc...@dolby.com>
      Gerrit-Attention: Thomas Guilbert <tgui...@chromium.org>
      Gerrit-Attention: Maya Jelonkiewicz <mj...@google.com>
      Gerrit-Attention: Dean Wheatley <dw...@dolby.com>
      Gerrit-Comment-Date: Mon, 15 Sep 2025 21:50:32 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Dale Curtis <dalec...@chromium.org>
      Comment-In-Reply-To: Michael Chan <mzc...@dolby.com>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Michael Chan (Gerrit)

      unread,
      Sep 16, 2025, 12:52:52 AM (4 days ago) Sep 16
      to Sandeep Vijayasekar, Simeon Anfinrud, Maya Jelonkiewicz, AyeAye, Dale Curtis, Thomas Guilbert, Ying Zheng, Dean Wheatley, Yule Wu, feature-me...@chromium.org
      Attention needed from Dale Curtis, Dean Wheatley, Maya Jelonkiewicz and Thomas Guilbert

      Michael Chan added 5 comments

      File media/audio/audio_manager_base.cc
      Line 425, Patchset 8: // Use input source audio channel count/layout if allowing
      Dale Curtis . unresolved

      Do we really need to keep just the channel count the same? I.e., if we prefer the stream sample rate, is that okay? I think it would let us drop this clause here and instead just add a new conditional to:

      Michael Chan

      Without this change here, the output is locked to the default channel count, even when I add an additional conditional to the above "use_stream_params".

      Dale Curtis

      Hmm, that's surprising. Are you hitting this clause here:

      Android should allow resampling passthrough, that combined with use_stream_params should mean you're able to use the stream params here.

      Michael Chan

      I am not getting into the else part because expecting_config_changes_ gets set to 0 and hence use_stream_params gets set to 1.

      File media/base/media_switches.cc
      Line 950, Patchset 9 (Latest):BASE_FEATURE(kMatchSourceAudioChannelLayout,
      Dale Curtis . resolved

      Can you file a bug for this feature that we can link to a "TODO(crbug.com/##): This should be replaced with a MediaClient mechanism if it works as intended"

      Michael Chan

      I've added this issue in the tracker: https://issues.chromium.org/u/1/issues/445215599

      Will add a TODO here.

      File media/renderers/audio_renderer_impl.cc
      Dale Curtis . resolved

      Initialize and return here since the sink should be stopped during Flush(). You can add a DCHECK(!sink_playing_) to confirm.

      Michael Chan

      Acknowledged

      Line 441, Patchset 9 (Latest): real_sink_needs_start_ = false;
      Dale Curtis . unresolved
      Do things work fine if you just copy the section from Initialize()? Maybe extract into a new InitializeSink() method that both can call?
      ```
      sink_->Initialize(audio_parameters_, this);
      if (null_sink_) {
      null_sink_->Initialize(audio_parameters_, this);
      null_sink_->Start(); // Does nothing but reduce state bookkeeping.
      real_sink_needs_start_ = true;
      } else {
      // Even when kSuspendMutedAudio is enabled, we can hit this path if we are
      // exclusively using NullAudioSink due to OnDeviceInfoReceived() failure.
      sink_->Start();
      sink_->Pause(); // Sinks play on start.
      }
      SetVolume(volume_);
      ```
      Michael Chan

      I will factor out the code you suggested into an InitializeSink() method and call it in the flush case. It doesn't work if I replace the code here with InitializeSink() as the semantics are slightly different: both sinks need to be initialized and Play() needs to be invoked, otherwise, playback doesn't commence after reinitialization.

      Line 1676, Patchset 9 (Latest): sink_->Pause(); // Avoid issuing play if already playing.
      Dale Curtis . unresolved

      I think you can drop this if you switch to the method I suggested above.

      Michael Chan

      I couldn't get it working with the method you suggested. Please refer to my comment above.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Dale Curtis
      • Dean Wheatley
      • Maya Jelonkiewicz
      • Thomas Guilbert
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I24aaa5d8e962f5e1218d71ce063c7e7ec18b3a53
      Gerrit-Change-Number: 6811046
      Gerrit-PatchSet: 9
      Gerrit-Owner: Michael Chan <mzc...@dolby.com>
      Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
      Gerrit-Reviewer: Thomas Guilbert <tgui...@chromium.org>
      Gerrit-Reviewer: Ying Zheng <yiz...@google.com>
      Gerrit-CC: Dean Wheatley <dw...@dolby.com>
      Gerrit-CC: Maya Jelonkiewicz <mj...@google.com>
      Gerrit-CC: Sandeep Vijayasekar <sa...@chromium.org>
      Gerrit-CC: Simeon Anfinrud <san...@chromium.org>
      Gerrit-CC: Yule Wu <y...@dolby.com>
      Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
      Gerrit-Attention: Thomas Guilbert <tgui...@chromium.org>
      Gerrit-Attention: Maya Jelonkiewicz <mj...@google.com>
      Gerrit-Attention: Dean Wheatley <dw...@dolby.com>
      Gerrit-Comment-Date: Tue, 16 Sep 2025 04:52:16 +0000
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Dale Curtis (Gerrit)

      unread,
      Sep 16, 2025, 4:11:15 PM (4 days ago) Sep 16
      to Michael Chan, Sandeep Vijayasekar, Simeon Anfinrud, Maya Jelonkiewicz, AyeAye, Thomas Guilbert, Ying Zheng, Dean Wheatley, Yule Wu, feature-me...@chromium.org
      Attention needed from Dean Wheatley, Maya Jelonkiewicz, Michael Chan and Thomas Guilbert

      Dale Curtis added 2 comments

      File media/renderers/audio_renderer_impl.cc
      Line 441, Patchset 9: real_sink_needs_start_ = false;
      Dale Curtis . unresolved
      Do things work fine if you just copy the section from Initialize()? Maybe extract into a new InitializeSink() method that both can call?
      ```
      sink_->Initialize(audio_parameters_, this);
      if (null_sink_) {
      null_sink_->Initialize(audio_parameters_, this);
      null_sink_->Start(); // Does nothing but reduce state bookkeeping.
      real_sink_needs_start_ = true;
      } else {
      // Even when kSuspendMutedAudio is enabled, we can hit this path if we are
      // exclusively using NullAudioSink due to OnDeviceInfoReceived() failure.
      sink_->Start();
      sink_->Pause(); // Sinks play on start.
      }
      SetVolume(volume_);
      ```
      Michael Chan

      I will factor out the code you suggested into an InitializeSink() method and call it in the flush case. It doesn't work if I replace the code here with InitializeSink() as the semantics are slightly different: both sinks need to be initialized and Play() needs to be invoked, otherwise, playback doesn't commence after reinitialization.

      Dale Curtis

      The InitializeSink() you extracted does initialize both sinks if they exist. The call to SetVolume() should ensure we play the sink too if volume > 1.

      Which clause of SetVolume() are we failing? I was expecting it would end up here:

      Which should then end up here:

      Due to setting `real_sink_needs_start_` to true in InitializeSink().

      Which of the above isn't happening?

      Line 452, Patchset 10 (Latest): {
      Dale Curtis . unresolved

      I think you want to do this before you call DoFlush_Locked(). You can then clean up the auto lockers such that you only have a auto lock for state changes.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Dean Wheatley
      • Maya Jelonkiewicz
      • Michael Chan
      • Thomas Guilbert
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I24aaa5d8e962f5e1218d71ce063c7e7ec18b3a53
      Gerrit-Change-Number: 6811046
      Gerrit-PatchSet: 10
      Gerrit-Owner: Michael Chan <mzc...@dolby.com>
      Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
      Gerrit-Reviewer: Thomas Guilbert <tgui...@chromium.org>
      Gerrit-Reviewer: Ying Zheng <yiz...@google.com>
      Gerrit-CC: Dean Wheatley <dw...@dolby.com>
      Gerrit-CC: Maya Jelonkiewicz <mj...@google.com>
      Gerrit-CC: Sandeep Vijayasekar <sa...@chromium.org>
      Gerrit-CC: Simeon Anfinrud <san...@chromium.org>
      Gerrit-CC: Yule Wu <y...@dolby.com>
      Gerrit-Attention: Michael Chan <mzc...@dolby.com>
      Gerrit-Attention: Thomas Guilbert <tgui...@chromium.org>
      Gerrit-Attention: Maya Jelonkiewicz <mj...@google.com>
      Gerrit-Attention: Dean Wheatley <dw...@dolby.com>
      Gerrit-Comment-Date: Tue, 16 Sep 2025 20:11:06 +0000
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Michael Chan (Gerrit)

      unread,
      Sep 16, 2025, 7:46:49 PM (4 days ago) Sep 16
      to Sandeep Vijayasekar, Simeon Anfinrud, Maya Jelonkiewicz, AyeAye, Dale Curtis, Thomas Guilbert, Ying Zheng, Dean Wheatley, Yule Wu, feature-me...@chromium.org
      Attention needed from Dale Curtis, Dean Wheatley, Maya Jelonkiewicz and Thomas Guilbert

      Michael Chan added 2 comments

      File media/renderers/audio_renderer_impl.cc
      Michael Chan

      Here's some more data:

          09-17 09:39:33.762  6092  6143 I chromium: [INFO:media/renderers/audio_renderer_impl.cc:889] SetVolume: mzchan: real_sink_needs_start_:1 volume_:1 volume:1 render_muted_audio_:0
      09-17 09:39:33.762 6092 6143 I chromium: [INFO:media/renderers/audio_renderer_impl.cc:1684] MaybeStartRealSink: mzchan: real_sink_needs_start_:1 sink_playing_:0


      Since sink_playing_ isn't set to true, sink_->Play() doesn't get triggered.

      Dale Curtis . resolved

      I think you want to do this before you call DoFlush_Locked(). You can then clean up the auto lockers such that you only have a auto lock for state changes.

      Michael Chan

      Acknowledged

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Dale Curtis
      • Dean Wheatley
      • Maya Jelonkiewicz
      • Thomas Guilbert
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I24aaa5d8e962f5e1218d71ce063c7e7ec18b3a53
      Gerrit-Change-Number: 6811046
      Gerrit-PatchSet: 10
      Gerrit-Owner: Michael Chan <mzc...@dolby.com>
      Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
      Gerrit-Reviewer: Thomas Guilbert <tgui...@chromium.org>
      Gerrit-Reviewer: Ying Zheng <yiz...@google.com>
      Gerrit-CC: Dean Wheatley <dw...@dolby.com>
      Gerrit-CC: Maya Jelonkiewicz <mj...@google.com>
      Gerrit-CC: Sandeep Vijayasekar <sa...@chromium.org>
      Gerrit-CC: Simeon Anfinrud <san...@chromium.org>
      Gerrit-CC: Yule Wu <y...@dolby.com>
      Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
      Gerrit-Attention: Thomas Guilbert <tgui...@chromium.org>
      Gerrit-Attention: Maya Jelonkiewicz <mj...@google.com>
      Gerrit-Attention: Dean Wheatley <dw...@dolby.com>
      Gerrit-Comment-Date: Tue, 16 Sep 2025 23:46:21 +0000
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Dale Curtis (Gerrit)

      unread,
      Sep 17, 2025, 6:36:10 PM (3 days ago) Sep 17
      to Michael Chan, Sandeep Vijayasekar, Simeon Anfinrud, Maya Jelonkiewicz, AyeAye, Thomas Guilbert, Ying Zheng, Dean Wheatley, Yule Wu, feature-me...@chromium.org
      Attention needed from Dean Wheatley, Maya Jelonkiewicz, Michael Chan and Thomas Guilbert

      Dale Curtis added 1 comment

      File media/renderers/audio_renderer_impl.cc
      Dale Curtis

      Something seems wrong is `sink_playing_` is false. Do you know what's setting that? That means StopRendering must have been called.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Dean Wheatley
      • Maya Jelonkiewicz
      • Michael Chan
      • Thomas Guilbert
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I24aaa5d8e962f5e1218d71ce063c7e7ec18b3a53
      Gerrit-Change-Number: 6811046
      Gerrit-PatchSet: 11
      Gerrit-Owner: Michael Chan <mzc...@dolby.com>
      Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
      Gerrit-Reviewer: Thomas Guilbert <tgui...@chromium.org>
      Gerrit-Reviewer: Ying Zheng <yiz...@google.com>
      Gerrit-CC: Dean Wheatley <dw...@dolby.com>
      Gerrit-CC: Maya Jelonkiewicz <mj...@google.com>
      Gerrit-CC: Sandeep Vijayasekar <sa...@chromium.org>
      Gerrit-CC: Simeon Anfinrud <san...@chromium.org>
      Gerrit-CC: Yule Wu <y...@dolby.com>
      Gerrit-Attention: Dean Wheatley <dw...@dolby.com>
      Gerrit-Attention: Michael Chan <mzc...@dolby.com>
      Gerrit-Attention: Thomas Guilbert <tgui...@chromium.org>
      Gerrit-Attention: Maya Jelonkiewicz <mj...@google.com>
      Gerrit-Comment-Date: Wed, 17 Sep 2025 22:36:00 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Michael Chan <mzc...@dolby.com>
      Comment-In-Reply-To: Dale Curtis <dalec...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Michael Chan (Gerrit)

      unread,
      Sep 17, 2025, 7:43:02 PM (3 days ago) Sep 17
      to Sandeep Vijayasekar, Simeon Anfinrud, Maya Jelonkiewicz, AyeAye, Dale Curtis, Thomas Guilbert, Ying Zheng, Dean Wheatley, Yule Wu, feature-me...@chromium.org
      Attention needed from Dale Curtis, Dean Wheatley, Maya Jelonkiewicz and Thomas Guilbert

      Michael Chan added 1 comment

      File media/renderers/audio_renderer_impl.cc
      Michael Chan

      This is probably due to a sink reinitialization occurring in the preroll stage before pressing the play button. I get these logs when loading up the media without pressing play:

          09-18 09:34:17.960 13012 13059 V chromium: [VERBOSE1:media/renderers/audio_renderer_impl.cc:382] Initialize
      09-18 09:34:17.964 13012 13059 V chromium: [VERBOSE1:media/renderers/audio_renderer_impl.cc:476] OnDeviceInfoReceived
      09-18 09:34:17.964 13012 13059 V chromium: [VERBOSE1:media/renderers/audio_renderer_impl.cc:509] OnDeviceInfoReceived: format: PCM_LOW_LATENCY, channel_layout: 3, channels: 2, sample_rate: 48000, frames_per_buffer: 1056, effects: NONE, mic_positions: , latency_tag: LatencyUnknown, hw_capabilities: min_frames_per_buffer: 0, max_frames_per_buffer: 0, bitstream_formats:0, require_encapsulation:0, require_audio_offload:0
      09-18 09:34:17.965 13012 13059 V chromium: [VERBOSE1:media/renderers/audio_renderer_impl.cc:689] OnDeviceInfoReceived: is_passthrough_=0 codec=eac3 stream->audio_decoder_config().sample_format=2
      09-18 09:34:17.980 13012 13059 V chromium: [VERBOSE1:media/renderers/audio_renderer_impl.cc:728] OnAudioDecoderStreamInitialized: 1
      09-18 09:34:17.980 13012 13059 V chromium: [VERBOSE1:media/renderers/audio_renderer_impl.cc:1564] ChangeState_Locked : 1 -> 3
      09-18 09:34:17.982 13012 13059 V chromium: [VERBOSE1:media/renderers/audio_renderer_impl.cc:199] SetMediaTime(0 s)
      09-18 09:34:17.982 13012 13059 V chromium: [VERBOSE1:media/renderers/audio_renderer_impl.cc:365] StartPlaying
      09-18 09:34:17.982 13012 13059 V chromium: [VERBOSE1:media/renderers/audio_renderer_impl.cc:1564] ChangeState_Locked : 3 -> 5
      09-18 09:34:17.982 13012 13059 V chromium: [VERBOSE1:media/renderers/audio_renderer_impl.cc:1262] SetPlaybackRate(0)
      09-18 09:34:17.989 13012 13059 V chromium: [VERBOSE1:media/renderers/audio_renderer_impl.cc:1009] DecodedAudioReady: Reconfiguring sink for channel count from 6 to 2
      09-18 09:34:17.989 13012 13059 V chromium: [VERBOSE1:media/renderers/audio_renderer_impl.cc:1564] ChangeState_Locked : 5 -> 4
      09-18 09:34:18.024 13012 13059 V chromium: [VERBOSE1:media/renderers/audio_renderer_impl.cc:443] OnSourceChannelCountChanged: Reconfiguring sink for channel count:2
      09-18 09:34:18.024 13012 13059 V chromium: [VERBOSE1:media/renderers/audio_renderer_impl.cc:1564] ChangeState_Locked : 4 -> 5
      09-18 09:34:32.926 13012 13059 V chromium: [VERBOSE1:media/renderers/audio_renderer_impl.cc:1262] SetPlaybackRate(0)
      09-18 09:34:32.927 13012 13059 V chromium: [VERBOSE1:media/renderers/audio_renderer_impl.cc:104] ~AudioRendererImpl
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Dale Curtis
      • Dean Wheatley
      • Maya Jelonkiewicz
      • Thomas Guilbert
      Gerrit-Attention: Thomas Guilbert <tgui...@chromium.org>
      Gerrit-Attention: Maya Jelonkiewicz <mj...@google.com>
      Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
      Gerrit-Comment-Date: Wed, 17 Sep 2025 23:42:26 +0000
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Dale Curtis (Gerrit)

      unread,
      Sep 17, 2025, 7:54:05 PM (3 days ago) Sep 17
      to Michael Chan, Sandeep Vijayasekar, Simeon Anfinrud, Maya Jelonkiewicz, AyeAye, Thomas Guilbert, Ying Zheng, Dean Wheatley, Yule Wu, feature-me...@chromium.org
      Attention needed from Dean Wheatley, Maya Jelonkiewicz, Michael Chan and Thomas Guilbert

      Dale Curtis added 1 comment

      File media/renderers/audio_renderer_impl.cc
      Dale Curtis

      Ah, in that case it should be okay for us to not start the new sink? It should start when playback starts up?

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Dean Wheatley
      • Maya Jelonkiewicz
      • Michael Chan
      • Thomas Guilbert
      Gerrit-Attention: Michael Chan <mzc...@dolby.com>
      Gerrit-Attention: Thomas Guilbert <tgui...@chromium.org>
      Gerrit-Attention: Maya Jelonkiewicz <mj...@google.com>
      Gerrit-Comment-Date: Wed, 17 Sep 2025 23:53:54 +0000
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Michael Chan (Gerrit)

      unread,
      Sep 17, 2025, 8:01:57 PM (3 days ago) Sep 17
      to Sandeep Vijayasekar, Simeon Anfinrud, Maya Jelonkiewicz, AyeAye, Dale Curtis, Thomas Guilbert, Ying Zheng, Dean Wheatley, Yule Wu, feature-me...@chromium.org
      Attention needed from Dale Curtis, Dean Wheatley, Maya Jelonkiewicz and Thomas Guilbert

      Michael Chan added 1 comment

      File media/renderers/audio_renderer_impl.cc
      Michael Chan

      For this case maybe we don't need to start the sink but for the case when sink reinitializes during playback, I think it would be required because the sink was previously stopped. Not sure how to differentiate between these two cases though.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Dale Curtis
      • Dean Wheatley
      • Maya Jelonkiewicz
      • Thomas Guilbert
      Gerrit-Attention: Thomas Guilbert <tgui...@chromium.org>
      Gerrit-Attention: Maya Jelonkiewicz <mj...@google.com>
      Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
      Gerrit-Comment-Date: Thu, 18 Sep 2025 00:01:29 +0000
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Dale Curtis (Gerrit)

      unread,
      Sep 18, 2025, 12:53:38 PM (2 days ago) Sep 18
      to Michael Chan, Sandeep Vijayasekar, Simeon Anfinrud, Maya Jelonkiewicz, AyeAye, Thomas Guilbert, Ying Zheng, Dean Wheatley, Yule Wu, feature-me...@chromium.org
      Attention needed from Dean Wheatley, Maya Jelonkiewicz, Michael Chan and Thomas Guilbert

      Dale Curtis added 1 comment

      File media/renderers/audio_renderer_impl.cc
      Dale Curtis

      The SetVolume() call I linked above should restart the sinks though? Do you not see that happening?

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Dean Wheatley
      • Maya Jelonkiewicz
      • Michael Chan
      • Thomas Guilbert
      Gerrit-Attention: Michael Chan <mzc...@dolby.com>
      Gerrit-Attention: Thomas Guilbert <tgui...@chromium.org>
      Gerrit-Attention: Maya Jelonkiewicz <mj...@google.com>
      Gerrit-Comment-Date: Thu, 18 Sep 2025 16:53:28 +0000
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Michael Chan (Gerrit)

      unread,
      Sep 18, 2025, 4:43:09 PM (2 days ago) Sep 18
      to Sandeep Vijayasekar, Simeon Anfinrud, Maya Jelonkiewicz, AyeAye, Dale Curtis, Thomas Guilbert, Ying Zheng, Dean Wheatley, Yule Wu, feature-me...@chromium.org
      Attention needed from Dale Curtis, Dean Wheatley, Maya Jelonkiewicz and Thomas Guilbert

      Michael Chan added 1 comment

      File media/renderers/audio_renderer_impl.cc
      Michael Chan

      In Patchset 12, I've cleaned up the code and now I don't start the new sink. Playback starts and sink reinitialization works as expected. Only issue I see now is that when I mute the audio, playback stops. If I unmute, playback continues. Any ideas what might be happening?

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Dale Curtis
      • Dean Wheatley
      • Maya Jelonkiewicz
      • Thomas Guilbert
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I24aaa5d8e962f5e1218d71ce063c7e7ec18b3a53
      Gerrit-Change-Number: 6811046
      Gerrit-PatchSet: 12
      Gerrit-Owner: Michael Chan <mzc...@dolby.com>
      Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
      Gerrit-Reviewer: Thomas Guilbert <tgui...@chromium.org>
      Gerrit-Reviewer: Ying Zheng <yiz...@google.com>
      Gerrit-CC: Dean Wheatley <dw...@dolby.com>
      Gerrit-CC: Maya Jelonkiewicz <mj...@google.com>
      Gerrit-CC: Sandeep Vijayasekar <sa...@chromium.org>
      Gerrit-CC: Simeon Anfinrud <san...@chromium.org>
      Gerrit-CC: Yule Wu <y...@dolby.com>
      Gerrit-Attention: Dean Wheatley <dw...@dolby.com>
      Gerrit-Attention: Thomas Guilbert <tgui...@chromium.org>
      Gerrit-Attention: Maya Jelonkiewicz <mj...@google.com>
      Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
      Gerrit-Comment-Date: Thu, 18 Sep 2025 20:42:24 +0000
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Michael Chan (Gerrit)

      unread,
      Sep 19, 2025, 3:37:56 AM (yesterday) Sep 19
      to Sandeep Vijayasekar, Simeon Anfinrud, Maya Jelonkiewicz, AyeAye, Dale Curtis, Thomas Guilbert, Ying Zheng, Dean Wheatley, Yule Wu, feature-me...@chromium.org
      Attention needed from Dale Curtis, Dean Wheatley, Maya Jelonkiewicz and Thomas Guilbert

      Michael Chan added 3 comments

      Patchset-level comments
      File-level comment, Patchset 13 (Latest):
      Michael Chan . resolved

      Hi Dale,

      I've addressed your comments and the code is in a good working state from my perspective. Please let me know what you think.

      Regards, Michael

      File media/renderers/audio_renderer_impl.cc
      Michael Chan

      The mute/unmute issue is not seen anymore after I fixed a bug in NullAudioSink where the playing flag didn't get reset on Stop().

      Line 1676, Patchset 9: sink_->Pause(); // Avoid issuing play if already playing.
      Dale Curtis . resolved

      I think you can drop this if you switch to the method I suggested above.

      Michael Chan

      I couldn't get it working with the method you suggested. Please refer to my comment above.

      Michael Chan

      This is not needed and has been removed now.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Dale Curtis
      • Dean Wheatley
      • Maya Jelonkiewicz
      • Thomas Guilbert
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I24aaa5d8e962f5e1218d71ce063c7e7ec18b3a53
      Gerrit-Change-Number: 6811046
      Gerrit-PatchSet: 13
      Gerrit-Owner: Michael Chan <mzc...@dolby.com>
      Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
      Gerrit-Reviewer: Thomas Guilbert <tgui...@chromium.org>
      Gerrit-Reviewer: Ying Zheng <yiz...@google.com>
      Gerrit-CC: Dean Wheatley <dw...@dolby.com>
      Gerrit-CC: Maya Jelonkiewicz <mj...@google.com>
      Gerrit-CC: Sandeep Vijayasekar <sa...@chromium.org>
      Gerrit-CC: Simeon Anfinrud <san...@chromium.org>
      Gerrit-CC: Yule Wu <y...@dolby.com>
      Gerrit-Attention: Dean Wheatley <dw...@dolby.com>
      Gerrit-Attention: Thomas Guilbert <tgui...@chromium.org>
      Gerrit-Attention: Maya Jelonkiewicz <mj...@google.com>
      Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
      Gerrit-Comment-Date: Fri, 19 Sep 2025 07:37:35 +0000
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Dale Curtis (Gerrit)

      unread,
      Sep 19, 2025, 3:04:04 PM (19 hours ago) Sep 19
      to Michael Chan, Sandeep Vijayasekar, Simeon Anfinrud, Maya Jelonkiewicz, AyeAye, Thomas Guilbert, Ying Zheng, Dean Wheatley, Yule Wu, feature-me...@chromium.org
      Attention needed from Dean Wheatley, Maya Jelonkiewicz, Michael Chan and Thomas Guilbert

      Dale Curtis added 1 comment

      File media/renderers/audio_renderer_impl.cc
      Dale Curtis

      Great, can you add a small unit test to NullAudioSink for that?

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Dean Wheatley
      • Maya Jelonkiewicz
      • Michael Chan
      • Thomas Guilbert
      Gerrit-Attention: Michael Chan <mzc...@dolby.com>
      Gerrit-Attention: Thomas Guilbert <tgui...@chromium.org>
      Gerrit-Attention: Maya Jelonkiewicz <mj...@google.com>
      Gerrit-Comment-Date: Fri, 19 Sep 2025 19:03:55 +0000
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Dale Curtis (Gerrit)

      unread,
      Sep 19, 2025, 3:06:17 PM (19 hours ago) Sep 19
      to Michael Chan, Sandeep Vijayasekar, Simeon Anfinrud, Maya Jelonkiewicz, AyeAye, Thomas Guilbert, Ying Zheng, Dean Wheatley, Yule Wu, feature-me...@chromium.org
      Attention needed from Dean Wheatley, Maya Jelonkiewicz, Michael Chan and Thomas Guilbert

      Dale Curtis added 2 comments

      File media/renderers/audio_renderer_impl.cc
      Line 448, Patchset 13 (Latest): AttemptRead_Locked();
      Dale Curtis . unresolved

      Is this needed? I'd expect SetVolume() to start the sink going which should end up triggering this automatically.

      Line 451, Patchset 13 (Latest): if (null_sink_) {
      Dale Curtis . unresolved

      This shouldn't be needed?

      Gerrit-Comment-Date: Fri, 19 Sep 2025 19:06:08 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Dale Curtis (Gerrit)

      unread,
      Sep 19, 2025, 3:08:25 PM (19 hours ago) Sep 19
      to Michael Chan, Sandeep Vijayasekar, Simeon Anfinrud, Maya Jelonkiewicz, AyeAye, Thomas Guilbert, Ying Zheng, Dean Wheatley, Yule Wu, feature-me...@chromium.org
      Attention needed from Dean Wheatley, Maya Jelonkiewicz, Michael Chan and Thomas Guilbert

      Dale Curtis added 2 comments

      Patchset-level comments
      File-level comment, Patchset 4:
      Michael Chan . resolved

      Hi Dale,

      I've addressed your comments in the latest patchset, but I have held off on null sink handling for now because I am getting DCHECK failures in null_audio_sink.cc.

      Nevertheless, I am still getting the same DCHECK failure in web_audio_source_provider_impl.cc:

          08-21 07:14:43.753 15030 15110 F DEBUG   : Abort message: '[FATAL:third_party/blink/renderer/platform/media/web_audio_source_provider_impl.cc:298] DCHECK failed: state_ == kStarted (0 vs. 1)'
      Dale Curtis

      Hmm, I'm not getting that same DCHECK over here. Are you able to reproduce that with https://storage.googleapis.com/dalecurtis/mse.html?src=aac_change_layout.adts&type=adts ? If so what are your repro steps?

      Michael Chan

      I am unable to start playback of that asset - it shows a spinning play icon and pressing play doesn't start playback and the icon continues to spin.

      With the Dolby Digital Plus asset, I can play through the first time but again, waiting like ~60 seconds before attempting to play again will cause the DCHECK failure above on AAOS15 emulator.

      Dale Curtis

      Hmm, the asset is just AAC. Are you building with proprietary_codecs=true and ffmpeg_branding=Chrome?

      Michael Chan

      Yes, I have those flags in my args.gn:

      target_os = "android"
      target_cpu = "x64" # See "Figuring out target_cpu" below
      android_static_analysis = "build_server"
      proprietary_codecs=true
      enable_platform_ac3_eac3_audio=true
      ffmpeg_branding="Chrome"
      is_debug=true
      dcheck_always_on = true

      Dale Curtis

      That all looks right. I'm not sure why the linked stream wouldn't work for you then. I'll try to poke at this more tomorrow when I have more time. That sink state does mean that there's some missing state case not being handled.

      Dale Curtis

      Acknowledged

      File media/audio/audio_manager_base.cc
      Line 425, Patchset 8: // Use input source audio channel count/layout if allowing
      Dale Curtis . unresolved

      Do we really need to keep just the channel count the same? I.e., if we prefer the stream sample rate, is that okay? I think it would let us drop this clause here and instead just add a new conditional to:

      Michael Chan

      Without this change here, the output is locked to the default channel count, even when I add an additional conditional to the above "use_stream_params".

      Dale Curtis

      Hmm, that's surprising. Are you hitting this clause here:

      Android should allow resampling passthrough, that combined with use_stream_params should mean you're able to use the stream params here.

      Michael Chan

      I am not getting into the else part because expecting_config_changes_ gets set to 0 and hence use_stream_params gets set to 1.

      Dale Curtis

      use_stream_params=true is what we want though? What params do we actually send to Initialize() in this case?

      Gerrit-Comment-Date: Fri, 19 Sep 2025 19:08:14 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy
      Reply all
      Reply to author
      Forward
      0 new messages