Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix stereo -> mono downmixing. #241

Merged
merged 1 commit into from
Oct 23, 2024

Conversation

mutexlox-signal
Copy link
Contributor

@mutexlox-signal mutexlox-signal commented Oct 22, 2024

Rather than summing the two channels, average them. This prevents integer overflow and clipping or needlessly increasing volume.

This will fix #240.

@mutexlox-signal
Copy link
Contributor Author

cc @padenot

not sure what the failures are, but they at least seem unrelated? i think?

Rather than summing the two channels, average them. This prevents
integer overflow and clipping or needlessly increasing volume.
@mutexlox-signal
Copy link
Contributor Author

I'm curious whether there's e.g. a breakage with a new version of macOS 14, or a new rustc or something, that is causing the breakage on macOS 14? I looked briefly at the failing tests, and I don't see an obvious connection. I wonder whether running the tests at HEAD on trailblazer would show the same issue.

@padenot
Copy link
Collaborator

padenot commented Oct 23, 2024

Historically there's been breakage related to upgrades. https://github.com/mozilla/cubeb-coreaudio-rs/actions/runs/11283677817/job/31383525624 shows that you're right.

@padenot padenot merged commit 28166fb into mozilla:trailblazer Oct 23, 2024
2 of 4 checks passed
@mutexlox-signal
Copy link
Contributor Author

Thanks!

@mutexlox-signal mutexlox-signal deleted the mutexlox/crash-fix branch October 23, 2024 16:45
@mutexlox-signal
Copy link
Contributor Author

Would you expect that this breakage is scoped just to tests, or do you think it will affect real-world usage as well?

@Pehrsons
Copy link
Contributor

Would you expect that this breakage is scoped just to tests, or do you think it will affect real-world usage as well?

This looks like an issue with the test-only device plugger. Or an issue/difference with macOS 14. Also it's running in a VM and sometimes they seem to get into a weird state because tests that normally don't fail suddenly fail at a high rate.

@mutexlox-signal
Copy link
Contributor Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(Debug builds) Reproducible crash at buffer_manager.rs:59 with S16NE stereo input device downmixing to mono
3 participants