Integrate ReferenceSignalProvider error handling in the AudioService [chromium/src : main]

0 views
Skip to first unread message

Fredrik Hernqvist (Gerrit)

unread,
Jun 10, 2025, 10:50:58 AM6/10/25
to Olga Sharonova, Chromium LUCI CQ, chromium...@chromium.org, marinacio...@chromium.org, olka+...@chromium.org, zhangwen...@google.com
Attention needed from Olga Sharonova

Fredrik Hernqvist voted and added 1 comment

Votes added by Fredrik Hernqvist

Commit-Queue+1

1 comment

Patchset-level comments
File-level comment, Patchset 8 (Latest):
Fredrik Hernqvist . resolved

PTAL! :)

Open in Gerrit

Related details

Attention is currently required from:
  • Olga Sharonova
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: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I6d5644ae7761441fe883da155286f2489aea36ce
Gerrit-Change-Number: 6620533
Gerrit-PatchSet: 8
Gerrit-Owner: Fredrik Hernqvist <fhern...@google.com>
Gerrit-Reviewer: Fredrik Hernqvist <fhern...@google.com>
Gerrit-Reviewer: Olga Sharonova <ol...@chromium.org>
Gerrit-Attention: Olga Sharonova <ol...@chromium.org>
Gerrit-Comment-Date: Tue, 10 Jun 2025 14:50:45 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Olga Sharonova (Gerrit)

unread,
Jun 10, 2025, 11:11:36 AM6/10/25
to Fredrik Hernqvist, Chromium LUCI CQ, chromium...@chromium.org, marinacio...@chromium.org, olka+...@chromium.org, zhangwen...@google.com
Attention needed from Fredrik Hernqvist

Olga Sharonova added 5 comments

File services/audio/audio_processor_handler.cc
Line 76, Patchset 8 (Latest): reference_stream_error_callback_.Run();
Olga Sharonova . unresolved

Do we have any threading expectations?

File services/audio/input_controller.cc
Line 371, Patchset 8 (Latest): base::BindPostTask(task_runner_,
Olga Sharonova . unresolved

So what do we have with error posting? Could you describe the full picture - how many times we post them in each context?


Also, what happens if the error signaling is scheduled after some other operations?

Line 383, Patchset 8 (Latest): // InputStream will be responsible for closing the stream after calling
Olga Sharonova . unresolved

Which stream? Itself? Or InputController? Or?

Line 385, Patchset 8 (Latest): event_handler_->OnError(
Olga Sharonova . unresolved

What about this error being signaled in the context of Record(), especially given that InputStream is responsible for closing, according to the comment?

Line 396, Patchset 8 (Latest): }
Olga Sharonova . unresolved

We need to do a better cleanup/state maintenance.
1) audio_callback_ being not null does not mean Record() started successfully any more
2) processing_fifo_ will run the dedicated thread even if we have not started.

Open in Gerrit

Related details

