jiangdongguo / AndroidUSBCamera

🔥🔥🔥Flexible and useful UVC camera engine on Android platform, supporting multi-road cameras!
https://juejin.cn/post/7115229806844706847
Apache License 2.0
2.35k stars 803 forks source link

华为Mate60和华为P50切换分辨率后预览黑屏 #699

Open JeffZane opened 2 weeks ago

JeffZane commented 2 weeks ago

手机通过ezcap U3采集盒连接DV(USB3.0),首次预览分辨率640x480正常,切换1920x1080后黑屏(日志如下所示),有时候等待时间久一点可以预览出来,重启App也不行,需要重新插拔才能恢复正常。

2024-11-01 11:24:16.932 V/AUSBC: [USBMonitor] USBMonitor:Constructor 2024-11-01 11:24:16.934 V/AUSBC: [USBMonitor] USBMonitor:mUsbManager=android.hardware.usb.UsbManager@ede9810 2024-11-01 11:24:16.934 I/AUSBC: [MultiCameraClient] register... 2024-11-01 11:24:16.934 I/AUSBC: [USBMonitor] register: 2024-11-01 11:24:17.946 I/AUSBC: [MultiCameraClient] attach device name/pid/vid:/dev/bus/usb/003/002&11417&7119 2024-11-01 11:24:17.966 I/AUSBC: [USBMonitor] request permission, has permission: true 2024-11-01 11:24:17.968 V/AUSBC: [USBMonitor] processConnect:device=/dev/bus/usb/003/002 2024-11-01 11:24:17.970 I/AUSBC: [USBMonitor] UsbControlBlock:constructor 2024-11-01 11:24:18.023 I/AUSBC: [USBMonitor] name=/dev/bus/usb/003/002,desc=5,busnum=3,devnum=2,rawDesc= 2024-11-01 11:24:18.023 I/AUSBC: [MultiCameraClient] connect device name/pid/vid:/dev/bus/usb/003/002&11417&7119 2024-11-01 11:24:18.030 I/AUSBC: [CameraFragment] camera connection. pid: 11417, vid: 7119 2024-11-01 11:24:18.031 I/AUSBC: [AspectRatioTextureView] AspectRatio = 1.3333333333333333 2024-11-01 11:24:18.082 I/AUSBC: [MultiCameraClient] surface measure size (1224, 918) 2024-11-01 11:24:18.095 I/AUSBC: [RenderManager] create RenderManager, Open ES version is 3.2 2024-11-01 11:24:18.104 I/AUSBC: [EGLEvn] Init EGL Success! 2024-11-01 11:24:18.104 I/AUSBC: [EGLEvn] setupSurface Success! 2024-11-01 11:24:18.113 I/AUSBC: [AbstractRender] init surface texture render success! 2024-11-01 11:24:18.117 I/AUSBC: [AbstractRender] create external texture, id = 1 2024-11-01 11:24:18.117 I/AUSBC: [AbstractRender] init surface texture render success! 2024-11-01 11:24:18.120 I/AUSBC: [AbstractRender] init surface texture render success! 2024-11-01 11:24:18.150 I/AUSBC: [UVCCamera] open camera status: 4049771264, size: {"formats":[{"index":1,"type":6,"default":1,"size":["1920x1080","640x480","800x600","1024x768","1280x720","1280x960","1280x1024","1360x768","1400x900","1440x900"]},{"index":2,"type":4,"default":1,"size":["1920x1080","640x480","800x600","1024x768","1280x720","1280x960","1280x1024","1360x768","1400x900","1440x900"]}]} 2024-11-01 11:24:18.181 I/AUSBC: [CameraUVC] aspect ratio = null, supportedSizeList = [Size(1920x1080@ 0.0,type:6,frame:0,index:0,[]), Size(640x480@ 0.0,type:6,frame:0,index:1,[]), Size(800x600@ 0.0,type:6,frame:0,index:2,[]), Size(1024x768@ 0.0,type:6,frame:0,index:3,[]), Size(1280x720@ 0.0,type:6,frame:0,index:4,[]), Size(1280x960@ 0.0,type:6,frame:0,index:5,[]), Size(1280x1024@ 0.0,type:6,frame:0,index:6,[]), Size(1360x768@ 0.0,type:6,frame:0,index:7,[]), Size(1400x900@ 0.0,type:6,frame:0,index:8,[]), Size(1440x900@ 0.0,type:6,frame:0,index:9,[])] 2024-11-01 11:24:18.181 I/AUSBC: [CameraUVC] getSuitableSize: PreviewSize(width=640, height=480) 2024-11-01 11:24:18.187 I/AUSBC: [CameraUVC] aspect ratio = null, supportedSizeList = [Size(1920x1080@ 0.0,type:6,frame:0,index:0,[]), Size(640x480@ 0.0,type:6,frame:0,index:1,[]), Size(800x600@ 0.0,type:6,frame:0,index:2,[]), Size(1024x768@ 0.0,type:6,frame:0,index:3,[]), Size(1280x720@ 0.0,type:6,frame:0,index:4,[]), Size(1280x960@ 0.0,type:6,frame:0,index:5,[]), Size(1280x1024@ 0.0,type:6,frame:0,index:6,[]), Size(1360x768@ 0.0,type:6,frame:0,index:7,[]), Size(1400x900@ 0.0,type:6,frame:0,index:8,[]), Size(1440x900@ 0.0,type:6,frame:0,index:9,[])] 2024-11-01 11:24:18.188 I/AUSBC: [MultiCameraClient] Audio record by using system mic 2024-11-01 11:24:18.217 I/AUSBC: [CameraUVC] start preview, name = /dev/bus/usb/003/002, preview=PreviewSize(width=640, height=480) 2024-11-01 11:24:18.218 I/AUSBC: [RenderManager] create camera SurfaceTexture: android.graphics.SurfaceTexture@c45bc63 2024-11-01 11:24:18.218 I/AUSBC: [AbstractRender] create texture, id = 2 2024-11-01 11:24:18.219 I/AUSBC: [AbstractFboRender] load fbo, textures: [I@a99060, buffers: [I@c6fe919 2024-11-01 11:24:18.219 I/AUSBC: [AbstractRender] create texture, id = 3 2024-11-01 11:24:18.220 I/AUSBC: [AbstractFboRender] load fbo, textures: [I@7020dde, buffers: [I@3cdbbbf 2024-11-01 11:24:18.229 I/AUSBC: [DemoFragment] max = 0, progress = 0 2024-11-01 11:24:19.100 I/AUSBC: [RenderManager] camera render frame rate is 26 fps-->gl_render 2024-11-01 11:24:20.100 I/AUSBC: [RenderManager] camera render frame rate is 60 fps-->gl_render 2024-11-01 11:24:21.115 I/AUSBC: [RenderManager] camera render frame rate is 61 fps-->gl_render 2024-11-01 11:24:22.116 I/AUSBC: [RenderManager] camera render frame rate is 60 fps-->gl_render 2024-11-01 11:24:23.116 I/AUSBC: [RenderManager] camera render frame rate is 60 fps-->gl_render 2024-11-01 11:24:24.116 I/AUSBC: [RenderManager] camera render frame rate is 60 fps-->gl_render 2024-11-01 11:24:25.116 I/AUSBC: [RenderManager] camera render frame rate is 60 fps-->gl_render 2024-11-01 11:24:26.132 I/AUSBC: [RenderManager] camera render frame rate is 61 fps-->gl_render 2024-11-01 11:24:27.096 I/AUSBC: [CameraUVC] aspect ratio = null, supportedSizeList = [Size(1920x1080@ 0.0,type:6,frame:0,index:0,[]), Size(640x480@ 0.0,type:6,frame:0,index:1,[]), Size(800x600@ 0.0,type:6,frame:0,index:2,[]), Size(1024x768@ 0.0,type:6,frame:0,index:3,[]), Size(1280x720@ 0.0,type:6,frame:0,index:4,[]), Size(1280x960@ 0.0,type:6,frame:0,index:5,[]), Size(1280x1024@ 0.0,type:6,frame:0,index:6,[]), Size(1360x768@ 0.0,type:6,frame:0,index:7,[]), Size(1400x900@ 0.0,type:6,frame:0,index:8,[]), Size(1440x900@ 0.0,type:6,frame:0,index:9,[])] 2024-11-01 11:24:27.141 I/AUSBC: [RenderManager] camera render frame rate is 61 fps-->gl_render 2024-11-01 11:24:28.148 I/AUSBC: [RenderManager] camera render frame rate is 56 fps-->gl_render

2024-11-01 11:24:28.389 I/AUSBC: [MultiCameraClient] updateResolution: width = 1920, height = 1080 2024-11-01 11:24:28.410 I/AUSBC: [USBMonitor] UsbControlBlock#close: 2024-11-01 11:24:28.411 I/AUSBC: [MultiCameraClient] disconnect device name/pid/vid:/dev/bus/usb/003/002&11417&7119 2024-11-01 11:24:28.411 I/AUSBC: [CameraUVC] stop preview, name = /dev/bus/usb/003/002 2024-11-01 11:24:28.412 I/AUSBC: [AbstractRender] release surface texture render success! 2024-11-01 11:24:28.413 I/AUSBC: [EGLEvn] Release EGL Success! 2024-11-01 11:24:28.413 I/AUSBC: [AbstractRender] release surface texture render success! 2024-11-01 11:24:28.413 I/AUSBC: [AbstractRender] release surface texture render success! 2024-11-01 11:24:29.397 I/AUSBC: [AspectRatioTextureView] AspectRatio = 1.7777777777777777 2024-11-01 11:24:29.441 I/AUSBC: [MultiCameraClient] surface measure size (1224, 688) 2024-11-01 11:24:29.444 I/AUSBC: [RenderManager] create RenderManager, Open ES version is 3.2 2024-11-01 11:24:29.450 I/AUSBC: [EGLEvn] Init EGL Success! 2024-11-01 11:24:29.451 I/AUSBC: [EGLEvn] setupSurface Success! 2024-11-01 11:24:29.454 I/AUSBC: [AbstractRender] init surface texture render success! 2024-11-01 11:24:29.457 I/AUSBC: [AbstractRender] create external texture, id = 1 2024-11-01 11:24:29.457 I/AUSBC: [AbstractRender] init surface texture render success! 2024-11-01 11:24:29.459 I/AUSBC: [AbstractRender] init surface texture render success! 2024-11-01 11:24:29.493 I/AUSBC: [UVCCamera] open camera status: 4049771264, size: {"formats":[{"index":1,"type":6,"default":1,"size":["1920x1080","640x480","800x600","1024x768","1280x720","1280x960","1280x1024","1360x768","1400x900","1440x900"]},{"index":2,"type":4,"default":1,"size":["1920x1080","640x480","800x600","1024x768","1280x720","1280x960","1280x1024","1360x768","1400x900","1440x900"]}]} 2024-11-01 11:24:29.532 I/AUSBC: [CameraUVC] aspect ratio = null, supportedSizeList = [Size(1920x1080@ 0.0,type:6,frame:0,index:0,[]), Size(640x480@ 0.0,type:6,frame:0,index:1,[]), Size(800x600@ 0.0,type:6,frame:0,index:2,[]), Size(1024x768@ 0.0,type:6,frame:0,index:3,[]), Size(1280x720@ 0.0,type:6,frame:0,index:4,[]), Size(1280x960@ 0.0,type:6,frame:0,index:5,[]), Size(1280x1024@ 0.0,type:6,frame:0,index:6,[]), Size(1360x768@ 0.0,type:6,frame:0,index:7,[]), Size(1400x900@ 0.0,type:6,frame:0,index:8,[]), Size(1440x900@ 0.0,type:6,frame:0,index:9,[])] 2024-11-01 11:24:29.533 I/AUSBC: [CameraUVC] getSuitableSize: PreviewSize(width=1920, height=1080) 2024-11-01 11:24:29.544 I/AUSBC: [CameraUVC] aspect ratio = null, supportedSizeList = [Size(1920x1080@ 0.0,type:6,frame:0,index:0,[]), Size(640x480@ 0.0,type:6,frame:0,index:1,[]), Size(800x600@ 0.0,type:6,frame:0,index:2,[]), Size(1024x768@ 0.0,type:6,frame:0,index:3,[]), Size(1280x720@ 0.0,type:6,frame:0,index:4,[]), Size(1280x960@ 0.0,type:6,frame:0,index:5,[]), Size(1280x1024@ 0.0,type:6,frame:0,index:6,[]), Size(1360x768@ 0.0,type:6,frame:0,index:7,[]), Size(1400x900@ 0.0,type:6,frame:0,index:8,[]), Size(1440x900@ 0.0,type:6,frame:0,index:9,[])] 2024-11-01 11:24:29.544 I/AUSBC: [MultiCameraClient] Audio record by using system mic 2024-11-01 11:24:29.546 I/AUSBC: [CameraUVC] start preview, name = /dev/bus/usb/003/002, preview=PreviewSize(width=1920, height=1080) 2024-11-01 11:24:29.546 I/AUSBC: [RenderManager] create camera SurfaceTexture: android.graphics.SurfaceTexture@4a4220a 2024-11-01 11:24:29.547 I/AUSBC: [AbstractRender] create texture, id = 2 2024-11-01 11:24:29.547 I/AUSBC: [AbstractFboRender] load fbo, textures: [I@9fdba7b, buffers: [I@5fc1098 2024-11-01 11:24:29.547 I/AUSBC: [AbstractRender] create texture, id = 3 2024-11-01 11:24:29.548 I/AUSBC: [AbstractFboRender] load fbo, textures: [I@6f190f1, buffers: [I@a6a54d6 2024-11-01 11:24:29.557 I/AUSBC: [DemoFragment] max = 0, progress = 0

JeffZane commented 2 weeks ago

6

340

485

627

678