Getting "PulseAudioService: pa_context_connect() failed" error while trying to play a .wav file using Qt Qsound class

I am using apalis imx6 with angastrom-lxde-image running on it.I have developed a Qt app for GUI. My Qt app is working fine and i am able to get desired GUI on my screen. But when i am trying to play a .wav file using Qt QSound class in the same Qt program, I am getting error “PulseAudioService: pa_context_connect() failed”.
same program is working fine on windows and ubuntu(Desktop) without any error and i am able to play .wav file. Problem arises when i tries it on my apalis imx6 board.
i have already added qtmultimedia package in my yocto build, but it doesn’t help.


As we do not deploy pulseaudio in any of our images I wouldn’t know what exactly needs to be done to get a working pulseaudio installation.

E.g. things to check:

Did you check that you have pulseaudio installed in your image?

opkg list-installed | grep pulse

Is pulseaudio correctly installed and the pulseaudio server running?

Note also some other community threads in regards to pulseaudio installation.



The “PulseAudioService: pa_context_connect() failed” since the pulseaudio is not running in system mode. So what you exactly need to do is that run the following commands in the board and check the result.

  1. Check pulseaudio is running as a daemon.

$ ps -ae | grep pulseaudio

  1. Run Pulseaudio in with verbose
    $ pulseaudio -vvvv

If RED color logs are there, please go through it or post below. If no error are there do ctrl +c

  1. Start Pulseaudio as a daemon
    $ pulseaudio -D

  2. Play a wav file using command line
    $ paplay “wave file path”

if you here sound then deploy your App and try it…Most probably it should play wave file.

Vimal Babu