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

oboe: add Quirk for broken mono on S9 #890

Merged
merged 4 commits into from
Jun 17, 2020
Merged

oboe: add Quirk for broken mono on S9 #890

merged 4 commits into from
Jun 17, 2020

Conversation

philburk
Copy link
Collaborator

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

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
@philburk philburk requested review from dturner and android-usb June 12, 2020 00:34
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
Copy link
Collaborator

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?

Copy link
Collaborator Author

@philburk philburk Jun 16, 2020

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.

) {
// Workaround for heap size regression in O.
// b/66967812 AudioRecord does not allow FAST track for stereo capture in O
childBuilder.setChannelCount(1);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Constant?

Copy link
Collaborator

@dturner dturner left a 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;
Copy link
Collaborator

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

@philburk philburk merged commit cb01be5 into master Jun 17, 2020
@philburk philburk deleted the fixmono824 branch June 17, 2020 18:21
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.

Audio input pitched down 1 octave on Samsung S9, broken mono
2 participants