Cheap PCM5102a board working

And what would be the minimum necessary for Pianoteq to behave as expected?

Difficult to say: If you reduce the number of voices (and can live with it) or the sample rate or the buffer size, you can use a “smaller” board if necessary.

I am using the Raspi-3B+ with settings which are ok for my playing (22500 Hz internal Srate, 64 voices, 96 bytes buffer) - perhaps not enough for a pro(?).

The absolute minimum (IMHO): Raspi-2, maybe only working as a toy…

Regards, Holger

fyi, the zynthian with AudioInjector Ultra 2 is showing 16 as well.
But it needs more power and I see the yellow flash again.
I am going to buy a 6A power supply :slight_smile:

1 Like

The PCM5102a is supported quite well (and quite easily) by Raspbian. It requires enabling i2s and dtoverlay=hifiberry-dac but it fails on the standard “Gorgona Omega” SD-image. I wonder if it relates to the GPIO18 conflict you reference (whatever that is). GPIO18 is the bit-clock hence required by the PCM5120a. Could it be that Zynthian uses GPIO18 for another purpose and hence hijacks the pin from the i2s driver?

I2S is quite simple: PCM data is streamed serially on the data line and is clocked into the ADC using the bit-clock. ADC switching (left / right - or even more channels is permissible) is done by the LRCLK. A master clock can drive the ADCs but tying this input to GND makes the PCM5102a generate it internally which is why this chip works with RPi which does not proved a master clock.

[Edit] I am not sure why but it is now working:

Installed “Gorgona Omega” SD-image.
In Web interface:
Set audio interface to HifiBerry DAC+ light
Set display to Generic HDMI display
Set wiring to Dummies
WORKING with display on HDMI and USB mouse pointer. Sound from I2S. USB MIDI input.
It occurred to me after posting this that GPIO18 can’t be relevant because it is used by HiFiBerry DAC+ Light.

3 Likes

I built a prototype zynth on veroboard with a 40 pin IDC connector and a 50 cm ribbon cable (from and old IDE disk drive) connecting to the Raspberry Pi. The I2S output had occasional clicks indicating timing errors. I added a 22pF capacitor between DIN and GND which seems to have solved the issue. This was a bit of adjust-on-test (trial and error) but it seems to have worked.

2 Likes

What is the 48pin-uc-controller board for?

It is actually a 40 pin Maple Mini (clone) STM32 microcontroller providing I2C interface to the rotary encoders (and more). See here and here.

2 Likes

Just had an issue with the sound output from my PCM510x board. No sound coming out. Eventually traced to the I2S board having stopped working. I don’t know if it was muted or just not happy. I had to remove power from the RPi to reset the board. (Powering down the RPi didn’t help because power was still fed to the I2S board so it wasn’t reset.) The PCM510x has power on reset but no other reset mechanism so if it gets upset like this then a power interruption is required.

Hi, I can’t connect this board,Zynthian I don’t see it.

PCM5102

@rozhok can you give some more detail of how you try to connect and configure? Some pictures of the installation and zynthian webconf details for the soundcard would help.

Hi,
I can confirm that these cheap ali express pcm5102 are working using the hifiberry dac light option in webconf.
But I’ve experienced a bunch of xruns. Having a better power supply improves these issues a lot.

I wired it as described on stackowerflow and enabled Hifibery DAC+ Light in webconf. No sound when testing from Zynthian UI (same true for mplayer via ssh).

root@zynthian:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 1: b1 [bcm2835 HDMI 1], device 0: bcm2835 HDMI 1 [bcm2835 HDMI 1]
  Subdevices: 4/4
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
card 2: sndrpihifiberry [snd_rpi_hifiberry_dac], device 0: HifiBerry DAC HiFi pcm5102a-hifi-0 [HifiBerry DAC HiFi pcm5102a-hifi-0]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 3: Headphones [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones]
  Subdevices: 4/4
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
root@zynthian:~# mplayer -ao alsa:device=hw=2.0 /home/pi/zynthian-data/audio/test.mp3
Failed to read /etc/mplayer/mplayer.conf.local: No such file or directory
Warning unknown option include at line 177
MPlayer 1.4 (C) 2000-2019 MPlayer Team
Can't open joystick device /dev/input/js0: No such file or directory
Can't init input joystick
do_connect: could not connect to socket
connect: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing /home/pi/zynthian-data/audio/test.mp3.
libavformat version 58.20.100 (external)
Audio only file format detected.
Clip info:
 Title: 2 Piste audio.mp3
 Artist: 2 Piste audio
 Album: 
 Year: 
 Comment: 
 Genre: Blues
Load subtitles in /home/pi/zynthian-data/audio/
==========================================================================
Opening audio decoder: [mpg123] MPEG 1.0/2.0/2.5 layers I, II, III
AUDIO: 44100 Hz, 2 ch, s16le, 128.0 kbit/9.07% (ratio: 16000->176400)
Selected audio codec: [mpg123] afm: mpg123 (MPEG 1.0/2.0/2.5 layers I, II, III)
==========================================================================
[AO_ALSA] alsa-lib: pcm_hw.c:1711:(snd_pcm_hw_open) open '/dev/snd/pcmC2D0p' failed (-16): Device or resource busy
[AO_ALSA] Playback open error: Device or resource busy
Failed to initialize audio driver 'alsa:device=hw=2.0'
Could not open/initialize audio device -> no sound.
Audio: no sound
Video: no video


Exiting... (End of file)

I don’t know that specific card. It is possible that some of the signals are not tied to default levels. You could add jumpers to pins:

  • FMT to GND (This formats the input as I2S)
  • XMT to VDD (This unmutes output)

Thank You. Now i can hear some cracking sound. When i touch ground on mini jack sound become better for a second but then returns to crackling again (even if i keep my hand on ground).

This is recorded sound of default mp3 from Zynthian:

1 Like

Also connect SLC to GND.

Thank you so much. It works!

SCL is an input for a clock signal but if you tie it to GND the device will create it’s own clock. The chip is very cleverly designed and works well. Watch our for the cryptic dungeon master requesting sound samples.

:face_with_monocle:

hello,

I have soldered a mt32-pi midi hat. There sketches for the PCB are there:

I’ve discovered it works great with Zynthian, the PCM5102a on board and the midi input are recognised perfectly!

2 Likes