[RK3399][Android7.1] 调试笔记 --- 播放音乐没有声音

Platform: RK3399
OS: Android 7.1
Kernel: v4.4.83

现象:

使用自带播放器播放音乐,没有声音。


Log:

01-18 13:34:17.119   306   352 D alsa_route: route_info->sound_card 0, route_info->devices 0  
01-18 13:34:17.119   306   352 D alsa_route: route_set_controls() set route 26
01-18 13:34:17.120   306   352 V alsa_route: get_route_config() route 26
01-18 13:34:17.120   306   352 V alsa_route: set_controls() ctls_count 1
01-18 13:34:17.120   306   352 V alsa_route: set_controls() Can not get ctl : Voice Call Path
01-18 13:34:17.120   306   352 D alsa_route: route_set_controls() set route 27
01-18 13:34:17.120   306   352 V alsa_route: get_route_config() route 27
01-18 13:34:17.120   306   352 V alsa_route: set_controls() ctls_count 1
01-18 13:34:17.120   306   352 V alsa_route: set_controls() Can not get ctl : Voip Path
01-18 13:34:17.120   306   352 V alsa_route: route_pcm_close() route 24
01-18 13:34:17.120   306   352 D alsa_route: route_set_controls() set route 24
01-18 13:34:17.120   306   352 V alsa_route: get_route_config() route 24
01-18 13:34:17.120   306   352 V alsa_route: set_controls() ctls_count 1
01-18 13:34:17.120   306   352 V alsa_route: set_controls() Can not get ctl : Playback Path
01-18 13:34:17.120   306   352 D alsa_route: route_set_controls() set route 0
01-18 13:34:17.121   306   352 V alsa_route: get_route_config() route 0
01-18 13:34:17.121   306   352 V alsa_route: set_controls() ctls_count 1
01-18 13:34:17.121   306   352 V alsa_route: set_controls() Can not get ctl : Playback Path
01-18 13:34:17.121   306   352 V alsa_route: route_pcm_open exit
01-18 13:34:17.121   306   352 E AudioHardwareTiny: pcm_open(PCM_CARD) failed: cannot open device '/dev/snd/pcmC0D0p': No such file or directory

原因:

USB Camera内部也自带了audio模块,导致默认打开的device 0不是Audio Codec。

这里写图片描述


解决方法:

由于产品不需要使用USB Audio,因此可以直接移除掉此功能。

kris@eco:~/rk3399/kernel$ g df
diff --git a/arch/arm64/configs/rockchip_ecovacs_defconfig b/arch/arm64/configs/rockchip_eco_defconfig
index 7e66b90..0c482c2 100644
@@ -504,7 +504,7 @@ CONFIG_SND_VERBOSE_PRINTK=y
 # CONFIG_SND_PCI is not set
 # CONFIG_SND_SPI is not set
 #Kris, 180709, Avoid opening wrong audio device.
-CONFIG_SND_USB_AUDIO=y
+#CONFIG_SND_USB_AUDIO=y
 CONFIG_SND_SOC=y
 CONFIG_SND_SOC_ROCKCHIP=y
 CONFIG_SND_SOC_ROCKCHIP_SPDIF=y

如果/dev/snd/pcmC0D0p设备存在,也有可能打开出错,例如有位网友遇到了设置参数错误。
[RK3399][Android7.1] 调试笔记 --- 播放音乐没有声音_第1张图片

你可能感兴趣的:(RK3399,子类__Audio)