mobile CCTV,mobile surveillance,police body worn cameras

标题: USB设备抢占冲突 [打印本页]

author: cus7    time: 2021-10-19 08:40
标题: USB设备抢占冲突
我们的项目中有用到USB Camera,这个是由我们进行开启拍照。目前采用商用版本的软件,登陆的时候会发生抢占USB问题
author: cus7    time: 2021-10-19 09:00
把MainService中的UvcManager.getInstance(this).selfCheck();
注释掉,会报如下错误。

A/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x8 in tid 13033 (HeapTaskDaemon), pid 13009 (om.smarteye.mcu)
author: cus7    time: 2021-10-19 09:04
E/ActivityThread: Failed to find provider info for com.smarteye.usbclientocalProvider
E/MCUApplication: mcp can not find com.smarteye.usbclient package
W/System.err: android.content.pm.PackageManager$NameNotFoundException: Application package com.smarteye.usbclient not found
W/System.err:     at android.app.ContextImpl.createPackageContextAsUser(ContextImpl.java:2344)
W/System.err:     at android.app.ContextImpl.createPackageContext(ContextImpl.java:2315)
        at android.content.ContextWrapper.createPackageContext(ContextWrapper.java:876)
W/System.err:     at com.smarteye.service.MCUApplication.initUsbClient(MCUApplication.java:1257)
        at com.smarteye.service.MCUApplication.init(MCUApplication.java:1236)
W/System.err:     at com.smarteye.service.MCUApplication.onCreate(MCUApplication.java:1224)
        at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1202)
W/System.err:     at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7588)
        at android.app.ActivityThread.access$2600(ActivityThread.java:260)
W/System.err:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2435)
        at android.os.Handler.dispatchMessage(Handler.java:110)
W/System.err:     at android.os.Looper.loop(Looper.java:219)
        at android.app.ActivityThread.main(ActivityThread.java:8668)
W/System.err:     at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
W/System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1109)
W/om.smarteye.mc: Verification of void com.smarteye.camera.CameraUtils.closeExtCameraOnly() took 338.198ms
W/VideoCapabilities: Unrecognized profile/level 0/0 for video/mpeg2
    Unrecognized profile/level 0/2 for video/mpeg2
author: cus7    time: 2021-10-19 09:26
将MCUApplication中的initUsbClient注释掉。

会报错
E/libc: Access denied finding property "ro.serialno"

倒追程序直接奔溃
author: bvwl    time: 2021-10-19 09:43
您可以尝试注释掉USB连接的广播,在AndroidManifest.xml文件中,有一个USB静态广播的注册类UsbStateBroadCastReceiver,注释掉这个类再尝试
author: cus7    time: 2021-10-19 09:48
diff --git a/app/src/main/java/com/smarteye/service/MainService.java b/app/src/main/java/com/smarteye/service/MainService.java
index c9211a9..322999a 100644
--- a/app/src/main/java/com/smarteye/service/MainService.java
+++ b/app/src/main/java/com/smarteye/service/MainService.java
@@ -1528,7 +1528,7 @@ public class MainService extends Service implements JNIMessageEvent, UserStatusC
                if (!TextUtils.isEmpty(addr)) {
                        RtspManager.getInstance(MainService.this).openRtsp(addr);
                }
-               UvcManager.getInstance(this).selfCheck();
+               //UvcManager.getInstance(this).selfCheck();^M
                init28181Config();
                loadMediaFile();
                initAutoAction();

author: cus7    time: 2021-10-19 09:48
这里需要注释掉么?
这个是MainService强制去注册的
author: bvwl    time: 2021-10-19 10:01
这个是动态注册,插入USB Camera时,如果MCP不在运行,是不需要注释的,如果在运行中,需要注释掉




欢迎光临 mobile CCTV,mobile surveillance,police body worn cameras (http://bbs.besovideo.com:8067/) Powered by Discuz! X3.2