I am having a perplexing difficulty, in that I cannot get my PyQt program to produce any sound. I am able to get sound correctly from the Pi over HDMI using speaker-test and paplay, so I am happy that both ALSA and Pulseaudio are functioning correctly. I have gstreamer1.0 and gstreamer1.0-pulseaudio packages installed. But my PyPi application gives no sound when I issue a QSoundEffect.play() command. I have put the code in its own separate app as follows (warning - requires kill signal to stop once running) and this works fine.
from PyQt5.QtCore import QUrl
from PyQt5.QtWidgets import QApplication
from PyQt5.QtMultimedia import QSound,QSoundEffect
from sys import argv
app = QApplication(argv)
Unfortunately, when I include the same code snippet within my app, I get nothing, and no feedback as to what is going wrong. Can anyone please suggest how I might be able to unravel this?
My app is using the linux-fb framework to write directly to the frame buffer. X is not running. This should make no difference to Qt and as I said, the snippet above works in my environment, just not within my code.