No sound from raspi3 3.5jack, using QtMediaPlayer

  • HI, I am trying to play music on a rpi3. I am cross compiling from ubuntu. Qt version is 5.10. I made use of QtMediaPlayer in QtQuick(qml) program. When I compile and run the program on host computer I can get sound from headphone jack and bluetooth speaker and built-in speaker. But when I deploy on rpi the audio file plays but there is no sound from any source. On the rpi omxplayer works fine. I have sound from jack and over bluetooth running mp3 files with omxplayer.
    What needs to be done to direct the qtmediaplayer output to 3.5 jack in rpi?

  • Is there any error coming from the QMediaPlayer? Anything being output to the console on the pi? Anything in the dmesg log that would help figure this out?

    Without further information my guess and it's a complete guess but something I see in linux a lot .. I'm thinking that your mixer for that audio source is set to a low or muted volume. Check that and see if it's muted or off. Without know what sound back end you are using I don't know which mixer to have you check, I'll just start with amixer or alsamixer due to lack of info. :)

  • Thanks for your response ambershark. There is no error message from QMediaPlayer. as I have mentioned the app works perfect on a linux machine, but when ported to raspberry pi 3 it does not work.
    I have checked the volume levels and other general reasons, but to no avail.

  • Lifetime Qt Champion


    Try to run your application with the QT_DEBUG_PLUGINS environment variable set to one, just to see if there's any hint coming from it.

  • I have solved the problem. the culprit is pulseaudio. you have to disable pulseaudio for user or globally and then everything works perfectly.
    Do not uninstall pulseaudio, because a lot of other stuff depends on it. I tried to remove pulseaudio and all hell broke loose.
    I disabled pulseaudio according to the instructions here

  • @Kachoraza thank you for sharing the solution. Please don't forget to mark your post as solved!

  • Dear Kachoraza,

    I met a same problem. I can't solve it but I turned off PulseAudio as you said.
    I am used QT3.7.1 on RPI 3.
    Now I am just testing using a meida player example of QT(

    Would you open more information for solving it?

  • I hope you have figured it out by now. But in case not, please follow the instructions in this article explaining the method.

  • @Kernel-KIM You need to install pulseaudio and enable it

    sudo apt-get install pulseaudio

  • @Kachoraza Hi!
    I got the same issue, but when I disabled pulseaudio as you did, I got an other error: PulseAudioService: pa_context_connect() failed. And when I enabled pulseaudio again, that error's gone but I couldn't get qtmediaplayer working (no sound from anysource). So I am in the loop now. Do you have any other suggestions? Thanks a lot!

  • Hi, just found something that worked for me :

    Installing gstreamer1.0-pulseaudio did the trick.

Log in to reply