AnsweredAssumed Answered

about audio problem while using gstreamer to play mp3 files

Question asked by liang yu on May 14, 2013
Latest reply on May 14, 2013 by liang yu
Branched to a new discussion

Hi All,

     Recently,I wanna play mp3 file by using gstreamer.But when my board had many audio cards,the problem occurred.

     Board: i.MX6Q SDB

     #arecord -l

     **** List of CAPTURE Hardware Devices ****
     card 0: wm8962audio [wm8962-audio], device 0: HiFi wm8962-0 []
       Subdevices: 1/1
       Subdevice #0: subdevice #0

  

     #aplay -l

     **** List of PLAYBACK Hardware Devices ****
     card 0: wm8962audio [wm8962-audio], device 0: HiFi wm8962-0 []
       Subdevices: 1/1
       Subdevice #0: subdevice #0
     card 1: imxhdmisoc [imx-hdmi-soc], device 0: IMX HDMI TX mxc-hdmi-soc-0 []
       Subdevices: 1/1
       Subdevice #0: subdevice #0

 

     #gst-launch filesrc location=/home/ILOVEIT.mp3 ! mad ! alsasink 

    It works very well.

 

  But I insert a usb mic before reboot,

     #arecord -l

     **** List of CAPTURE Hardware Devices ****
     card 0: U0x46d0x825 [USB Device 0x46d:0x825], device 0: USB Audio [USB Audio]
       Subdevices: 1/1
       Subdevice #0: subdevice #0
     card 1: wm8962audio [wm8962-audio], device 0: HiFi wm8962-0 []
       Subdevices: 1/1
       Subdevice #0: subdevice #0

   

    #aplay -l

     **** List of PLAYBACK Hardware Devices ****
     card 1: wm8962audio [wm8962-audio], device 0: HiFi wm8962-0 []
       Subdevices: 1/1
       Subdevice #0: subdevice #0
     card 2: imxhdmisoc [imx-hdmi-soc], device 0: IMX HDMI TX mxc-hdmi-soc-0 []
       Subdevices: 1/1
       Subdevice #0: subdevice 0

 

     #gst-launch filesrc location=/home/ILOVEIT.mp3 ! mad ! alsasink device="hw:1,0"

     it is not working.The output print follows as:

     Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
ERROR: from element /GstPipeline:pipeline0/GstAlsaSink:alsasink0: Could not get/set settings from/on resource.
Additional debug info:
gstalsasink.c(477): set_hwparams (): /GstPipeline:pipeline0/GstAlsaSink:alsasink0:
Sample format not available for playback: Invalid argument
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...

 

But I use playbin2 to run it and add this setting,it works

    #gst-launch playbin2 uri=file:///home/ILOVEIT.mp3 audio-sink="alsasink device="hw:1,0""

 

I don't know what I miss? Can  Anybody tell me why? How to solve "Could not get/set settings from/on resource." problem?

Outcomes