Template:S5Pxx18SelectALSAAudioDevice/zh

From FriendlyELEC WiKi
Revision as of 10:37, 12 March 2019 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: nanopi2audio [nanopi2-audio], device 0: c0055000.i2s-ES8316 HiFi ES8316 HiFi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: nanopi2audio [nanopi2-audio], device 1: c0059000.spdiftx-dit-hifi dit-hifi-1 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

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

声卡设备 声卡序号 说明
nanopi2audio device 0 3.5mm耳机输出
nanopi2audio device 1 HDMI输出

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

pcm.!default {
    type hw
    card 0
    device 0
}
 
ctl.!default {
    type hw
    card 0
}

要配置成将音频输出到HDMI,则将上面的device 0修改为device 1。