Any application which uses v4l2src element can be froze when recording video (e.x. cheese)

Bug #1041432 reported by Christopher
34
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Cheese
Unknown
Unknown
OEM Priority Project
Fix Released
High
James M. Leddy
Precise
Fix Released
High
Unassigned
Quantal
Fix Released
High
James M. Leddy
gst-plugins-good
Unknown
Unknown
cheese (Ubuntu)
Invalid
Undecided
Unassigned
Precise
Invalid
Undecided
Unassigned
Quantal
Invalid
Undecided
Unassigned
Raring
Invalid
Undecided
Unassigned
gst-plugins-good0.10 (Ubuntu)
Fix Released
High
Iain Lane
Precise
Fix Released
High
Unassigned
Quantal
Fix Released
High
Unassigned
Raring
Fix Released
High
Iain Lane

Bug Description

[Impact]

Pretty much no one can use their webcam to take one off pitctures or video, since everyone uses cheese to do this and cheese depends on gstreamer working.

[Test Case]

1. Start Cheese
2. Observe if mouse and keyboard are frozen

[Regression Potential]

Small, all this change does is ensure that the proper value for the size of the mmaped buffer is calculated.

[Original Report]

This is a bug in gstreamer-plugins-good.

------------------------------------------------------------------------------------------
Quantal 3.5.0-11 becomes totally unresponsive when starting a video from the built in webcam. Both mouse and keyboard are frozen.

I tried both 32 and 64 bit versions of both cheese and camorama and the result was the same. This was not an issue with Precise.

ProblemType: Bug
DistroRelease: Ubuntu 12.10
Package: cheese 3.5.5-0ubuntu1
ProcVersionSignature: Ubuntu 3.5.0-11.11-generic 3.5.2
Uname: Linux 3.5.0-11-generic i686
NonfreeKernelModules: wl
ApportVersion: 2.5.1-0ubuntu2
Architecture: i386
Date: Fri Aug 24 21:57:00 2012
InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Release i386 (20101007)
SourcePackage: cheese
UpgradeStatus: Upgraded to quantal on 2012-08-17 (8 days ago)

Revision history for this message
Christopher (soft-kristal) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in cheese (Ubuntu):
status: New → Confirmed
Revision history for this message
Hsin-Yi, Chen (hychen) (ossug-hychen) wrote :

Redhat has a similar bug that video device is busy when doing video recording.

- https://bugzilla.gnome.org/show_bug.cgi?id=670257

Gstreamer bugs:
- https://bugzilla.gnome.org/show_bug.cgi?id=670257

Explain for the patch:

When recording video, Cheese uses gsteamer to set caps, meanwhile cmaera device re-init while caps settings.
because the buffer is not freed and kernel complain that camera device is busy, so cheese hangs.

Revision history for this message
Hsin-Yi, Chen (hychen) (ossug-hychen) wrote :

@Christopher

I have some questions for you , pleas help , thanks.
And also please provide logs for each question ( the instructions are inline)

Q1. Does cheese video recording works if you use 3.2 kernel ?

1. Install 3.2 kernel
2. Boot with 3.2 kernel
3. Launch Cheese with the following command "cheese --gst-debug=5 --gst-debug-no-color 2> 3.2cheese_debug.log"
4. Start to Recording

Please help to attache 3.2cheese_debug.log. I found some machines's cheese video recording works with 3.2 kernel and 3.5 kernel, but others does not work with 3.5 kernel , but works with 3.2 kernel.

Q2: What are video resolution Cheese shows in preference ? Which is default.

Q3: Does guvcview works well even you uses 3.5 kernel?

Q4: What is your webcam?

please attache the output of " lsusb -v "

Revision history for this message
Christopher (soft-kristal) wrote : Re: [Bug 1041432] Re: cheese and camorama freeze system when recording video

gucview suits my hardware better than cheese. If I have time, I'll get
to the cheese issue. I always have the latest kernel and proposed updates.

