cheese display corrupted under Ubuntu 22.04

Bug #1967843 reported by Jack Howarth
166
This bug affects 31 people
Affects Status Importance Assigned to Milestone
Cheese
Fix Released
Unknown
OEM Priority Project
Fix Released
Critical
Unassigned
cheese (Ubuntu)
Invalid
Low
Unassigned
clutter-gst-3.0 (Ubuntu)
Fix Released
High
Jeremy Bícha
Jammy
Fix Released
High
Jeremy Bícha

Bug Description

Impact
======
The cheese app is unusable with color bands showing in the main view.

This bug doesn't affect all webcams. It's unknown what percentage of webcams are affected.

Test Case
========
On a system that experiences this bug:
Install the update
Run the cheese app
Verify that the main view shows what your webcam can see normally.
Click the camera button in the bottom toolbar area.
Check if the photo looks normal. You can find it in ~/Pictures/Webcam

What Could Go Wrong
===================
Only 4 apps in Ubuntu use clutter-gst: empathy, cheese, lyricue, pinpoint

clutter-gst has been archived by GNOME. (It's recommended for apps to use GTK4 instead of GTK3 + Clutter). That means it's not possible for this patch to be accepted upstream. Instead, distros like Arch Linux are applying this patch.

This patch removes 2 renderers that don't work (RGBx and BGRx) but still keeps ones that do work: RGBA and BRGA.

Original Bug Report
===================
The cheese application produces a corrupted display under Ubuntu 22.04 with a Logitech C525 webcam. When started from the command line, cheese produces repeated warnings of the form...

(cheese:4175): cheese-WARNING **: 05:15:48.706: A lot of buffers are being dropped.: ../libs/gst/base/gstbasesink.c(3143): gst_base_sink_is_too_late (): /GstCameraBin:camerabin/GstViewfinderBin:vf-bin/ClutterGstVideoSink:cluttergstvideosink0:
There may be a timestamping problem, or this computer is too slow.

Adding /etc/modprobe.d/uvcvideo.conf

with 'options uvcvideo nodrop=1' doesn't solve the problem. This issue is not seen in either Ubuntu 21.10 or under Fedora-Workstation-Live-x86_64-36_Beta-1.4. The problem in Ubuntu 22.04 occurs under both Wayland and X11 displays with the Nvidia drivers.

ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: cheese 41.1-1build1
ProcVersionSignature: Ubuntu 5.15.0-25.25-generic 5.15.30
Uname: Linux 5.15.0-25-generic x86_64
NonfreeKernelModules: nvidia_modeset nvidia
ApportVersion: 2.20.11-0ubuntu80
Architecture: amd64
CasperMD5CheckResult: pass
CurrentDesktop: ubuntu:GNOME
Date: Tue Apr 5 05:15:35 2022
ExecutablePath: /usr/bin/cheese
InstallationDate: Installed on 2022-03-31 (4 days ago)
InstallationMedia: Ubuntu 22.04 LTS "Jammy Jellyfish" - Alpha amd64 (20220326)
MachineType: Gigabyte Technology Co., Ltd. X570 UD
ProcEnviron:
 SHELL=/bin/bash
 LANG=en_US.UTF-8
 TERM=xterm-256color
 XDG_RUNTIME_DIR=<set>
 PATH=(custom, no user)
RelatedPackageVersions:
 cheese 41.1-1build1
 cheese-common 41.1-1build1
SourcePackage: linux
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 01/18/2021
dmi.bios.release: 5.17
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: F32
dmi.board.asset.tag: Default string
dmi.board.name: X570 UD
dmi.board.vendor: Gigabyte Technology Co., Ltd.
dmi.board.version: x.x
dmi.chassis.type: 3
dmi.chassis.vendor: Default string
dmi.chassis.version: Default string
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvrF32:bd01/18/2021:br5.17:svnGigabyteTechnologyCo.,Ltd.:pnX570UD:pvrDefaultstring:rvnGigabyteTechnologyCo.,Ltd.:rnX570UD:rvrx.x:cvnDefaultstring:ct3:cvrDefaultstring:skuDefaultstring:
dmi.product.family: X570 MB
dmi.product.name: X570 UD
dmi.product.sku: Default string
dmi.product.version: Default string
dmi.sys.vendor: Gigabyte Technology Co., Ltd.
---
ProblemType: Bug
ApportVersion: 2.20.11-0ubuntu80
Architecture: amd64
CasperMD5CheckResult: pass
CurrentDesktop: ubuntu:GNOME
DistroRelease: Ubuntu 22.04
InstallationDate: Installed on 2022-03-31 (4 days ago)
InstallationMedia: Ubuntu 22.04 LTS "Jammy Jellyfish" - Alpha amd64 (20220326)
MachineType: Gigabyte Technology Co., Ltd. X570 UD
NonfreeKernelModules: nvidia_modeset nvidia
Package: cheese 41.1-1build1
PackageArchitecture: amd64
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 5.15.0-25.25-generic 5.15.30
RelatedPackageVersions:
 cheese 41.1-1build1
 cheese-common 41.1-1build1
Tags: wayland-session third-party-packages jammy gstreamer-error
Uname: Linux 5.15.0-25-generic x86_64
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm cdrom dip lpadmin lxd plugdev sambashare sudo
_MarkForUpload: True
dmi.bios.date: 01/18/2021
dmi.bios.release: 5.17
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: F32
dmi.board.asset.tag: Default string
dmi.board.name: X570 UD
dmi.board.vendor: Gigabyte Technology Co., Ltd.
dmi.board.version: x.x
dmi.chassis.type: 3
dmi.chassis.vendor: Default string
dmi.chassis.version: Default string
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvrF32:bd01/18/2021:br5.17:svnGigabyteTechnologyCo.,Ltd.:pnX570UD:pvrDefaultstring:rvnGigabyteTechnologyCo.,Ltd.:rnX570UD:rvrx.x:cvnDefaultstring:ct3:cvrDefaultstring:skuDefaultstring:
dmi.product.family: X570 MB
dmi.product.name: X570 UD
dmi.product.sku: Default string
dmi.product.version: Default string
dmi.sys.vendor: Gigabyte Technology Co., Ltd.

Revision history for this message
Jack Howarth (jwhowarth) wrote :
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote : Missing required logs.

This bug is missing log files that will aid in diagnosing the problem. While running an Ubuntu kernel (not a mainline or third-party kernel) please enter the following command in a terminal window:

apport-collect 1967843

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
Revision history for this message
lotuspsychje (lotuspsychje) wrote :

Thank you to report this bug and make Ubuntu better,

Could you please run: apport-collect 1967843 from you terminal again in order to drag relevant info about cheese into this bug?

Thank you!

Changed in linux (Ubuntu):
status: Incomplete → Invalid
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thank you for your bug report, do you have the same issue if you start

$ GST_V4L2_USE_LIBV4L2=1 gst-launch-1.0 v4l2src ! xvimagesink

?

Changed in cheese (Ubuntu):
importance: Undecided → Low
status: New → Incomplete
Revision history for this message
Jack Howarth (jwhowarth) wrote : CheeseDebug.txt.gz

apport information

tags: added: apport-collected
description: updated
Revision history for this message
Jack Howarth (jwhowarth) wrote : Dependencies.txt

apport information

Revision history for this message
Jack Howarth (jwhowarth) wrote : ProcCpuinfo.txt

apport information

Revision history for this message
Jack Howarth (jwhowarth) wrote : ProcCpuinfoMinimal.txt

apport information

Revision history for this message
Jack Howarth (jwhowarth) wrote : lspci.txt

apport information

Revision history for this message
Jack Howarth (jwhowarth) wrote : lsusb.txt

apport information

Revision history for this message
Jack Howarth (jwhowarth) wrote :

Unlike cheese, 'ST_V4L2_USE_LIBV4L2=1 gst-launch-1.0 v4l2src ! xvimagesink' displays the webcam image fine.

Revision history for this message
Jack Howarth (jwhowarth) wrote :

I also can confirm that the warnings...

(cheese:2554): cheese-WARNING **: 16:50:13.024: A lot of buffers are being dropped.: ../libs/gst/base/gstbasesink.c(3143): gst_base_sink_is_too_late (): /GstCameraBin:camerabin/GstViewfinderBin:vf-bin/ClutterGstVideoSink:cluttergstvideosink0:
There may be a timestamping problem, or this computer is too slow.

and associated rendering artifacts in the cheese display occur for both the nouveau and nvidia 510 drivers.

Revision history for this message
Jack Howarth (jwhowarth) wrote :
Revision history for this message
Matthew Ruffell (mruffell) wrote :

Hi Jack,

Thanks for reporting. I have a Logitech C270 camera, and I am also affected.

Attached is what I see, I get green and purple bars, and overall terrible performance.

I am on Jammy 5.15.0-25-generic, Wayland session, gnome 42, cheese 41.1-1build1.

I will start investigating.

Thanks,
Matthew

Revision history for this message
Matthew Ruffell (mruffell) wrote :

I downgraded cheese from 41.1-1build1 to 3.38.0-4 and it works fine again. Seems to be a cheese 41 problem.

GST_V4L2_USE_LIBV4L2=1 gst-launch-1.0 v4l2src ! xvimagesink

works fine, as well as using the webcam in Google Meet with Firefox.

no longer affects: linux (Ubuntu)
Changed in cheese (Ubuntu Jammy):
status: Incomplete → In Progress
assignee: nobody → Matthew Ruffell (mruffell)
Revision history for this message
Matthew Ruffell (mruffell) wrote :
Revision history for this message
Matthew Ruffell (mruffell) wrote :

I have determined the root cause via git bisecting the master branch.

The issue was introduced in:

commit 58de82b3d463b69f4c0bef75667e47020924e28b
Author: Jakub Adam <email address hidden>
Date: Tue Sep 3 13:00:30 2019 +0200
Subject: Support camera video formats with MJPEG output
Link: https://gitlab.gnome.org/GNOME/cheese/-/commit/58de82b3d463b69f4c0bef75667e47020924e28b

If I checkout current master branch and revert this commit, things work fine.

I will report the issue to upstream, and we can go from there.

Revision history for this message
Jack Howarth (jwhowarth) wrote :

It is very odd that Fedora 36 beta also uses a build of cheese 41.1 with minimal patching and the apparently the same optimizations yet it doesn't exhibit this artifact.

Revision history for this message
Jack Howarth (jwhowarth) wrote :

Matthew, do you see the same corruption if you boot the same machine with the Logitech C270 camera under a Fedora 36 Beta live image? It would be interesting to know if their Fedora cheese 41.1 package doesn't show the same artifact like it doesn't on my hardware.

Revision history for this message
Jack Howarth (jwhowarth) wrote :

I can confirm that rebuilding the current 41.1-1build1 cheese packaging with the offending commit reverted...

https://gitlab.gnome.org/GNOME/cheese/-/commit/58de82b3d463b69f4c0bef75667e47020924e28b.patch

...allows my Logitech C525 webcam to operate properly again.

Revision history for this message
Matthew Ruffell (mruffell) wrote :

Hi Jack,

I booted a Fedora 36 Beta live image like you suggested, and cheese works fine there on my machine.

Their cheese includes the above patch. I had a look around, it has a 5.17 kernel, and gstreamer 1.20.

Ubuntu has gstreamer 1.20.1, and when I booted my machine into a 5.17 kernel, I found that the issue still persists. So it doesn't appear to be a kernel issue.

Will have to try and keep narrowing it down.

Matthew

Revision history for this message
Doki (lkishalmi) wrote :

Just an additional info:
The issue also presents when Take a Picture is selected in Profile image change.

Using Cheese (with Logitech C270), selecting 640x480 resolution provides good picture.

Revision history for this message
Luís Louro (lapisdecor) wrote :

Also with Logitech C270. 640x480 provides good picture but you can't take a photo.

$ cheese

(cheese:19369): Gdk-WARNING **: 15:21:08.634: Native Windows taller than 65535 pixels are not supported
Unsupported modifier, resource creation failed.
XXX: resource creation failed
Unsupported modifier, resource creation failed.
XXX: resource creation failed
Unsupported modifier, resource creation failed.
XXX: resource creation failed
Unsupported modifier, resource creation failed.
XXX: resource creation failed

(cheese:19369): cheese-WARNING **: 15:21:40.621: Output state was not configured: ../gst-libs/gst/video/gstvideoencoder.c(2281): gst_video_encoder_can_push_unlocked (): /GstCameraBin:camerabin/GstEncodeBin:image-encodebin/GstJpegEnc:jpegenc0

Jeremy Bícha (jbicha)
Changed in cheese (Ubuntu Jammy):
status: In Progress → Triaged
assignee: Matthew Ruffell (mruffell) → nobody
Revision history for this message
Jan Steffens (heftig) wrote :
Revision history for this message
Matthew Ruffell (mruffell) wrote :

Jan also added a testcase to the upstream bug, that calls clutter-gst directly and does not require cheese:

$ gst-launch-1.0 videotestsrc ! jpegenc ! jpegdec ! clutterautovideosink

Attached is a picture running the testcase with clutter-gst-3.0 3.0.27-2build2, showing distorted picture.

Revision history for this message
Matthew Ruffell (mruffell) wrote :

I built the patch Jan provided into a test package, available in the below ppa:

https://launchpad.net/~mruffell/+archive/ubuntu/lp1967843-test

When I install it, the testcase is fixed, shown in the attachment, and cheese works as normal.

Jeremy, shall we submit the patch to Debian, and SRU to Ubuntu? It seems the upstream clutter-gst project is now archived and not accepting new patches.

Changed in clutter-gst-3.0 (Ubuntu):
importance: Undecided → High
Changed in clutter-gst-3.0 (Ubuntu Jammy):
importance: Undecided → High
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in clutter-gst-3.0 (Ubuntu Jammy):
status: New → Confirmed
Changed in clutter-gst-3.0 (Ubuntu):
status: New → Confirmed
Revision history for this message
Holbok István (holbi88) wrote :

My Ubuntu 22.04 also affected. After upgrading from 21.10 the Cheese shows blank screen.
Running from terminal this is the message:
$ cheese

(cheese:88137): cheese-WARNING **: 20:11:16.797: Internal data stream error.: ../libs/gst/base/gstbasesrc.c(3127): gst_base_src_loop (): /GstCameraBin:camerabin/GstWrapperCameraBinSrc:camera_source/GstBin:bin18/GstPipeWireSrc:pipewiresrc1:
streaming stopped, reason not-negotiated (-4)

And also affected the latest Zoom client.

Revision history for this message
Peter (beny51) wrote :

I'm on Ubuntu 22.04:
Linux 5.15.0-27-generic #28-Ubuntu SMP
Same problems with chees as reported above:
(cheese:5095): cheese-WARNING **: 19:48:12.491: A lot of buffers are being dropped.: ../libs/gst/base/gstbasesink.c(3143): gst_base_sink_is_too_late (): /GstCameraBin:camerabin/GstViewfinderBin:vf-bin/ClutterGstVideoSink:cluttergstvideosink0:
There may be a timestamping problem, or this computer is too slow.

GST_V4L2_USE_LIBV4L2=1 gst-launch-1.0 v4l2src ! xvimagesink
Works fine! Same for skype and google meeting.

A patch in the official repo would be very much appreciated.

Jeremy Bícha (jbicha)
no longer affects: cheese (Ubuntu Jammy)
Changed in clutter-gst-3.0 (Ubuntu):
status: Confirmed → Fix Committed
Changed in clutter-gst-3.0 (Ubuntu Jammy):
status: Confirmed → In Progress
Jeremy Bícha (jbicha)
description: updated
Jeremy Bícha (jbicha)
Changed in oem-priority:
importance: Undecided → Critical
status: New → Confirmed
tags: added: oem-priority
Jeremy Bícha (jbicha)
description: updated
Changed in cheese (Ubuntu):
status: Triaged → Invalid
Changed in clutter-gst-3.0 (Ubuntu):
assignee: nobody → Jeremy Bicha (jbicha)
Jeremy Bícha (jbicha)
Changed in clutter-gst-3.0 (Ubuntu Jammy):
assignee: nobody → Jeremy Bicha (jbicha)
Revision history for this message
Timo Aaltonen (tjaalton) wrote : Please test proposed package

Hello Jack, or anyone else affected,

Accepted clutter-gst-3.0 into jammy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/clutter-gst-3.0/3.0.27-2ubuntu1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-jammy to verification-done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-jammy. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in clutter-gst-3.0 (Ubuntu Jammy):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-jammy
Revision history for this message
Florent Toniello (ftoniello) wrote :

Hi all, the new package did solve the bug for me — Cheese display now correct, captured pictures & videos also OK.

Package: libclutter-gst-3.0-0
Version: 3.0.27-2ubuntu1
Status: install ok installed

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package clutter-gst-3.0 - 3.0.27-3

---------------
clutter-gst-3.0 (3.0.27-3) unstable; urgency=medium

  * Add patch from Arch Linux to fix corrupted display with Cheese
    (LP: #1967843)

 -- Jeremy Bicha <email address hidden> Thu, 12 May 2022 16:30:52 -0400

Changed in clutter-gst-3.0 (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Diego Viola (diego-viola-deactivatedaccount) wrote :

Same problem here with a Logitech C505 on Ubuntu 22.04.

Revision history for this message
Matthew Ruffell (mruffell) wrote :

Performing verification for Jammy.

Starting with the broken 3.0.27-2build2 in -release, running

gst-launch-1.0 videotestsrc ! jpegenc ! jpegdec ! clutterautovideosink

shows a grey picture with vertical bars. Opening cheese, we see the same vertical bars, poor video performance and purple lines.

I enabled -proposed and installed 3.0.27-2ubuntu1, and re-ran

gst-launch-1.0 videotestsrc ! jpegenc ! jpegdec ! clutterautovideosink

and had cheese running. Performance was great, nice and smooth, and picture is correct.

Tested with my Logitech C720 webcam, and attached is a screenshot of everything running with 3.0.27-2ubuntu1 from -proposed.

Happy to mark as verified for Jammy.

tags: added: verification-done-jammy
removed: verification-needed verification-needed-jammy
Revision history for this message
Stephan Oehlert (soehlert) wrote :

I can confirm that the update fixes the issue for me.
In particular, Zoom works again now.

Changed in cheese:
status: Unknown → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package clutter-gst-3.0 - 3.0.27-2ubuntu1

---------------
clutter-gst-3.0 (3.0.27-2ubuntu1) jammy; urgency=medium

  * Add patch from Arch Linux to fix corrupted display with Cheese
    (LP: #1967843)

 -- Jeremy Bicha <email address hidden> Thu, 12 May 2022 16:48:21 -0400

Changed in clutter-gst-3.0 (Ubuntu Jammy):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for clutter-gst-3.0 has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
jeremyszu (os369510) wrote :

I can confirmed the original issue gone after installing the version from comment#37

Changed in oem-priority:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.