Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Profile error after too many short consecutives recordings #298

Open
silviabf opened this issue Jun 14, 2016 · 10 comments
Open

Profile error after too many short consecutives recordings #298

silviabf opened this issue Jun 14, 2016 · 10 comments

Comments

@silviabf
Copy link

Steps:

  • With the attached profile selected, go to Recorder
    webcam.ini.txt
  • Do consecutive recordings with duration of one or two seconds and only one second between them (record, stop, record, stop,...)

Problem: After 5 or 6 recordings there is a profile error when you stop the recording. In the log you can see the next info:

galicaster  2016-06-14 11:31:43,963 DEBUG   recorder    recorder preview
galicaster  2016-06-14 11:31:44,032 ERROR   recorder    gst-resource-error-quark: Device '/dev/webcam' is busy (4) (gstv4l2object.c(3450): gst_v4l2_object_set_format_full (): /GstPipeline:galicaster_recorder/galicaster+recorder+bins+v4l2+GCv4l2:galicaster+recorder+bins+v4l2+gcv4l2-12/GstBin:bin18/GstV4l2Src:gc-v4l2-src:
Call to S_FMT failed for YV12 @ 1280x720: Device or resource busy)
galicaster  2016-06-14 11:31:44,069 ERROR   service Handle error (gst-resource-error-quark: Device '/dev/webcam' is busy (4) (gstv4l2object.c(3450): gst_v4l2_object_set_format_full (): /GstPipeline:galicaster_recorder/galicaster+recorder+bins+v4l2+GCv4l2:galicaster+recorder+bins+v4l2+gcv4l2-12/GstBin:bin18/GstV4l2Src:gc-v4l2-src:
Call to S_FMT failed for YV12 @ 1280x720: Device or resource busy))
galicaster  2016-06-14 11:31:53,339 INFO    scheduler   Set status unknown to server

And in the console:

** (run_galicaster.py:28834): CRITICAL **: gst_v4l2_buffer_pool_process: assertion 'gst_buffer_pool_is_active (bpool)' failed
libv4l2: error setting pixformat: Device or resource busy

@smarquard, you reported this message in issue #227. Is this message shown in a similar situation (very close recordings or too many consecutive recordings)?. Thank you in advance.

@hcaloto
Copy link
Contributor

hcaloto commented Jul 1, 2016

Let's check if this error persists after these changes: 089a3a4 and 85db813

@hcaloto hcaloto assigned silviabf and unassigned hcaloto Jul 11, 2016
@silviabf silviabf assigned hcaloto and unassigned silviabf Jul 11, 2016
@silviabf
Copy link
Author

silviabf commented Jul 11, 2016

This bug continues happening.

@silviabf
Copy link
Author

This bug happens more frecuently if you use io-mode parameter in the profile.

@rubenrua
Copy link
Contributor

To test execute the next snippet test.py:

import time
from galicaster.core import context
r = context.get_recorder()
r.preview()
time.sleep(1)
while True:
    r.record()
    time.sleep(1)
    r.stop()
    time.sleep(1)

with:

GST_DEBUG=*v4l2*:6  strace -o /tmp/strace.log -P /dev/video0 python test.py 2> /tmp/gst.log

Getting the error: libv4l2: error setting pixformat: Device or resource busy

@rubenrua
Copy link
Contributor

We need to test it with GStramer 1.8.2 (ubuntu xenial-updates), you can check changes in https://github.com/GStreamer/gst-plugins-good/commits/master/sys/v4l2/gstv4l2src.c

@dpeite
Copy link
Contributor

dpeite commented Aug 24, 2016

With the next script there is no error:

import gi
gi.require_version('Gst','1.0')
from gi.repository import Gst
Gst.init(None)
print Gst.version()

while True:
        # Build the pipeline                                                                                                                                                                                 
        pipeline = Gst.parse_launch(
                "v4l2src device=/dev/video0 num-buffers=100 ! video/x-raw,framerate=24/1,width=1280,height=720 ! xvimagesink")
        # Start playing                                                                                                                                                                                      
        pipeline.set_state(Gst.State.PLAYING)

        # Wait until error or EOS                                                                                                                                                                            
        bus = pipeline.get_bus()
        msg = bus.timed_pop_filtered(
                Gst.CLOCK_TIME_NONE, Gst.MessageType.ERROR | Gst.MessageType.EOS)
        # Free resources                                                                                                                                                                                     
        pipeline.set_state(Gst.State.NULL)

@dpeite
Copy link
Contributor

dpeite commented Aug 24, 2016

test_ok_raw_ynb.py.txt use num-buffers in pipeline and works fine
test_ko_raw_nnb.py.txt not use num-buffers in pipeline and getting the error: libv4l2: error setting pixformat: Device or resource busy
test_xx_raw_nnb_2.py.txt same test with a short pipeline, fail again

@Alfro
Copy link
Contributor

Alfro commented Nov 21, 2016

We are working with the GStreamer project to solve this issue:
https://bugzilla.gnome.org/show_bug.cgi?id=772521

@dpeite dpeite assigned Alfro and unassigned hcaloto, silviabf and dpeite Mar 24, 2017
@Alfro
Copy link
Contributor

Alfro commented Jun 19, 2017

I failed to update this issue here, but the GStreamer devs solved it in the 1.8 branch of the plugins-good project. The change was included in the 1.10.3 version, so it should be solved from there onwards.

@Alfro
Copy link
Contributor

Alfro commented Jun 19, 2017

We patched the gstreamer package (gstreamer1.0-plugins-good) for their 1.8 version, so either upgrading that package from our repo or us fixing #531 and upgrading to 1.10 should solve this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants