DAC I2S & Squeezelite

From an audiophile point of view, using some USB DAC is not the best way to have excellent sound quality. In our page about Squeezelite for the Orange Pi Zero, we use an extremely low cost USB DAC based on PCM2704.

I2S is a better way to produce some good quality sound. In this page we are going to use a better component, the PCM5102A, installed on a very cheap card (but at least 2x more expansive than the PCM2704).

  • PCM2704, 4€, USB, 98dB SNR, 16-bit 48kHz, output 0.55V
  • PCM5102, 8€, I2S, 112dB SNR, 32-bit 384kHz, output 2.1V

Ok, the +4€ are worth the price! If you listen only to MP3 you do not need quality, but today a lot of music is available at 24-bit in frequency from 88 to 192kHz in FLAC: the I2S with a good DAC is for you!

Orange Pi Zero does not provide I2S pin. In fact you can but the price to pay is to solder some stuff. So, for less than 15€, you can buy a nice Orange Pi One and use it like a no-brainer solution for I2S.

So below are the 3 steps to install and use the I2S DAC on the Orange Pi One (or other H3 system). Done with Debian version.

For reference:

1/ Connecting the I2S DAC to the Orange Pi One

You can start with this

And because the DAC is powered with voltage between 4.2 to 12V you can use a battery to have a very clean power

2/ Configuring the system

go to boot folder

cd /boot

turn script.bin into fex file and edit

sudo bin2fex script.bin script.fex
sudo nano script.fex

Changes:

[twi1]

twi_used = 1

to

twi_used = 0

[pcm0]

daudio_used = 0

to

daudio_used = 1

Then save the file and

sudo fex2bin script.fex script.bin

And reboot.

3/ Install the Squeezelite Player

Well, before the hard job, we can test if the system is seeing the new DAC :

cat /proc/asound/cards 0 [audiocodec ]: audiocodec - audiocodec audiocodec 1 [snddaudio ]: snddaudio - snddaudio snddaudio 2 [sndhdmi ]: sndhdmi - sndhdmi sndhdmi

Here the snddaudio is present, this is our I2S DAC !

Next, with aplay:

aplay -l **** List of PLAYBACK Hardware Devices **** card 0: audiocodec [audiocodec], device 0: SUNXI-CODEC sndcodec-0 [] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: snddaudio [snddaudio], device 0: SUNXI-TDM0 snddaudio-0 [] Subdevices: 1/1 Subdevice #0: subdevice #0 card 2: sndhdmi [sndhdmi], device 0: SUNXI-HDMIAUDIO sndhdmi-0 [] Subdevices: 1/1 Subdevice #0: subdevice #0

Ok, smells good.

Try this

sudo speaker-test -twav -c2 -Dhw:1

and you should be able to listen something.

Well, if everything is ok, let's install the Squeezelite player: (near) all the information is the same as the OPZ. Please read the lines below before the installation to be able to select to correct DAC.

Then ask for a list:

