I want sound output at the 3.5mm ear phone connector. It works with any application (mplayer, aplay, ...) and even with gstreamer (gst-launch-1.0 filesrc location=test.mp3 ! mad ! audioconvert ! alsasink)
QMediaPlayer runs properly (no error messages from the (qt-)plugins) and I get positionChanged(qint64) signaling while playing the sound file.
QAudioDeviceInfo info(QAudioDeviceInfo::defaultOutputDevice());
qDebug() << "deviceName " << info.deviceName();
qDebug() << " supportedCodecs" << info.supportedCodecs();
for(int i=0; i < info.availableDevices(QAudio::AudioOutput).size(); i++)
{
qDebug() << "out" << info.availableDevices(QAudio::AudioOutput).at(i).deviceName() << "----"
<< info.availableDevices(QAudio::AudioOutput).at(i).supportedCodecs() <<
info.availableDevices(QAudio::AudioOutput).at(i).supportedSampleRates();
}
mMediaPlayer = new QMediaPlayer(this/*, QMediaPlayer::LowLatency*/);
mMediaPlaylist = new QMediaPlaylist(mMediaPlayer);
mMediaPlayer->setMedia(QUrl::fromLocalFile("/mnt/music/test.wav"));
mMediaPlayer->play();
mMediaPlayer->setVolume(100);
qDebug() << "state:" << mMediaPlayer->state();
Output after GST_DEBUG=3,alsa:5 ./prog:
deviceName ""
supportedCodecs ()
state: QMediaPlayer::PlayingState
What is going wrong here? Has anybody a working configuration? I have spend a lot of time figuring out the problem (last kernel 4.1(?) and Qt5.4 had already the same issue).
Thanks