Bad playback speed while playing WAV and MP3 file

Hi,

I have an image built for Colibri T20 with Yocto Poky Morty and necessary tegra layers.
I have also gstreamer 1.0 with all necessary plugins.
I’m now experiencing weird playback issues with an example WAV file (rec in 44100) and MP3 file.
As I try to launch it with gstreamer, the playback sound a little bit slower than expected.
I thought that maybe my gstreamer config was screwed.

So I tried to play the WAV file with alsa tool aplay.
And it sounds the same, that is a little bit slower.

Therefore I was wondering if I had to change settings in some config file.
I didn’t find much resources for the Colibri T20 and it sound processor.
Could it be related to the rate of the file and the rate of the device ?

Thanks for your feedback.

Karim

PS: I have performed the same test with a fresh LXDE image and aplay: same result.

Yes, I believe natively AC97 may only play 48 kHz audio. Other sample rates would need explicit conversion.

Thanks for your feedback Marcel.

Do you mean that there is no way at all to play files in 44KHZ ?
What about changing the ALSA settings in

/usr/share/alsa/alsa.conf

or

/etc/.asoundrc

Not being a specialist, It seems to be doable.

However, in the current Linux image, changing these settings have no effect.

Do you know if there are some settings specific for Colibri T20 boards ?
Is it the same thing for mp3 or m4a file contents ?

Thanks.

Karim

Thanks for your feedback Marcel.

You are very welcome.

Do you mean that there is no way at all to play files in 44KHZ ?

No, not at all. Other sample rates would just need explicit conversion e.g. using audioresample.

What about changing the ALSA settings in
/usr/share/alsa/alsa.conf
or
/etc/.asoundrc

I don’t think any such settings change anything in that regard.

Not being a specialist, It seems to be doable.

However, in the current Linux image, changing these settings have no effect.

Do you know if there are some settings specific for Colibri T20 boards ?

No, I don’t think so.

Is it the same thing for mp3 or m4a file contents ?

Yes, I guess so.

Hi Marcel,

You’re right. Using the audioresample plugin can fix this issue.
I have tested it successfully in command line.

The problem is, I’m using Qt5.7 and the QMultimedia framework and I don’ know how it’s possible to force the use of this plugin…as this layer is abstracted by Qt.

Have you already experienced this kind of issue ?

Best Regards,

Karim

We do not have Qt expertise. However, for wav playback the QAudioOutput class might me more appropriate. One can pass a QAudioFormat object which allows setting the sample rate while initialising the QAudioOutput class object.