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

Cannot open recording stream on Motorola Moto G 2nd Gen #192

Closed
dturner opened this issue Aug 22, 2018 · 8 comments
Closed

Cannot open recording stream on Motorola Moto G 2nd Gen #192

dturner opened this issue Aug 22, 2018 · 8 comments
Assignees
Labels
P1 high priority
Milestone

Comments

@dturner
Copy link
Collaborator

dturner commented Aug 22, 2018

Steps to repro:

  • Run the LiveEffect sample
  • Hit Start

Expected outcome:

  • Audio from the microphone is heard through the speaker or headphones

Actual outcome:

  • No audio is heard from the speaker or headphones

The following logcat output shows that the recording stream fails to be created:

07-21 18:51:02.063 16034-16034/com.google.sample.oboe.liveeffect E/libOpenSLES: Cannot create AudioRecorder: data sink must be in PCM format
07-21 18:51:02.063 16034-16034/com.google.sample.oboe.liveeffect E/libOpenSLES: Cannot create AudioRecorder: invalid source or sink
07-21 18:51:02.063 16034-16034/com.google.sample.oboe.liveeffect W/libOpenSLES: Leaving Engine::CreateAudioRecorder (SL_RESULT_PARAMETER_INVALID)
07-21 18:51:02.063 16034-16034/com.google.sample.oboe.liveeffect E/OboeAudio: createAudioRecorder() result:SL_RESULT_PARAMETER_INVALID
07-21 18:51:02.063 16034-16034/com.google.sample.oboe.liveeffect E/AUDIO-APP: Failed to create recording stream. Error: ErrorInternal
07-21 18:51:02.063 16034-16034/com.google.sample.oboe.liveeffect E/AUDIO-APP: Failed to create recording (0x0) and/or playback (0xb8aef600) stream

@dturner dturner added the P1 high priority label Aug 22, 2018
@dturner dturner added this to the v1.0 milestone Aug 22, 2018
@dturner dturner self-assigned this Aug 22, 2018
@dturner
Copy link
Collaborator Author

dturner commented Aug 22, 2018

It appears that the Moto G doesn't support floating point recording.

I verified this by commenting out this block.

@philburk
Copy link
Collaborator

What version was the Moto G running?

Is this a version issue or vendor implementation issue?
I would think that the FLOAT code in OpenSL ES would all be above the level of the HAL.

@dturner
Copy link
Collaborator Author

dturner commented Aug 23, 2018

The Moto G was running API 21 LXB22.99-16.3.

The only reference I can find to that error message is here: https://android.googlesource.com/platform/frameworks/wilhelm/+/4597a74/libopensles/android_AudioRecorder.cpp#61

So it could be a version issue, although I was sure that API 21 had float support for recording streams. Maybe that was introduced later?

@dturner
Copy link
Collaborator Author

dturner commented Aug 23, 2018

I just tested a Samsung Galaxy S4 running API 21 and ran into the same issue. Looks like it is a version issue.

@dturner
Copy link
Collaborator Author

dturner commented Aug 23, 2018

Once we figure out what is the expected behaviour we should definitely add a test for this.

@dturner
Copy link
Collaborator Author

dturner commented Aug 24, 2018

It appears that float playback capability was added to Lollipop but float record capability was only added in Marshmallow.

Verified by running repro steps on emulators:

API 21 - error message
API 22 - error message
API 23 - no error
API 24 - no error

@vbarthel-fr
Copy link
Contributor

Here is an attempt at addressing this issue: #205

As mentioned in the PR, I don't have the knowledge required to fully understand the consequences of those changes. See the description of the PR for more details :)

@vbarthel-fr
Copy link
Contributor

My bad, there is already an opened PR addressing this issue: #194

Sorry for all that :/

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

No branches or pull requests

3 participants