Difference between revisions of "Template:RK3399SelectALSAAudioDevice"

From FriendlyELEC WiKi
Jump to: navigation, search
(updated by API)
(updated by API)
 
Line 1: Line 1:
===选择系统默认的音频设备===
+
===Select the system default audio device===
可以通过下面的操作步骤,设置系统默认的音频设备。<br /><br />
+
You can set the system default audio device by following the steps below. <br />
可用以下命令查看系统中所有的声卡设备 (注:不同的开发板结果会有所不同):
+
Use the following command to view all the sound card devices in the system (Note: different development boards will have different results):
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
pi@NanoPi:~$ aplay -l
 
pi@NanoPi:~$ aplay -l
Line 15: Line 15:
 
   Subdevice #0: subdevice #0
 
   Subdevice #0: subdevice #0
 
</syntaxhighlight>
 
</syntaxhighlight>
上面的信息表示:
+
As you can see, the following sound card devices are available on the hardware:
 
::{| class="wikitable"
 
::{| class="wikitable"
 
|-
 
|-
|声卡设备 || 声卡序号 || 说明
+
|Sound card device || Sound card  number || Description
 
|-
 
|-
|  realtekrt5651co || 0 || Realtek声卡的缺省输出接口(板上表现为通过3.5mm耳机输出)
+
|  realtekrt5651co || 0 || Realtek sound card's default output interface (through 3.5mm jack interface)
 
|-
 
|-
|  rockchiphdmi || 1 || HDMI输出
+
|  rockchiphdmi || 1 || HDMI
 
|-
 
|-
--ROCKCHIPSPDIF || 2 || 光纤输出 (注:暂不可用,因为硬件没有引出)
+
|  ROCKCHIPSPDIF || 2 || SPDIF (Note: temporarily unavailable, because the hardware is not exported)...
 
|}
 
|}
要配置成将音频输出到3.5mm耳机接口,可修改配置文件/etc/asound.conf,修改成如下内容:  
+
To configure the audio output to the 3.5mm jack, modify the configuration file /etc/asound.conf and modify it to the following:  
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
defaults.pcm.card 0
 
defaults.pcm.card 0
 
defaults.pcm.device 0
 
defaults.pcm.device 0
 
</syntaxhighlight>
 
</syntaxhighlight>
要配置成将音频输出到HDMI,则将上面的defaults.pcm.card修改为1。<br />
+
To configure to output audio to HDMI, change the defaults.pcm.card above to 1.<br />
需要注意的是,有些板子由于没有Realtek声卡 (没有耳机输出接口),所以HDMI设备的序号会是card 0,所以配置时,要以aplay -l命令的结果为准。
+
Note that some boards do not have a Realtek sound card (no 3.5mm jack interface), so the card number of the HDMI device will be 0, so the configuration should be based on the result of the aplay -l command.

Latest revision as of 07:26, 21 December 2018

Select the system default audio device

You can set the system default audio device by following the steps below.
Use the following command to view all the sound card devices in the system (Note: different development boards will have different results):

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

As you can see, the following sound card devices are available on the hardware:

Sound card device Sound card number Description
realtekrt5651co 0 Realtek sound card's default output interface (through 3.5mm jack interface)
rockchiphdmi 1 HDMI
ROCKCHIPSPDIF 2 SPDIF (Note: temporarily unavailable, because the hardware is not exported)...

To configure the audio output to the 3.5mm jack, modify the configuration file /etc/asound.conf and modify it to the following:

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

To configure to output audio to HDMI, change the defaults.pcm.card above to 1.
Note that some boards do not have a Realtek sound card (no 3.5mm jack interface), so the card number of the HDMI device will be 0, so the configuration should be based on the result of the aplay -l command.