GNOME Bugzilla – Bug 774048
androidmedia: Android application crashes for build 1.9.90
Last modified: 2016-11-10 10:48:12 UTC
Created attachment 339234 [details] androidmedia(gst_android_hardware_sensor_init) Hello, Our Android application running without any issues with previous build 1.4.5 and it has been tested for QA cycle including accessing hardware codecs for Video encoding and decoding. However we've updated cerbero build and NDK to support latest version of android i.e 6.0/7.0. I've successfully build the cerbero for version 1.9.90 and updated NDK for android-ndk-r12b. With these latest changes our Android application crashes while launching app. Debug logs points to androidmedia(gst_android_hardware_sensor_init) plugin is culprit. W/GStreamer+amc(14205): 0:00:01.284946250 0x78f74a20 gstamc.c:3531:gst_amc_codec_info_to_caps Unsupported mimetype 'audio/ac3' E/GStreamer+ahs(14205): 0:00:01.295211375 0x78f74a20 gst-android-hardware-sensor.c:598:_init_classes Failed to initialize Android classes: Failed to get static field ID TYPE_HEART_RATE (I): java.lang.NoSuchFieldError: no static field with name='TYPE_HEART_RATE' signature='I' in class Landroid/hardware/Sensor; E/GStreamer+ahs(14205): java.lang.NoSuchFieldError: no static field with name='TYPE_HEART_RATE' signature='I' in class Landroid/hardware/Sensor; E/GStreamer+ahs(14205): at org.freedesktop.gstreamer.GStreamer.nativeInit(Native Method) E/GStreamer+ahs(14205): at org.freedesktop.gstreamer.GStreamer.init(GStreamer.java:16) E/GStreamer+ahs(14205): at com.iVideo.videotrans.Video.init(iVideoTrans.java:135) E/GStreamer+ahs(14205): at com.iVideo.GstVideoApp.iDemoApp.onCreate(iDemoApp.java:56) E/GStreamer+ahs(14205): at android.app.Activity.performCreate(Activity.java:5426) E/GStreamer+ahs(14205): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105) E/GStreamer+ahs(14205): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2269) E/GStreamer+ahs(14205): at android.app.ActivityThread.handleLaunchActivity(A E/GLib+stderr(14205): ** E/GLib+stderr(14205): ERROR:gst-android-hardware-sensor.c:157:gst_ah_sensor_sensor_sizes_deinit: 'sensor_sizes' should not be NULL (attached detail log) Please note instead of hardware codecs if we use software based codecs i.e x264 and avdec_h264 Applications works perfectly fine.This issue has been observed on Qualcomm and Exynos based chipsets It would be great if we get help/suggestions or pointers to resolve this issue at earliest. Thanks in advance. -Umashankar
Created attachment 339235 [details] [review] ahs: Don't assert on deinit if initialization failed before Initialization failure is handled correctly by just not registering the ahssrc element.
Created attachment 339236 [details] [review] amc: Allow registering codecs, camera or sensors if any of the others failed
Review of attachment 339236 [details] [review]: This seems to complicate things more than already is. What if we add separate functions for checking that the elements are available and reduce the goto footprint to smaller areas?
That's true, yes
Attachment 339235 [details] pushed as 56ee6c4 - ahs: Don't assert on deinit if initialization failed before Attachment 339236 [details] pushed as e6651a7 - amc: Allow registering codecs, camera or sensors if any of the others failed
Hello Sebastian, Thanks for prompt response, however I'm finding another build issue while compiling cerbero with patch. First I build the gst-plugins-bad-1.0-static recipe and I didn't find any issue. But when I run the cerbero -c config/cross-android-armv7.cbc package gstreamer-1.0 command I found errors. Please find below steps I've followed. let me know if I missing anything here. Thanks in advance ice@ice:~/cerbero$ cerbero -c config/cross-android-armv7.cbc cleanone gst-plugins-bad-1.0-static ice@ice:~/cerbero$ cerbero -c config/cross-android-armv7.cbc buildone gst-plugins-bad-1.0-static WARNING: Using default configuration because /home/ice/.cerbero/cerbero.cbc is missing Building the following recipes: gst-plugins-bad-1.0-static [(1/1) gst-plugins-bad-1.0-static -> fetch ] [(1/1) gst-plugins-bad-1.0-static -> extract ] -----> Extracting -----> Apply source patch in Git Class -----> Apply source patch in Git Class Applying source file patch bad_plugins/bad_plugins.patch Copy modified gstamc.c file to the bad plugin source tree Copy modified gst-android-hardware-sensor.c file to the bad plugin source tree [(1/1) gst-plugins-bad-1.0-static -> configure ] [(1/1) gst-plugins-bad-1.0-static -> compile ] [(1/1) gst-plugins-bad-1.0-static -> install ] [(1/1) gst-plugins-bad-1.0-static -> post_install ] ice@ice:~/cerbero$ cerbero -c config/cross-android-armv7.cbc package gstreamer-1.0 make[3]: Entering directory '/home/ice/cerbero/build/sources/android_armv7/gst-plugins-bad-1.0-1.9/sys/androidmedia' /bin/bash ../../libtool --tag=CC --tag=disable-static --mode=compile arm-linux-androideabi-gcc -fuse-ld=gold -std=gnu99 -DHAVE_CONFIG_H -I. -I../.. --sysroot=/home/ice/cerbero/build/android-ndk-r12b/platforms/android-9/arch-arm -I/home/ice/cerbero/build/android-ndk-r12b/platforms/android-9/arch-arm/usr/include -DANDROID -DPIC -D__ARM_ARCH_7A__ -Wno-error -I/home/ice/cerbero/build/dist/android_armv7/include -I../../gst-libs -I../../gst-libs -pthread -I/home/ice/cerbero/build/dist/android_armv7/include/gstreamer-1.0 -I/home/ice/cerbero/build/dist/android_armv7/include/glib-2.0 -I/home/ice/cerbero/build/dist/android_armv7/lib/glib-2.0/include -pthread -I/home/ice/cerbero/build/dist/android_armv7/include/gstreamer-1.0 -I/home/ice/cerbero/build/dist/android_armv7/include/glib-2.0 -I/home/ice/cerbero/build/dist/android_armv7/lib/glib-2.0/include -pthread -I/home/ice/cerbero/build/dist/android_armv7/include/gstreamer-1.0 -I/home/ice/cerbero/build/dist/android_armv7/include/glib-2.0 -I/home/ice/cerbero/build/dist/android_armv7/lib/glib-2.0/include -DGST_USE_UNSTABLE_API -DG_THREADS_MANDATORY -DG_DISABLE_CAST_CHECKS -Wall -Wdeclaration-after-statement -Wvla -Wpointer-arith -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wwrite-strings -Wformat-security -Wold-style-definition -Winit-self -Wmissing-include-dirs -Waddress -Wno-multichar -Wnested-externs -g -I/home/ice/cerbero/build/dist/android_armv7/include/orc-0.4 -DGST_USE_UNSTABLE_API -Wall -g -Os --sysroot=/home/ice/cerbero/build/android-ndk-r12b/platforms/android-9/arch-arm -I/home/ice/cerbero/build/android-ndk-r12b/platforms/android-9/arch-arm/usr/include -ffunction-sections -funwind-tables -fstack-protector -no-canonical-prefixes -fPIC -mthumb -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -DANDROID -DPIC -D__ARM_ARCH_7A__ -Wa,--noexecstack -Wno-error -DGSTREAMER_GLIB_COCOA_NSAPPLICATION=1 -DGST_LEVEL_MAX=GST_LEVEL_FIXME -MT libgstandroidmedia_la-gstamc.lo -MD -MP -MF .deps/libgstandroidmedia_la-gstamc.Tpo -c -o libgstandroidmedia_la-gstamc.lo `test -f 'gstamc.c' || echo './'`gstamc.c libtool: compile: arm-linux-androideabi-gcc -fuse-ld=gold -std=gnu99 -DHAVE_CONFIG_H -I. -I../.. --sysroot=/home/ice/cerbero/build/android-ndk-r12b/platforms/android-9/arch-arm -I/home/ice/cerbero/build/android-ndk-r12b/platforms/android-9/arch-arm/usr/include -DANDROID -DPIC -D__ARM_ARCH_7A__ -Wno-error -I/home/ice/cerbero/build/dist/android_armv7/include -I../../gst-libs -I../../gst-libs -pthread -I/home/ice/cerbero/build/dist/android_armv7/include/gstreamer-1.0 -I/home/ice/cerbero/build/dist/android_armv7/include/glib-2.0 -I/home/ice/cerbero/build/dist/android_armv7/lib/glib-2.0/include -pthread -I/home/ice/cerbero/build/dist/android_armv7/include/gstreamer-1.0 -I/home/ice/cerbero/build/dist/android_armv7/include/glib-2.0 -I/home/ice/cerbero/build/dist/android_armv7/lib/glib-2.0/include -pthread -I/home/ice/cerbero/build/dist/android_armv7/include/gstreamer-1.0 -I/home/ice/cerbero/build/dist/android_armv7/include/glib-2.0 -I/home/ice/cerbero/build/dist/android_armv7/lib/glib-2.0/include -DGST_USE_UNSTABLE_API -DG_THREADS_MANDATORY -DG_DISABLE_CAST_CHECKS -Wall -Wdeclaration-after-statement -Wvla -Wpointer-arith -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wwrite-strings -Wformat-security -Wold-style-definition -Winit-self -Wmissing-include-dirs -Waddress -Wno-multichar -Wnested-externs -g -I/home/ice/cerbero/build/dist/android_armv7/include/orc-0.4 -DGST_USE_UNSTABLE_API -Wall -g -Os --sysroot=/home/ice/cerbero/build/android-ndk-r12b/platforms/android-9/arch-arm -I/home/ice/cerbero/build/android-ndk-r12b/platforms/android-9/arch-arm/usr/include -ffunction-sections -funwind-tables -fstack-protector -no-canonical-prefixes -fPIC -mthumb -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -DANDROID -DPIC -D__ARM_ARCH_7A__ -Wa,--noexecstack -Wno-error -DGSTREAMER_GLIB_COCOA_NSAPPLICATION=1 -DGST_LEVEL_MAX=GST_LEVEL_FIXME -MT libgstandroidmedia_la-gstamc.lo -MD -MP -MF .deps/libgstandroidmedia_la-gstamc.Tpo -c gstamc.c -fPIC -DPIC -o .libs/libgstandroidmedia_la-gstamc.o gstamc.c:2031:3: error: 'COLOR_FormatYUV420Flexible' undeclared here (not in a function) COLOR_FormatYUV420Flexible, GST_VIDEO_FORMAT_I420}, { ^ gstamc.c:2035:3: error: 'COLOR_INTEL_FormatYUV420PackedSemiPlanar' undeclared here (not in a function) COLOR_INTEL_FormatYUV420PackedSemiPlanar, GST_VIDEO_FORMAT_NV12}, { ^ gstamc.c:2036:3: error: 'COLOR_INTEL_FormatYUV420PackedSemiPlanar_Tiled' undeclared here (not in a function) COLOR_INTEL_FormatYUV420PackedSemiPlanar_Tiled, GST_VIDEO_FORMAT_NV12}, { ^ gstamc.c:2039:3: error: 'COLOR_QCOM_FormatYVU420SemiPlanar32m' undeclared here (not in a function) COLOR_QCOM_FormatYVU420SemiPlanar32m, GST_VIDEO_FORMAT_NV12}, { ^ gstamc.c:2040:3: error: 'COLOR_QCOM_FormatYVU420SemiPlanar32mMultiView' undeclared here (not in a function) COLOR_QCOM_FormatYVU420SemiPlanar32mMultiView, GST_VIDEO_FORMAT_NV12}, { ^ gstamc.c:2041:3: error: 'COLOR_OMX_SEC_FormatNV12Tiled' undeclared here (not in a function) COLOR_OMX_SEC_FormatNV12Tiled, GST_VIDEO_FORMAT_NV12}, { ^ gstamc.c:2043:3: error: 'COLOR_FormatYV12' undeclared here (not in a function) COLOR_FormatYV12, GST_VIDEO_FORMAT_YV12} ^ gstamc.c:2598:3: error: 'HEVCProfileMain' undeclared here (not in a function) HEVCProfileMain, "main"}, { ^ gstamc.c:2598:3: error: initializer element is not constant gstamc.c:2598:3: error: (near initialization for 'hevc_profile_mapping_table[0].id') gstamc.c:2599:3: error: 'HEVCProfileMain10' undeclared here (not in a function) HEVCProfileMain10, "main-10"} ^ gstamc.c:2599:3: error: initializer element is not constant gstamc.c:2599:3: error: (near initialization for 'hevc_profile_mapping_table[1].id') gstamc.c:2638:3: error: 'HEVCMainTierLevel1' undeclared here (not in a function) HEVCMainTierLevel1, "main", "1"}, { ^ gstamc.c:2638:3: error: initializer element is not constant gstamc.c:2638:3: error: (near initialization for 'hevc_tier_level_mapping_table[0].id') gstamc.c:2639:3: error: 'HEVCMainTierLevel2' undeclared here (not in a function) HEVCMainTierLevel2, "main", "2"}, { ^ gstamc.c:2639:3: error: initializer element is not constant gstamc.c:2639:3: error: (near initialization for 'hevc_tier_level_mapping_table[1].id') gstamc.c:2640:3: error: 'HEVCMainTierLevel21' undeclared here (not in a function) HEVCMainTierLevel21, "main", "2.1"}, { ^ gstamc.c:2640:3: error: initializer element is not constant gstamc.c:2640:3: error: (near initialization for 'hevc_tier_level_mapping_table[2].id') gstamc.c:2641:3: error: 'HEVCMainTierLevel3' undeclared here (not in a function) HEVCMainTierLevel3, "main", "3"}, { ^ gstamc.c:2641:3: error: initializer element is not constant gstamc.c:2641:3: error: (near initialization for 'hevc_tier_level_mapping_table[3].id') gstamc.c:2642:3: error: 'HEVCMainTierLevel31' undeclared here (not in a function) HEVCMainTierLevel31, "main", "3.1"}, { ^ gstamc.c:2642:3: error: initializer element is not constant gstamc.c:2642:3: error: (near initialization for 'hevc_tier_level_mapping_table[4].id') gstamc.c:2643:3: error: 'HEVCMainTierLevel4' undeclared here (not in a function) HEVCMainTierLevel4, "main", "4"}, { ^ gstamc.c:2643:3: error: initializer element is not constant gstamc.c:2643:3: error: (near initialization for 'hevc_tier_level_mapping_table[5].id') gstamc.c:2644:3: error: 'HEVCMainTierLevel41' undeclared here (not in a function) HEVCMainTierLevel41, "main", "4.1"}, { ^ gstamc.c:2644:3: error: initializer element is not constant gstamc.c:2644:3: error: (near initialization for 'hevc_tier_level_mapping_table[6].id') gstamc.c:2645:3: error: 'HEVCMainTierLevel5' undeclared here (not in a function) HEVCMainTierLevel5, "main", "5"}, { ^ gstamc.c:2645:3: error: initializer element is not constant gstamc.c:2645:3: error: (near initialization for 'hevc_tier_level_mapping_table[7].id') gstamc.c:2646:3: error: 'HEVCMainTierLevel51' undeclared here (not in a function) HEVCMainTierLevel51, "main", "5.1"}, { ^ gstamc.c:2646:3: error: initializer element is not constant gstamc.c:2646:3: error: (near initialization for 'hevc_tier_level_mapping_table[8].id') gstamc.c:2647:3: error: 'HEVCMainTierLevel52' undeclared here (not in a function) HEVCMainTierLevel52, "main", "5.2"}, { ^ gstamc.c:2647:3: error: initializer element is not constant gstamc.c:2647:3: error: (near initialization for 'hevc_tier_level_mapping_table[9].id') gstamc.c:2648:3: error: 'HEVCMainTierLevel6' undeclared here (not in a function) HEVCMainTierLevel6, "main", "6"}, { ^ gstamc.c:2648:3: error: initializer element is not constant gstamc.c:2648:3: error: (near initialization for 'hevc_tier_level_mapping_table[10].id') gstamc.c:2649:3: error: 'HEVCMainTierLevel61' undeclared here (not in a function) HEVCMainTierLevel61, "main", "6.1"}, { ^ gstamc.c:2649:3: error: initializer element is not constant gstamc.c:2649:3: error: (near initialization for 'hevc_tier_level_mapping_table[11].id') gstamc.c:2650:3: error: 'HEVCMainTierLevel62' undeclared here (not in a function) HEVCMainTierLevel62, "main", "6.2"}, { ^ gstamc.c:2650:3: error: initializer element is not constant gstamc.c:2650:3: error: (near initialization for 'hevc_tier_level_mapping_table[12].id') gstamc.c:2651:3: error: 'HEVCHighTierLevel1' undeclared here (not in a function) HEVCHighTierLevel1, "high", "1"}, { ^ gstamc.c:2651:3: error: initializer element is not constant gstamc.c:2651:3: error: (near initialization for 'hevc_tier_level_mapping_table[13].id') gstamc.c:2652:3: error: 'HEVCHighTierLevel2' undeclared here (not in a function) HEVCHighTierLevel2, "high", "2"}, { ^ gstamc.c:2652:3: error: initializer element is not constant gstamc.c:2652:3: error: (near initialization for 'hevc_tier_level_mapping_table[14].id') gstamc.c:2653:3: error: 'HEVCHighTierLevel21' undeclared here (not in a function) HEVCHighTierLevel21, "high", "2.1"}, { ^ gstamc.c:2653:3: error: initializer element is not constant gstamc.c:2653:3: error: (near initialization for 'hevc_tier_level_mapping_table[15].id') gstamc.c:2654:3: error: 'HEVCHighTierLevel3' undeclared here (not in a function) HEVCHighTierLevel3, "high", "3"}, { ^ gstamc.c:2654:3: error: initializer element is not constant gstamc.c:2654:3: error: (near initialization for 'hevc_tier_level_mapping_table[16].id') gstamc.c:2655:3: error: 'HEVCHighTierLevel31' undeclared here (not in a function) HEVCHighTierLevel31, "high", "3.1"}, { ^ gstamc.c:2655:3: error: initializer element is not constant gstamc.c:2655:3: error: (near initialization for 'hevc_tier_level_mapping_table[17].id') gstamc.c:2656:3: error: 'HEVCHighTierLevel4' undeclared here (not in a function) HEVCHighTierLevel4, "high", "4"}, { ^ gstamc.c:2656:3: error: initializer element is not constant gstamc.c:2656:3: error: (near initialization for 'hevc_tier_level_mapping_table[18].id') gstamc.c:2657:3: error: 'HEVCHighTierLevel41' undeclared here (not in a function) HEVCHighTierLevel41, "high", "4.1"}, { ^ gstamc.c:2657:3: error: initializer element is not constant gstamc.c:2657:3: error: (near initialization for 'hevc_tier_level_mapping_table[19].id') gstamc.c:2658:3: error: 'HEVCHighTierLevel5' undeclared here (not in a function) HEVCHighTierLevel5, "high", "5"}, { ^ gstamc.c:2658:3: error: initializer element is not constant gstamc.c:2658:3: error: (near initialization for 'hevc_tier_level_mapping_table[20].id') gstamc.c:2659:3: error: 'HEVCHighTierLevel51' undeclared here (not in a function) HEVCHighTierLevel51, "high", "5.1"}, { ^ gstamc.c:2659:3: error: initializer element is not constant gstamc.c:2659:3: error: (near initialization for 'hevc_tier_level_mapping_table[21].id') gstamc.c:2660:3: error: 'HEVCHighTierLevel52' undeclared here (not in a function) HEVCHighTierLevel52, "high", "5.2"}, { ^ gstamc.c:2660:3: error: initializer element is not constant gstamc.c:2660:3: error: (near initialization for 'hevc_tier_level_mapping_table[22].id') gstamc.c:2661:3: error: 'HEVCHighTierLevel6' undeclared here (not in a function) HEVCHighTierLevel6, "high", "6"}, { ^ gstamc.c:2661:3: error: initializer element is not constant gstamc.c:2661:3: error: (near initialization for 'hevc_tier_level_mapping_table[23].id') gstamc.c:2662:3: error: 'HEVCHighTierLevel61' undeclared here (not in a function) HEVCHighTierLevel61, "high", "6.1"} ^ gstamc.c:2662:3: error: initializer element is not constant gstamc.c:2662:3: error: (near initialization for 'hevc_tier_level_mapping_table[24].id') gstamc.c: In function 'plugin_init': gstamc.c:3337:12: warning: variable 'init_ok' set but not used [-Wunused-but-set-variable] gboolean init_ok = FALSE; ^ Makefile:1001: recipe for target 'libgstandroidmedia_la-gstamc.lo' failed make[3]: *** [libgstandroidmedia_la-gstamc.lo] Error 1 make[3]: Leaving directory '/home/ice/cerbero/build/sources/android_armv7/gst-plugins-bad-1.0-1.9/sys/androidmedia' Makefile:1152: recipe for target 'androidmedia' failed make[2]: *** [androidmedia] Error 2 make[2]: Leaving directory '/home/ice/cerbero/build/sources/android_armv7/gst-plugins-bad-1.0-1.9/sys' Makefile:988: recipe for target 'all-recursive' failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory '/home/ice/cerbero/build/sources/android_armv7/gst-plugins-bad-1.0-1.9' Makefile:917: recipe for target 'all' failed make: *** [all] Error 2
This looks like things are in an inconsistent state in your build directory, also you're building for 1.9. Please update to the latest master branch and test with that, and do a full rebuild.
I'm following below steps please correct me if I'm wrong. Step 1. git clone git://anongit.freedesktop.org/gstreamer/cerbero (This is master branch with git commit 8243037 "Update versions to 1.11") Step 2. Run the patch from git commit 56ee6c4 and e6651a7 Step 3. Full rebuild i.e cerbero -c config/cross-android-armv7.cbc bootstrap cerbero -c config/cross-android-armv7.cbc package gstreamer-1.0 Thanks
Bugzilla is not a support forum, ask on the mailing list: https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel