<div dir="ltr"><div>Hi Oliver,<br><br><br></div><div>I get the problem cause for this SIGFPE. I gave clock-rate=0 in udpsrc caps to receive dtmf. Sorry for the post. <br></div><div class="gmail_extra"><br></div><div class="gmail_extra">
Thanks, <br></div><div class="gmail_extra">Amar.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 31, 2013 at 4:32 PM, amar <span dir="ltr"><<a href="mailto:asontakke@phonologies.com" target="_blank">asontakke@phonologies.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi Olivier,<br><br></div><div>I have written a C code to catch rtp DTMF event. I am able to catch the GST_MESSAGE_ELEMENT from my bus. I am using rtpdtmfdepay for the above opration. But as pipeline get the DTMF RTP EVENT it throws a segmentation fault due to SIGFPE (floating point exception ). I tried to debug this with gdb but not getting any success for resolving the problem. I am giving my code and back-trace of the problem. Please look at once, what is going wrong ?<br>
<br></div><div>I am using the followimg code to catch RTP DTMF Event :<br></div><div>***********************************************************************************<br><span style="font-family:courier new,monospace">#include <gst/gst.h><br>
<br>static gboolean bus_call (GstBus *bus, GstMessage *msg, gpointer data)<br>{<br> GMainLoop *loop = (GMainLoop *) data;<br> switch (GST_MESSAGE_TYPE (msg)) {<br> case GST_MESSAGE_EOS:<br> g_print ("End of stream\n");<br>
g_main_loop_quit (loop);<br> break;<br> case GST_MESSAGE_ERROR:{<br> gchar *debug;<br> GError *error;<br> gst_message_parse_error (msg, &error, &debug);<br> g_free (debug);<br>
g_printerr ("Error: %s\n", error->message);<br> g_error_free (error);<br> g_main_loop_quit (loop);<br> break;<br> }<br> case GST_MESSAGE_ELEMENT:<br> g_print("**************Getting GST_MESSAGE_ELEMENT*************\n");<br>
break;<br> default:<br> break;<br> }<br> }<br><br> int main (int argc, char *argv[])<br> {<br> GMainLoop *loop;<br> GstElement *pipeline, *asource, *acapsfilter, *pcmurtpdepay, *sink;<br>
GstBus *bus;<br> guint bus_watch_id;<br> GstCaps *caps;<br><br> /* Initialisation */<br> gst_init (&argc, &argv);<br> loop = g_main_loop_new (NULL, FALSE);<br><br> /* Create gstreamer elements */<br>
pipeline = gst_pipeline_new ("av-recorder");<br> asource = gst_element_factory_make ("udpsrc", "aud-source");<br> acapsfilter = gst_element_factory_make ("capsfilter", "audio-caps");<br>
pcmurtpdepay = gst_element_factory_make ("rtpdtmfdepay", "artpdepay");<br> sink = gst_element_factory_make ("filesink", "file-output");<br><br> if (!pipeline || !asource || !acapsfilter || !pcmurtpdepay || !sink) {<br>
g_printerr ("One element could not be created. Exiting.\n");<br> return -1;<br> }<br><br> g_object_set (G_OBJECT (asource), "port", 3333, NULL);<br> g_object_set (G_OBJECT (sink), "location", "event", NULL);<br>
<br> caps = gst_caps_from_string("application/x-rtp,encoding-name=TELEPHONE-EVENT,payload=101,media=(string)audio, clock-rate=(int)0");<br> g_object_set (G_OBJECT (acapsfilter), "caps", caps, NULL);<br>
gst_caps_unref (caps);<br> bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));<br> bus_watch_id = gst_bus_add_watch (bus, bus_call, loop);<br> gst_object_unref (bus);<br><br> gst_bin_add_many (GST_BIN (pipeline),<br>
asource, acapsfilter, pcmurtpdepay,<br> sink, NULL);<br><br> gst_element_link_many (asource, acapsfilter, pcmurtpdepay, sink, NULL);<br><br> gst_element_set_state (pipeline, GST_STATE_PLAYING);<br>
<br> g_print ("Recording (or not!)...\n");<br> g_main_loop_run (loop);<br> g_print ("Returned, stopping recording\n");<br> gst_element_set_state (pipeline, GST_STATE_NULL);<br><br> g_print ("Deleting pipeline\n");<br>
gst_object_unref (GST_OBJECT (pipeline));<br> g_source_remove (bus_watch_id);<br> g_main_loop_unref (loop);<br><br> return 0;<br> }</span><br>*********************************************************************************************<br>
<br>Following is a back-trace from gdb :<br><br>$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$<br><span style="font-family:comic sans ms,sans-serif">[amar@localhost gstreamer]$ gdb ./tele_event <br>
GNU gdb (GDB) Fedora (7.6-30.fc19)<br>Copyright (C) 2013 Free Software Foundation, Inc.<br>License GPLv3+: GNU GPL version 3 or later <<a href="http://gnu.org/licenses/gpl.html" target="_blank">http://gnu.org/licenses/gpl.html</a>><br>
This is free software: you are free to change and redistribute it.<br>There is NO WARRANTY, to the extent permitted by law. Type "show copying"<br>and "show warranty" for details.<br>This GDB was configured as "i686-redhat-linux-gnu".<br>
For bug reporting instructions, please see:<br><<a href="http://www.gnu.org/software/gdb/bugs/" target="_blank">http://www.gnu.org/software/gdb/bugs/</a>>...<br>Reading symbols from /home/amar/gstreamer/tele_event...(no debugging symbols found)...done.<br>
(gdb) run event<br>Starting program: /home/amar/gstreamer/tele_event event<br>Traceback (most recent call last):<br> File "/usr/share/gdb/auto-load/usr/lib/<a href="http://libgobject-2.0.so.0.3600.3-gdb.py" target="_blank">libgobject-2.0.so.0.3600.3-gdb.py</a>", line 9, in <module><br>
from gobject import register<br> File "/usr/share/glib-2.0/gdb/gobject.py", line 3, in <module><br> import gdb.backtrace<br>ImportError: No module named backtrace<br>[Thread debugging using libthread_db enabled]<br>
Using host libthread_db library "/lib/libthread_db.so.1".<br>[New Thread 0xb7d4db40 (LWP 5999)]<br>Recording (or not!)...<br></span></div><span style="font-family:comic sans ms,sans-serif">**************Getting GST_MESSAGE_ELEMENT*************<br>
</span><div><span style="font-family:comic sans ms,sans-serif"><br>Program received signal SIGFPE, Arithmetic exception.<br>[Switching to Thread 0xb7d4db40 (LWP 5999)]<br>0xb7de0743 in __divdi3 () from /usr/lib/gstreamer-1.0/libgstdtmf.so<br>
(gdb) bt<br>#0 0xb7de0743 in __divdi3 () from /usr/lib/gstreamer-1.0/libgstdtmf.so<br>#1 0xb7ddee04 in gst_dtmf_src_generate_tone (payload=..., rtpdtmfdepay=0x816e0f8) at gstrtpdtmfdepay.c:356<br>#2 gst_rtp_dtmf_depay_process (depayload=0x816e0f8, buf=0x81746f0) at gstrtpdtmfdepay.c:506<br>
#3 0xb7d5d11c in gst_rtp_base_depayload_chain (pad=0x81624e0, parent=0x816e0f8, in=0x81746f0)<br> at gstrtpbasedepayload.c:353<br>#4 0x449cf222 in gst_pad_chain_data_unchecked (data=0x81746f0, type=<optimized out>, pad=0x81624e0)<br>
at gstpad.c:3655<br>#5 gst_pad_push_data (pad=0x81623a8, type=type@entry=4112, data=0x81746f0) at gstpad.c:3872<br>#6 0x449d671f in gst_pad_push (pad=0x81746f0, buffer=0x81746f0) at gstpad.c:3975<br>#7 0x43a8dd0d in gst_base_transform_chain (pad=0x8162270, parent=0x816c1b8, buffer=0x81746f0)<br>
at gstbasetransform.c:2212<br>#8 0x449cf222 in gst_pad_chain_data_unchecked (data=0x81746f0, type=<optimized out>, pad=0x8162270)<br> at gstpad.c:3655<br>#9 gst_pad_push_data (pad=0x8162138, type=type@entry=4112, data=0x81746f0) at gstpad.c:3872<br>
#10 0x449d671f in gst_pad_push (pad=0x81746f0, pad@entry=0x8162138, buffer=0x81746f0) at gstpad.c:3975<br>#11 0x43a843bf in gst_base_src_loop (pad=0x8162138) at gstbasesrc.c:2726<br>#12 0x449fffc8 in gst_task_func (task=task@entry=0x8174010) at gsttask.c:316<br>
#13 0x44a00f70 in default_func (tdata=0x81661e0, pool=0x805cc10) at gsttaskpool.c:70<br>#14 0x4f28b475 in g_thread_pool_thread_proxy (data=0x805c8d0) at gthreadpool.c:309<br>#15 0x4f28a96b in g_thread_proxy (data=0x8055780) at gthread.c:798<br>
#16 0x4f1089da in start_thread (arg=0xb7d4db40) at pthread_create.c:308<br>#17 0x4f038c0e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:131<br>(gdb) f 0<br>#0 0xb7de0743 in __divdi3 () from /usr/lib/gstreamer-1.0/libgstdtmf.so<br>
(gdb) info local<br>No symbol table info available.<br>(gdb) info locals<br>No symbol table info available.<br>(gdb) info args<br>No symbol table info available.<br>(gdb) info threads<br> Id Target Id Frame <br>
* 2 Thread 0xb7d4db40 (LWP 5999) "aud-source:src" 0xb7de0743 in __divdi3 ()<br> from /usr/lib/gstreamer-1.0/libgstdtmf.so<br> 1 Thread 0xb7fe66c0 (LWP 5995) "tele_event" 0xb7fff424 in __kernel_vsyscall ()</span><br>
<br>$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$<br><br></div><div class="gmail_extra">Thanks,<br></div><div class="gmail_extra">Amar.<br></div><div><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">
On Wed, Oct 30, 2013 at 4:08 PM, Olivier Crête <span dir="ltr"><<a href="mailto:olivier.crete@collabora.com" target="_blank">olivier.crete@collabora.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<div><br>
On Wed, 2013-10-30 at 15:09 +0530, amar wrote:<br>
> Thank you for giving response to my query.<br>
> Please can you give me any example for grepping the DTMF event from<br>
> rtpdtmfdepay.<br>
><br>
> I am unable to catch the DTMF event from messege bus. How to catch the<br>
> DTMF event from GstMessege ?<br>
<br>
</div>You should receive a message of type GST_MESSAGE_ELEMENT. This only<br>
works if you receive DTMF as RTP telephone-event messages, if you<br>
receive the DTMF as sound, you need to use the dtmfdetect element from<br>
the spandsp plugin. This element will also emit the same messages where<br>
it gets DTMF sound.<br>
<div><div><br>
--<br>
Olivier Crête<br>
<a href="mailto:olivier.crete@collabora.com" target="_blank">olivier.crete@collabora.com</a><br>
<br>
_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
</div></div></blockquote></div><br></div></div></div></div>
</blockquote></div><br></div></div>