[gstreamer-bugs] [Bug 440161] New: alsasink element can be used only one time per program
GStreamer (bugzilla.gnome.org)
bugzilla-daemon at bugzilla.gnome.org
Mon May 21 05:35:46 PDT 2007
If you have any questions why you received this email, please see the text at
the end of this email. Replies to this email are NOT read, please see the text
at the end of this email. You can add comments to this bug at:
http://bugzilla.gnome.org/show_bug.cgi?id=440161
GStreamer | gst-plugins-base | Ver: HEAD CVS
Summary: alsasink element can be used only one time per program
Product: GStreamer
Version: HEAD CVS
Platform: Other
OS/Version: All
Status: UNCONFIRMED
Severity: normal
Priority: Normal
Component: gst-plugins-base
AssignedTo: gstreamer-bugs at lists.sourceforge.net
ReportedBy: zazubrik at mail.ru
QAContact: gstreamer-bugs at lists.sourceforge.net
GNOME version: 2.13/2.14
GNOME milestone: Unspecified
Please describe the problem:
I can run pipeline with alsasink only one time. After unref-ing the pipeline,
and creating new one with alsasink the new pipeline won't go into PLAYING
state. ringbuffer hangs in opening device.
On the other hand, works fine with OSSsink or previous version
(gst-plugins-base 0.10.11)
Steps to reproduce:
Testcase: (http://timon.stabilis.ru/~timon/alstest.c)
#include <gst/gst.h>
#define GST_CREATE_EL(el, kind, name) do { \
el = gst_element_factory_make(kind, name); \
g_assert(el);
\
g_print("Created %s of kind %s with name %s, %p\n", \
#el, kind, name, el);
\
if (el != pipe)
\
gst_bin_add(GST_BIN(pipe), el);
\
} while (0)
#define SINK "alsa"
GMainLoop *loop;
GstElement *pipe, *src, *conv, *res, *sink;
int timer = 0;
void
CreatePipeline()
{
GST_CREATE_EL(pipe, "pipeline", "pipeline");
GST_CREATE_EL(src, "audiotestsrc", "src");
GST_CREATE_EL(conv, "audioconvert", "converter");
GST_CREATE_EL(res, "audioresample", "resampler");
GST_CREATE_EL(sink, SINK"sink", sink);
gst_element_link_many(src, conv, res, sink, NULL);
}
gboolean
IdleTimer(gpointer data)
{
timer ++;
g_print("Timer: %d\n", timer);
if ((timer % 10) == 0) {
gst_element_set_state(pipe, GST_STATE_NULL);
g_main_loop_quit(loop);
}
return TRUE;
}
int
main(int ac, char **av)
{
gst_init(&ac, &av);
loop = g_main_loop_new(NULL, FALSE);
g_timeout_add(100, IdleTimer, NULL);
CreatePipeline();
gst_element_set_state(pipe, GST_STATE_PLAYING);
g_main_loop_run(loop);
g_object_unref(pipe);
g_print("done\n");
CreatePipeline();
gst_element_set_state(pipe, GST_STATE_PLAYING);
g_main_loop_run(loop);
g_object_unref(pipe);
return (0);
}
Actual results:
First time the pipeline runs well.
Second time the pipeline doesn't change to PLAYING state, with the last
message:
0:00:02.348000000 10497 0x502010 DEBUG ringbuffer
gstringbuffer.c:443:gst_ring_buffer_open_device:<audiosinkringbuffer1> opening
device.
Have to kill program using ^C.
Expected results:
Hear sample tone, then gap, then sample tone again.
Does this happen every time?
YES.
Other information:
Test program: http://timon.stabilis.ru/~timon/alstest.c
results of test run with --gst-debug=5
http://timon.stabilis.ru/~timon/alstest-cvs.log.gz
--
See http://bugzilla.gnome.org/page.cgi?id=email.html for more info about why you received
this email, why you can't respond via email, how to stop receiving
emails (or reduce the number you receive), and how to contact someone
if you are having problems with the system.
You can add comments to this bug at http://bugzilla.gnome.org/show_bug.cgi?id=440161.
More information about the Gstreamer-bugs
mailing list