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 700959 - Camera device is not being released
Camera device is not being released
Status: RESOLVED FIXED
Product: gnome-contacts
Classification: Core
Component: general
3.8.x
Other Linux
: Normal normal
: ---
Assigned To: GNOME Contacts maintainer(s)
GNOME Contacts maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2013-05-24 13:14 UTC by Chris Cummins
Modified: 2013-05-27 15:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Screenshot showing the blank webcam preview after reproducing the problem (112.17 KB, image/png)
2013-05-24 13:14 UTC, Chris Cummins
  Details
Dispose of cheese widget on avatar dialog destroy (1.11 KB, patch)
2013-05-24 13:22 UTC, Chris Cummins
committed Details | Review

Description Chris Cummins 2013-05-24 13:14:19 UTC
Created attachment 245240 [details]
Screenshot showing the blank webcam preview after reproducing the problem

The avatar 'Take Picture with Camera' functionality only works the first time. To reproduce:

1) Open Contacts.
2) Select a contact -> edit.
3) Click on the avatar.
4) Select camera icon on avatar dialog.
5) Close avatar dialog and repeat from step 3.
6) Observe that the camera preview is now a white screen (see attached screenshot).

It looks like the avatar dialog does not properly free the camera device when closed. After performing these steps, the camera device is still in use:

$ gst-launch v4l2src ! xvimagesink
Setting pipeline to PAUSED ...
ERROR: Pipeline doesn't want to pause.
WARNING: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Video input device did not accept new frame rate setting.
Additional debug info:
v4l2src_calls.c(262): gst_v4l2src_set_capture (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
system error: Device or resource busy
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Could not get buffers from device '/dev/video0'.
Additional debug info:
gstv4l2bufferpool.c(407): gst_v4l2_buffer_pool_new (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
error requesting 2 buffers: Device or resource busy
Setting pipeline to NULL ...
Freeing pipeline ...

Closing and reopening the Contacts application cures the problem.
Comment 1 Chris Cummins 2013-05-24 13:22:10 UTC
Created attachment 245241 [details] [review]
Dispose of cheese widget on avatar dialog destroy

This workaround fixes the problem, by ensuring that the cheese widget used in the avatar dialog is destroyed when the dialog is closed.