Qt - No audio output device - Yocto/poky
Asked Answered
B

2

1


I'm trying to play a WAV audio file with Qt (QSound, QSoundeffect) on an ARM based Atmel board (sama5d31ek).
I've build the rootfs (and Qt SDK for cross-compiling) with Yocto/poky.
When playing with QSound I get the following log message: using null output device, none available.
I'm getting nothing when running:

foreach (const QAudioDeviceInfo &deviceInfo, QAudioDeviceInfo::availableDevices(QAudio::AudioOutput))
    qDebug() << "Device name: " << deviceInfo.deviceName();

I can play the file via command-line, with aplay (alsa).
pulseaudio util is missing.

Anything?

Cleiton:

 > aplay --list-devices
**** List of PLAYBACK Hardware Devices ****
card 0: SAMA5D3 [tlv320aic3x @ SAMA5D3], device 0: TLV320AIC3X PCM tlv320aic3x-hifi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

 > cat /proc/asound/card0/pcm0p/info
card: 0
device: 0
subdevice: 0
stream: PLAYBACK
id: TLV320AIC3X PCM tlv320aic3x-hifi-0
name:
subname: subdevice #0
class: 0
subclass: 0
subdevices_count: 1
subdevices_avail: 1

No audio with the following command:

 > aplay -D hw:0,0 35_800.wav
Playing WAVE '35_800.wav' : Unsigned 8 bit, Rate 8000 Hz, Mono
aplay: set_params:1241: Sample format non available
Available formats:
- S16_LE
- S24_LE
- S32_LE

Audio playing with the following command:

 > aplay -D plughw:0,0 35_800.wav
Playing WAVE '35_800.wav' : Unsigned 8 bit, Rate 8000 Hz, Mono

Looping over QAudioDeviceInfo: no devices are found.

thanks

Bunny answered 16/4, 2016 at 5:58 Comment(0)
M
3

had the same issue and after installing the qt multimedia plugin access to audio devices worked.

sudo apt install libqt5multimedia5-plugins
Merralee answered 14/8, 2019 at 6:17 Comment(0)
A
1

Add packages alsa-utils and execute:

$ aplay --list-devices
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC269VB Analog >[ALC269VB Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Then, depending on the output run:

aplay -D plughw:0,0 music.wav 

Or:

$ cat /proc/asound/card0/pcm0p/info
card: 0
device: 0
subdevice: 0
stream: PLAYBACK
id: HDMI 0
name: HDMI 0
subname: subdevice #0
class: 0
subclass: 0
subdevices_count: 1
subdevices_avail: 1

Using:

aplay -D hw:0,0 music.wav

Then with Qt, you can list the devices with:

QList <QAudioDeviceInfo> devices = QAudioDeviceInfo :: availableDevices (QAudio :: AudioOutput);
foreach (i QAudioDeviceInfo, devices)
   // Print the devices here!

Try and post the results here!

Affaire answered 18/4, 2016 at 16:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.