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

Bug #1041432 reported by Christopher on 2012-08-25
34
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Cheese
Unknown
Unknown
OEM Priority Project
High
James M. Leddy
Precise
High
Unassigned
Quantal
High
James M. Leddy
gst-plugins-good
Unknown
Unknown
cheese (Ubuntu)
Undecided
Unassigned
Precise
Undecided
Unassigned
Quantal
Undecided
Unassigned
Raring
Undecided
Unassigned
gst-plugins-good0.10 (Ubuntu)
High
Iain Lane
Precise
High
Unassigned
Quantal
High
Unassigned
Raring
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)

Christopher (soft-kristal) wrote :
Launchpad Janitor (janitor) wrote :

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

Changed in cheese (Ubuntu):
status: New → Confirmed

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.

@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 "

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 "
>

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

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)

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
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

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

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.

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

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) on 2013-02-11
Changed in cheese (Ubuntu Precise):
status: New → Invalid
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
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
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.

Iain Lane (laney) wrote :

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

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

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
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!

Shawn Wang (shawn111) wrote :

That's good on precise, thanks

Iain Lane (laney) on 2013-03-13
tags: added: verification-done
removed: verification-needed
Colin Watson (cjwatson) on 2013-03-13
tags: added: verification-done-precise verification-needed
removed: verification-done

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.

James M. Leddy (jm-leddy) wrote :

Marking verification-done-quantal based on comment 22

tags: added: verification-done-quantal
tags: removed: verification-needed

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.

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
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  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

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