On 13-01-25 06:43 AM, Hsin-Yi, Chen (hychen) wrote:
> @Christopher
>
> I have some questions for you , pleas help , thanks.
> And also please provide logs for each question ( the instructions are inline)
>
> Q1. Does cheese video recording works if you use 3.2 kernel ?
>
> 1. Install 3.2 kernel
> 2. Boot with 3.2 kernel
> 3. Launch Cheese with the following command "cheese --gst-debug=5 --gst-debug-no-color 2> 3.2cheese_debug.log"
> 4. Start to Recording
>
> Please help to attache 3.2cheese_debug.log. I found some machines's
> cheese video recording works with 3.2 kernel and 3.5 kernel, but others
> does not work with 3.5 kernel , but works with 3.2 kernel.
>
> Q2: What are video resolution Cheese shows in preference ? Which is
> default.
>
> Q3: Does guvcview works well even you uses 3.5 kernel?
>
> Q4: What is your webcam?
>
> please attache the output of " lsusb -v "
>

Revision history for this message
Steve Magoun (smagoun) wrote : Re: cheese and camorama freeze system when recording video

Added precise task because this may affect the lts backport stack on precise

Revision history for this message
Hsin-Yi, Chen (hychen) (ossug-hychen) wrote :

this bug can be fixed by this patch

From 4cd9255f0a8a9e15d81561f00f02d275b5095f70 Mon Sep 17 00:00:00 2001
From: Oleksij Rempel (Alexey Fisher) <email address hidden>
Date: Thu, 01 Mar 2012 13:15:29 +0000
Subject: v4l2src: fix v4l2_munmap() for compressed formats

Make sure we always call munmap() with the same size we called mmap()
with before.

Current v4l2src uses the same structure for VIDIOC_QUERYBUF, VIDIOC_QBUF
and v4l2_munmap calls. The problem is that the video buffer size (length)
may vary for compressed or emulated bufs. VIDIOC_QBUF will change it if
we pass the pointer of a v4l2_buffer. This is why we should avoid using
same variable for mmap and video buffers.

https://bugzilla.gnome.org/show_bug.cgi?id=671126

description: updated
Changed in cheese (Ubuntu):
status: Confirmed → Invalid
summary: - cheese and camorama freeze system when recording video
+ Any application which uses v4l2src element can be froze when recording
+ video (e.x. cheese)
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "0001-fix-v4l2_munmap.patch" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-reviewers team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
Revision history for this message
Sebastien Bacher (seb128) wrote :

@hychen: thanks for the work there. Is that patch required in raring or is the issue fixed with gstreamer 1.0?

Steve: The comments suggest the issue doesn't happen in precise ... what do you mean by "backport stack on precise"? Do you guys need the fix in quantal, or are you just concerned that the bug might hit precise through an update at some point?

Changed in gst-plugins-good0.10 (Ubuntu):
status: New → Triaged
importance: Undecided → High
Revision history for this message
Hsin-Yi, Chen (hychen) (ossug-hychen) wrote :

1. This bug can reproduced on precise.
2. the patch is for gstreamer-0.10 branch , not 1.0 branch.

Revision history for this message
Steve Magoun (smagoun) wrote :

@Seb: The 'LTS backport stack' is the quantal kernel + xorg that was backported to precise for hardware enablement. The packages in the lts backport stack include linux-lts-quantal and xserver-org-lts-quantal. The bug can occur when that backport stack is used with a precise userspace.

Revision history for this message
Sebastien Bacher (seb128) wrote :

@Steve: thanks for the explanation, does that mean it's happening with 12.04.2 new installs or is the hadware enablement stack an opt-in still (I think upgrades don't get the new stack but new install will get it but I'm not sure)? In any case it's on my todolist and I will get it upload in the next days

Revision history for this message
Iain Lane (laney) wrote :

Hey,

I'm uploading to raring now. Thanks!

Can someone (~hychen?) rewrite the description here to be SRU compliant? Description, test case, regression potential.

Then I or Seb or someone can upload.

  https://wiki.ubuntu.com/StableReleaseUpdates#Procedure

Cheers.

Changed in cheese (Ubuntu Quantal):
status: New → Invalid
Iain Lane (laney)
Changed in cheese (Ubuntu Precise):
status: New → Invalid
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gst-plugins-good0.10 - 0.10.31-3+nmu1ubuntu2

