Page MenuHomePhabricator

Bug 1940906 - Stream audio in smaller blocks; implement chunked downmixing. r?#media-playback-reviewers
ClosedPublic

Authored by padenot on Jul 8 2026, 5:04 PM.
Referenced Files
Unknown Object (File)
Mon, Nov 9, 3:47 PM
Unknown Object (File)
Tue, Nov 3, 2:54 PM
Unknown Object (File)
Sep 29 2026, 7:43 AM
Unknown Object (File)
Sep 29 2026, 7:42 AM
Unknown Object (File)
Sep 29 2026, 6:06 AM
Unknown Object (File)
Sep 29 2026, 5:07 AM
Unknown Object (File)
Sep 29 2026, 4:23 AM
Unknown Object (File)
Sep 29 2026, 3:20 AM
Subscribers

Details

Summary

Send audio to the inference process in ~40ms blocks instead of 0.5s, so
end-to-end latency is bounded by the streaming model (~180ms) rather than IPC
batching. Implement the chunked downmixing path in DataCallback (slice-wise,
RT-safe) instead of crashing, and stop clearing the graph-thread scratch
buffer from the main thread in Stop() (a data race the lower latency exposed).

Count the amount of frame dropped, increase ringbuffer depth to smooth
over load spike events.

Diff Detail

Event Timeline

phab-bot published this revision for review.Jul 8 2026, 5:05 PM
phab-bot changed the visibility from "Custom Policy" to "Public (No Login Required)".
phab-bot changed the edit policy from "Custom Policy" to "Restricted Project (Project)".
phab-bot removed a project: secure-revision.
alwu added a subscriber: alwu.

How's testing status for this?

This revision is now accepted and ready to land.Jul 8 2026, 7:17 PM

This revision requires a Testing Policy Project Tag to be set before landing. Please apply one of testing-approved, testing-exception-unchanged, testing-exception-ui, testing-exception-elsewhere, testing-exception-other. Tip: this Firefox add-on makes it easy!

How's testing status for this?

I'll find stereo speech for testing, good call. I think it's all mono for now in my tests.

No, better than landing a stereo file, I just upmixed with the Web Audio API, so this is covered.

Code analysis found 42 defects in diff 1351234:

  • 42 build errors found by clang-tidy
IMPORTANT: Found 42 defects (error level) that must be fixed before landing.

You can run this analysis locally with:

  • ./mach static-analysis check --outgoing (C/C++)

If you see a problem in this automated review, please report it here.

You can view these defects in the Diff Detail section of Phabricator diff 1351234.

padenot edited the summary of this revision. (Show Details)

Code analysis found 11 defects in diff 1361675:

  • 1 defect found by clang-format (Mozlint)
  • 10 build errors found by clang-tidy
WARNING: Found 1 defect (warning level) that can be dismissed.
IMPORTANT: Found 10 defects (error level) that must be fixed before landing.

You can run this analysis locally with:

  • ./mach static-analysis check --outgoing (C/C++)
  • ./mach lint --warnings --outgoing

If you see a problem in this automated review, please report it here.

You can view these defects in the Diff Detail section of Phabricator diff 1361675.

Code analysis found 10 defects in diff 1362742:

  • 10 build errors found by clang-tidy
IMPORTANT: Found 10 defects (error level) that must be fixed before landing.

You can run this analysis locally with:

  • ./mach static-analysis check --outgoing (C/C++)

The analysis task source-test-mozlint-rejected-words failed, but we could not detect any defect.
Please check this task manually.

The analysis task source-test-node-devtools-tests failed, but we could not detect any defect.
Please check this task manually.

The analysis task source-test-mozlint-c-includes failed, but we could not detect any defect.
Please check this task manually.

The analysis task source-test-mozlint-dot-mozilla-reference failed, but we could not detect any defect.
Please check this task manually.

The analysis task source-test-mozlint-eslint failed, but we could not detect any defect.
Please check this task manually.

The analysis task source-test-mozlint-clang-format failed, but we could not detect any defect.
Please check this task manually.

The analysis task source-test-mozlint-trojan-source failed, but we could not detect any defect.
Please check this task manually.


If you see a problem in this automated review, please report it here.

You can view these defects in the Diff Detail section of Phabricator diff 1362742.

Code analysis found 8 defects in diff 1363702:

  • 8 build errors found by clang-tidy
IMPORTANT: Found 8 defects (error level) that must be fixed before landing.

You can run this analysis locally with:

  • ./mach static-analysis check --outgoing (C/C++)

The analysis task source-test-mozlint-trojan-source failed, but we could not detect any defect.
Please check this task manually.

The analysis task source-test-mozlint-eslint failed, but we could not detect any defect.
Please check this task manually.

The analysis task source-test-mozlint-py-ruff failed, but we could not detect any defect.
Please check this task manually.

The analysis task source-test-mozlint-rejected-words failed, but we could not detect any defect.
Please check this task manually.

The analysis task source-test-mozlint-clang-format failed, but we could not detect any defect.
Please check this task manually.

The analysis task source-test-mozlint-mingw-cap failed, but we could not detect any defect.
Please check this task manually.

The analysis task source-test-mozlint-file-perm failed, but we could not detect any defect.
Please check this task manually.

The analysis task source-test-mozlint-c-includes failed, but we could not detect any defect.
Please check this task manually.

The analysis task source-test-doc-upload failed, but we could not detect any defect.
Please check this task manually.

The analysis task source-test-node-devtools-tests failed, but we could not detect any defect.
Please check this task manually.

The analysis task source-test-mozlint-lintpref failed, but we could not detect any defect.
Please check this task manually.

The analysis task source-test-node-devtools-verify-bundle failed, but we could not detect any defect.
Please check this task manually.

The analysis task source-test-mozlint-py-ruff-format failed, but we could not detect any defect.
Please check this task manually.


If you see a problem in this automated review, please report it here.

You can view these defects in the Diff Detail section of Phabricator diff 1363702.