After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 523475 - After recording video the webcam is no longer displaying a preview.
After recording video the webcam is no longer displaying a preview.
Status: RESOLVED FIXED
Product: cheese
Classification: Applications
Component: general
git master
Other Linux
: High blocker
: ---
Assigned To: Cheese Maintainer(s)
Cheese Maintainer(s)
: 523133 524811 539435 539498 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-03-19 21:59 UTC by Román Huerta
Modified: 2008-07-05 14:35 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
t a a bt (17.85 KB, text/plain)
2008-04-23 16:10 UTC, Matthias Clasen
Details

Description Román Huerta 2008-03-19 21:59:54 UTC
+++ This bug was initially created as a clone of Bug #523133 +++

Please describe the problem:
After recording a video the preview is not reconnected to the webcam.
Requires a restart of cheese to make it connect again.

Product:

Ubuntu Hardy 8.04

Steps to reproduce:
1. Record video.
2. Stop recording.



Actual results:
Cheese becomes unable to take photos or record videos.

Expected results:
Video preview is enabled after recording and cheese is able to take photos and record videos.

Does this happen every time?
Yes

Other information:
Please consider fixing it so that pressing "Video" also switches the pipeline into video stream mode (lower resolution, faster fps).
I don't know if it is possible to add an inactive file sink to the video pipeline and just activating it when the record button is pressed. Or a fake sink and the switching it to a file sink when recording.
Comment 1 daniel g. siegel 2008-03-20 21:38:21 UTC
*** Bug 523133 has been marked as a duplicate of this bug. ***
Comment 2 Dave Nguyen 2008-03-30 06:09:47 UTC
I'm also having this problem, as well as another video problems. When I open Cheese (version 2.22.1 on Arch Linux), it won't load the videos:


[bladesonfire@alai ~]$ cheese

** (cheese:16136): WARNING **: could not load /home/bladesonfire/.gnome2/cheese/media/0003.ogg (video/x-theora+ogg)


The same message appears when creating a video.
Comment 3 daniel g. siegel 2008-04-02 03:04:03 UTC
*** Bug 524811 has been marked as a duplicate of this bug. ***
Comment 4 daniel g. siegel 2008-04-19 15:54:02 UTC
ok,

cheese-webcam.c:948
===================
void
cheese_webcam_stop_video_recording (CheeseWebcam *webcam)
{
  CheeseWebcamPrivate* priv = CHEESE_WEBCAM_GET_PRIVATE (webcam);

  /* Send EOS message down the pipeline by stopping video and audio source*/
  gst_element_set_state (priv->video_source, GST_STATE_NULL);
  gst_element_set_locked_state (priv->video_source, TRUE);
  gst_element_set_state (priv->audio_source, GST_STATE_NULL);
  gst_element_set_locked_state (priv->audio_source, TRUE);
}

fails because priv->video_source and priv->audio_source is NULL. you can get that result by either adding and if(priv->video_source == NULL) ... or with gdb.

those two variables are already NULL in

cheese-webcam.c:219
===================
static void
cheese_webcam_bus_message_cb (GstBus *bus, GstMessage *message, CheeseWebcam *webcam)
{
  CheeseWebcamPrivate* priv = CHEESE_WEBCAM_GET_PRIVATE (webcam);

  if (GST_MESSAGE_TYPE(message) == GST_MESSAGE_EOS)
  {
    g_signal_emit (webcam, webcam_signals [VIDEO_SAVED], 0);

    gst_element_set_locked_state (priv->video_source, FALSE);
    gst_element_set_locked_state (priv->audio_source, FALSE);
    cheese_webcam_change_sink (webcam, priv->video_display_bin,
                               priv->photo_save_bin, priv->video_save_bin);
    priv->is_recording = FALSE;
  }
}  
Comment 5 daniel g. siegel 2008-04-19 16:05:02 UTC
i tried to investigate every priv->video_source available:
------------------------
cheese-webcam.c:632
  priv->video_source = gst_bin_get_by_name (GST_BIN (priv->webcam_source_bin), "video_source");

in static gboolean cheese_webcam_create_webcam_source_bin (CheeseWebcam *webcam);

here priv->video_source gets created. it is NOT NULL.
------------------------
next step is
cheese-webcam.c:228
  gst_element_set_locked_state (priv->video_source, FALSE);

in static void cheese_webcam_bus_message_cb (GstBus *bus, GstMessage *message, CheeseWebcam *webcam);

priv->video_source is NULL, from the first callback to the last.
------------------------
next step is
cheese-webcam.c:954
  gst_element_set_state (priv->video_source, GST_STATE_NULL);
  gst_element_set_locked_state (priv->video_source, TRUE);

in void cheese_webcam_stop_video_recording (CheeseWebcam *webcam);

priv->video_source is NULL when the video recording gets stopped (does not get called before)


