GNOME Bugzilla – Bug 700959
Camera device is not being released
Last modified: 2013-05-27 15:20:09 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.
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.
Fixed. Pushed here: https://git.gnome.org/browse/gnome-contacts/commit/?h=gnome-3-8&id=e841d8a70609c3a8181cbb9cc264ddd82996f47e and here: https://git.gnome.org/browse/gnome-contacts/commit/?id=e558b874015220f9fa047958c0b2fb7ad2d960ce