cheese 41.1 一运行就 coredump

已经更新到最新,桌面环境 MATE,从菜单启动会在任务栏有一闪而过的“正在启动 茄子”和“拍照”,之后未出现任何窗口。从终端运行则直接崩溃,回显如下:

$ cheese
Gtk-Message: 13:37:20.593: Failed to load module "colorreload-gtk-module"
Gtk-Message: 13:37:20.593: Failed to load module "window-decorations-gtk-module"

(cheese:14724): dbind-WARNING **: 13:37:20.600: Couldn't connect to accessibility bus: Failed to connect to socket /var/lib/lxdm/.cache/at-spi/bus_0: 权限不够
[3:48:34.287505142] [14724]  INFO Camera camera_manager.cpp:313 libcamera v0.3.0
段错误(核心已转储)

lsusb:

Bus 001 Device 005: ID 0bda:565a Realtek Semiconductor Corp. Integrated_Webcam_HD
使用 GDB 调试,有如下显示:
$ gdb cheese
GNU gdb (GDB) 15.1
Copyright (C) 2024 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-aosc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from cheese...
Reading symbols from /usr/lib/debug/.build-id/8e/7570557ea94da2c2ebdc02d0a6805d6bff83bf.debug...
(gdb) run
Starting program: /usr/bin/cheese 

This GDB supports auto-downloading debuginfo from the following URLs:
  <https://debuginfod.aosc.io>
  <https://debuginfod.elfutils.org>
Enable debuginfod for this session? (y or [n]) n
Debuginfod has been disabled.
To make this setting permanent, add 'set debuginfod enabled off' to .gdbinit.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7fffe73ff6c0 (LWP 15295)]
[New Thread 0x7fffdffff6c0 (LWP 15296)]
[New Thread 0x7fffe6bfe6c0 (LWP 15297)]
[New Thread 0x7fffe63b06c0 (LWP 15298)]
Gtk-Message: 13:43:07.084: Failed to load module "colorreload-gtk-module"
Gtk-Message: 13:43:07.084: Failed to load module "window-decorations-gtk-module"
[New Thread 0x7fffe5ae86c0 (LWP 15299)]

(cheese:15291): dbind-WARNING **: 13:43:07.089: Couldn't connect to accessibility bus: Failed to connect to socket /var/lib/lxdm/.cache/at-spi/bus_0: 权限不够
[New Thread 0x7fffe4c076c0 (LWP 15300)]
[New Thread 0x7fffdd1ff6c0 (LWP 15301)]
[New Thread 0x7fffdc9fe6c0 (LWP 15302)]
[New Thread 0x7fffc0dff6c0 (LWP 15303)]
[Thread 0x7fffc0dff6c0 (LWP 15303) exited]
[Thread 0x7fffdc9fe6c0 (LWP 15302) exited]
[New Thread 0x7fffdc9fe6c0 (LWP 15304)]
[New Thread 0x7fffc0dff6c0 (LWP 15305)]
[New Thread 0x7fffb39ff6c0 (LWP 15306)]
[New Thread 0x7fffa97ff6c0 (LWP 15307)]
[New Thread 0x7fffa8ffe6c0 (LWP 15308)]
[Thread 0x7fffa97ff6c0 (LWP 15307) exited]
[New Thread 0x7fffa97ff6c0 (LWP 15309)]
[New Thread 0x7fffa23ff6c0 (LWP 15310)]
[3:54:20.747062859] [15291]  INFO Camera camera_manager.cpp:313 libcamera v0.3.0
[New Thread 0x7fffa1bfe6c0 (LWP 15311)]
[Thread 0x7fffa1bfe6c0 (LWP 15311) exited]
[New Thread 0x7fffa1bfe6c0 (LWP 15312)]

