I think I've found the problem. It seems that the connection with jumper wires isn't very stable, causing distortion—which made me mistakenly think there was an issue with the headphone (HP) volume control. However, once the distortion occurs, it persists, and the only way to fix it is to power the device off and on again.I'm configuring the SGTL5000 REV 2D Audio Shield for the channel I2S_IN->DAC->HP, but the sound is extremely quiet. Even adjusting the CHIP_ANA_HP_CTRL register doesn’t boost the volume at all. Could any kind friend share a working configuration file with me?
However, I'm quite confused: in the schematic of the Audio Adaptor Boards for Teensy, HP_VGND is connected to the headphones, instead of being left floating as in the classic example from the SGTL5000 datasheet.I'm configuring the SGTL5000 REV 2D Audio Shield for the channel I2S_IN->DAC->HP, but the sound is extremely quiet. Even adjusting the CHIP_ANA_HP_CTRL register doesn’t boost the volume at all. Could any kind friend share a working configuration file with me?
However, I'm quite confused:
Thank you so much for your reply and guidance. First of all, there was a slight mistake in my first message—what I described earlier was actually caused by my own error. I’m using an STM32 to implement music playback on the Teensy Audio Shield for SGTL5000 verification, and I referenced your Teensy Audio Library. The project is now running extremely successfully with excellent results (except for occasional minor issues, which are likely due to my wiring). Your Teensy Audio Library and Teensy Audio Shield have been incredibly helpful to me, and I truly appreciate your support.I'll try to explain, because the datasheet probably doesn't make this clear...
Like pretty much all audio chips with single power supply, the audio signals have a DC bias. It's approx 1.5V to 1.6V for chips running from 3.3V, though the exact bias voltage depends on the chip's design. So when the signal has 1 volt peak (or 2 volt peak-to-peak) amplitude, when the audio signal is at its +1V relative peak, the actual voltage relative to the chip GND is 2.5V. And when the audio signal is at -1V relative peak, the actual voltage is 0.5V. Audio from single supply chips pretty much always has to work this way because the chip has only 1 power supply and it needs to create output by using transistors which conduct (source) current towards either the power supply voltage or (sink) current towards GND.
Headphones or speakers which are just a coil of wire can't handle DC voltage. They can only accept AC. If you give them DC, the coil is just a wire rather than an impedance expected at audio frequencies. You have to somehow give the speaker coil only the AC part of the signal without subjecting it to the DC bias voltage.
When designing a PCB with SGTL5000 for headphone output, you can use large capacitors to block the 1.5V DC bias voltage, as that reference schematic does. With many codec chips on the market, that's your only option. But SGTL5000 has a feature which eliminates the need for those big capacitors. Or you can connect the headphone ground to HP_VGND, which is basically a 3rd high current output that is just the DC bias voltage, approx 1.5V DC. The headphones and the electrons flowing through them don't "know" about the PCB's GND or Earth GND. They do as electrons always do, flow according to voltage and impedance. Each headphone coil sees only the AC voltage, because its "ground" wire is connected to the DC bias voltage.
Now that I've spent some time to explain this SGTL5000 feature, I want to specifically ask if you have actually used with Teensy Audio Shield and Teensy Audio Library? Which Teensy are you using? It's very easy to run pretty much any of the example and plug in headphones to hear it really does work.
[ EDIT: I see that @PaulStoffregen beat me to the punch !! ]
Notice that the Teensy Audio Adapter does not have any capacitors between the SGTL5000 & the headphone jack. Also take note of the statement on the snipped example schematic that you provided "Note: Cap-coupled headphone design shown here. For capless design, see 32QFN Typical Application Schematic." That example schematic (included below) shows connectivity just like exists on the Teensy Audio Adapter. Also, pay particular attention to the warning about never connecting HP_VGND to GROUND !!
Mark J Culross
KD5RXT
View attachment 38419
[ EDIT: I see that @PaulStoffregen beat me to the punch !! ]
Notice that the Teensy Audio Adapter does not have any capacitors between the SGTL5000 & the headphone jack. Also take note of the statement on the snipped example schematic that you provided "Note: Cap-coupled headphone design shown here. For capless design, see 32QFN Typical Application Schematic." That example schematic (included below) shows connectivity just like exists on the Teensy Audio Adapter. Also, pay particular attention to the warning about never connecting HP_VGND to GROUND !!
Mark J Culross
KD5RXT
View attachment 38419
It's incredibly helpful—thank you so much![ EDIT: I see that @PaulStoffregen beat me to the punch !! ]
Notice that the Teensy Audio Adapter does not have any capacitors between the SGTL5000 & the headphone jack. Also take note of the statement on the snipped example schematic that you provided "Note: Cap-coupled headphone design shown here. For capless design, see 32QFN Typical Application Schematic." That example schematic (included below) shows connectivity just like exists on the Teensy Audio Adapter. Also, pay particular attention to the warning about never connecting HP_VGND to GROUND !!
Mark J Culross
KD5RXT
View attachment 38419
There is finite isolation between the lineout and the headphone. My application is a radio transceiver. In CW mode (Morse code), there is a very strong audio tone sent out on both left and right line out. With the headphone muted using the muteHeadphone() function, I can hear a faint tone in the headphones. I mean very faint; barely audible. But it is definitely there. I passed a hearing test earlier this year, so I can confidently say the tone in the headphones is indeed very low.I just gave it a try—when feeding I2S data into DOUT, there seems to be faint music coming from the headphone (HP) output under some incorrect configuration (even with no setup at all and I2C not used). It’s probably still my mistake, just a little detour. Haha!
There is finite isolation between the lineout and the headphone. My application is a radio transceiver. In CW mode (Morse code), there is a very strong audio tone sent out on both left and right line out. With the headphone muted using the muteHeadphone() function, I can hear a faint tone in the headphones. I mean very faint; barely audible. But it is definitely there. I passed a hearing test earlier this year, so I can confidently say the tone in the headphones is indeed very low.
No circuit has perfect isolation. Just a guess, the isolation is 60dB+, but I have no way to measure it. The leakage path could be either on the chip itself, the chip package (via shared common ground), or in the PCB design. This level of leakage is totally acceptable. No user will complain, because the user won't ever have the headphones on under this condition (radio configured to use speaker).