sudo /usr/bin/squeezelite-armv6hf -l Output devices: null - Discard all samples (playback) or generate zero samples (capture) default:CARD=audiocodec - audiocodec, - Default Audio Device sysdefault:CARD=audiocodec - audiocodec, - Default Audio Device dmix:CARD=audiocodec,DEV=0 - audiocodec, - Direct sample mixing device dsnoop:CARD=audiocodec,DEV=0 - audiocodec, - Direct sample snooping device hw:CARD=audiocodec,DEV=0 - audiocodec, - Direct hardware device without any conversions plughw:CARD=audiocodec,DEV=0 - audiocodec, - Hardware device with all software conversions default:CARD=snddaudio - snddaudio, - Default Audio Device sysdefault:CARD=snddaudio - snddaudio, - Default Audio Device dmix:CARD=snddaudio,DEV=0 - snddaudio, - Direct sample mixing device dsnoop:CARD=snddaudio,DEV=0 - snddaudio, - Direct sample snooping device hw:CARD=snddaudio,DEV=0 - snddaudio, - Direct hardware device without any conversions plughw:CARD=snddaudio,DEV=0 - snddaudio, - Hardware device with all software conversions default:CARD=sndhdmi - sndhdmi, - Default Audio Device sysdefault:CARD=sndhdmi - sndhdmi, - Default Audio Device dmix:CARD=sndhdmi,DEV=0 - sndhdmi, - Direct sample mixing device dsnoop:CARD=sndhdmi,DEV=0 - sndhdmi, - Direct sample snooping device hw:CARD=sndhdmi,DEV=0 - sndhdmi, - Direct hardware device without any conversions plughw:CARD=sndhdmi,DEV=0 - sndhdmi, - Hardware device with all software conversions default:CARD=DAC - USB AUDIO DAC, USB Audio - Default Audio Device sysdefault:CARD=DAC - USB AUDIO DAC, USB Audio - Default Audio Device front:CARD=DAC,DEV=0 - USB AUDIO DAC, USB Audio - Front speakers surround21:CARD=DAC,DEV=0 - USB AUDIO DAC, USB Audio - 2.1 Surround output to Front and Subwoofer speakers surround40:CARD=DAC,DEV=0 - USB AUDIO DAC, USB Audio - 4.0 Surround output to Front and Rear speakers surround41:CARD=DAC,DEV=0 - USB AUDIO DAC, USB Audio - 4.1 Surround output to Front, Rear and Subwoofer speakers surround50:CARD=DAC,DEV=0 - USB AUDIO DAC, USB Audio - 5.0 Surround output to Front, Center and Rear speakers surround51:CARD=DAC,DEV=0 - USB AUDIO DAC, USB Audio - 5.1 Surround output to Front, Center, Rear and Subwoofer speakers surround71:CARD=DAC,DEV=0 - USB AUDIO DAC, USB Audio - 7.1 Surround output to Front, Center, Side, Rear and Woofer speakers iec958:CARD=DAC,DEV=0 - USB AUDIO DAC, USB Audio - IEC958 (S/PDIF) Digital Audio Output dmix:CARD=DAC,DEV=0 - USB AUDIO DAC, USB Audio - Direct sample mixing device dsnoop:CARD=DAC,DEV=0 - USB AUDIO DAC, USB Audio - Direct sample snooping device hw:CARD=DAC,DEV=0 - USB AUDIO DAC, USB Audio - Direct hardware device without any conversions plughw:CARD=DAC,DEV=0 - USB AUDIO DAC, USB Audio - Hardware device with all software conversions

Note 1: snddaudio is here, it's perfect

Note 2: you can also see the PCM2704 connected here, name is DAC on the line with USN AUDIO mention.

So, to use the I2S DAC use the command

sudo /usr/bin/squeezelite-armv6hf -o hw:CARD=snddaudio,DEV=0 -s 192.168.1.120

sudo /usr/bin/squeezelite-armv6hf -o hw:CARD=snddaudio,DEV=0 -s 192.168.1.120

sudo /usr/bin/squeezelite-armv6hf -o hw:CARD=snddaudio,DEV=0 -s 192.168.1.120

Note: replace the IP address of your server (or nothing for autodetect)

Sonic performances

Well, PCM2407 is just enough to see a movie or a sport event. To listen to music, it's not very engaging. It sounds flat (no 3D image), not very clear, and after few minutes you just want to stop the music. And also few little annoying points are present: big noise in the speakers when power on / off, some numeric scratch (i suppose clock errors and resynchronisation), and a low output level (.55V), not enough power when you want to listen loud.

In the other side, the PCM 5102A is so many times more musical, powerful and user friendly. With the I2S DAC connected, there is an efficient mute system to avoid noises when power on / off, no numeric scratch and the output level is 2.1V : it's a respectable high level and you can drive directly your amplifier with that. Note for headphone users: if you use for example an AKG K702 at 62 ohms the sound level is sufficient but not crazy.

To be confirmed: PCM2704 requires a restart of squezeelite at least one per day. You can let PCM5102A always on!

In term of sonic performances, it's purely incredible for something at 8€. I have a multi thousands euros system as a reference, a more than excellent source with SPDIF output build by TVC Audio and their best in the world ultra low jitter clock, a numeric hub with a buffer and resync system with high quality clock and one of the best huge DAC in the world... And frankly speaking, I can live many weeks with the 8€ DAC without suffering. The I2S DAC propose an open 3D image, there is plenty of energy / dynamic everywhere, sound is clean and detailed. It is just lacking some details in the highs, but only when you know you can have more. So, it is more than the bargain of the century: it is the proof that you can have an excellent audio source for less than 20€ (one Orange Pi One and one I2S DAC).

Another information: the DAC is able to manage 24 bits (and more) and 192kHz (and more), so for the persons who attach importance to these figures, it is a natural winner.

And I think I have to test it powered by a battery (and my amp to, so it means all audio system powered by batteries, no more power pollution from the wall plug).

If you want read some information about DAC, a good start is from Texas Instruments here :

http://www.ti.com/lit/an/sbaa055/sbaa055.pdf

After the reading you will understand why there is no noise between two tracks using the Delta Sigma DAC, among other little things.