3

I purchased a PCM5102 for my PiZeroW, but having problems finding

  1. complete driver software information
  2. voltage information
  3. wiring information.

I chose this particular unit because they seemed very popular on Ebay when talking about adding I2S sound to Raspberry Pi.

With so many on sale, I guessed instructions would be easy to find.

enter image description here What is the Device Driver / Device Setup

I have been watching the Adafruit setup of a different I2S unit. Looking for hints. https://www.youtube.com/watch?v=kkaYTIC0RoQ

aplay -l

This should show available sound cards. But I don't get any. I suspect I have the wrong boot config. I do have I2S enabled in the /boot/config.txt, also set the

dtoverlay=hifiberry-dac

I have setup /etc/asound.conf as well.

What is the Vcc Voltage for this card? 3.3v or 5v?

The raw chip looks to be 3.3v, according to the datasheet, but there are many surface mount resistors on the card, any could be used to pull down a Vcc of 5volts to 3.3v. http://www.ti.com/general/docs/datasheetdiagram.tsp?genericPartNumber=PCM5102&diagramId=SLAS764B

I've gone conservative for now, picking 3.3v. Trying to keep the magic smoke within the unit:)

Wiring the PCM5102 to the PiW

Other than Vcc, the other wiring I deduced from here.

http://masterandrey.com/posts/en/dac_raspberry_pi_pcm5102/ http://www.denshi.club/pc/audio/raspberry-pi-2i2s-dac.html

Is the MCK (SCK) line to be connected, or left unconnected as suggested by www.denshi.club ?

Symptoms

No sound when using headphones plugged into the 3.5mm jack.

The led on the card comes on.

Sorry, I don't have a scope, so I'm not able to test the I2S lines.

aplay -l

Not seeing any cards listed.

  • "With so many on sale, I guessed instructions would be easy to find." -> Next time check first ;) – goldilocks Dec 7 '17 at 14:59
4

I was able to make this unit work with my Raspberry Pi 3 using volumio and osmc without the need of any software tweaking. I must say that it sounds very good on both distributions.

While using both the distributions, I selected the HifiBerry DAC profile from system settings.

Note that my unit came with the jumpers for the extended headers already shorted. In the picture below, you can see the little jumpers.

For powering up the board:

There's a 3.3V regulator already on the audio board and you can leave it unconnected. I ended up connecting the 5V rail from the rpi to the VIN of the DAC and it works just fine. The blue LED on the DAC should light up when it's powered up correctly.

Wiring Pinout:

DAC BOARD   > Raspberry Pi 3 Model B connector J8
-----------------------------------------------
SCK         > Not wired (Internally generated)
BCK         > PIN 12    (GPIO18)
DIN         > PIN 40    (GPIO21)
LRCK        > PIN 35    (GPIO19)
GND         > PIN 6     (GND) Ground
VIN         > PIN 2     (5V)

-----------------------------------------------
FLT             > Not wired 
DEMP            > Not wired 
XSMT            > Not wired 
FMT             > Not wired 
A3V3            > Not wired 
AGND            > Not wired (Same as headphone out) 
ROUT            > Not wired (Same as headphone out)
AGNDL           > Not wired (Same as headphone out)
LROUT           > Not wired (Same as headphone out)

This setup works while using this unit Audio device enumeration returns the following:

volumio@audio:~$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
  Subdevices: 8/8
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
  Subdevice #4: subdevice #4
  Subdevice #5: subdevice #5
  Subdevice #6: subdevice #6
  Subdevice #7: subdevice #7
card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: sndrpihifiberry [snd_rpi_hifiberry_dac], device 0: HifiBerry DAC HiFi pcm5102a-hifi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

