about audio problem while using gstreamer to play mp3 files

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

about audio problem while using gstreamer to play mp3 files

ソリューションへジャンプ
4,686件の閲覧回数
liangyu
Contributor III

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?

ラベル(2)
0 件の賞賛
返信
1 解決策
2,094件の閲覧回数
LeonardoSandova
Specialist I

Hi Lian,

I am not an audio expert but there are two ways to figure out what elements are being instantiated in playbin2 (so you can find the missing ones on the pipeline you are manually creating), check this link

https://community.freescale.com/docs/DOC-93451

Try to use the same elements as playbin2 in your manual-pipeline.

Leo

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
2,095件の閲覧回数
LeonardoSandova
Specialist I

Hi Lian,

I am not an audio expert but there are two ways to figure out what elements are being instantiated in playbin2 (so you can find the missing ones on the pipeline you are manually creating), check this link

https://community.freescale.com/docs/DOC-93451

Try to use the same elements as playbin2 in your manual-pipeline.

Leo

0 件の賞賛
返信
2,094件の閲覧回数
liangyu
Contributor III

I get the resolution, I miss the audioconvert element before alsasink.Thx

0 件の賞賛
返信