I want to set up audio output for my raspberry pi with Yocto [2.6.1], I have configured Yocto in local.conf
IMAGE_INSTALL_append = " gstreamer1.0 gstreamer1.0-meta-base gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer-plugins-ugly"
IMAGE_INSTALL_append = " alsa-lib alsa-utils alsa-plugin alsa-tools"
PACKAGECONFIG_append_pn-qtmultimedia = " gstreamer alsa"
When i test audio with aplay and wav file, i can heard sound (successfully).
Then, i try to play trough Qt with QMediaPlayer (c++) and Audio QML, i can not heard anything and I got following message
Could not open audio device for playback
That my code:
onStatusChanged: testLabel.text = "File Audio Status: " + status + " - " + "Volume: " + volume
onBufferProgressChanged: console.log("Buffer Progress: "+ bufferProgress)
onAvailabilityChanged: console.log("Availability: "+ availability)
But, when I test with examples software from qt code (audiooutput), I can heard beep sound testing (the software have option to select audio device).
I guess the problem is qt don't know which one audio device to use.
How to set default audio device output globally in qt, so QMediaPlayer and QML Audio can run?
That is result when i run my qt software
Unable to query physical screen size, defaulting to 100 dpi.
To override, set QT_QPA_EGLFS_PHYSICAL_WIDTH and QT_QPA_EGLFS_PHYSICAL_HEIGHT (in millimeters).
Device name: "default"
Device name: "default:CARD=Set"
Device name: "sysdefault:CARD=Set"
Device name: "front:CARD=Set"
Device name: "surround21:CARD=Set,DEV=0"
Device name: "surround40:CARD=Set,DEV=0"
Device name: "surround41:CARD=Set,DEV=0"
Device name: "surround50:CARD=Set,DEV=0"
Device name: "surround51:CARD=Set,DEV=0"
Device name: "surround71:CARD=Set,DEV=0"
Device name: "iec958:CARD=Set,DEV=0"
Warning: "Could not open audio device for playback."