Solved QAudioDeviceInfo cannot find available audio device in RPi ?
-
Dear Sirs,
I tried below code on RPi3:
foreach (const QAudioDeviceInfo &deviceInfo, QAudioDeviceInfo::availableDevices(QAudio::AudioOutput)) qDebug() << "Device name: " << deviceInfo.deviceName();
In WIN7, it shows correct audio device, such as "Realtek HD Audio".
However, in RPi3, it cannot find ant audio device. I can play music to 3.5mm Headphone jack by CLI:
aplay -D hw:0,0 123.wav
So I believe audio device is working, I don't know why above QT demo code not working.
Another clue is: I use "./configure xxxxxxxxx --recheck" it shows
ALSA ................................... no
Do I have to see it "YES" then can work ?
Is there anyone can help ?
-
Hi,
That would help yes. For that you need to have the ALSA development package on your Pi for when you build Qt.
-
Hi,
That would help yes. For that you need to have the ALSA development package on your Pi for when you build Qt.
-
@SGaist ,
After install alsa-dev package and re-run ./configure, then I can see ALSA is YES.
And thus QAudioDeviceInfo can see audio sound card.Thanks.