大家好,
适用于 i.MX 8 的 Android Automotive 12 的三个版本均无法播放任何声音。
运行 Android Automotive 13 映像时,确认同一块主板可以正常工作。
音频插孔连接到一对扬声器,并使用厨房水槽应用程序播放声音。我也尝试了 YouTube 视频。
以下是来自 logcat 的相关错误
11:30:08.894 385-4621 audio_hw_primary android.hardware.audio.service I start_output_stream: primary: 1, out: 0xe6042d70, device: 16777216, address: bus0_media_out, mode: 0, flags 0x2
11:30:08.894 385-4621 audio_hw_primary android.hardware.audio.service I select_output_device(), headphone 0 ,headset 0 ,speaker 2
11:30:08.894 385-4621 audio_hw_primary android.hardware.audio.service E Failed to find card from bus 'bus0_media_out'
11:30:08.894 385-4621 audio_hw_primary android.hardware.audio.service D start_output_stream: pcm_open: card: -1, pcm_device_id: 0, rate: 48000, channel: 2, format: 0, period_size: 0xc0, flag: 9
11:30:08.894 385-4621 audio_hw_primary android.hardware.audio.service E start_output_stream: Invalid PCM card id: -1附上了从 Android Studio 的 logcat 导出的完整日志。.logcat文件可以导入到Android Studio中以便更好的查看。
我可以通过厨房水槽应用程序->音量测试确认来自音频插孔的音频。在应用程序中,我只在测试 1 号公交车时听到音频。
如果我想将所有音频路由到音频插孔,看起来我应该修改设备代码中的标签。
我已在此主题上阅读了有关音频的更多信息。
如果我想将所有音频路由到音频插孔,这看起来是可行的方法。
这很奇怪,幸运的是这种行为在较新的 Android 版本中不存在。