---------------
gst-plugins-good0.10 (0.10.31-3+nmu1ubuntu2) raring; urgency=low

  * debian/patches/0001-fix-v4l2_munmap.patch: Cherry-pick a commit from
    upstream to resolve an issue where applications freeze when using v4l2src.
    (LP: #1041432)
 -- Iain Lane <email address hidden> Mon, 11 Feb 2013 11:18:03 +0000

Changed in gst-plugins-good0.10 (Ubuntu Raring):
status: Triaged → Fix Released
Revision history for this message
James M. Leddy (jm-leddy) wrote :

Hi Iain,

I've uploaded the SRU report, let me know if there's anything else you would like.

description: updated
Revision history for this message
Iain Lane (laney) wrote :

There's an outstanding SRU for this package—bug #1068155—which it would be preferable to clear out before uploading another one. I don't suppose you'll be able to help verifying it due to the nature of the bug. I'll give the reporter a few days to reply before taking any further action.

Revision history for this message
Iain Lane (laney) wrote :

Oho, the submitter there responded faster than I expected. Uploaded to quantal and precise -proposed

Revision history for this message
James M. Leddy (jm-leddy) wrote :

That's good, thanks for the update Iain

Changed in gst-plugins-good0.10 (Ubuntu Raring):
assignee: nobody → Iain Lane (laney)
Changed in gst-plugins-good0.10 (Ubuntu Precise):
importance: Undecided → High
status: New → Fix Committed
Changed in gst-plugins-good0.10 (Ubuntu Quantal):
importance: Undecided → High
status: New → Fix Committed
tags: added: rls-r-incoming
Revision history for this message
Colin Watson (cjwatson) wrote : Please test proposed package

Hello Christopher, or anyone else affected,

Accepted gst-plugins-good0.10 into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/gst-plugins-good0.10/0.10.31-1ubuntu1.2 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 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, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

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

tags: added: verification-needed
Revision history for this message
Colin Watson (cjwatson) wrote :

Hello Christopher, or anyone else affected,

Accepted gst-plugins-good0.10 into quantal-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/gst-plugins-good0.10/0.10.31-3ubuntu1.2 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 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, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

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

Revision history for this message
Shawn Wang (shawn111) wrote :

That's good on precise, thanks

Iain Lane (laney)
tags: added: verification-done
removed: verification-needed
Colin Watson (cjwatson)
tags: added: verification-done-precise verification-needed
removed: verification-done
Revision history for this message
Hsin-Yi, Chen (hychen) (ossug-hychen) wrote :

cheese in quantal depends on libgstreamer1.0 and I can not reproduce this bug on quantal.

To verify this bug, I found another bug block me, which was already reported on bug: 1132316. it said taht gstreamer1.0-pulseaudio is missing and make cheese froze when ruser try to record video.

Revision history for this message
James M. Leddy (jm-leddy) wrote :

Marking verification-done-quantal based on comment 22

tags: added: verification-done-quantal
tags: removed: verification-needed
Revision history for this message
Colin Watson (cjwatson) wrote : Update Released

The verification of this Stable Release Update has completed successfully and the package has now been 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 regresssions.

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

This bug was fixed in the package gst-plugins-good0.10 - 0.10.31-1ubuntu1.2

---------------
gst-plugins-good0.10 (0.10.31-1ubuntu1.2) precise; urgency=low

  * debian/patches/0001-fix-v4l2_munmap.patch: Cherry-pick a commit from
    upstream to resolve an issue where applications freeze when using v4l2src.
    (LP: #1041432)
 -- Iain Lane <email address hidden> Wed, 13 Feb 2013 12:52:25 +0000

Changed in gst-plugins-good0.10 (Ubuntu Precise):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gst-plugins-good0.10 - 0.10.31-3ubuntu1.2

---------------
gst-plugins-good0.10 (0.10.31-3ubuntu1.2) quantal; urgency=low

  * debian/patches/0001-fix-v4l2_munmap.patch: Cherry-pick a commit from
    upstream to resolve an issue where applications freeze when using v4l2src.
    (LP: #1041432)
 -- Iain Lane <email address hidden> Wed, 13 Feb 2013 12:54:56 +0000

Changed in gst-plugins-good0.10 (Ubuntu Quantal):
status: Fix Committed → Fix Released
no longer affects: oem-priority/raring
Changed in oem-priority:
status: Fix Committed → 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.