Android Things Audio I2S不可用

问题描述 投票:-1回答:1

[我正在尝试通过I2S和Android Things播放声音,但一直在获取

E/audio_hw_hikey: cannot open pcm_out driver: cannot open device '/dev/snd/pcmC1D0p': No such file or directory 48000 2 0

我已经使用adb ls /dev/snd检查了音频设备,但该设备确实存在

000041ed 00000078 5db48f0c .
000041ed 00000500 00000008 ..
000021b0 00000000 00000002 pcmC0D1p
000021b0 00000000 00000002 controlC0
000021b0 00000000 00000002 pcmC0D0p
000021b0 00000000 00000002 timer

我想念什么?

linux android-things
1个回答
0
投票

您是否尝试使用路径直接打开I2S总线?那行不通。相反,您使用AudioTrack API和set the preferred device会将其通过管道传输到I2S通道。

audioInputDevice = findAudioDevice(AudioManager.GET_DEVICES_INPUTS, AudioDeviceInfo.TYPE_BUS);
audioOutputDevice = findAudioDevice(AudioManager.GET_DEVICES_OUTPUTS, AudioDeviceInfo.TYPE_BUS);

链接样本includes some code的操作方法。

© www.soinside.com 2019 - 2024. All rights reserved.