Qt-无音频输出设备-Yocto/poky [英] Qt - No audio output device - Yocto/poky
问题描述
我正在尝试在基于ARM的Atmel主板(sama5d31ek)上使用Qt(QSound,QSoundeffect)播放WAV音频文件.
我已经使用Yocto/poky构建了rootfs(以及用于交叉编译的Qt SDK).
使用QSound播放时,出现以下日志消息:使用空输出设备,无可用.
运行时我什么也没得到:
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();
我可以通过命令行使用aplay(alsa)播放文件.
缺少pulseaudio util.
I can play the file via command-line, with aplay (alsa).
pulseaudio util is missing.
有什么事吗?
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
没有音频,请使用以下命令:
> 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
使用以下命令播放音频:
> aplay -D plughw:0,0 35_800.wav
Playing WAVE '35_800.wav' : Unsigned 8 bit, Rate 8000 Hz, Mono
在QAudioDeviceInfo上循环:未找到任何设备.
谢谢
推荐答案
出现了相同的问题,并且安装了qt多媒体插件后,对音频设备的访问仍然有效.
had the same issue and after installing the qt multimedia plugin access to audio devices worked.
sudo apt install libqt5multimedia5-plugins
这篇关于Qt-无音频输出设备-Yocto/poky的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!