Audio with high peaks can saturate the output op-amp.
The op-amp is configured to provide 2x gain. The circuit is the reference circuit from the dsPIC33/PIC24 FRM DAC manual. The problem is that when you get a voltage going in that is too high (it could be up to about 3.3v) the op-amp tries to amplify that to greater than the 3.3v supply voltage. This causes lots of distortion.
What to do about it?
Well, powering the op-amp off a higher voltage (the 5V feed) would give more headroom, or changing the circuit to give just 1x gain would get around the problem.
The issue with the former is that of noise - the 5V signal isn't very clean, being full of clicks and buzzes from the Arduino, and the SD card.
The issue with the latter is that the 2x gain is a result of the combining of the differential outputs of the dsPIC DAC. There are 2 unused resistors in the left-hand (of the three together) 10K array, so it might be possible to parallel these with the existing 10K feedback resistors to halve the gain. It would make the whole thing quieter though.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If you want to modify your boards to use a gain if 1, it's quite simple. All you need is 2 10K through-hole resistors (I use 1/8w ones - the smaller the better). Solder them directly to the pins of the op-amp. One goes between the middle two pins on the side towards the three resistor packs (pins 6 and 7). The other goes on pins 1 & 2 - that's on the side towards the edge of the board, and directly under the eP of WavePro (the two pins nearest the output jack).
Directly driving small speakers (eg 8Ω ones) is very quiet.
There is no power amplifier in the board. It is aimed at being linked to an amplifier or mixer for sound reproduction. There is the option of small daughter boards that can plug in to the top end of the board, and a power amplifier daughter board is a possibility for those who want to directly drive small speakers. This could also include a traditional potentiometer based volume control.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This is due to the DAC being disabled when a track stops playing and enabled again when the next one starts. It helps to reduce hiss between tracks, but the pop is annoying. An enableDAC() and disableDAC() pair of commands which will allow you to manually turn the DAC on and off when you want to will cure the problem.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The sound output jack socket is too close to the USB socket on the Arduino.
The low profile nature of the jack sockets means that some larger jack plugs won't fit properly and press against the USB socket on some Arduino boards. This causes the whole shield to lift slightly. While not a problem electrically (all connections are still sound) it's not an ideal situation. Cure: Initially, if it is a problem, I suggest connecting to the 3 pin "OUT" header next to the jack socket using a flying lead, or using a smaller jack plug if possible. Longer term, I am thinking of swapping over the jack/header pairs so the header is on the inside and the jack is on the outside. This would move the socket a few mm to the side of the USB port and should allow easier access using larger cables.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Audio with high peaks can saturate the output op-amp.
The op-amp is configured to provide 2x gain. The circuit is the reference circuit from the dsPIC33/PIC24 FRM DAC manual. The problem is that when you get a voltage going in that is too high (it could be up to about 3.3v) the op-amp tries to amplify that to greater than the 3.3v supply voltage. This causes lots of distortion.
What to do about it?
Well, powering the op-amp off a higher voltage (the 5V feed) would give more headroom, or changing the circuit to give just 1x gain would get around the problem.
The issue with the former is that of noise - the 5V signal isn't very clean, being full of clicks and buzzes from the Arduino, and the SD card.
The issue with the latter is that the 2x gain is a result of the combining of the differential outputs of the dsPIC DAC. There are 2 unused resistors in the left-hand (of the three together) 10K array, so it might be possible to parallel these with the existing 10K feedback resistors to halve the gain. It would make the whole thing quieter though.
Yep, reducing the gain to 1 helps quite a lot.
If you want to modify your boards to use a gain if 1, it's quite simple. All you need is 2 10K through-hole resistors (I use 1/8w ones - the smaller the better). Solder them directly to the pins of the op-amp. One goes between the middle two pins on the side towards the three resistor packs (pins 6 and 7). The other goes on pins 1 & 2 - that's on the side towards the edge of the board, and directly under the eP of WavePro (the two pins nearest the output jack).
Last edit: Majenko Technologies 2012-10-27
Directly driving small speakers (eg 8Ω ones) is very quiet.
There is no power amplifier in the board. It is aimed at being linked to an amplifier or mixer for sound reproduction. There is the option of small daughter boards that can plug in to the top end of the board, and a power amplifier daughter board is a possibility for those who want to directly drive small speakers. This could also include a traditional potentiometer based volume control.
There is a pop, or click, between tracks.
This is due to the DAC being disabled when a track stops playing and enabled again when the next one starts. It helps to reduce hiss between tracks, but the pop is annoying. An enableDAC() and disableDAC() pair of commands which will allow you to manually turn the DAC on and off when you want to will cure the problem.
The sound output jack socket is too close to the USB socket on the Arduino.
The low profile nature of the jack sockets means that some larger jack plugs won't fit properly and press against the USB socket on some Arduino boards. This causes the whole shield to lift slightly. While not a problem electrically (all connections are still sound) it's not an ideal situation. Cure: Initially, if it is a problem, I suggest connecting to the 3 pin "OUT" header next to the jack socket using a flying lead, or using a smaller jack plug if possible. Longer term, I am thinking of swapping over the jack/header pairs so the header is on the inside and the jack is on the outside. This would move the socket a few mm to the side of the USB port and should allow easier access using larger cables.