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

Audio-echo and native-audio in the sample project do not work in Nexus 6P #367

Closed
lakdong opened this issue Mar 6, 2017 · 14 comments
Closed
Assignees

Comments

@lakdong
Copy link

lakdong commented Mar 6, 2017

Audio-echo and native-audio in the sample project do not work in android nougat.

I tested it on the Nexus 6P ( Android Version 7.1.1 )

@lakdong lakdong changed the title The sample project does not work Audio-echo, Native-audio sample project does not work Mar 6, 2017
@lakdong lakdong changed the title Audio-echo, Native-audio sample project does not work Audio-echo and native-audio in the sample project do not work in Nexus 6P Mar 6, 2017
@ggfan
Copy link
Contributor

ggfan commented Mar 6, 2017

thanks for reporting the issue, will take a look! Please list your build environment like buildToolsVersion etc in case some are automatically updated by your tool.

@lakdong
Copy link
Author

lakdong commented Mar 6, 2017

My build environment
Android Studio 2.3
BuildToolsVersion 25.0.0
com.android.tools.build:Gradle:2.3.0
services.gradle.org/distributions/gradle-3.3-all.zip

@ggfan
Copy link
Contributor

ggfan commented Mar 6, 2017

Adding link to another related issue:
https://groups.google.com/forum/#!topic/android-ndk/9Xjvz0Zh2Qw

I saw it on Nexus 6, will investigate ( might be a little later: need to get other 2 things done ).

@Sathya-Subbiah
Copy link

Hi.. Audio-Echo sample is found not work in Android 7.1.1 version. Facing same issue. Any update on the above issue?

@ggfan
Copy link
Contributor

ggfan commented May 15, 2017

Not yet, this one falling off, need to look at it later in the week.

@Sathya-Subbiah
Copy link

By increasing the buffersize the audio echo is heard in Nexus phone (Nexus 6 - Version 7.1.1). But heard with latency. Need some suggestion to reduce the latency.

@ggfan
Copy link
Contributor

ggfan commented May 17, 2017

I need to have a look to see: the buffer size is in Fast-Audio path, once changed, it would be out of the fast audio path; between input stream and output stream is a queue of buffers: could you increase the buffer count ( it is macro ) instead -- if that works, the latency will increase, but it should still be within fast audio path. Also there is one effect I need to disable to make input into the fast path ( just not having time to get to it ). you might try them out ( you are in the center of "Pro Audio" war :-))

@IgorGanapolsky
Copy link

IgorGanapolsky commented May 18, 2017

I am facing the same situation on Samsung Galaxy S4 running android 7.1.1. When I press the start button, I see this stacktrace:

libOpenSLES: Conversion from OpenSL ES positional channel mask 0x4 to Android mask 0 loses channels
05-18 16:05:05.013 6572-6572/com.google.sample.echo I/libOpenSLES: Emulating old channel mask behavior (ignoring positional mask 0x4, using default mask 0x10 based on channel count of 1)
05-18 16:05:05.026 6572-6635/com.google.sample.echo E/SchedPolicy: sched_setscheduler failed: tid 6635, errno=1

And no sound comes out until I actually tap the start/buttons several times.

@IgorGanapolsky
Copy link

IgorGanapolsky commented May 18, 2017

Ok, I was able to get the audio to play on the Galaxy S4 consistently by changing AUDIO_SAMPLE_CHANNELS 1 value to 10 in audio_common.h. It is still very choppy (latency).

The latency issue seems to be that framesPerBuf is reported as too high on problematic phones: 8305. Normally, on phones that play sound well - the framesPerBuf is only 192.

Any clues?

@ggfan ggfan self-assigned this Jul 13, 2017
@ggfan
Copy link
Contributor

ggfan commented Jul 17, 2017

Adding a fix in #410 for echo sample, works on
nexus 4 - JB /Nexus 5X - N/ Pixel XL - Android O.
When the buffer is too big, it would mean that there is no low latency path -- the size needs to be DMA size between SLES <--> audio driver; I did not see this though on Nexus phones.
@lakdong if you could try it out on your Nexus 6P, that would be very helpful

Not looking at the Native-Audio problem yet.

@lakdong
Copy link
Author

lakdong commented Jul 18, 2017

echo sample works on Nexus 6p !!

@ggfan
Copy link
Contributor

ggfan commented Jul 18, 2017

thanks, will get the change reviewed!

@ggfan
Copy link
Contributor

ggfan commented Jul 18, 2017

merged into main. thank you for reporting the issue: will find some time to improve the sample concerning
UI
Synchronization etc.

@ggfan
Copy link
Contributor

ggfan commented Jul 19, 2017

as for Galaxy S4 phone, the reported buffer size is 960 on android L. The audio path from vendor's OS build may not use the AOSP's source as is: they might have their own audio path.

In the sample, the playback begins after captures 3 buffers, 3 x 960 / 48000Hz = 60ms, then plus platform delays ( mic --> audio driver --> SLES --> audio driver --> speakers: analog ), the latency is felt. Even I tried to use 2 buffers, do not feel too much difference from3 buffer case, then my guess is that the other part of the system for latency is more significant than from these 2 buffer introduced latency. Closing down this as native-audio fix also merged in.

@ggfan ggfan closed this as completed Jul 19, 2017
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

No branches or pull requests

4 participants