I hope this helps get things moving.

  • I corrected the ground wire pin above (ground is 6), and typo in Volumio. – nslntmnx Dec 11 '17 at 12:43
  • The hardware setup above is verified. I already had a running system so I just did the system setup manually, and used mplayer. Instructions here for the setup support.hifiberry.com/hc/en-us/articles/… – nslntmnx Dec 11 '17 at 12:46
  • Thanks for the instructions, edits and congratulations on getting it to work. – Kamran Sethi Dec 12 '17 at 13:57
  • I had to connect SCK to GND to make the module work with my Pi Zero W. – javaxian Jan 20 at 17:13
2

On these purple PCBs there are 5 sets of bridging pads.

On the front (component side) there is one pair of pads which may be bridged to tie the SCK (system clock) low. This will force the PCM510x to generate the system clock using its internal PLL. You may bridge these pads to remove the need for an external SCK or connect the SCK pin to ground (0V). The Raspberry Pi does not supply a system clock so this will be required to connect to the Raspberry Pi.

On the back (non-component side) there are 4 sets of 3 pads for the 4 functions:

  1. FLT - Filter select : Normal latency (Low) / Low latency (High)
  2. DEMP - De-emphasis control for 44.1kHz sampling rate: Off (Low) / On (High)
  3. XSMT - Soft mute control(1): Soft mute (Low) / soft un-mute (High)
  4. FMT - Audio format selection : I2S (Low) / Left justified (High)

The centre pad is connected to the corresponding pin. Each of these function pads may be bridged with solder either high or low (or the pins connected to +3.3V / 0V). (My board is supplied with 1, 2 & 4 bridged low and 3 bridged high, i.e. normal latency filter, 44.1kHz de-emphasis disabled, soft-mute not asserted, I2S audio format.)

The normal filter is an FIR with good response, delaying the signal by approx. 500us (at 44.1 kHz) which should be fine. The fast filter is an IIR with slightly poorer response and delays the signal approx. 80us. Very few (if any) audio sources have pre-emphasis applied so DEMP should be low. The XSMT pin would allow muting of the output via a GPI (if the solder bridge was removed). Raspberry Pi supports I2S bitstream so FMT should be low.

*Do not connect pins to a supply rail if the solder bridges are applied.

The VIN pin goes to a pair of voltage regulators, one of which provides the 3.3V required by the PCM510x. This also connects to the A3V3 pin. The regulator is low drop so VIN may be fed from 3.3V or 5V.

The input pins SCK, BCK, DIN & LCK are fed through a resistor pack which should allow 5V signals to be connected to the 3.3V PCM510x chip, i.e. the board is 3.3V but 5V tolerant.

*Note: LCK pin is actually LRCK (left right clock).

The 'L' & 'R' pins are directly connected to the 3.5mm jack. Simultaneous connection to both should be avoided. The 2 'G' pins are connected to ground and are provided for convenience of wiring audio output jacks.

This is a very well designed PCB. It is a shame that this description is not provided elsewhere.

1

DAC BOARD > Raspberry Pi ZeroW connector J8

 SCK         > Not wired (Internally generated)
 BCK         > PIN 12    (GPIO18)
 DIN         > PIN 40    (GPIO21)
 LRCK        > PIN 35    (GPIO19)
 GND         > PIN 6     (GND)
 VIN         > PIN 2     (5V)

Pinouts - Credit Kamran Sethi

Driver setup and Mplayer Software install:

For the command line player on an existing system, the setup instructions are here:

https://support.hifiberry.com/hc/en-us/articles/205377651-Configuring-Linux-4-x-or-higher

enter image description here

1

Got a highly distorted sound when HDMI cable was unplugged. Sound was good again when I touched a ground connection on RPI. So there is some issue with grounding.
Took me a 3 hour search to find the solution. All works fine when SCK is connected to GND. Hope this helps.

  • 1
    I don't know if it is related, but I hooked one up to an ESP32 and it didn't work well until I pull-down the SCK pin to ground – Scott Wood Dec 18 '18 at 15:28

Not the answer you're looking for? Browse other questions tagged or ask your own question.