Hi all,
I want to play mp3 on sabrelite running LTIB using gstreamer,what i refer is "i.MX_6_Ubuntu_Multimedia_User_Guide.pdf", and the linux BSP version is "L3.0.35_4.0.0",I try two ways:
1) gst-launch filesrc location=test.mp3 typefind=true ! beepdec ! audioconvert ! 'audio/x-raw-int, channels=2' ! alsasink
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
** (gst-launch-0.10:3249): CRITICAL **: gst_beepdec_chain: assertion `beepdec->handle' failed
ERROR: from element /GstPipeline:pipeline0/GstFileSrc:filesrc0: Internal data flow error.
Additional debug info:
gstbasesrc.c(2582): gst_base_src_loop (): /GstPipeline:pipeline0/GstFileSrc:filesrc0:
streaming task paused, reason not-negotiated (-4)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...
crash and quit.
2) gst-launch playbin2 uri=file:///mnt/test.mp3 audio-sink="alsasink"
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Beep: 3.0.7
Core: MP3 decoder Wrapper build on Mar 15 2013 09:57:40
mime: audio/mpeg, mpegversion = (int)1
file: /usr/lib/imx-mm/audio-codec/wrap/lib_mp3d_wrap_arm12_elinux.so
CODEC: BLN_MAD-MMCODECS_MP3D_ARM_02.13.00_CORTEX-A8 build on Dec 5 2012 09:45:19.
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstAudioSinkClock
success.
Can someone tell me what wrong with the 1st way? Thanks!
Probably the mp3 is a container, so you need a demuxer before decoding. You can see what elements are being instantiated by playbin2 with --gst-debug=GST_ELEMENT_FACTORY:3
Leo
thanks Leo,
I add the params of "--gst-debug=GST_ELEMENT_FACTORY:3", and get the below message:
0:00:00.060519313 2654 | 0x17050 INFO | GST_ELEMENT_FACTORY gstelementfactory.c:375:gst_element_factory_create: creating element "playbin2" |
0:00:00.073615317 2654 | 0x17050 INFO | GST_ELEMENT_FACTORY gstelementfactory.c:375:gst_element_factory_create: creating element "alsasink" |
0:00:00.075104650 2654 | 0x17050 INFO | GST_ELEMENT_FACTORY gstelementfactory.c:375:gst_element_factory_create: creating element "bin" |
Setting pipeline to PAUSED ...
0:00:00.077509984 2654 | 0x17050 INFO | GST_ELEMENT_FACTORY gstelementfactory.c:375:gst_element_factory_create: creating element "uridecodebin" |
0:00:00.080884985 2654 | 0x17050 INFO | GST_ELEMENT_FACTORY gstelementfactory.c:373:gst_element_factory_create: creating element "filesrc" named "source" |
0:00:00.081628985 2654 | 0x17050 INFO | GST_ELEMENT_FACTORY gstelementfactory.c:375:gst_element_factory_create: creating element "decodebin2" |
0:00:00.082183985 2654 | 0x17050 INFO | GST_ELEMENT_FACTORY gstelementfactory.c:373:gst_element_factory_create: creating element "typefind" named "typefind" |
0:00:00.568129985 2654 | 0x17050 INFO | GST_ELEMENT_FACTORY gstelementfactory.c:375:gst_element_factory_create: creating element "id3demux" |
0:00:00.600694985 2654 | 0x17050 INFO | GST_ELEMENT_FACTORY gstelementfactory.c:375:gst_element_factory_create: creating element "mpegaudioparse" |
Pipeline is PREROLLING ...
0:00:00.606165651 2654 | 0x7d290 INFO | GST_ELEMENT_FACTORY gstelementfactory.c:375:gst_element_factory_create: creating element "beepdec.mp3" |
0:00:00.609144652 2654 | 0x7d290 INFO | GST_ELEMENT_FACTORY gstelementfactory.c:375:gst_element_factory_create: creating element "input-selector" |
0:00:00.610065652 2654 | 0x7d290 INFO | GST_ELEMENT_FACTORY gstelementfactory.c:373:gst_element_factory_create: creating element "tee" named "audiotee" |
0:00:00.610972319 2654 | 0x7d290 INFO | GST_ELEMENT_FACTORY gstelementfactory.c:373:gst_element_factory_create: creating element "bin" named "abin" |
0:00:00.611159985 2654 | 0x7d290 INFO | GST_ELEMENT_FACTORY gstelementfactory.c:373:gst_element_factory_create: creating element "queue" named "aqueue" |
0:00:00.612864652 2654 | 0x7d290 INFO | GST_ELEMENT_FACTORY gstelementfactory.c:373:gst_element_factory_create: creating element "audioconvert" named "aconv" |
0:00:00.614820318 2654 | 0x7d290 INFO | GST_ELEMENT_FACTORY gstelementfactory.c:373:gst_element_factory_create: creating element "audioresample" named "aresample" |
0:00:00.617156318 2654 | 0x7d290 INFO | GST_ELEMENT_FACTORY gstelementfactory.c:373:gst_element_factory_create: creating element "volume" named "volume" |
Beep: 3.0.7
Core: MP3 decoder Wrapper build on Mar 15 2013 09:57:40
mime: audio/mpeg, mpegversion = (int)1
file: /usr/lib/imx-mm/audio-codec/wrap/lib_mp3d_wrap_arm12_elinux.so
CODEC: BLN_MAD-MMCODECS_MP3D_ARM_02.13.00_CORTEX-A8 build on Dec 5 2012 09:45:19.
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstAudioSinkClock
But I don't know how to exactly create the pipeline, whould you give me some advise please?
filesrc typefind=true ! id3demux ! mpegaudioparse ! beeddec ! audioconvert ! audioresample ! alsasink
*bin elements are element containers and playbin2 can be seen as a single element....
Hi Leon,
Thanks for your help, I follow you advice and encounter the below problem:
root@freescale ~$ gst-launch filesrc location=/mnt/test.mp3 typefind=true ! id3demux ! mpegaudioparse ! beepdec ! audioconvert ! audioresample ! alsasink
Setting pipeline to PAUSED ...
Caught SIGSEGV accessing address (nil)
Spinning. Please run 'gdb gst-launch 2636' to continue debugging, Ctrl-C to quit, or Ctrl-\ to dump core.