i suppose priv->audio_source behaves similar to video_source
Comment 6 Matthias Clasen 2008-04-22 04:25:48 UTC
While looking into the similar 
https://bugzilla.redhat.com/show_bug.cgi?id=443499
I was playing with this without a webcam plugged in and noticed that
in this case, priv->video_source is never set, since we are hitting
the fallback code in cheese_webcam_create_webcam_source_bin.
Comment 7 daniel g. siegel 2008-04-22 07:39:35 UTC
matthias, i hope i fixed that with revision 664
( http://svn.gnome.org/viewvc/cheese?view=revision&revision=664 )
Comment 8 Matthias Clasen 2008-04-22 13:41:19 UTC
Yes, that looks like the right fix - of course, it doesn't help for video recording running into a deadlock inside gstreamer...
Comment 9 daniel g. siegel 2008-04-22 13:46:40 UTC
somehow this happens just on certain computers with cheese installed.
Comment 10 Tim-Philipp Müller 2008-04-22 14:12:13 UTC
> Yes, that looks like the right fix - of course, it doesn't help for video
> recording running into a deadlock inside gstreamer...

What/where is the deadlock? Do you have a stack trace?


FWIW, it would probably better to bump the GStreamer requirements to 0.10.16 and use the gst_element_send_event() method described in

http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer-libs/html/GstBaseSrc.html

in the 'Controlled shutdown of live sources in applications' section.

(Make sure you haven't got any pads blocked when you do that though, but that applies to the old method as well.).
Comment 11 Matthias Clasen 2008-04-23 01:45:16 UTC
Here is what I am seeing when I press the "Stop recording" button:

(gdb) bt
  • #0 __kernel_vsyscall
  • #1 __lll_lock_wait
    from /lib/libpthread.so.0
  • #2 _L_lock_87
    from /lib/libpthread.so.0
  • #3 __pthread_mutex_lock
    at pthread_mutex_lock.c line 86
  • #4 IA__g_static_rec_mutex_lock
    at gthread.c line 313
  • #5 gst_pad_stop_task
    at gstpad.c line 4471
  • #6 gst_base_src_activate_push
    at gstbasesrc.c line 2531
  • #7 gst_pad_activate_push
    at gstpad.c line 896
  • #8 gst_pad_set_active
    at gstpad.c line 665
  • #9 activate_pads
    at gstelement.c line 2509
  • #10 gst_iterator_fold
    at gstiterator.c line 503
  • #11 iterator_activate_fold_with_resync
    at gstelement.c line 2541
  • #12 gst_element_pads_activate
    at gstelement.c line 2577
  • #13 gst_element_change_state_func
    at gstelement.c line 2663


And it is stuck there
Comment 12 Tim-Philipp Müller 2008-04-23 15:33:14 UTC
> Here is what I am seeing when I press the "Stop recording" button:

Any chance you could you do one with 'thread apply all bt'?
Comment 13 Matthias Clasen 2008-04-23 16:10:27 UTC
Created attachment 109778 [details]
t a a bt
Comment 14 Matthias Clasen 2008-05-05 04:40:05 UTC
Tim, any further info I can provide ?
Comment 15 daniel g. siegel 2008-06-07 11:04:00 UTC
*** Bug 534616 has been marked as a duplicate of this bug. ***
Comment 16 daniel g. siegel 2008-06-21 11:18:48 UTC
*** Bug 539435 has been marked as a duplicate of this bug. ***
Comment 17 daniel g. siegel 2008-06-21 18:28:35 UTC
*** Bug 539498 has been marked as a duplicate of this bug. ***
Comment 18 Maxim Levitsky 2008-06-29 14:34:19 UTC
I still see this bug in svn.

Is there any progress on that?
Comment 19 daniel g. siegel 2008-06-29 15:17:11 UTC
we werent able to find it yet. it also seems to happen just on some gstreamer installations and on some cameras
Comment 20 Maxim Levitsky 2008-06-29 15:45:48 UTC
Details about my system:

Ubuntu hardy.
gstreamer0.10- 0.10.18-3
Acer crystal eye (uvcvideo latest svn)

camera used to hang just after few minutes with ubuntu drivers
I installed svn and this bug dissapered.

Also running latest -git of kernel.

This bug (no video restart) happens regardless of uvcvideo version

I am going to update to ubuntu 8.10 (want to have latest packages, and in my opinion alphas/betas/releases are all the same, all have bugs :-) )
Comment 21 jpangamarca 2008-06-30 20:49:04 UTC
Same happening here. Taking a picture works well, but Cheese hangs after capturing video, seemingly the camera turns off or disconnect from Cheese (the camera has a little blue light that indicates activity, it turns off), its necessary to close and open again.

System Info:

- Cheese 2.22.3 (latest stable, June 29th 2008)
- My camera is a HP Webcam (lsusb says it's a Chicony Electronics Co., Ltd camera).
- All GStreamer tools are 0.10.*
- Ubuntu Hardy Heron (8.04) up to date.
- gstreamer-properties says:

Sound:

Default output
Complement: Automatically detect
Device: Not supported
Pipeline autoaudiosinkd

Default input
Complement: ALSA
Device: Default
Pipeline: alsasrc

Video:

Default output
Complement: X Window System(X11/XShm/Xv)
Device: NV17 Video Texture
Pipeline xvimagesink device="0"

Default input
Complement: Video for Linux 2 (v4l2)
Device: HP Webcam
Pipeline: v4l2src device="/dev/video0"

- Video card: NVIDIA GeForce 8400M GS, driver 169.12., XServer version 1.4.0.90 (10400090) by X.Org Foundation; NV Version 1.14.

Any other info that I should post here?
Comment 22 jpangamarca 2008-06-30 20:52:36 UTC
I forgot, uname says: "Linux fmg-m003 2.6.24-19-rt #1 SMP PREEMPT RT Wed Jun 18 16:35:41 UTC 2008 i686 GNU/Linux" for my computer, it's a HP Pavilion dv6871us.
Comment 23 Filippo Argiolas 2008-07-05 14:35:23 UTC
Closing, fixed in trunk.
I've bumped gstreamer requirements to 0.10.16 and used gst_element_send_event to make the video recording shut down properly, as suggested in GstBaseSrc docs and pointed out by Tim.
With the previous (deprecated) method no EOS message was being generated so the pipeline did not restarted.
Now the pipeline doesn't freeze anymore but registered video and audio are still sluggish and with poor quality. Opening another bug for this and for the video file loading problem (comment #2).