I²S DACs - dwhinham/mt32-pi GitHub Wiki

The Raspberry Pi's built-in 3.5mm stereo jack (on non-Zero models) is a simple PWM device, and not designed for high-fidelity audio. This becomes very obvious when you use mt32-pi - distortion in the sound is apparent when quieter sounds are playing.

Luckily, a plethora of inexpensive DAC (digital-to-analog converter) hardware is available for the Raspberry Pi, giving it true hi-fi quality audio output. These often take the form of an easy-to-install "HAT" board that you place onto the Raspberry Pi's GPIO pins. They make use of the Raspberry Pi's I²S bus for interfacing.

⚠️ Note: We do not support any kind of USB DAC audio output device, due to the lack of drivers in the Circle baremetal framework that we depend on. Adding USB audio support to Circle would be a huge undertaking, although if that changes in the future and Circle gains USB audio support, we could certainly make use of it.

Setup

mt32-pi defaults to PWM (3.5mm jack) output. Edit mt32-pi.cfg and change output_device to i2s to enable the I²S DAC driver.

Compatibility

Many Raspberry Pi DACs are based on the popular Texas Instruments PCM5xxx series of chips, which work well. The NXP UDA1334 is also reportedly working well.

Some more advanced DACs are configured by software (normally a Linux driver), whereas others need no configuration as they are preconfigured in hardware. DACs requiring software initialization will be automatically probed and configured at startup if they are supported.

Feel free to open an issue if you'd like to help us support your DAC, or even just to report success or failure so that we can build a list of supported DACs.

The following models of DAC have been confirmed as working by our testers. Please note the necessary configuration file options.

Manufacturer Device DAC chip Additional config file options Comments
Arananet PI-MIDI UDA1334 None required Stereo RCA output. Custom design by @arananet also with GPIO MIDI in. Tested by @dwhinham.
Blokas Pisound PCM5102A Ensure sample_rate is set to 48000, 96000, or 192000 Stereo 6.35mm output, volume knob, and integrated SPI MIDI interface. Tested by @dwhinham and @sigkill.
chris-jh mt32-pi-midi-hat PCM5102A None required Stereo 3.5mm output. Custom free/open source design by @chris-jh also with GPIO MIDI in. Tested by @gmcn42.
Generic [GY-PCM5102](/dwhinham/mt32-pi/wiki/GY-PCM5102-DAC-module) PCM5102A None required Stereo 3.5mm output. Found very cheaply on AliExpress and other sites. Tested by @dwhinham.
Generic MAX98357 DAC +Class D Amp MAX98357 None required 3W 4ohm mono speaker output. Very small and cheap on AliExpress. Tested by @gaai.
Generic Pi-Fi DAC+ v2.0 PCM5122 None required Stereo RCA and 3.5mm output. Tested by @rc55.
gmcn42 clumsyMIDI PCM5102A None required Stereo 3.5mm output. Custom free/open source design by @gmcn42 also with GPIO MIDI in and out/thru. Tested by @gmcn42.
HiFiBerry DAC+ ADC PCM5122 None required Stereo RCA output. Tested by @kgorphanides.
innomaker HiFi DAC HAT PCM5122 None required Stereo RCA and 3.5mm output. Not compatible with hd44780_4bit displays. Sample rates of 44100, 48000 88200 and 96000 reported working by @Knosys6 1, however @alexras reports "sampling artifacts" unless set to 44100 2. Also tested by @calvinmorrow and @rsn8887.
IQaudIO Pi-DAC Pro PCM5242 None required Stereo RCA and 3.5mm output. Tested by @dwhinham.
Waveshare WM8960 Audio HAT WM8960 None required Stereo 3.5mm and wired speaker outputs. Tested by @probonopd.