dring segfaults when trying to use the webcam with hardware acceleration enabled
I am unable to use my webcam on a Thinkpad T460s laptop with Ubuntu 20.04 and the latest version of Jami when hardware acceleration is enabled. When I click on the gear to configure my Jami account and go to the Media tab, I see a black rectangle instead of my camera's video feed. dring will crash shortly after with the following message in the syslog:
ul 14 20:04:13 zone3 dring[2636]: -- Starting decoding init for cuda with default device.
Jul 14 20:04:13 zone3 dring[2636]: -- Init decoding for cuda with device 0.
Jul 14 20:04:13 zone3 cx.ring.Ring[2636]: [AVHWDeviceContext @ 0x7efd940041c0] Cannot load libcuda.so.1
Jul 14 20:04:13 zone3 cx.ring.Ring[2636]: [AVHWDeviceContext @ 0x7efd940041c0] Could not dynamically load CUDA
Jul 14 20:04:13 zone3 cx.ring.Ring[2636]: [AVHWDeviceContext @ 0x7efd940041c0] Cannot load libcuda.so.1
Jul 14 20:04:13 zone3 cx.ring.Ring[2636]: [AVHWDeviceContext @ 0x7efd940041c0] Could not dynamically load CUDA
Jul 14 20:04:13 zone3 dring[2636]: -- Init decoding for cuda with device 1.
Jul 14 20:04:13 zone3 cx.ring.Ring[2636]: [AVHWDeviceContext @ 0x7efd94003200] Cannot load libcuda.so.1
Jul 14 20:04:13 zone3 cx.ring.Ring[2636]: [AVHWDeviceContext @ 0x7efd94003200] Could not dynamically load CUDA
Jul 14 20:04:13 zone3 cx.ring.Ring[2636]: [AVHWDeviceContext @ 0x7efd94006380] Cannot load libcuda.so.1
Jul 14 20:04:13 zone3 cx.ring.Ring[2636]: [AVHWDeviceContext @ 0x7efd94006380] Could not dynamically load CUDA
Jul 14 20:04:13 zone3 dring[2636]: -- Init decoding for cuda with device 2.
Jul 14 20:04:13 zone3 dring[2636]: -- Starting decoding init for vaapi with default device.
Jul 14 20:04:13 zone3 dring[2636]: Using hardware decoding for mjpeg with vaapi
Jul 14 20:04:13 zone3 cx.ring.Ring[2636]: [AVHWFramesContext @ 0x7efd94006040] Failed to read image from surface 0x19: -1 (unknown libva error).
Jul 14 20:04:13 zone3 dring[2636]: Start sink <local / Jami Daemon_shm_2636_0>, size=848x480, mixer=0
Jul 14 20:04:13 zone3 dring[2636]: Unable to create a scaler context
Jul 14 20:04:13 zone3 cx.ring.Ring[2636]: [swscaler @ 0x7efd94289580] vaapi_vld is not supported as input pixel format
Jul 14 20:04:13 zone3 dring[2636]: Start sink <local / Jami Daemon_shm_2636_0>, size=848x480, mixer=0
Jul 14 20:04:13 zone3 kernel: dring[2717]: segfault at 0 ip 00007efe053db1c5 sp 00007efdfd7f7a30 error 4 in iHD_drv_video.so[7efe052b2000+36b000]
Jul 14 20:04:13 zone3 kernel: Code: 01 48 83 f8 42 75 e6 31 db 66 41 89 9f 58 0c 00 00 49 8b 5f 28 8b 83 f0 1d 00 00 85 c0 0f 84 ba 01 00 00 48 8b b3 e8 1d 00 00 <81> 3e 00 00 01 00 48 89 75 c8 0f 85 a3 01 00 00 44 8d 70 f0 4d 63
I am able to reproduce this bug every time I open the Media tab or I try to make or receive a video call in Jami.
If I disable the hardware acceleration under the Video section (Media tab), dring is no longer crashing and I can make video calls.
- jami package version: 20200708.1.398241e~dfsg1-1
- graphics adapter: 00:02.0 VGA compatible controller: Intel Corporation Skylake GT2 [HD Graphics 520] (rev 07) (kernel module: i915)
- webcam: Bus 001 Device 003: ID 04f2:b52c Chicony Electronics Co., Ltd Integrated Camera
Edited by Hussein Abdallah