Can't play MP3s on iMX6 Solo using QMediaPlayer on Qt5

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Can't play MP3s on iMX6 Solo using QMediaPlayer on Qt5

1,926 Views
ralph__
Contributor IV

I'm trying to play back MP3 files on my iMX6 Solo evaluation board using Qt. I can already play MP3s using mplayer and also using gstreamer with any of the following command lines:

mplayer /usr/sample.mp3

gst-launch filesrc location=/usr/sample.mp3 ! mad ! alsasink  

gst-launch filesrc location=/usr/sample.mp3 ! mp3parse ! ffdec_mp3 ! alsasink

However, when I try to use Qt5 (with ALSA and Pulseaudio support enabled) I can only play back wav files. For example, this code works fine:

qDebug() << "Play /usr/sample.wav.\n";

QMediaPlayer* player1 = new QMediaPlayer;

player1->setMedia(QUrl::fromLocalFile("/usr/sample.wav"));

player1->setVolume(100);

player1->play();

sleep(10);

delete(player1);

But this code gives me an error:

qDebug() << "Play /usr/sample.mp3.\n";

QMediaPlayer* player2 = new QMediaPlayer;

player2->setMedia(QUrl::fromLocalFile("/usr/sample.mp3"));

player2->setVolume(100);

player2->play();

sleep(20);

delete(player2);

The error message I get back is:

GStreamer; Unable to play - "file:///usr/sample.mp3"

Does anyone know what is going wrong or how to specify which sinks to use to Qt?

Some more information that might help is the output of "gst-inspect-0.10 | grep imx":

beep.imx: ac3: ac3

beep.imx: 3ca: ac3

beep.imx:  beepdec: beep audio decoder

isink.imx:  mfw_isink: IPU-based video sink

tvsrc.imx:  tvsrc: v4l2 based tv src

vpu.imx:  vpudec: VPU-based video decoder

vpu.imx:  vpuenc: VPU-based video encoder

aiur.imx: webm: webm

aiur.imx:  aiurdemux: aiur universal demuxer

ipucsc.imx:  mfw_ipucsc: IPU-based video converter

v4lsrc.imx:  mfw_v4lsrc: v4l2 based camera src

v4lsink.imx:  mfw_v4lsink: v4l2 video sink

There is no mp3 codec there. Could this be the problem? Looking at other people's builds, they all seem to have this line:

beep.imx:  beepdec.mp3: MP3 decoder

Thanks.

Ralph

Labels (4)
Tags (3)
0 Kudos
3 Replies

718 Views
gusarambula
NXP TechSupport
NXP TechSupport

Hello Ralph,

Are you using the Community BSP or the BSP Release? I would make sure that you have the gstreamer packagegroup installed correctly on your image.

You may add the gstreamer package group for gstreamer 0.1 on the BSP Release by adding the following file on the local.conf file.

IMAGE_INSTALL_append = “ packagegroup-fsl-gstreamer “

Let us know if this helps!

0 Kudos

718 Views
ralph__
Contributor IV

Hi,

I'm using my own version of Buildroot with patches applied as per here:

http://buildroot-busybox.2317881.n4.nabble.com/PATCH-0-14-v3-freescale-update-userspace-packages-bra...

I already am building gstreamer-0.10 and gst-fsl-plugins.

All in all, I have these packages built and installed:

gst-ffmpeg-0.10.13/   gst-fsl-plugins-3.0.11/   gst-plugins-bad-0.10.23/  gst-plugins-base-0.10.36/ gst-plugins-good-0.10.31/ gst-plugins-ugly-0.10.19/


Ralph

0 Kudos

718 Views
gusarambula
NXP TechSupport
NXP TechSupport
0 Kudos