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

the drumthumper have a crash #1608

Closed
Hyyzt opened this issue Aug 18, 2022 · 15 comments
Closed

the drumthumper have a crash #1608

Hyyzt opened this issue Aug 18, 2022 · 15 comments
Assignees
Labels

Comments

@Hyyzt
Copy link

Hyyzt commented Aug 18, 2022

Android version(s): 12
Android device(s): redmi K50
Oboe version: 1.6.1

Hello, I encountered a crash when connecting to drumthumper, but this crash is not mandatory, it occurs by accident. I can't figure out what's causing it. The version of oboe used is 1.6.1 under the main branch
I grabbed the log of the crash locally, which is very strange.
Sometimes it crashes in the loadWavAssets method, sometimes it crashes in the startAudioStream method.

2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: tagged_addr_ctrl: 0000000000000001
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: signal 11 (SIGSEGV), code 0 (SI_USER), fault addr --------
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: x0 b400007178cc6500 x1 b400007134495000 x2 000000000000a000 x3 0000000000006000
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: x4 0000000000004000 x5 0000000000000001 x6 0000000000000000 x7 0000000000004000
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: x8 00000000000000c8 x9 00000000000000c8 x10 0000000000000000 x11 b4000071d7608800
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: x12 b4000071d7607720 x13 0000000000000000 x14 b4000071d7607714 x15 0000000000000000
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: x16 00000071e757aac8 x17 b4000071d7614280 x18 0000007fe6fb8930 x19 b4000072aa4aac00
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: x20 0000000000000000 x21 b4000072aa4aac00 x22 00000072aa674000 x23 b4000072aa4aacb0
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: x24 00000071e76a4348 x25 b4000072aa48b000 x26 00000072aa674000 x27 0000000000000069
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: x28 0000007fe6fbacf0 x29 0000007fe6fbaa90
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: lr 00000071e755480c sp 0000007fe6fbaa70 pc 00000071e756dee0 pst 0000000060001000
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: backtrace:
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #00 pc 0000000000051ee0 /data/app/~~ETVK3S7O-RqCEDYPaGhWJg==/com.infinite.score-F8ObngM_WOFlHcIb8F4ATw==/base.apk!libdrumthumper.so (oboe::resampler::PolyphaseResamplerStereo::readFrame(float*)+680) (BuildId: f0847206a42833e28b1d8ad0ec8c9ca8e160b75f)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #1 pc 0000000000038808 /data/app/~~ETVK3S7O-RqCEDYPaGhWJg==/com.infinite.score-F8ObngM_WOFlHcIb8F4ATw==/base.apk!libdrumthumper.so (oboe::resampler::MultiChannelResampler::readNextFrame(float*)+44) (BuildId: f0847206a42833e28b1d8ad0ec8c9ca8e160b75f)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #2 pc 0000000000038714 /data/app/~~ETVK3S7O-RqCEDYPaGhWJg==/com.infinite.score-F8ObngM_WOFlHcIb8F4ATw==/base.apk!libdrumthumper.so (iolib::resampleData(iolib::ResampleBlock const&, iolib::ResampleBlock*, int)+320) (BuildId: f0847206a42833e28b1d8ad0ec8c9ca8e160b75f)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #3 pc 0000000000038894 /data/app/~~ETVK3S7O-RqCEDYPaGhWJg==/com.infinite.score-F8ObngM_WOFlHcIb8F4ATw==/base.apk!libdrumthumper.so (iolib::SampleBuffer::resampleData(int)+116) (BuildId: f0847206a42833e28b1d8ad0ec8c9ca8e160b75f)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #4 pc 0000000000039838 /data/app/~~ETVK3S7O-RqCEDYPaGhWJg==/com.infinite.score-F8ObngM_WOFlHcIb8F4ATw==/base.apk!libdrumthumper.so (iolib::SimpleMultiPlayer::addSampleSource(iolib::SampleSource*, iolib::SampleBuffer*)+56) (BuildId: f0847206a42833e28b1d8ad0ec8c9ca8e160b75f)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #5 pc 0000000000036b88 /data/app/~~ETVK3S7O-RqCEDYPaGhWJg==/com.infinite.score-F8ObngM_WOFlHcIb8F4ATw==/base.apk!libdrumthumper.so (Java_com_infinite_audio_DrumPlayer_loadWavAssetNative+340) (BuildId: f0847206a42833e28b1d8ad0ec8c9ca8e160b75f)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #6 pc 0000000000222244 /apex/com.android.art/lib64/libart.so (art_quick_generic_jni_trampoline+148) (BuildId: f85f61cefde706285d92d74faa9c233e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #7 pc 0000000000218964 /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: f85f61cefde706285d92d74faa9c233e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #8 pc 0000000000284060 /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+184) (BuildId: f85f61cefde706285d92d74faa9c233e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #9 pc 00000000003e1730 /apex/com.android.art/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+400) (BuildId: f85f61cefde706285d92d74faa9c233e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #10 pc 00000000003dc024 /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+804) (BuildId: f85f61cefde706285d92d74faa9c233e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #11 pc 000000000074ccc4 /apex/com.android.art/lib64/libart.so (MterpInvokeDirect+1036) (BuildId: f85f61cefde706285d92d74faa9c233e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #12 pc 0000000000203914 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_direct+20) (BuildId: f85f61cefde706285d92d74faa9c233e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #13 pc 00000000000b8a00 /data/data/com.infinite.score/code_cache/.overlay/base.apk/classes2.dex (com.infinite.audio.DrumPlayer.loadWavAsset+56)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #14 pc 00000000003d3fd0 /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool)+304) (BuildId: f85f61cefde706285d92d74faa9c233e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #15 pc 00000000003db5a4 /apex/com.android.art/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+204) (BuildId: f85f61cefde706285d92d74faa9c233e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #16 pc 00000000003dc000 /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+768) (BuildId: f85f61cefde706285d92d74faa9c233e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #17 pc 000000000074ccc4 /apex/com.android.art/lib64/libart.so (MterpInvokeDirect+1036) (BuildId: f85f61cefde706285d92d74faa9c233e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #18 pc 0000000000203914 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_direct+20) (BuildId: f85f61cefde706285d92d74faa9c233e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #19 pc 00000000000b8a6a /data/data/com.infinite.score/code_cache/.overlay/base.apk/classes2.dex (com.infinite.audio.DrumPlayer.loadWavAssets+30)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #20 pc 00000000003d3fd0 /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool)+304) (BuildId: f85f61cefde706285d92d74faa9c233e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #21 pc 00000000003db5a4 /apex/com.android.art/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+204) (BuildId: f85f61cefde706285d92d74faa9c233e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #22 pc 00000000003dc000 /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+768) (BuildId: f85f61cefde706285d92d74faa9c233e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #23 pc 0000000000743a64 /apex/com.android.art/lib64/libart.so (MterpInvokeVirtual+1212) (BuildId: f85f61cefde706285d92d74faa9c233e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #24 pc 0000000000203814 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: f85f61cefde706285d92d74faa9c233e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #25 pc 000000000011642a /data/data/com.infinite.score/code_cache/.overlay/base.apk/classes2.dex (com.infinite.main.impl.BeatPlayer.+86)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #26 pc 00000000003d3fd0 /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool)+304) (BuildId: f85f61cefde706285d92d74faa9c233e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #27 pc 00000000003db5a4 /apex/com.android.art/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+204) (BuildId: f85f61cefde706285d92d74faa9c233e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #28 pc 00000000003dc000 /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+768) (BuildId: f85f61cefde706285d92d74faa9c233e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #29 pc 000000000074ccc4 /apex/com.android.art/lib64/libart.so (MterpInvokeDirect+1036) (BuildId: f85f61cefde706285d92d74faa9c233e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #30 pc 0000000000203914 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_direct+20) (BuildId: f85f61cefde706285d92d74faa9c233e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #31 pc 0000000000116336 /data/data/com.infinite.score/code_cache/.overlay/base.apk/classes2.dex (com.infinite.main.impl.BeatPlayer.getInstance+26)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #32 pc 00000000003d3fd0 /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool)+304) (BuildId: f85f61cefde706285d92d74faa9c233e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #33 pc 00000000003db5a4 /apex/com.android.art/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+204) (BuildId: f85f61cefde706285d92d74faa9c233e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #34 pc 00000000003dc000 /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+768) (BuildId: f85f61cefde706285d92d74faa9c233e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #35 pc 000000000074e9e8 /apex/com.android.art/lib64/libart.so (MterpInvokeStatic+952) (BuildId: f85f61cefde706285d92d74faa9c233e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #36 pc 0000000000203994 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_static+20) (BuildId: f85f61cefde706285d92d74faa9c233e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #37 pc 00000000000ee6d2 /data/data/com.infinite.score/code_cache/.overlay/base.apk/classes2.dex (com.infinite.main.beat.dialog.BeatDialog.show$lambda-10+10)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #38 pc 000000000074ee7c /apex/com.android.art/lib64/libart.so (MterpInvokeStatic+2124) (BuildId: f85f61cefde706285d92d74faa9c233e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #39 pc 0000000000203994 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_static+20) (BuildId: f85f61cefde706285d92d74faa9c233e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #40 pc 00000000000ee1ac /data/data/com.infinite.score/code_cache/.overlay/base.apk/classes2.dex (com.infinite.main.beat.dialog.BeatDialog.lambda$vsV7IGENdnPMgneOLU1HRRQYS-8+0)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #41 pc 00000000003d3fd0 /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool)+304) (BuildId: f85f61cefde706285d92d74faa9c233e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #42 pc 0000000000732564 /apex/com.android.art/lib64/libart.so (artQuickToInterpreterBridge+784) (BuildId: f85f61cefde706285d92d74faa9c233e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #43 pc 0000000000222378 /apex/com.android.art/lib64/libart.so (art_quick_to_interpreter_bridge+88) (BuildId: f85f61cefde706285d92d74faa9c233e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #44 pc 0000000000211608 /apex/com.android.art/lib64/libart.so (nterp_helper+152) (BuildId: f85f61cefde706285d92d74faa9c233e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #45 pc 00000000000ec8b4 /data/data/com.infinite.score/code_cache/.overlay/base.apk/classes2.dex (com.infinite.main.beat.dialog.-$$Lambda$BeatDialog$vsV7IGENdnPMgneOLU1HRRQYS-8.run+4)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #46 pc 000000000200ab9c /memfd:jit-cache (deleted) (android.os.Handler.handleCallback+140)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #47 pc 00000000020382d8 /memfd:jit-cache (deleted) (android.os.Handler.dispatchMessage+104)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #48 pc 0000000002027ab8 /memfd:jit-cache (deleted) (android.os.Looper.loopOnce+1480)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #49 pc 0000000000218be8 /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+568) (BuildId: f85f61cefde706285d92d74faa9c233e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #50 pc 000000000028407c /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+212) (BuildId: f85f61cefde706285d92d74faa9c233e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #51 pc 00000000003e1730 /apex/com.android.art/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+400) (BuildId: f85f61cefde706285d92d74faa9c233e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #52 pc 00000000003dc024 /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+804) (BuildId: f85f61cefde706285d92d74faa9c233e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #53 pc 000000000074e9e8 /apex/com.android.art/lib64/libart.so (MterpInvokeStatic+952) (BuildId: f85f61cefde706285d92d74faa9c233e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #54 pc 0000000000203994 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_static+20) (BuildId: f85f61cefde706285d92d74faa9c233e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #55 pc 0000000000459c2c /system/framework/framework.jar (android.os.Looper.loop+152)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #56 pc 000000000074ef44 /apex/com.android.art/lib64/libart.so (MterpInvokeStatic+2324) (BuildId: f85f61cefde706285d92d74faa9c233e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #57 pc 0000000000203994 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_static+20) (BuildId: f85f61cefde706285d92d74faa9c233e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #58 pc 00000000001caad6 /system/framework/framework.jar (android.app.ActivityThread.main+294)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #59 pc 00000000003d3fd0 /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool)+304) (BuildId: f85f61cefde706285d92d74faa9c233e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #60 pc 0000000000732564 /apex/com.android.art/lib64/libart.so (artQuickToInterpreterBridge+784) (BuildId: f85f61cefde706285d92d74faa9c233e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #61 pc 0000000000222378 /apex/com.android.art/lib64/libart.so (art_quick_to_interpreter_bridge+88) (BuildId: f85f61cefde706285d92d74faa9c233e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #62 pc 0000000000218be8 /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+568) (BuildId: f85f61cefde706285d92d74faa9c233e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #63 pc 000000000028407c /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+212) (BuildId: f85f61cefde706285d92d74faa9c233e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #64 pc 0000000000617370 /apex/com.android.art/lib64/libart.so (_jobject* art::InvokeMethod<(art::PointerSize)8>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jobject*, _jobject*, unsigned long)+1384) (BuildId: f85f61cefde706285d92d74faa9c233e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #65 pc 000000000058a5ec /apex/com.android.art/lib64/libart.so (art::Method_invoke(_JNIEnv*, _jobject*, _jobject*, _jobjectArray*)+52) (BuildId: f85f61cefde706285d92d74faa9c233e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #66 pc 00000000000b3f74 /apex/com.android.art/javalib/arm64/boot.oat (art_jni_trampoline+132) (BuildId: 796d614030f0575d5c41d46931bc6566402577c5)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #67 pc 0000000000218964 /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: f85f61cefde706285d92d74faa9c233e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #68 pc 0000000000284060 /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+184) (BuildId: f85f61cefde706285d92d74faa9c233e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #69 pc 00000000003e1730 /apex/com.android.art/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+400) (BuildId: f85f61cefde706285d92d74faa9c233e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #70 pc 00000000003dc024 /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+804) (BuildId: f85f61cefde706285d92d74faa9c233e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #71 pc 0000000000743a64 /apex/com.android.art/lib64/libart.so (MterpInvokeVirtual+1212) (BuildId: f85f61cefde706285d92d74faa9c233e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #72 pc 0000000000203814 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: f85f61cefde706285d92d74faa9c233e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #73 pc 0000000000251f32 /system/framework/framework.jar (com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run+22)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #74 pc 00000000003d3fd0 /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool)+304) (BuildId: f85f61cefde706285d92d74faa9c233e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #75 pc 0000000000732564 /apex/com.android.art/lib64/libart.so (artQuickToInterpreterBridge+784) (BuildId: f85f61cefde706285d92d74faa9c233e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #76 pc 0000000000222378 /apex/com.android.art/lib64/libart.so (art_quick_to_interpreter_bridge+88) (BuildId: f85f61cefde706285d92d74faa9c233e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #77 pc 00000000009472c0 /system/framework/arm64/boot-framework.oat (com.android.internal.os.ZygoteInit.main+2288) (BuildId: 68986080fc4469c1a1c75f5e9a332b4065715317)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #78 pc 0000000000218be8 /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+568) (BuildId: f85f61cefde706285d92d74faa9c233e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #79 pc 000000000028407c /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+212) (BuildId: f85f61cefde706285d92d74faa9c233e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #80 pc 0000000000617ac4 /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeWithVarArgsart::ArtMethod*(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, art::ArtMethod*, std::__va_list)+448) (BuildId: f85f61cefde706285d92d74faa9c233e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #81 pc 0000000000617f90 /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeWithVarArgs<_jmethodID*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, std::__va_list)+92) (BuildId: f85f61cefde706285d92d74faa9c233e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #82 pc 00000000004f7590 /apex/com.android.art/lib64/libart.so (art::JNI::CallStaticVoidMethodV(_JNIEnv*, _jclass*, _jmethodID*, std::__va_list)+608) (BuildId: f85f61cefde706285d92d74faa9c233e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #83 pc 00000000000b0ad0 /system/lib64/libandroid_runtime.so (_JNIEnv::CallStaticVoidMethod(_jclass*, _jmethodID*, ...)+120) (BuildId: 2247c8628ae8a6b225d642f8dcba1c98)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #84 pc 00000000000bc0cc /system/lib64/libandroid_runtime.so (android::AndroidRuntime::start(char const*, android::Vectorandroid::String8 const&, bool)+932) (BuildId: 2247c8628ae8a6b225d642f8dcba1c98)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #85 pc 0000000000002580 /system/bin/app_process64 (main+1324) (BuildId: 9f08aa5a3e51ad57e04d7600e569204e)
2022-08-18 17:38:49.696 21945-21945/? A/DEBUG: #86 pc 0000000000081d48 /apex/com.android.runtime/lib64/bionic/libc.so (__libc_init+96) (BuildId: 4cbc2a7636b3e0b018386ca8427ddf9b)