Attention is currently required from:
  • Fredrik Hernqvist
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • 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: I6d5644ae7761441fe883da155286f2489aea36ce
    Gerrit-Change-Number: 6620533
    Gerrit-PatchSet: 8
    Gerrit-Owner: Fredrik Hernqvist <fhern...@google.com>
    Gerrit-Reviewer: Fredrik Hernqvist <fhern...@google.com>
    Gerrit-Reviewer: Olga Sharonova <ol...@chromium.org>
    Gerrit-Attention: Fredrik Hernqvist <fhern...@google.com>
    Gerrit-Comment-Date: Tue, 10 Jun 2025 15:11:21 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Fredrik Hernqvist (Gerrit)

    unread,
    Jun 12, 2025, 9:12:54 AM6/12/25
    to AyeAye, Olga Sharonova, Chromium LUCI CQ, chromium...@chromium.org, mac-r...@chromium.org, feature-me...@chromium.org, marinacio...@chromium.org, olka+...@chromium.org, zhangwen...@google.com
    Attention needed from Olga Sharonova

    Fredrik Hernqvist added 6 comments

    File media/audio/mac/catap_audio_input_stream.h
    Line 163, Patchset 10: static int error_test;
    Fredrik Hernqvist . unresolved

    Ignore the changes in the catap files until the rest of the code is ready, I use this for testing.

    File services/audio/audio_processor_handler.cc
    Line 76, Patchset 8: reference_stream_error_callback_.Run();
    Olga Sharonova . resolved

    Do we have any threading expectations?

    Fredrik Hernqvist

    Added a check, done.

    File services/audio/input_controller.cc
    Line 371, Patchset 8: base::BindPostTask(task_runner_,
    Olga Sharonova . unresolved

    So what do we have with error posting? Could you describe the full picture - how many times we post them in each context?


    Also, what happens if the error signaling is scheduled after some other operations?

    Fredrik Hernqvist

    event_handler_->OnError() can be called in these situations:

    1) In DoReportError posted from the AudioCallback when the input stream has an error (through the callback bound here). This can happen an arbitrary number of times depending on the OS implementation of the input stream, but probably once.
    2) In DoReportError posted from the AudioProcessorHandler when the reference stream has had an error. This can happen once.
    3) In DoCreate() (once) if we fail to create/open the stream.
    4) In Record() (once per record) if we fail to start the reference signal.

    I have not found a case where it matters when the error signaling is scheduled, the result is always that the stream is eventually destroyed.

    Line 383, Patchset 8: // InputStream will be responsible for closing the stream after calling
    Olga Sharonova . resolved

    Which stream? Itself? Or InputController? Or?

    Fredrik Hernqvist

    Both, clarified.

    Line 385, Patchset 8: event_handler_->OnError(
    Olga Sharonova . unresolved

    What about this error being signaled in the context of Record(), especially given that InputStream is responsible for closing, according to the comment?

    Fredrik Hernqvist

    It can be called at any time (it's also called in OnCreate, for example). It will schedule the deletion of the InputStream and InputController, but that won't happen until Record() finishes.

    Olga Sharonova . unresolved

    We need to do a better cleanup/state maintenance.
    1) audio_callback_ being not null does not mean Record() started successfully any more
    2) processing_fifo_ will run the dedicated thread even if we have not started.

    Fredrik Hernqvist

    I reordered it so that audio_callback_ will be null and the fifo will not start if the reference stream failed to start.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Olga Sharonova
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • 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: I6d5644ae7761441fe883da155286f2489aea36ce
    Gerrit-Change-Number: 6620533
    Gerrit-PatchSet: 11
    Gerrit-Owner: Fredrik Hernqvist <fhern...@google.com>
    Gerrit-Reviewer: Fredrik Hernqvist <fhern...@google.com>
    Gerrit-Reviewer: Olga Sharonova <ol...@chromium.org>
    Gerrit-Attention: Olga Sharonova <ol...@chromium.org>
    Gerrit-Comment-Date: Thu, 12 Jun 2025 13:12:39 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Olga Sharonova <ol...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Fredrik Hernqvist (Gerrit)

    unread,
    Jun 16, 2025, 7:35:16 AM6/16/25
    to AyeAye, Olga Sharonova, Chromium LUCI CQ, chromium...@chromium.org, mac-r...@chromium.org, feature-me...@chromium.org, marinacio...@chromium.org, olka+...@chromium.org, zhangwen...@google.com
    Attention needed from Olga Sharonova

    Fredrik Hernqvist added 1 comment

    File services/audio/input_controller.cc
    Line 385, Patchset 8: event_handler_->OnError(
    Olga Sharonova . unresolved

    What about this error being signaled in the context of Record(), especially given that InputStream is responsible for closing, according to the comment?

    Fredrik Hernqvist

    It can be called at any time (it's also called in OnCreate, for example). It will schedule the deletion of the InputStream and InputController, but that won't happen until Record() finishes.

    Fredrik Hernqvist

    The JS-observable effect is that the stream will end (with the ended-event being dispatched) shortly after the getUserMedia-promise resolves successfully.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Olga Sharonova
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • 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: I6d5644ae7761441fe883da155286f2489aea36ce
    Gerrit-Change-Number: 6620533
    Gerrit-PatchSet: 14
    Gerrit-Owner: Fredrik Hernqvist <fhern...@google.com>
    Gerrit-Reviewer: Fredrik Hernqvist <fhern...@google.com>
    Gerrit-Reviewer: Olga Sharonova <ol...@chromium.org>
    Gerrit-Attention: Olga Sharonova <ol...@chromium.org>
    Gerrit-Comment-Date: Mon, 16 Jun 2025 11:35:03 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Fredrik Hernqvist <fhern...@google.com>
    Comment-In-Reply-To: Olga Sharonova <ol...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Olga Sharonova (Gerrit)

    unread,
    Jun 16, 2025, 12:10:48 PM6/16/25
    to Fredrik Hernqvist, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, mac-r...@chromium.org, feature-me...@chromium.org, marinacio...@chromium.org, olka+...@chromium.org, zhangwen...@google.com
    Attention needed from Fredrik Hernqvist

    Olga Sharonova added 11 comments

    File services/audio/audio_processor_handler.h
    Line 137, Patchset 14 (Latest): const ReferenceStreamErrorCallback reference_stream_error_callback_;
    Olga Sharonova . unresolved

    GUARDED_BY_CONTEXT(owning_sequence_)?

    Line 113, Patchset 14 (Latest): // Called on the main thread.
    Olga Sharonova . unresolved

    On owning_sequence_?

    File services/audio/input_controller.h
    Line 124, Patchset 14 (Latest): // Failed to open aec reference stream due to device in use by another app
    Olga Sharonova . unresolved

    .

    Line 121, Patchset 14 (Latest): // Failed to open aec reference stream due to lack of system permissions
    Olga Sharonova . unresolved

    .

    Line 118, Patchset 14 (Latest): // Failed to open aec reference stream
    Olga Sharonova . unresolved

    .

    Line 115, Patchset 14 (Latest): // Failed to create aec reference stream
    Olga Sharonova . unresolved

    .

    File services/audio/input_controller.cc
    Line 361, Patchset 14 (Latest): // The AEC reference stream failed to start. By calling OnError() we let
    // the owning InputStream know about the error. This will schedule
    // the deletion of the InputStream and the InputController on the main
    // thread. As the InputController is now about to be deleted, we exit
    // early and do not start the stream or the processing thread.
    Olga Sharonova . unresolved

    Is this true for all DoReportError() calls? Why do we need to state it here specifically?

    Line 366, Patchset 14 (Latest): event_handler_->OnError(
    Olga Sharonova . unresolved

    DoReportError()

    Line 371, Patchset 8: base::BindPostTask(task_runner_,
    Olga Sharonova . unresolved

    So what do we have with error posting? Could you describe the full picture - how many times we post them in each context?


    Also, what happens if the error signaling is scheduled after some other operations?

    Fredrik Hernqvist

    event_handler_->OnError() can be called in these situations:

    1) In DoReportError posted from the AudioCallback when the input stream has an error (through the callback bound here). This can happen an arbitrary number of times depending on the OS implementation of the input stream, but probably once.
    2) In DoReportError posted from the AudioProcessorHandler when the reference stream has had an error. This can happen once.
    3) In DoCreate() (once) if we fail to create/open the stream.
    4) In Record() (once per record) if we fail to start the reference signal.

    I have not found a case where it matters when the error signaling is scheduled, the result is always that the stream is eventually destroyed.

    Olga Sharonova

    1) In DoReportError posted from the AudioCallback

    From which threads?

    2) In DoReportError posted from the AudioProcessorHandle

    From which threads?

    4) In Record() (once per record) if we fail to start the reference signal.

    once per record? the comment you added in the new PS says InputController will be deleted.

    Line 385, Patchset 8: event_handler_->OnError(
    Olga Sharonova . unresolved

    What about this error being signaled in the context of Record(), especially given that InputStream is responsible for closing, according to the comment?

    Fredrik Hernqvist

    It can be called at any time (it's also called in OnCreate, for example). It will schedule the deletion of the InputStream and InputController, but that won't happen until Record() finishes.

    Fredrik Hernqvist

    The JS-observable effect is that the stream will end (with the ended-event being dispatched) shortly after the getUserMedia-promise resolves successfully.

    Olga Sharonova
    " It will schedule the deletion of the InputStream"
     could you point to the code?
    Line 396, Patchset 8: }
    Olga Sharonova . resolved

    We need to do a better cleanup/state maintenance.
    1) audio_callback_ being not null does not mean Record() started successfully any more
    2) processing_fifo_ will run the dedicated thread even if we have not started.

    Fredrik Hernqvist

    I reordered it so that audio_callback_ will be null and the fifo will not start if the reference stream failed to start.

    Olga Sharonova

    Acknowledged

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Fredrik Hernqvist
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • 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: I6d5644ae7761441fe883da155286f2489aea36ce
    Gerrit-Change-Number: 6620533
    Gerrit-PatchSet: 14
    Gerrit-Owner: Fredrik Hernqvist <fhern...@google.com>
    Gerrit-Reviewer: Fredrik Hernqvist <fhern...@google.com>
    Gerrit-Reviewer: Olga Sharonova <ol...@chromium.org>
    Gerrit-Attention: Fredrik Hernqvist <fhern...@google.com>
    Gerrit-Comment-Date: Mon, 16 Jun 2025 16:10:32 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Fredrik Hernqvist (Gerrit)

    unread,
    Jun 17, 2025, 6:36:35 AM6/17/25
    to AyeAye, Olga Sharonova, Chromium LUCI CQ, chromium...@chromium.org, mac-r...@chromium.org, feature-me...@chromium.org, marinacio...@chromium.org, olka+...@chromium.org, zhangwen...@google.com
    Attention needed from Olga Sharonova

    Fredrik Hernqvist added 10 comments

    File services/audio/audio_processor_handler.h
    Line 137, Patchset 14: const ReferenceStreamErrorCallback reference_stream_error_callback_;
    Olga Sharonova . resolved

    GUARDED_BY_CONTEXT(owning_sequence_)?

    Fredrik Hernqvist

    Done

    Line 113, Patchset 14: // Called on the main thread.
    Olga Sharonova . resolved

    On owning_sequence_?

    Fredrik Hernqvist

    Done

    File services/audio/input_controller.h
    Line 124, Patchset 14: // Failed to open aec reference stream due to device in use by another app
    Olga Sharonova . resolved

    .

    Fredrik Hernqvist

    Done

    Line 121, Patchset 14: // Failed to open aec reference stream due to lack of system permissions
    Olga Sharonova . resolved

    .

    Fredrik Hernqvist

    Done

    Line 118, Patchset 14: // Failed to open aec reference stream
    Olga Sharonova . resolved

    .

    Fredrik Hernqvist

    Done

    Line 115, Patchset 14: // Failed to create aec reference stream
    Olga Sharonova . resolved

    .

    Fredrik Hernqvist

    Done

    File services/audio/input_controller.cc
    Line 361, Patchset 14: // The AEC reference stream failed to start. By calling OnError() we let

    // the owning InputStream know about the error. This will schedule
    // the deletion of the InputStream and the InputController on the main
    // thread. As the InputController is now about to be deleted, we exit
    // early and do not start the stream or the processing thread.
    Olga Sharonova . unresolved

    Is this true for all DoReportError() calls? Why do we need to state it here specifically?

    Fredrik Hernqvist

    Yes it's always true. Removed the comment.

    Line 366, Patchset 14: event_handler_->OnError(
    Olga Sharonova . resolved

    DoReportError()

    Fredrik Hernqvist

    Done

    Line 371, Patchset 8: base::BindPostTask(task_runner_,
    Olga Sharonova . unresolved

    So what do we have with error posting? Could you describe the full picture - how many times we post them in each context?


    Also, what happens if the error signaling is scheduled after some other operations?

    Fredrik Hernqvist

    event_handler_->OnError() can be called in these situations:

    1) In DoReportError posted from the AudioCallback when the input stream has an error (through the callback bound here). This can happen an arbitrary number of times depending on the OS implementation of the input stream, but probably once.
    2) In DoReportError posted from the AudioProcessorHandler when the reference stream has had an error. This can happen once.
    3) In DoCreate() (once) if we fail to create/open the stream.
    4) In Record() (once per record) if we fail to start the reference signal.

    I have not found a case where it matters when the error signaling is scheduled, the result is always that the stream is eventually destroyed.

    Olga Sharonova

    1) In DoReportError posted from the AudioCallback

    From which threads?

    2) In DoReportError posted from the AudioProcessorHandle

    From which threads?

    4) In Record() (once per record) if we fail to start the reference signal.

    once per record? the comment you added in the new PS says InputController will be deleted.

    Fredrik Hernqvist

    1) Posted from either realtime thread or main thread (as usual with AudioInputCallback::OnError)
    2) Always posted from main thread
    4) As far as I understand the code, there will only ever be one call to Record() regardless of errors. I stated it as "once per record" in case that ever changes, but it may just have confused things.

    Line 385, Patchset 8: event_handler_->OnError(
    Olga Sharonova . unresolved

    What about this error being signaled in the context of Record(), especially given that InputStream is responsible for closing, according to the comment?

    Fredrik Hernqvist

    It can be called at any time (it's also called in OnCreate, for example). It will schedule the deletion of the InputStream and InputController, but that won't happen until Record() finishes.

    Fredrik Hernqvist

    The JS-observable effect is that the stream will end (with the ended-event being dispatched) shortly after the getUserMedia-promise resolves successfully.

    Olga Sharonova
    " It will schedule the deletion of the InputStream"
    could you point to the code?
    Fredrik Hernqvist

    OnError() implementation: https://source.chromium.org/chromium/chromium/src/+/main:services/audio/input_stream.cc;l=255;drc=2a9c070f15d3fc47eeee29d0c1982f82f0d11fb6

    Then the call chain goes
    OnError() ->
    OnStreamError() ->
    PostTask(CallDeleter) to main thread ->
    ...wait for the task to run... ->
    CallDeleter() ->
    delete_callback_.Run() ->
    StreamFactory::DestroyInputStream() ->
    ~InputStream()

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Olga Sharonova
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • 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: I6d5644ae7761441fe883da155286f2489aea36ce
    Gerrit-Change-Number: 6620533
    Gerrit-PatchSet: 15
    Gerrit-Owner: Fredrik Hernqvist <fhern...@google.com>
    Gerrit-Reviewer: Fredrik Hernqvist <fhern...@google.com>
    Gerrit-Reviewer: Olga Sharonova <ol...@chromium.org>
    Gerrit-Attention: Olga Sharonova <ol...@chromium.org>
    Gerrit-Comment-Date: Tue, 17 Jun 2025 10:36:21 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Olga Sharonova (Gerrit)

    unread,
    Jun 17, 2025, 7:21:01 AM6/17/25
    to Fredrik Hernqvist, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, mac-r...@chromium.org, feature-me...@chromium.org, marinacio...@chromium.org, olka+...@chromium.org, zhangwen...@google.com
    Attention needed from Fredrik Hernqvist

    Olga Sharonova voted and added 4 comments

    Votes added by Olga Sharonova

    Code-Review+1

    4 comments

    Patchset-level comments
    File-level comment, Patchset 15 (Latest):
    Olga Sharonova . resolved

    LGTM - thanks.

    File services/audio/audio_processor_handler.h
    Line 113, Patchset 15 (Latest): // Called on owning_sequence_.
    Olga Sharonova . unresolved

    `owning_sequence_`. (backticks)

    File services/audio/input_controller.cc
    Line 371, Patchset 8: base::BindPostTask(task_runner_,
    Olga Sharonova . resolved

    So what do we have with error posting? Could you describe the full picture - how many times we post them in each context?


    Also, what happens if the error signaling is scheduled after some other operations?

    Fredrik Hernqvist

    event_handler_->OnError() can be called in these situations:

    1) In DoReportError posted from the AudioCallback when the input stream has an error (through the callback bound here). This can happen an arbitrary number of times depending on the OS implementation of the input stream, but probably once.
    2) In DoReportError posted from the AudioProcessorHandler when the reference stream has had an error. This can happen once.
    3) In DoCreate() (once) if we fail to create/open the stream.
    4) In Record() (once per record) if we fail to start the reference signal.

    I have not found a case where it matters when the error signaling is scheduled, the result is always that the stream is eventually destroyed.

    Olga Sharonova

    1) In DoReportError posted from the AudioCallback

    From which threads?

    2) In DoReportError posted from the AudioProcessorHandle

    From which threads?

    4) In Record() (once per record) if we fail to start the reference signal.

    once per record? the comment you added in the new PS says InputController will be deleted.

    Fredrik Hernqvist

    1) Posted from either realtime thread or main thread (as usual with AudioInputCallback::OnError)
    2) Always posted from main thread
    4) As far as I understand the code, there will only ever be one call to Record() regardless of errors. I stated it as "once per record" in case that ever changes, but it may just have confused things.

    Olga Sharonova

    Acknowledged

    Line 385, Patchset 8: event_handler_->OnError(
    Olga Sharonova . resolved

    What about this error being signaled in the context of Record(), especially given that InputStream is responsible for closing, according to the comment?

    Fredrik Hernqvist

    It can be called at any time (it's also called in OnCreate, for example). It will schedule the deletion of the InputStream and InputController, but that won't happen until Record() finishes.

    Fredrik Hernqvist

    The JS-observable effect is that the stream will end (with the ended-event being dispatched) shortly after the getUserMedia-promise resolves successfully.

    Olga Sharonova
    " It will schedule the deletion of the InputStream"
    could you point to the code?
    Fredrik Hernqvist

    OnError() implementation: https://source.chromium.org/chromium/chromium/src/+/main:services/audio/input_stream.cc;l=255;drc=2a9c070f15d3fc47eeee29d0c1982f82f0d11fb6

    Then the call chain goes
    OnError() ->
    OnStreamError() ->
    PostTask(CallDeleter) to main thread ->
    ...wait for the task to run... ->
    CallDeleter() ->
    delete_callback_.Run() ->
    StreamFactory::DestroyInputStream() ->
    ~InputStream()

    Olga Sharonova

    Ok, thanks!

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Fredrik Hernqvist
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement 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: I6d5644ae7761441fe883da155286f2489aea36ce
    Gerrit-Change-Number: 6620533
    Gerrit-PatchSet: 15
    Gerrit-Owner: Fredrik Hernqvist <fhern...@google.com>
    Gerrit-Reviewer: Fredrik Hernqvist <fhern...@google.com>
    Gerrit-Reviewer: Olga Sharonova <ol...@chromium.org>
    Gerrit-Attention: Fredrik Hernqvist <fhern...@google.com>
    Gerrit-Comment-Date: Tue, 17 Jun 2025 11:20:45 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Fredrik Hernqvist (Gerrit)

    unread,
    Jun 17, 2025, 7:36:53 AM6/17/25
    to Olga Sharonova, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, mac-r...@chromium.org, feature-me...@chromium.org, marinacio...@chromium.org, olka+...@chromium.org, zhangwen...@google.com

    Fredrik Hernqvist added 3 comments

    File media/audio/mac/catap_audio_input_stream.h
    Line 163, Patchset 10: static int error_test;
    Fredrik Hernqvist . resolved

    Ignore the changes in the catap files until the rest of the code is ready, I use this for testing.

    Fredrik Hernqvist

    resolving

    File services/audio/audio_processor_handler.h
    Line 113, Patchset 15: // Called on owning_sequence_.
    Olga Sharonova . resolved

    `owning_sequence_`. (backticks)

    Fredrik Hernqvist

    `Done`

    File services/audio/input_controller.cc
    Line 361, Patchset 14: // The AEC reference stream failed to start. By calling OnError() we let
    // the owning InputStream know about the error. This will schedule
    // the deletion of the InputStream and the InputController on the main
    // thread. As the InputController is now about to be deleted, we exit
    // early and do not start the stream or the processing thread.
    Olga Sharonova . resolved

    Is this true for all DoReportError() calls? Why do we need to state it here specifically?

    Fredrik Hernqvist

    Yes it's always true. Removed the comment.

    Fredrik Hernqvist

    resolving

    Open in Gerrit

    Related details

    Attention set is empty
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement 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: I6d5644ae7761441fe883da155286f2489aea36ce
    Gerrit-Change-Number: 6620533
    Gerrit-PatchSet: 16
    Gerrit-Owner: Fredrik Hernqvist <fhern...@google.com>
    Gerrit-Reviewer: Fredrik Hernqvist <fhern...@google.com>
    Gerrit-Reviewer: Olga Sharonova <ol...@chromium.org>
    Gerrit-Comment-Date: Tue, 17 Jun 2025 11:36:40 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    open
    diffy

    Fredrik Hernqvist (Gerrit)

    unread,
    Jun 17, 2025, 7:47:32 AM6/17/25
    to Olga Sharonova, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, mac-r...@chromium.org, feature-me...@chromium.org, marinacio...@chromium.org, olka+...@chromium.org, zhangwen...@google.com

    Fredrik Hernqvist voted Commit-Queue+2

    Commit-Queue+2
    Open in Gerrit

    Related details

    Attention set is empty
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement 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: I6d5644ae7761441fe883da155286f2489aea36ce
    Gerrit-Change-Number: 6620533
    Gerrit-PatchSet: 16
    Gerrit-Owner: Fredrik Hernqvist <fhern...@google.com>
    Gerrit-Reviewer: Fredrik Hernqvist <fhern...@google.com>
    Gerrit-Reviewer: Olga Sharonova <ol...@chromium.org>
    Gerrit-Comment-Date: Tue, 17 Jun 2025 11:47:16 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    Chromium LUCI CQ (Gerrit)

    unread,
    Jun 17, 2025, 8:32:52 AM6/17/25
    to Fredrik Hernqvist, Olga Sharonova, AyeAye, chromium...@chromium.org, mac-r...@chromium.org, feature-me...@chromium.org, marinacio...@chromium.org, olka+...@chromium.org, zhangwen...@google.com

    Chromium LUCI CQ submitted the change with unreviewed changes

    Unreviewed changes

    15 is the latest approved patch-set.
    The change was submitted with unreviewed changes in the following files:

    ```
    The name of the file: services/audio/audio_processor_handler.h
    Insertions: 1, Deletions: 1.

    @@ -110,7 +110,7 @@
    void OnPlayoutData(const media::AudioBus& audio_bus,
    int sample_rate,
    base::TimeDelta delay) final;
    - // Called on owning_sequence_.
    + // Called on `owning_sequence_`.
    void OnReferenceStreamError() final;

    // mojom::AudioProcessorControls implementation.
    ```

    Change information

    Commit message:
    Integrate ReferenceSignalProvider error handling in the AudioService

    This plumbs the errors into InputController, which calls OnError on its
    EventHandler. This means that when an AEC reference loopback stream has
    an error, all subscribing capture streams will stop with an error.
    Bug: 416229772
    Change-Id: I6d5644ae7761441fe883da155286f2489aea36ce
    Commit-Queue: Fredrik Hernqvist <fhern...@google.com>
    Reviewed-by: Olga Sharonova <ol...@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1474893}
    Files:
    • M services/audio/audio_processor_handler.cc
    • M services/audio/audio_processor_handler.h
    • M services/audio/input_controller.cc
    • M services/audio/input_controller.h
    • M services/audio/input_controller_unittest.cc
    • M services/audio/input_stream.cc
    • M services/audio/output_tapper.cc
    • M services/audio/output_tapper.h
    Change size: M
    Delta: 8 files changed, 212 insertions(+), 29 deletions(-)
    Branch: refs/heads/main
    Submit Requirements:
    • requirement satisfiedCode-Review: +1 by Olga Sharonova
    Open in Gerrit
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: merged
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I6d5644ae7761441fe883da155286f2489aea36ce
    Gerrit-Change-Number: 6620533
    Gerrit-PatchSet: 17
    Gerrit-Owner: Fredrik Hernqvist <fhern...@google.com>
    Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
    Gerrit-Reviewer: Fredrik Hernqvist <fhern...@google.com>
    Gerrit-Reviewer: Olga Sharonova <ol...@chromium.org>
    open
    diffy
    satisfied_requirement
    Reply all
    Reply to author
    Forward
    0 new messages