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

Android openPCM16AudioInMemory #736

Open
asacque opened this issue Dec 5, 2022 · 6 comments
Open

Android openPCM16AudioInMemory #736

asacque opened this issue Dec 5, 2022 · 6 comments

Comments

@asacque
Copy link

asacque commented Dec 5, 2022

I make extensive use of openPCM16AudioInMemory for AdvancedAudioPlayer in my app and everything goes fine.
But this is true only if I set targetSdkVersion 29 (ver.10) in build.gradle.
As soon I set it at 30 (ver.11), or higher, this is what happens:

Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x28 in tid 7620 (AAudio_1), pid 7564 (mant.yyy)
pid: 7564, tid: 7620, name: AAudio_1 >>> com.xxx.yyy <<<
../lib/arm64/libSPAudioEngine.so (Superpowered::bufferList::update()+40)
../lib/arm64/libSPAudioEngine.so (Superpowered::memoryPcmProvider::hasResponse()+92)
../lib/arm64/libSPAudioEngine.so (Superpowered::playerProcess::processAUTHREAD(float**, bool, unsigned int, float*, ...)+1704)
../lib/arm64/libSPAudioEngine.so (Superpowered::AdvancedAudioPlayer::processStereo(float*, bool, unsigned int, float)+72)
../lib/arm64/libSPAudioEngine.so (SampleTrack::process(float*, float, unsigned int)+124)
../lib/arm64/libSPAudioEngine.so (SPAudioEngine::process(short*, unsigned int)+300)

all this with SDK 2.5.0, but tried with 2.6.0 it's the same.
Moreover, I use #define USE_AAUDIO 1 in SuperpoweredAndroidAudioIO.cpp, to get the least latency, but also because if I set it to 0 it gives:

Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x2f7365722f6b70 in tid 8904 (AudioTrack), pid 8867 (mant.yyy)
pid: 8867, tid: 8904, name: AudioTrack >>> com.xxx.yyy<<<

at the launch, and the app doesn't even get started.

Any clue?
Thanx in advance

@ivannador
Copy link
Contributor

Thank you for reaching out!

We were able to reproduce the issue. The SuperpoweredPlayer sample app indeed crashes when using openPCM16AudioInMemory. While the issue gets resolved, as a workaround we recommend using the other open methods of the AdvancedAudioPlayer using the file path:

void open(const char *path, Superpowered::httpRequest *customHTTPRequest = 0, bool skipSilenceAtBeginning = false, bool measureSilenceAtEnd = false);

or

void open(const char *path, int offset, int length, Superpowered::httpRequest *customHTTPRequest = 0, bool skipSilenceAtBeginning = false, bool measureSilenceAtEnd = false);

@ivannador
Copy link
Contributor

Closing issue, will fix in future version.

@asacque
Copy link
Author

asacque commented Dec 7, 2022

Thank you so much for the rapid answer! Although the workaround could not fit my specific use case (I'm implementing a looper, and saving the real time audio input in a file to be opened, in real time, through the path could be not suitable) I'm happy to know that the issue will be fixed in a future release! Thanx again!

@renezuidhof
Copy link

I'm also running into this issue when using audioPlayer.openPCM16AudioInMemory. As a workaround I could set android:allowNativeHeapPointerTagging to false. I prefer not to though.

Any idea when this will be fixed?

@balazsbanto balazsbanto reopened this Dec 18, 2023
@balazsbanto
Copy link
Contributor

Yes, setting android:allowNativeHeapPointerTagging to false is a workaround. We are planning to release a fix soon.

@Jbaxter03261982
Copy link

android:allowNativeHeapPointerTagging

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

5 participants