@robertwu1
Copy link
Collaborator

Below is the code for PolyphaseResamplerStereo::readFrame

void PolyphaseResamplerStereo::readFrame(float *frame) {
    // Clear accumulators.
    float left = 0.0;
    float right = 0.0;

    // Multiply input times precomputed windowed sinc function.
    const float *coefficients = &mCoefficients[mCoefficientCursor];
    float *xFrame = &mX[mCursor * STEREO];
    const int numLoops = mNumTaps >> 2; // n/4
    for (int i = 0; i < numLoops; i++) {
        // Manual loop unrolling, might get converted to SIMD.
        float coefficient = *coefficients++;
        left += *xFrame++ * coefficient;
        right += *xFrame++ * coefficient;

        coefficient = *coefficients++; // next tap
        left += *xFrame++ * coefficient;
        right += *xFrame++ * coefficient;

        coefficient = *coefficients++;  // next tap
        left += *xFrame++ * coefficient;
        right += *xFrame++ * coefficient;

        coefficient = *coefficients++;  // next tap
        left += *xFrame++ * coefficient;
        right += *xFrame++ * coefficient;
    }

    mCoefficientCursor = (mCoefficientCursor + mNumTaps) % mCoefficients.size();

    // Copy accumulators to output.
    frame[0] = left;
    frame[1] = right;
}

