Template:RK3399SelectALSAAudioDevice/zh

From FriendlyELEC WiKi
Revision as of 07:21, 21 December 2018 by Tzs (Talk | contribs) (updated by API)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

选择系统默认的音频设备

可以通过下面的操作步骤,设置系统默认的音频设备。
可用以下命令查看系统中所有的声卡设备 (注:不同的开发板结果会有所不同):

pi@NanoPi:~$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: realtekrt5651co [realtek,rt5651-codec], device 0: ff880000.i2s-rt5651-aif1 rt5651-aif1-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: rockchiphdmi [rockchip,hdmi], device 0: ff8a0000.i2s-i2s-hifi i2s-hifi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: ROCKCHIPSPDIF [ROCKCHIP,SPDIF], device 0: ff870000.spdif-dit-hifi dit-hifi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

可以看到,硬件上有如下声卡设备:

声卡设备 声卡序号 说明
realtekrt5651co 0 Realtek声卡的缺省输出接口(通过3.5mm耳机输出)
rockchiphdmi 1 HDMI输出
ROCKCHIPSPDIF 2 光纤输出 (注:暂不可用,因为硬件没有引出)

要配置成将音频输出到3.5mm耳机接口,可修改配置文件/etc/asound.conf,修改成如下内容:

defaults.pcm.card 0
defaults.pcm.device 0

要配置成将音频输出到HDMI,则将上面的defaults.pcm.card修改为1。
需要注意的是,有些板子由于没有Realtek声卡 (没有耳机输出接口),所以HDMI设备的序号会是card 0,所以配置时,要以aplay -l命令的结果为准。