-
Notifications
You must be signed in to change notification settings - Fork 582
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
oboe: add Quirk for broken mono on S9 #890
Conversation
The Samsung S9 does not support mono properly. It is actually stereo. So on that device, we open a stereo stream and then convert it to mono by extracting the first channel. Fixes #824
This is used by the QuirksManager.
@@ -30,6 +30,7 @@ set (oboe_sources | |||
src/flowgraph/ClipToRange.cpp | |||
src/flowgraph/ManyToMultiConverter.cpp | |||
src/flowgraph/MonoToMultiConverter.cpp | |||
src/flowgraph/MultiToMonoConverter.cpp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't both MultiToMono
and MonoToMulti
be contained within single ChannelCountConverter
which takes an arbitrary number of input and output channels?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a ChannelCountConverter for the previous unsupported case, eg "2:3". But it looks a bit more complex and is slower than the Mono nodes. So I kept them as optimizations for the mono cases.
src/common/QuirksManager.cpp
Outdated
) { | ||
// Workaround for heap size regression in O. | ||
// b/66967812 AudioRecord does not allow FAST track for stereo capture in O | ||
childBuilder.setChannelCount(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Constant?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments
@@ -110,6 +110,9 @@ class QuirksManager { | |||
|
|||
private: | |||
|
|||
static constexpr int32_t kChannelCountMono = 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than add these I think you can use the oboe::ChannelCount::*
constants
The Samsung S9 does not support mono properly.
It is actually stereo. So on that device, we open a stereo
stream and then convert it to mono by extracting
the first channel.
Fixes #824