Android Codec2组件存储懒加载服务停止时崩溃问题求助
Android Codec2懒加载服务停止播放时崩溃问题调试
- 音频解码器以Lazy Service(懒加载服务)方式集成到Android Codec2,播放媒体文件时音视频正常,但停止播放(点击返回按钮退出播放器窗口)时,adb日志中出现崩溃转储
- 该问题仅在服务作为懒加载服务(动态启动)运行时出现,若服务随设备启动则无崩溃情况
服务主代码
int main() { ALOGE("Lazy Service starting..."); ::android::hardware::configureRpcThreadpool(/*threads*/ 8, /*willJoin*/ true); using namespace ::android::hardware::media::c2::V1_0; ALOGE("Instantiating Codec2's IComponentStore service..."); android::sp<IComponentStore> store( new utils::ComponentStore(android::MyComponentStore::Create())); if (store == nullptr) { ALOGE("Cannot create Codec2's IComponentStore service."); } status_t status; { auto serviceRegistrar = ::android::hardware::LazyServiceRegistrar::getInstance(); status = serviceRegistrar.registerService(store, "default3"); } LOG_ALWAYS_FATAL_IF(status != android::OK, "Error while registering default3 lazy service: %d", status); ::android::hardware::joinRpcThreadpool(); ALOGE("Lazy Service stopped..."); return 0; }
崩溃日志片段
--------- beginning of crash 06-10 23:18:42.875 1046 4195 4222 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 06-10 23:18:42.875 1046 4195 4222 F DEBUG : Build fingerprint: 'Android/aosp_panther/panther:14/UP1A.231005.007.A1/eng.audio.20240510.161544:userdebug/test-keys' 06-10 23:18:42.875 1046 4195 4222 F DEBUG : Revision: 'MP1.0' 06-10 23:18:42.875 1046 4195 4222 F DEBUG : ABI: 'arm64' [省略后续日志内容]
服务.rc配置文件
service vendor-media-c2-hal-1-0-audiocodec /vendor/bin/hw/vendor.hardware.media.c2@1.0-audiocodec-service interface android.hardware.media.c2@1.0::IComponentStore default3 class hal oneshot disabled user mediacodec group mediadrm camera drmrpc system ioprio rt 4
内容的提问来源于stack exchange,提问作者Rahul M
相关产品推荐
相关产品推荐

