I'm working on and Android game in Unity 2018.1.0f2. Some builds of the App lead to a crash. The log contains then the following:
05-20 18:52:17.993: A/libc(26270): Fatal signal 11 (SIGSEGV), code 2, fault addr 0xef97cffc in tid 26284 (UnityMain)
05-20 18:52:17.993: A/libc(26270): [ 05-20 18:52:17.993 3095: 3095 W/ ]
05-20 18:52:17.993: A/libc(26270): debuggerd: handling request: pid=26270 uid=10367 gid=10367 tid=26284
05-20 18:52:18.094: A/DEBUG(26286): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
05-20 18:52:18.094: A/DEBUG(26286): Build fingerprint: 'samsung/heroltexx/herolte:7.0/NRD90M/G930FXXS2DRDI:user/release-keys'
05-20 18:52:18.094: A/DEBUG(26286): Revision: '8'
05-20 18:52:18.094: A/DEBUG(26286): ABI: 'arm'
05-20 18:52:18.095: A/DEBUG(26286): pid: 26270, tid: 26284, name: UnityMain >>> de.zoomapp.zoom <<<
05-20 18:52:18.095: A/DEBUG(26286): signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0xef97cffc
05-20 18:52:18.095: A/DEBUG(26286): r0 e9c93908 r1 f0f805c0 r2 e42c70e0 r3 00000008
05-20 18:52:18.095: A/DEBUG(26286): r4 00000000 r5 e42c70e0 r6 00000010 r7 00000008
05-20 18:52:18.095: A/DEBUG(26286): r8 e42c7000 r9 e9c93908 sl f0f805c0 fp 00000000
05-20 18:52:18.095: A/DEBUG(26286): ip f1200948 sp ef97d020 lr f11e6bc1 pc f11cbf00 cpsr 60070030
05-20 18:52:18.098: A/DEBUG(26286): backtrace:
05-20 18:52:18.098: A/DEBUG(26286): #00 pc 00053f00 /system/lib/libc.so (arena_purge_to_limit+1151)
05-20 18:52:18.098: A/DEBUG(26286): #01 pc 00064095 /system/lib/libc.so (imemalign+428)
05-20 18:52:18.098: A/DEBUG(26286): #02 pc 0000002f <unknown>
05-20 18:52:19.028: E/audit(4563): type=1701 audit(1526835139.011:7135): auid=4294967295 uid=10367 gid=10367 ses=4294967295 subj=u:r:untrusted_app:s0:c512,c768 pid=26284 comm="UnityMain" exe="/system/bin/app_process32" sig=11
05-20 18:52:19.054: E/lowmemorykiller(3180): Error writing /proc/26270/oom_score_adj; errno=22
05-20 18:52:19.059: E/InputDispatcher(4902): channel ~ Channel is unrecoverably broken and will be disposed!
05-20 18:52:21.967: E/OpenGLRenderer(4902): Error:glDeleteShader::<shader> is not a value generated by OpenGL
05-20 18:52:21.967: E/OpenGLRenderer(4902): Error:glDeleteShader::<shader> is not a value generated by OpenGL
05-20 18:52:21.967: E/OpenGLRenderer(4902): Error:glDeleteShader::<shader> is not a value generated by OpenGL
05-20 18:52:21.967: E/OpenGLRenderer(4902): Error:glDeleteShader::<shader> is not a value generated by OpenGL
05-20 18:52:21.967: E/OpenGLRenderer(4902): Error:glDeleteShader::<shader> is not a value generated by OpenGL
05-20 18:52:21.967: E/OpenGLRenderer(4902): Error:glDeleteShader::<shader> is not a value generated by OpenGL
As I said, I don't get this problem every time, only in some builds. The crash occurs even before the Unity splash screen is shown. It seems like none of my scripts is called (not even Awake()) before it crashes. Also it only occured in the release build which I wanted to upload into the Google Play Store. This release build is splitted into APK and OBB file by Unity, so maybe there is some kind of problem? I don't know if there is much I can do to avoid this, as I don't see how my code or scene might lead to this error.
Maybe someone saw this kind of error before or even had some similiar problem and can give me a hint on how to fix this.
Thank you guys.
Regards, Michael
Any crash inside malloc, realloc, free, or memalign is a 99.99% indication that you have heap corruption (which is the result of overflowing a heap-allocated buffer, freeing unallocated memory, freeing memory twice, etc. etc.)
I don't get this problem every time, only in some builds
Yes: these are all quite characteristic of heap corruption problems.
I don't see how my code or scene might lead to this error.
Unfortunately, heap corruption errors are often very hard to debug without tool support.
On Linux and Mac OSX, you could use valgrind or (better) Address Sanitizer. Looks like the Address Sanitizer is available on Android as well.
Related
I'm working collaboratively on an Android app that uses AR Foundation. From one day to another (without making new builds) the app started to crash after the splash screen, every time. I'm working on my Huawei Mate 20 Pro, but my teammates use other Android phones (Samsung, Xiaomi and Motorola) and they continued to develop the app, and it works just fine for them. I pull their commits (which work for them), make no changes, and it keeps crashing on my phone. We are using Firebase so I have the info from Crashlytics, but I can't quiet understand it:
Unity version is 2019.4.8f1 LTS, and the Huawei phone runs on Android 10.
The complete crash log is:
Caused by java.lang.Error
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Version '2019.4.8f1 (60781d942082)', Build type 'Release', Scripting Backend 'mono', CPU 'armeabi-v7a'
Build fingerprint: 'HUAWEI/LYA-L29/HWLYA:10:user/release-keys' Revision: '0' ABI: 'arm'
Timestamp: 2020-08-13 14:12:37-0300 pid: 3571, tid: 3777,
name: UnityMain >>> com.app.name <<<
uid: 10315 signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
Cause: null pointer dereference r0 00000000 r1 00000000 r2 00000000 r3 00000000 r4 a965d490 r5 bd74a87c r6 80808080 r7 00000000 r8 be98f540 r9 00000000 r10 00000000 r11 b2f15f60 ip b2f4cc90 sp bd74a878 lr b2f1e859 pc 00000000
managed backtrace: #00 (wrapper managed-to-native)
UnityEngine.XR.ARCore.ARCoreSessionSubsystem/NativeApi:UnityARCore_session_update (UnityEngine.ScreenOrientation,UnityEngine.Vector2Int,intptr,UnityEngine.XR.ARSubsystems.Feature) #01
UnityEngine.XR.ARCore.ARCoreSessionSubsystem/ARCoreProvider:Update (UnityEngine.XR.ARSubsystems.XRSessionUpdateParams,UnityEngine.XR.ARSubsystems.Configuration) <0xef> #02
UnityEngine.XR.ARSubsystems.XRSessionSubsystem:Update (UnityEngine.XR.ARSubsystems.XRSessionUpdateParams) <0x1d3> #03
UnityEngine.XR.ARFoundation.ARSession:Update () <0x157> #04
(wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
UPDATE
I've managed to narrow down the crash to the following lines of code, inside the Update of ARSession script:
void Update()
{
if (subsystem?.running == true)
{
m_TrackingMode = subsystem.requestedTrackingMode.ToTrackingMode();
if (subsystem.matchFrameRateEnabled)
{
Application.targetFrameRate = subsystem.frameRate;
QualitySettings.vSyncCount = 0;
}
//subsystem.Update(new XRSessionUpdateParams
//{
// screenOrientation = Screen.orientation,
// screenDimensions = new Vector2Int(Screen.width, Screen.height)
//});
switch (subsystem.trackingState)
{
case TrackingState.None:
case TrackingState.Limited:
state = ARSessionState.SessionInitializing;
break;
case TrackingState.Tracking:
state = ARSessionState.SessionTracking;
break;
}
}
}
With those commented lines, the app starts but the camera won't work. If I uncomment them, it crashes. I know the problem is there because I placed a:
UnityEngine.Handheld.Vibrate();
Before and after, and the phone only vibrates once.
I updated the question's title because the problem is caused by an issue in the update of Google Play Services for AR. I managed to make my app work by manually downloading an older version of Google Play Services for AR, following the instructions here.
You can track the issue I opened in the ARCore Unity SDK repo here
I'm building an Android App with Unity 2018.1.0f2 and get some kind of segmentation fault while running it. The exact error is the following:
05-16 20:54:11.834: E/SamsungIME(9413): <AbstractKeyboardView> - onDraw() called
05-16 20:54:12.142: E/ViewRootImpl(17850): sendUserActionEvent() mView == null
05-16 20:54:12.146: E/SKBD KeyboardInfoUtils(9413): getInstance start
05-16 20:54:12.146: E/SKBD KeyboardInfoUtils(9413): sendSIPInformation state:6 isAbstractKeyboardView : true
05-16 20:54:12.151: E/SKBD KeyboardInfoUtils(9413): sending null keyboardInfo as SIP is closed
05-16 20:54:15.401: A/libc(17850): Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 17865 (UnityMain)
05-16 20:54:15.401: A/libc(17850): [ 05-16 20:54:15.407 3096: 3096 W/ ]
05-16 20:54:15.401: A/libc(17850): debuggerd: handling request: pid=17850 uid=10350 gid=10350 tid=17865
05-16 20:54:15.633: A/DEBUG(17987): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
05-16 20:54:15.634: A/DEBUG(17987): Build fingerprint: 'samsung/heroltexx/herolte:7.0/NRD90M/G930FXXS2DRDI:user/release-keys'
05-16 20:54:15.635: A/DEBUG(17987): Revision: '8'
05-16 20:54:15.635: A/DEBUG(17987): ABI: 'arm'
05-16 20:54:15.635: A/DEBUG(17987): pid: 17850, tid: 17865, name: UnityMain >>> de.zoomapp.zoom <<<
05-16 20:54:15.635: A/DEBUG(17987): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
05-16 20:54:15.636: A/DEBUG(17987): r0 00000000 r1 c7ad20b0 r2 cf9ffc24 r3 efc62308
05-16 20:54:15.637: A/DEBUG(17987): r4 c7ad20b0 r5 c7ad20cc r6 ffffffff r7 00000000
05-16 20:54:15.637: A/DEBUG(17987): r8 00000000 r9 ee67ecb4 sl ee67ebc8 fp ee67e5e8
05-16 20:54:15.637: A/DEBUG(17987): ip c7ad20b0 sp ee67e5c8 lr cf9ffc3c pc f2386338 cpsr a00e0030
05-16 20:54:15.651: A/DEBUG(17987): backtrace:
05-16 20:54:15.652: A/DEBUG(17987): #00 pc 00018338 /system/lib/libc.so (strcmp+47)
05-16 20:54:15.652: A/DEBUG(17987): #01 pc 0014bc38 /data/app/de.zoomapp.zoom-1/lib/arm/libunity.so
05-16 20:54:15.652: A/DEBUG(17987): #02 pc 00008484 <anonymous:c7275000>
05-16 20:54:17.518: E/audit(4645): type=1701 audit(1526496857.505:4791): auid=4294967295 uid=10350 gid=10350 ses=4294967295 subj=u:r:untrusted_app:s0:c512,c768 pid=17865 comm="UnityMain" exe="/system/bin/app_process32" sig=11
05-16 20:54:17.562: E/lowmemorykiller(3180): Error writing /proc/17850/oom_score_adj; errno=22
I try to provide each screen in landscape and portrait mode. When the user is in the login screen and clicks the login button, a UnityWebRequest is sent to the server. If the server responds with a positive result, the UI transitions opens a loading screen, in the background multiple UnityWebRequests are sent to retrieve more information about icons and images to show. When loading is done the main menu is shown and in the background the game is already loaded, but paused. This game consists of only showing a bunch of images and is pretty static, which is the reason why I don't describe it in detail here.
The said crash occurs, if the user rotates his phone from portrait to landscape right after clicking login and while the loading screen shows. I could reproduce this error all the time on my Samsung Galaxy S7, but could not make a minimal example in a clean project.
It might be a problem with yielding the web requests maybe? I put log messages all over my code and before the crash I often saw the yield statement of some web request. I have more coroutines loading some images in async. If I comment out all coroutines it runs fine, but I don't know if this is due to the loading running very fast or if coroutines cause the problem.
I then searched on the internet and found to use addr2line tool. It produced for the address 0014bc38:
operator delete[](void*, std::nothrow_t const&)
I can't find the exact problem. I hope maybe someone has a hint how I can search for this.
Thank you guys.
Regards,
Michael
SEG_MAPERR with address of 0x0 is null pointer dereference.
It's valid to delete a null pointer (and should be for the delete[] operator). I suspect that you have some sort of race condition. Put some logs when you delete or free anything (although everything is GC...)
Also, check the official bug tracker and submit a new bug if you can't find something similar. I suspect that it is trying to access a null pointer when the new window parameters are sent to the app.
I'm currently using the Skobbler SDK in an Android app to handle mapping and turn-by-turn direction tasks. One issue that came up was the desire to change to frequency at which audio advice is issued from the SDK so that we don't have too many instructions being fired off one after the other.
I found this answer to another question which explains the need to modify an advice_places.adv file which I was able to find within the SDK provided SKMaps.zip file.
The issue I'm experiencing seems to be related to how I re-archive the zip file once I've finished making changes to the advice_places.adv file. I'm working on a Mac and it seems that regardless of if I use the built-in "Compress..." context menu option or if I perform a zip operation via the command line similar to:
zip -vr SKMaps.zip SKMaps/ -x "*.DS_Store"; chmod +x SKMaps.zip
I still can't seem to load my app without it crashing during the Skobbler SDK map initialization process.
I've narrowed down the issue to it being a zip/unzip related issue since I can recreate the crash even if I don't modify any of the contents of the SKMaps.zip but only unzip and then rezip.
Here is a dump of the logs that I see when my app crashes.
SKMaps D SKMapViewHolder----#onResume
D SKMapSurfaceView----#onResume
D SKMapSurfaceView----#onResume preserve GL context is TRUE
WindowManager V Adding window Window{278f3a43 u0 com.company.mymapapp/com.company.mymapapp.activities.MainActivity} at 23 of 32 (before Window{246caca8 u0 SurfaceView})
V Adding window Window{1b0d49f9 u0 SurfaceView} at 23 of 33 (before Window{278f3a43 u0 com.company.mymapapp/com.company.mymapapp.activities.MainActivity})
SKMaps D MapRenderer----#onSurfaceCreated
D MapRenderer----#onSurfaceCreated LinInitialized = true
D MapRenderer---- #initGLView
SkobblerNG D set density JNI - before NG_SetScreenScale
D set density JNI - after NG_SetScreenScale
libc F Fatal signal 11 (SIGSEGV), code 1, fault addr 0x4 in tid 24828 (GLThread 44711)
btif_config_util D btif_config_save_file(L188): in file name:/data/misc/bluedroid/bt_config.new
DEBUG I *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I Build fingerprint: 'google/shamu/shamu:5.1/LMY47I/1767468:user/release-keys'
I Revision: '33696'
I ABI: 'arm'
I pid: 24493, tid: 24828, name: GLThread 44711 >>> com.company.mymapapp <<<
I signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x4
I r0 00000001 r1 00000000 r2 00000001 r3 00000029
I r4 a0edfcd0 r5 00000000 r6 a0edfc00 r7 a044a9b0
I r8 00000000 r9 a044a9d8 sl 00000001 fp 13250820
I ip 80000000 sp a044a978 lr 9e8d5efd pc 9e8d5f22 cpsr 600f0030
I backtrace:
I #00 pc 0018ef22 /data/app/com.company.mymapapp-1/lib/arm/libngnative.so (EarthSphere::SetupTextureInBufferFromTex(SK_WTEXTURE_ID&)+113)
I #01 pc 0018ff23 /data/app/com.company.mymapapp-1/lib/arm/libngnative.so (EarthSphere::Init(unsigned int, unsigned int)+190)
I #02 pc 0011dc7d /data/app/com.company.mymapapp-1/lib/arm/libngnative.so (MapRenderer::InitializeGlobeAndWorldTextures()+116)
I #03 pc 000fe1bd /data/app/com.company.mymapapp-1/lib/arm/libngnative.so (NG_InitializeGL+52)
I #04 pc 000e7fcf /data/app/com.company.mymapapp-1/lib/arm/libngnative.so (Java_com_skobbler_ngx_map_MapRenderer_initgl+14)
I #05 pc 0064b963 /data/dalvik-cache/arm/data#app#com.company.mymapapp-1#base.apk#classes.dex
I Tombstone written to: /data/tombstones/tombstone_07
ActivityManager W Force finishing activity 1 com.company.mymapapp/.activities.MainActivity
BootReceiver I Copying /data/tombstones/tombstone_07 to DropBox (SYSTEM_TOMBSTONE)
JavaBinder E !!! FAILED BINDER TRANSACTION !!!
WindowState I WIN DEATH: Window{23adbb9a u0 SurfaceView}
NetlinkEvent E NetlinkEvent::FindParam(): Parameter 'INTERFACE' not found
E NetlinkEvent::FindParam(): Parameter 'TIME_NS' not found
NetdConnector E Error handling '613 IfaceClass active (null)': java.lang.NumberFormatException: Invalid int: "(null)"
WindowState I WIN DEATH: Window{246caca8 u0 SurfaceView}
I WIN DEATH: Window{259e40bc u0 com.company.mymapapp/com.company.mymapapp.activities.IntroActivity}
I WIN DEATH: Window{278f3a43 u0 com.company.mymapapp/com.company.mymapapp.activities.MainActivity}
I WIN DEATH: Window{1b0d49f9 u0 SurfaceView}
Zygote I Process 24493 exited due to signal (11)
ActivityManager W Exception thrown during pause
W android.os.TransactionTooLargeException
W at android.os.BinderProxy.transactNative(Native Method)
W at android.os.BinderProxy.transact(Binder.java:496)
W at android.app.ApplicationThreadProxy.schedulePauseActivity(ApplicationThreadNative.java:704)
W at com.android.server.am.ActivityStack.startPausingLocked(ActivityStack.java:825)
W at com.android.server.am.ActivityStack.finishActivityLocked(ActivityStack.java:2726)
W at com.android.server.am.ActivityStack.finishTopRunningActivityLocked(ActivityStack.java:2583)
W at com.android.server.am.ActivityStackSupervisor.finishTopRunningActivityLocked(ActivityStackSupervisor.java:2497)
W at com.android.server.am.ActivityManagerService.handleAppCrashLocked(ActivityManagerService.java:11500)
W at com.android.server.am.ActivityManagerService.makeAppCrashingLocked(ActivityManagerService.java:11397)
W at com.android.server.am.ActivityManagerService.crashApplication(ActivityManagerService.java:12081)
W at com.android.server.am.ActivityManagerService.handleApplicationCrashInner(ActivityManagerService.java:11592)
W at com.android.server.am.NativeCrashListener$NativeCrashReporter.run(NativeCrashListener.java:86)
lowmemorykiller E Error opening /proc/24493/oom_score_adj; errno=2
Process com.company.mymapapp (PID: 24493) ended
If anyone has any information as to the preferred method of generating a zip file on a Mac for use with the Skobbler SDK in this fashion, I would appreciate any guidance.
Thank you!
Keith
I've had the same issue (I did the zipping/unzipping manually) - I did not get to the bottom of the problem but the trick is not to zip the SkMaps folder (that you get when unzipping) but the content of that folder (all the subfolders) in an archive named SkMaps.zip (go in the unpacked folder, SKMaps, select all the folder and compress them to an SKMaps.zip.
I'm not sure if this is Mac specific or zip specific. The SDK expects that when unzipping SKMaps.zip it will find a number of folders, but when you compress the SKMaps folder directly you end up with an archive that has as root folder a folder named SkMaps (which is wrong) and only inside that folder the correct folder structure.
I make an update including all Cardboard SDK feature into my game https://play.google.com/store/apps/details?id=com.oriongames.spaceshooter
BUT, I found that some Android device (not all, since my Note 2 and editor mode is working perfectly) Crash instantly after the Unity logo.
Here is the repport :
java.lang.Error: FATAL EXCEPTION [UnityMain] Unity version : 5.1.1f1
Device model : samsung SM-T210 Device fingerprint:
samsung/lt02wifixx/lt02wifi:4.1.2/JZO54K/T210XXAMKF:user/release-keys
Caused by: java.lang.Error: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR),
fault addr 6ab6b090 Build fingerprint:
'samsung/lt02wifixx/lt02wifi:4.1.2/JZO54K/T210XXAMKF:user/release-keys'
Revision: '7' pid: 13587, tid: 13600, name: UnityMain >>>
com.oriongames.spaceshooter <<< r0 00000000 r1 00000000 r2 80808080 r3
6ab6b090 r4 6952f800 r5 6ab6a11c r6 5eb20520 r7 6ab6b090 r8 5eb20524
r9 5eb2056c sl 00000328 fp 69530190 ip 6ab5ed60 sp 5eb20500 lr
6a9a1979 pc 400ca174 cpsr 4b34354f
at libc.strlen(strlen:72) at
libvrunity.ion::gfx::GraphicsManager::InitGlInfo()(gfx:136) at
libvrunity.ion::gfx::GraphicsManager::InitFunctions()(gfx:356) at
libvrunity.ion::gfx::GraphicsManager::Init(bool)(gfx:172) at
libvrunity.ion::gfx::GraphicsManager::GraphicsManager()(gfx:6010) at
libvrunity.gvr::VrSessionImpl::InitIonDefaults()(VrSessionImpl:124) at
libvrunity.gvr::CardboardVrSessionFactory::CreateCardboardVrSession(gvr::DisplayMetrics
const&, gvr::VrAppInfo const&, bool, std::function const&,
std::function const&)(CardboardVrSessionFactory:72) at
libvrunity.gvr::CardboardApiImpl::CardboardApiImpl(gvr::DisplayMetrics
const&)(CardboardApiImpl:182) at libvrunity.Start(Start:364) at
Unknown.0000eecc(Unknown Source) at BaseCardboardDevice.Start(Native
Method) at BaseCardboardDevice.Init(<0x00090>:144) at
CardboardAndroidDevice.Init(<0x0001b>:27) at
Cardboard.InitDevice(<0x00073>:115) at Cardboard.Awake(<0x00083>:131)
at Object.runtime_invoke_void__this__(Native Method) at
GameObject.Internal_AddComponentWithType(Native Method) at
GameObject.AddComponent(<0x00024>:36) at
GameObject.AddComponent(<0x0002b>:43) at
Cardboard.get_SDK(<0x000a3>:163) at
CameraManagerVRCardboard.Recenter(<0x00017>:23) at
c__IteratorD.MoveNext(<0x0009f>:159) at
.runtime_invoke_bool__this__(Native Method) at
MonoBehaviour.StartCoroutine(Native Method) at
MonoBehaviour.StartCoroutine(<0x00028>:40) at
CameraManager.changeCameraState(<0x000b3>:179) at
StartMenu.Init(<0x00257>:599) at StartMenu.Start(<0x00043>:67) at
Object.runtime_invoke_void__this__(Native Method) at
libmono.00021bcf(Native Method) at
libmono.mono_runtime_invoke(mono_runtime_invoke:136) at
libunity.002b1e08(Native Method)
The game works again if I simply remove the Cardboard SDK from the game.
I try to changed GPU Skinning and Automatic Graphics API under PlayerPref but nothing works.
Do you have any clue ?
Thanks you !
Code:
path = "httplive://<host>/moviets/index.m3u8";
// Create a new media player and set the listeners
mMediaPlayer = new MediaPlayer();
mMediaPlayer.setDataSource(path);
mMediaPlayer.setOnErrorListener(this);
mMediaPlayer.setDisplay(holder);
mMediaPlayer.prepare(); // Crashes here. prepareAsync() does not help either
mMediaPlayer.setOnBufferingUpdateListener(this);
mMediaPlayer.setOnCompletionListener(this);
mMediaPlayer.setOnPreparedListener(this);
mMediaPlayer.setOnVideoSizeChangedListener(this);
mMediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
mMediaPlayer.start();
Stack trace:
ERROR/MediaPlayer(1349): error (100, 0)
ERROR/MediaPlayerDemo(1349): error: Prepare failed.: status=0x64
ERROR/MediaPlayerDemo(1349): java.io.IOException: Prepare failed.: status=0x64
ERROR/MediaPlayerDemo(1349): at android.media.MediaPlayer.prepare(Native Method)
ERROR/MediaPlayerDemo(1349): at com.example.Example.VideoPlayerActivity.playVideo(VideoPlayerActivity.java:81)
ERROR/MediaPlayerDemo(1349): at com.example.Example.VideoPlayerActivity.surfaceCreated(VideoPlayerActivity.java:138)
ERROR/MediaPlayerDemo(1349): at android.view.SurfaceView.updateWindow(SurfaceView.java:565)
ERROR/MediaPlayerDemo(1349): at android.view.SurfaceView.access$000(SurfaceView.java:84)
ERROR/MediaPlayerDemo(1349): at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:173)
ERROR/MediaPlayerDemo(1349): at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:590)
ERROR/MediaPlayerDemo(1349): at android.view.ViewRoot.performTraversals(ViewRoot.java:1325)
ERROR/MediaPlayerDemo(1349): at android.view.ViewRoot.handleMessage(ViewRoot.java:1944)
ERROR/MediaPlayerDemo(1349): at android.os.Handler.dispatchMessage(Handler.java:99)
ERROR/MediaPlayerDemo(1349): at android.os.Looper.loop(Looper.java:126)
ERROR/MediaPlayerDemo(1349): at android.app.ActivityThread.main(ActivityThread.java:3997)
ERROR/MediaPlayerDemo(1349): at java.lang.reflect.Method.invokeNative(Native Method)
ERROR/MediaPlayerDemo(1349): at java.lang.reflect.Method.invoke(Method.java:491)
ERROR/MediaPlayerDemo(1349): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
ERROR/MediaPlayerDemo(1349): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
ERROR/MediaPlayerDemo(1349): at dalvik.system.NativeStart.main(Native Method)
DEBUG/MediaPlayerDemo(1349): surfaceChanged called
Logcat:
DEBUG/MediaPlayerDemo(1349): surfaceCreated called
INFO/System.out(1349): the path is httplive://192.168.0.196/moviets/index.m3u8
INFO/StagefrightPlayer(1312): setDataSource('httplive://192.168.0.196/moviets/index.m3u8')
INFO/LiveSession(1312): onConnect 'http://192.168.0.196/moviets/index.m3u8'
INFO/NuHTTPDataSource(1312): connect to 192.168.0.196:80/moviets/index.m3u8 #0
INFO/NuHTTPDataSource(1312): connect to 192.168.0.196:80/moviets/index.m3u8 #0
INFO/NuHTTPDataSource(1312): connect to 192.168.0.196:80/moviets/file5.ts #0
INFO/avc_utils(1312): found AVC codec config (320 x 240, Baseline-profile level 3.0)
INFO/ESQueue(1312): found something resembling an AAC syncword at offset 1017
INFO/NuHTTPDataSource(1312): connect to 192.168.0.196:80/moviets/file6.ts #0
INFO/ESQueue(1312): found AAC codec config (48000 Hz, 7 channels)
INFO/ESQueue(1312): [ 06-26 17:37:17.397 1312:0x550 F/ESQueue ]
INFO/ESQueue(1312): frameworks/base/media/libstagefright/mpeg2ts/ESQueue.cpp:255 Should not be here.
INFO/DEBUG(31): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
INFO/DEBUG(31): Build fingerprint: 'generic/sdk/generic:3.0/HONEYCOMB/104254:eng/test-keys'
INFO/DEBUG(31): pid: 1312, tid: 1360 >>> /system/bin/mediaserver <<<
INFO/DEBUG(31): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadbaad
INFO/DEBUG(31): r0 deadbaad r1 0000000c r2 00000027 r3 00000000
INFO/DEBUG(31): r4 00000080 r5 aff46658 r6 00000007 r7 00000000
INFO/DEBUG(31): r8 a2b72589 r9 00012a6c 10 00100000 fp 00000001
INFO/DEBUG(31): ip ffffffff sp 4060f488 lr aff193e9 pc aff15f58 cpsr 00000030
INFO/NuHTTPDataSource(1312): connect to 192.168.0.196:80/moviets/file7.ts #0
INFO/DEBUG(31): #00 pc 00015f58 /system/lib/libc.so
INFO/DEBUG(31): #01 pc 00001466 /system/lib/liblog.so (__android_log_assert)
INFO/DEBUG(31): libc base address: aff00000
What stumps me is the line "found AAC codec config", while the video file contains mp3 encoding. Is that normal or my Android client is wrongly detecting mp3 as aac? FYI, other videos with aac encoding are playing okay on the client
Any clue?
This seems like a bug in Honeycomb emulator where Android wrongly detects mp3 stream as aac. FFmpeg, on the other hand, detects the mp3 stream correctly, as below
ffmpeg -i file6.ts
Stream #0.1[0x101]: Audio: mp3, 48000 Hz, 2 channels, s16, 192 kb/s
Unfortunately, Android thinks it is AAC
INFO/avc_utils(1312): found AVC codec config (320 x 240, Baseline-profile level 3.0)
INFO/ESQueue(1312): found something resembling an AAC syncword at offset 1017
INFO/NuHTTPDataSource(1312): connect to <ip>:<port>/moviets/file6.ts #0
INFO/ESQueue(1312): found AAC codec config (48000 Hz, 7 channels)
INFO/ESQueue(1312): [ 06-26 17:37:17.397 1312:0x550 F/ESQueue ]
INFO/ESQueue(1312): frameworks/base/media/libstagefright/mpeg2ts/ESQueue.cpp:255 \
Should not be here.
The workaround is to use AAC encoding. If you are using ffmpeg, use the -acodec libfaac option. This works for our project because we have the liberty of choosing the source video formats. This might not necessarily be your case though.