Difference between revisions of "Template:RK3399SelectALSAAudioDevice"

From FriendlyELEC WiKi
Jump to: navigation, search
(updated by API)
 
(updated by API)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
===选择系统默认音频设备===
+
===Select the system default audio device===
如果当前系统存在多个音频设备, 例如HDMI-Audio、3.5mm耳机座、I2S-Codec时, 可以通过下面的操作步骤,设置默认使用的音频设备。<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>
上面的信息表示realtekrt5651co代表3.5mm耳机座,rockchiphdmi代表HDMI, ROCKCHIPSPDIF代表光纤输出。<br />
+
As you can see, the following sound card devices are available on the hardware:
<br />
+
::{| class="wikitable"
要配置成将音频输出到3.5mm耳机接口(对应aplay -l命令结果的card 0),可修改配置文件/etc/asound.conf,修改成如下内容:  
+
|-
 +
|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:  
 
<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 (对应aplay -l命令结果的card 1),则将上面的defaults.pcm.card修改为1。<br />
+
To configure to output audio to HDMI, change the defaults.pcm.card above to 1.<br />
有些板子由于没有耳机输出接口,所以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.