Thread 1 "cheese" received signal SIGSEGV, Segmentation fault.
gst_structure_get_field (fieldname=0x7ffff7f7b323 "api.v4l2.path", structure=0x0) at ../subprojects/gstreamer/gst/gststructure.c:1108
warning: 1108	../subprojects/gstreamer/gst/gststructure.c: 没有那个文件或目录
(gdb) backtrace 
#0  gst_structure_get_field (fieldname=0x7ffff7f7b323 "api.v4l2.path", structure=0x0) at ../subprojects/gstreamer/gst/gststructure.c:1108
#1  gst_structure_get_value (structure=0x0, fieldname=fieldname@entry=0x7ffff7f7b323 "api.v4l2.path") at ../subprojects/gstreamer/gst/gststructure.c:1131
#2  0x00007ffff7f76711 in cheese_camera_device_set_property (object=0x5555565f6660 [CheeseCameraDevice], prop_id=3, value=0x7fffffffd6b0, pspec=0x555556041850 [GParamObject]) at ../libcheese/cheese-camera-device.c:635
#3  0x00007ffff7384ef8 in object_set_property (object=object@entry=0x5555565f6660 [CheeseCameraDevice], pspec=0x555556041850 [GParamObject], value=0x7fffffffd6b0, nqueue=nqueue@entry=0x0, user_specified=<optimized out>)
    at ../gobject/gobject.c:2169
#4  0x00007ffff73866b0 in g_object_new_internal (class=0x5555565f6c70, params=0x7fffffffd5b0, n_params=1) at ../gobject/gobject.c:2648
#5  0x00007ffff7388f03 in g_object_new_internal (n_params=1, params=0x7fffffffd5b0, class=0x5555565f6c70) at ../gobject/gobject.c:2920
#6  g_object_new_valist (object_type=object_type@entry=0x5555564594c0 [CheeseCameraDevice], first_property_name=first_property_name@entry=0x7ffff7f7b05f "device", var_args=var_args@entry=0x7fffffffd8b0) at ../gobject/gobject.c:2942
#7  0x00007ffff744ed9e in g_initable_new_valist
    (object_type=0x5555564594c0 [CheeseCameraDevice], first_property_name=0x7ffff7f7b05f "device", var_args=var_args@entry=0x7fffffffd8b0, cancellable=cancellable@entry=0x0, error=error@entry=0x7fffffffd9b0) at ../gio/ginitable.c:245
#8  0x00007ffff744ee89 in g_initable_new (object_type=<optimized out>, cancellable=cancellable@entry=0x0, error=error@entry=0x7fffffffd9b0, first_property_name=first_property_name@entry=0x7ffff7f7b05f "device") at ../gio/ginitable.c:163
#9  0x00007ffff7f7747e in cheese_camera_device_new (device=device@entry=0x5555565f66d0 [GstLibcameraDevice], error=error@entry=0x7fffffffd9b0) at ../libcheese/cheese-camera-device.c:781
#10 0x00007ffff7f774d2 in cheese_camera_device_monitor_set_up_device (device=0x5555565f66d0 [GstLibcameraDevice]) at ../libcheese/cheese-camera-device-monitor.c:96
#11 cheese_camera_device_monitor_added (monitor=0x555556023950 [CheeseCameraDeviceMonitor], device=device@entry=0x5555565f66d0 [GstLibcameraDevice]) at ../libcheese/cheese-camera-device-monitor.c:117
#12 0x00007ffff7f7767f in cheese_camera_device_monitor_add_devices (data=0x5555565f66d0, user_data=<optimized out>) at ../libcheese/cheese-camera-device-monitor.c:189
#13 0x00007ffff7276fa8 in g_list_foreach (list=<optimized out>, list@entry=0x5555565d0930 = {...}, func=func@entry=0x7ffff7f77670 <cheese_camera_device_monitor_add_devices>, user_data=user_data@entry=0x555556023950)
    at ../glib/glist.c:1008
