NanoHat PCM5102A

From FriendlyELEC WiKi
Revision as of 10:15, 3 July 2017 by Yftan (Talk | contribs) (Update Log)

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

查看中文

1 Introduction

NanoHat PCM5102A
  • The NanoHat PCM5102A module uses TI's DAC audio chip PCM5102A and NS' low-noise, ultra-low dropout LP2992 regulator. PCM5102A's sample rates up to 384kHz and its resolution is 32-bit.
  • Its dynamic range is 112dB. Its THD+N at –1 dBFS is -93db. Its full-scale single-ended output is 2.1V. The SNR is 120dB.
  • Its onboard VS1838B infrared receiver allows it to be remote-controlled.
  • This module has exactly the same dimension as the NanoPi NEO/Air and can be stacked on an NanoPi NEO/Air.

2 Hardware Spec

  • Ultra-low out-of-band noise
  • Audio data bit length: 16-bit, 24-bit and 32-bit
  • Audio format selection: I2S (Low) / Left-justified
  • Sampling frequency: 384KHz, resolution: 32-bit
  • Onboard infrared receiver

NanoHat PCM5102A-PCB

  • Pin Description:

NanoPi NEO/Air 24 Pin header is not listed here. Refer to NanoPi NEO/Air's wiki site for more details
NanoPi NEO NanoPi NEO Air

12Pin header pin description:

Pin Name Description
1 VDD_5V 5V Power In
2 NC Not Connected
3 NC Not Connected
4 NC Not Connected
5   NC Not Connected
6   IR Receiver IR Receiver
7   NC Not Connected
8   LRCK I2S/PCM Sample Rate Clock/Sync
9   BCK I2S/PCM Sample Rate Clock
10   DIN I2S/PCM Serial Data Input
11   NC Not Connected
12   GND GND

3 Hardware & Software Systems that Work with NanoHat PCM5102A

Index CPU Model Board Model OS
1 H3 NanoPi NEO Allwinner's released Linux-3.4 kernel and Mainline Linux-4.x kernel
2 H3 NanoPi NEO Air Allwinner's released Linux-3.4 kernel and Mainline Linux-4.x
3 H5 NanoPi NEO2 Mainline Linux-4.x kernel
4 H5 NanoPi NEO Plus2 Mainline Linux-4.x kernel

4 Applications

The NanoHat PCM5102A can be stacked on supported boards. Here is a hardware setup:
Matrix - NanoHat   PCM5102A_nanopi_NEO

5 How to Play

5.1 Under H3 & Linux-3.4 Kernel

If you use a FriendlyElec's H3 board under Allwinner's released Linux-3.4 kernel run the following command to check whether or not the NanoHat PCM5102A is enabled:

$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Pcm5102a [Pcm5102a], device 0: Playback pcm5102a-hifi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: sndhdmi [sndhdmi], device 0: SUNXI-HDMIAUDIO sndhdmi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

card 0 stands for pcm5102a. You can play an audio file by running the following command:

$ aplay /root/Music/test.wav -D plughw:0

-D plughw:0 stands for audio card 0. Connect your module to a speaker and you will hear your music.

5.2 Under H3/H5 & Linux-4.x Kernel

If you use a FriendlyElec's H3/H5 board under Allwinner's released Linux-4.x kernel you need to enable the NanoHat PCM5102A with npi-config:
Start npi-config as root:

$ npi-config

Open the following menu:
pcm5102a-1
Open I2S:
pcm5102a-2
Enable/Disable I2S. By default I2S0 is disabled:
pcm5102a-3
After you enable I2S0 I2C1 will be disabled.After I2S0 is enabled select pcm5102a:
pcm5102a-4
Return to the main menu and do <Finish>. Reboot your system and run the following command to check whether or not the NanoHat PCM5102A is enabled:

$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: sndsun8ii2sdac [snd-sun8i-i2s-dac], device 0: sun8i-i2s-dac pcm5102a-hifi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Codec [H3 Audio Codec], device 0: CDC PCM Codec-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

card 0 stands for pcm5102a. You can play an audio file by running the following command:

$ aplay /root/Music/test.wav -D plughw:0

-D plughw:0 stands for audio card 0. Connect your module to a speaker and you will hear your music.

6 Resources

7 Update Log

7.1 Jan-20-2017

  • Released English version

7.2 July-4-2017

  • Added section 3
  • Updated section 5: added details on how to play it with H3 and H5 boards under different kernels