It seems like if mNumTaps is not a multiple of 4, this code may have issues. @Hyyzt can you add breakpoints to see where the crash happens in this code? I can't seem to repro any failures on the phones I have on hand.

@philburk
Copy link
Collaborator

philburk commented Aug 19, 2022 via email

@Hyyzt
Copy link
Author

Hyyzt commented Aug 19, 2022

Below is the code for PolyphaseResamplerStereo::readFrame

void PolyphaseResamplerStereo::readFrame(float *frame) {
    // Clear accumulators.
    float left = 0.0;
    float right = 0.0;

    // Multiply input times precomputed windowed sinc function.
    const float *coefficients = &mCoefficients[mCoefficientCursor];
    float *xFrame = &mX[mCursor * STEREO];
    const int numLoops = mNumTaps >> 2; // n/4
    for (int i = 0; i < numLoops; i++) {
        // Manual loop unrolling, might get converted to SIMD.
        float coefficient = *coefficients++;
        left += *xFrame++ * coefficient;
        right += *xFrame++ * coefficient;

        coefficient = *coefficients++; // next tap
        left += *xFrame++ * coefficient;
        right += *xFrame++ * coefficient;

        coefficient = *coefficients++;  // next tap
        left += *xFrame++ * coefficient;
        right += *xFrame++ * coefficient;

        coefficient = *coefficients++;  // next tap
        left += *xFrame++ * coefficient;
        right += *xFrame++ * coefficient;
    }

    mCoefficientCursor = (mCoefficientCursor + mNumTaps) % mCoefficients.size();

    // Copy accumulators to output.
    frame[0] = left;
    frame[1] = right;
}

It seems like if mNumTaps is not a multiple of 4, this code may have issues. @Hyyzt can you add breakpoints to see where the crash happens in this code? I can't seem to repro any failures on the phones I have on hand.

Thank you for your reply.

First of all, because this crash is not inevitable, but happens occasionally, it is difficult for me to judge which line of code has a problem through debugging, but I will print the current numLoops through the log, and observe the normal situation. Different from the crash situation, is this approach also able to obtain some useful information.

Thanks again for your reply

@Hyyzt
Copy link
Author

Hyyzt commented Aug 19, 2022

Yes the number of taps must be a multiple of four. There should be an assert somewhere for that. Is the crash happening in the drumthumper app? Or is the developer using functions from drumthumper in their own app?

@philburk

In fact, I also reproduced this problem in the demo, but when I wanted to pull the log, it suddenly stopped crashing and ran normally.

@Hyyzt
Copy link
Author

Hyyzt commented Aug 19, 2022

Yes the number of taps must be a multiple of four. There should be an assert somewhere for that. Is the crash happening in the drumthumper app? Or is the developer using functions from drumthumper in their own app?

I set up two audio files instead of the 8 in the demo, will this be a problem?

@Hyyzt
Copy link
Author

Hyyzt commented Aug 19, 2022

Maybe I found the reason for the crash, when I put our own wav files into the demo and load them, switching back and forth between the desktop and the APP, calling the Activity.onStart and Activivy.onStop methods repeatedly, It crashes after a few times.
So is it an audio issue?