#14 0x00007ffff7f788d8 in cheese_camera_device_monitor_coldplug (monitor=0x555556023950 [CheeseCameraDeviceMonitor]) at ../libcheese/cheese-camera-device-monitor.c:221
#15 0x00007ffff7f78b3b in cheese_camera_detect_camera_devices (camera=0x5555561aeec0 [CheeseCamera]) at ../libcheese/cheese-camera.c:350
#16 cheese_camera_setup (camera=camera@entry=0x5555561aeec0 [CheeseCamera], device=device@entry=0x0, error=error@entry=0x7fffffffdb20) at ../libcheese/cheese-camera.c:1577
#17 0x000055555556a2d8 in cheese_application_setup_camera (self=0x5555555aa830 [CheeseApplication]) at ../src/cheese-application.vala:217
#18 cheese_application_common_init (self=<optimized out>) at ../src/cheese-application.vala:131
#22 0x00007ffff739bb3f in <emit signal 'activate' on instance 0x5555555aa830 [CheeseApplication]> (instance=instance@entry=0x5555555aa830, signal_id=<optimized out>, detail=detail@entry=0) at ../gobject/gsignal.c:3583
    #19 0x00007ffff7380ab1 in _g_closure_invoke_va (closure=0x5555555a7fa0, return_value=0x0, instance=0x5555555aa830, args=0x7fffffffddf0, n_params=0, param_types=0x0) at ../gobject/gclosure.c:897
    #20 0x00007ffff7395ef8 in signal_emit_valist_unlocked (instance=instance@entry=0x5555555aa830, signal_id=signal_id@entry=8, detail=detail@entry=0, var_args=var_args@entry=0x7fffffffddf0) at ../gobject/gsignal.c:3424
    #21 0x00007ffff739ba92 in g_signal_emit_valist (instance=0x5555555aa830, signal_id=8, detail=0, var_args=0x7fffffffddf0) at ../gobject/gsignal.c:3263
#23 0x00007ffff74b2e3b in g_application_activate (application=0x5555555aa830 [CheeseApplication]) at ../gio/gapplication.c:2451
#24 0x0000555555560efc in cheese_application_real_command_line (base=0x5555555aa830 [CheeseApplication], cl=cl@entry=0x555555bf0420 [GApplicationCommandLine]) at ../src/cheese-application.vala:173
#29 0x00007ffff739bb3f in <emit signal 'command-line' on instance 0x5555555aa830 [CheeseApplication]> (instance=instance@entry=0x5555555aa830, signal_id=<optimized out>, detail=detail@entry=0) at ../gobject/gsignal.c:3583
    #25 0x00007ffff74560b3 in _g_cclosure_marshal_INT__OBJECTv
    (closure=0x5555555a8420, return_value=0x7fffffffe0e0, instance=<optimized out>, args=<optimized out>, marshal_data=<optimized out>, n_params=<optimized out>, param_types=0x5555555a82d0) at ../gio/gmarshal-internal.c:847
    #26 0x00007ffff7380ab1 in _g_closure_invoke_va (closure=0x5555555a8420, return_value=0x7fffffffe0e0, instance=0x5555555aa830, args=0x7fffffffe1e0, n_params=1, param_types=0x5555555a82d0) at ../gobject/gclosure.c:897
    #27 0x00007ffff739520e in signal_emit_valist_unlocked (instance=instance@entry=0x5555555aa830, signal_id=signal_id@entry=10, detail=detail@entry=0, var_args=var_args@entry=0x7fffffffe1e0) at ../gobject/gsignal.c:3424
    #28 0x00007ffff739ba92 in g_signal_emit_valist (instance=0x5555555aa830, signal_id=10, detail=0, var_args=0x7fffffffe1e0) at ../gobject/gsignal.c:3263
