In my app I need to record an alsasrc to mp3 files. When the user clicks a button, a new file should be created.
The problem is that I have a segmentation fault when I add an mfw_mp3encoder to my pipeline when it is running. When I replace the mfw_mp3encoder with an wavenc, everything works fine.
Is it possible that this is a bug in the mp3encoder of freescale?
When I debug the app, this is the gdb backtrace of the error:
#0 0x44715718 in mp3e_flush_bitstream () from /usr/lib/lib_mp3_enc_arm9_elinux.so.2.2.0
#1 0x44702268 in mfw_gst_mp3enc_sink_event (pad=<value optimized out>, event=0x43602180) at mfw_gst_mp3enc.c:448
#2 0x401d806c in gst_pad_send_event (pad=0x13a0d0, event=0x43602180) at gstpad.c:4962
#3 0x401d8900 in gst_pad_push_event (pad=0x13a008, event=0x43602180) at gstpad.c:4818
#4 0x41cda44c in gst_base_transform_sink_event (pad=<value optimized out>, event=0x43602180) at gstbasetransform.c:1710
#5 0x401d806c in gst_pad_send_event (pad=0xf1710, event=0x43602180) at gstpad.c:4962
#6 0x401d8900 in gst_pad_push_event (pad=0xf1648, event=0x43602180) at gstpad.c:4818
#7 0x41dd2cbc in gst_queue_loop (pad=<value optimized out>) at gstqueue.c:1094
#8 0x401f82d8 in gst_task_func (task=0xfe278) at gsttask.c:234
#9 0x401f9be8 in default_func (tdata=<value optimized out>, pool=<value optimized out>) at gsttaskpool.c:70
#10 0x40108d74 in g_thread_pool_thread_proxy (data=<value optimized out>) at gthreadpool.c:265
#11 0x401077bc in g_thread_create_proxy (data=0x140058) at gthread.c:635
#12 0x4025d7cc in start_thread () from /lib/libpthread.so.0#13 0x4033cc08 in clone () from /lib/libc.so.6
Anyone?
I have no problem when using gst-launch to create the pipeline, because there the pipeline is set to playing when the mp3encoder is already added.
In my application, I have a tee on which mp3encoders are added on the fly when the pipeline is already playing.
I'm using the latest mm-codecs (2.0.3) on an imx28.
My pipeline is as follows:
alsasrc ! tee ! queue ! fakesink
When a I start to record, I attach following to the tee:
queue ! "audio/x-raw-int,rate=44100,width=16,height=16,channels=1" ! mfw_mp3encoder ! queue ! filesink
Everything works fine when I start to record before I set the pipeline to playing, but attaching the mp3 encoder when the pipeline is playing gives a segfault.
can you use gst-lauch to establish the pipeline and have a try "gst-launch alsasrc ! mfw_mp3encoder ! filesin location = out.mp3" or can you share your gst-launch pipeline for us to investigate?
BTW: what's the release version of your package and which platform are you using?