@robertwu1
Copy link
Collaborator

Maybe I found the reason for the crash, when I put our own wav files into the demo and load them, switching back and forth between the desktop and the APP, calling the Activity.onStart and Activivy.onStop methods repeatedly, It crashes after a few times. So is it an audio issue?

How large are your wav files? Perhaps we have some race condition in the DrumThumper sample app related to start and stop that get exposed once your wav files are much larger than the current ones.

@Hyyzt
Copy link
Author

Hyyzt commented Aug 20, 2022

How large are your wav files? Perhaps we have some race condition in the DrumThumper sample app related to start and stop that get exposed once your wav files are much larger than the current ones.

Both wav files are no larger than 10kb.
But when loading these two files, the loadWavAssetNative method will return false, and there is a toast prompt in the demo: one or more audio assets has an incorrect format and may not play correctly.
Is there any special format requirement for wav files?

@android-usb
Copy link
Collaborator

Hyyzt, can you provide the WAV files in question? I would be interested in examining them.

@Hyyzt
Copy link
Author

Hyyzt commented Aug 23, 2022

@android-usb
wav_test_1608.zip
Thank you for your reply.
I uploaded two wav files.
The specific reproduction method is to load these two files under the drumthumper module, then switch back and forth between the desktop and the APP, and repeatedly trigger the loadWavAssets in onStart and the unloadWavAssets method in onStop, which can easily catch this crash. .