#30 0x00007ffff74b0d55 in g_application_call_command_line (exit_status=0x7fffffffe374, options=<optimized out>, arguments=<optimized out>, application=0x5555555aa830 [CheeseApplication]) at ../gio/gapplication.c:1103
#31 g_application_call_command_line (application=0x5555555aa830 [CheeseApplication], arguments=<optimized out>, options=<optimized out>, exit_status=0x7fffffffe374) at ../gio/gapplication.c:1080
#32 0x00007ffff74b324a in g_application_real_local_command_line (application=0x5555555aa830 [CheeseApplication], arguments=0x7fffffffe378, exit_status=0x7fffffffe374) at ../gio/gapplication.c:1179
#33 0x00007ffff74b33c6 in g_application_run (application=application@entry=0x5555555aa830 [CheeseApplication], argc=argc@entry=1, argv=argv@entry=0x7fffffffe4f8) at ../gio/gapplication.c:2681
#34 0x000055555555fa85 in _vala_main (args_length1=1, args=0x7fffffffe4f8) at ../src/cheese-main.vala:27
#35 main (argc=1, argv=0x7fffffffe4f8) at ../src/cheese-main.vala:21
Thread 1 "cheese" received signal SIGSEGV, Segmentation fault.
gst_structure_get_field (fieldname=0x7ffff7f7b323 "api.v4l2.path", structure=0x0) at ../subprojects/gstreamer/gst/gststructure.c:1108
warning: 1108	../subprojects/gstreamer/gst/gststructure.c: 没有那个文件或目录

使用 GStreamer 相关工具尝试读取,未显示 api.v4l2.path 属性,经查询网络资料,一般都是会有的:My laptop's web cam doesn't show in in the device list if I launch cheese while an external webcam is connected (#92) · Issues · GNOME / cheese · GitLab

$ gst-device-monitor-1.0 Video/Source
Probing devices...

[3:56:15.860490610] [15397]  INFO Camera camera_manager.cpp:313 libcamera v0.3.0

Device found:

	name  : \_SB_.PCI0.XHC_.RHUB.HS06-6:1.0-0bda:565a
	class : Source/Video
	caps  : image/jpeg, width=640, height=360
	        image/jpeg, width=640, height=480
	        image/jpeg, width=848, height=480
	        image/jpeg, width=960, height=540
	        image/jpeg, width=1280, height=720
	        image/jpeg, width=1280, height=720
	        video/x-raw, format=YUY2, width=160, height=120
	        video/x-raw, format=YUY2, width=320, height=180
	        video/x-raw, format=YUY2, width=320, height=240
	        video/x-raw, format=YUY2, width=424, height=240
	        video/x-raw, format=YUY2, width=640, height=360
	        video/x-raw, format=YUY2, width=640, height=480
	        video/x-raw, format=YUY2, width=640, height=480
	gst-launch-1.0 libcamerasrc camera-name="\\_SB_.PCI0.XHC_.RHUB.HS06-6:1.0-0bda:565a" ! ...

GStreamer 本身可以正常打开摄像头,以下两种方式都可以:

$ gst-launch-1.0 v4l2src ! jpegdec ! xvimagesink
$ gst-launch-1.0 libcamerasrc camera-name="\\\\_SB_.PCI0.XHC_.RHUB.HS06-6:1.0-0bda:565a" ! jpegdec ! xvimagesink

VLC 和 guvcview 也都能正常使用摄像头。

感谢报告分析,我们尽快解决

我现在感觉是上游 Bug,但是不能确定问题是出在 cheese、gstreamer 还是 v4l2 / uvcvideo。有空时我换个发行版试试,但我记得这台电脑之前用旧版 Ubuntu 是可以的

因为这台电脑(在 AOSC OS 下)会识别到 /dev/video0 和 /dev/video1 两个设备(挂在同一个 USB 设备下),在 VLC 里 video0 是可以用的,video1 不可用。

cheese 应该是能够打开 video0,但是之后会试图打开 video1 并崩溃。我尝试禁用当前用户对 video1 的权限,然后 cheese 会在终端提示 ERROR MediaDevice media_object.cpp:370 Device node /dev/video1 can't be accessed: 权限不够,继而在图形界面中提示找不到设备。