@Hyyzt
Copy link
Author

Hyyzt commented Aug 29, 2022

@android-usb
Hi, can you tell me what's going on with this bug? Is it a problem with our audio or with the code? please!!

@android-usb
Copy link
Collaborator

From DrumPlayer.kt:29
val NUM_SAMPLE_CHANNELS: Int = 1 // All WAV resource must be mono

The WAV files you are trying to use are 2 channel (i.e. Stereo) files. They must be 1 channel (Mono).

@android-usb
Copy link
Collaborator

BTW, there are many (free) WAV editor applications available that will allow conversion of Stereo files to mono.

@Hyyzt
Copy link
Author

Hyyzt commented Aug 30, 2022

@android-usb
Thanks, I'll convert the format and test it.

@elias-lm
Copy link

elias-lm commented Feb 28, 2023

is it possible to use STEREO wav?
can someone point me?
getting crash in PolyphaseResamplerStereo.writeFrame when using stereo files

void PolyphaseResamplerStereo::writeFrame(const float *frame) {
    // Move cursor before write so that cursor points to last written frame in read.
    if (--mCursor < 0) {
        mCursor = getNumTaps() - 1;
    }
    float *dest = &mX[mCursor * STEREO];
    const int offset = mNumTaps * STEREO;
    // Write each channel twice so we avoid having to wrap when running the FIR.
    const float left =  frame[0]; // <----------------------THIS LINE CRASH--------------------< 
    const float right = frame[1];
    // Put ordered writes together.
    dest[0] = left;
    dest[1] = right;
    dest[offset] = left;
    dest[1 + offset] = right;
}

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

No branches or pull requests

5 participants