qosch
Posts: 1
Joined: Tue Nov 04, 2014 9:51 pm

Class-D I2S amplifier

Tue Nov 04, 2014 10:38 pm

Hey,
I am currently designing an amplifier for the Raspberry Pi B+ and need some help.
The IC I am using is the TAS5756M made by TI. Here is a link to the datasheet:
http://www.ti.com/lit/gpn/tas5756m
The problem i have is to figure out wich clock signals i need. What I understood so far is that there are three clocks. One is for the PCM signal (can act as input or output), one for the I2C and a master clock. The datasheet says the PCM clock should be generated by an internal PLL from the master clock for best performance.
My question is what pin i should attach the master clock to. It looks like the frequency can be up to 50MHz and is then divided down. To run the sytem at 192kHz at least a 25MHz clock is required. Is there a low-jitter clock source on the GPIO Header available? Or otherwise what frequency can I get out of the GPIO?
The part concerning clocks starts on page 35 in the datasheet.
Have a nice evening
Oskar

java
Posts: 226
Joined: Mon Jul 21, 2014 9:41 am

Re: Class-D I2S amplifier

Sat Nov 08, 2014 6:26 am

From my perspective, if you are building an amplifier, you have no need to worry about clock rates, but if you where building a DAC, I could well understand ...

User avatar
0xFF
Posts: 202
Joined: Tue Nov 20, 2012 7:52 pm
Location: Poland

Re: Class-D I2S amplifier

Sat Nov 08, 2014 12:15 pm

Here is thread about RPi's I2S interface capabilities: http://www.raspberrypi.org/forums/viewtopic.php?t=8496
AFAIK you need external masterclock.

Hanzibal
Posts: 7
Joined: Tue Dec 30, 2014 6:18 pm

Re: Class-D I2S amplifier

Tue Dec 30, 2014 6:29 pm

Hi, I have successfully created a TAS5756m based amplifier board which works with the Raspberry Pi.

I can confirm that it does not necessarily require a master clock.

bertouttier
Posts: 3
Joined: Thu May 28, 2015 7:26 pm

Re: Class-D I2S amplifier

Thu May 28, 2015 7:30 pm

@hanzibal: Did you need extra software for your amp to work? Did you need to write your own kernel module for the TAS5756M or was it supported otb? Thanks!

Hanzibal
Posts: 7
Joined: Tue Dec 30, 2014 6:18 pm

Re: Class-D I2S amplifier

Fri May 29, 2015 12:13 am

Actually no, I found that I could rely on the hifiberry kmod for basic i2s audio and then I just added a script to run a few i2c writes at boot.

Of course, to really take advantage of the chip, I would have to write my own kmod and I think, ALSA driver too.

Please let me know if you are up for it!

bertouttier
Posts: 3
Joined: Thu May 28, 2015 7:26 pm

Re: Class-D I2S amplifier

Wed Jul 01, 2015 5:44 pm

@hanzibal: thanks for your answer! Could you give us the list of commands that you run at boot?

We made a PCB design using the TAS5756M and we are planning on making it open-source. It would be great if we could provide some working software for it :)

Hanzibal
Posts: 7
Joined: Tue Dec 30, 2014 6:18 pm

Re: Class-D I2S amplifier

Wed Jul 01, 2015 7:30 pm

I think it's these i2c writes:

write(0, 0); /* cmd #0 */
write(1, 17); /* cmd #1 */
write(189, 255, 255); /* cmd #2 */
write(37, 26); /* cmd #3 */
write(13, 16); /* cmd #4 */
write(14, 16); /* cmd #5 */
write(24, 1); /* cmd #6 */
write(21, 32); /* cmd #7 */
write(22, 0); /* cmd #8 */
write(23, 0); /* cmd #9 */
write(20, 0); /* cmd #10 */
write(27, 1); /* cmd #11 */
write(28, 15); /* cmd #12 */
write(29, 7); /* cmd #13 */
write(30, 3); /* cmd #14 */
write(40, 0); /* cmd #15 */
write(41, 0); /* cmd #16 */
write(189, 153, 153); /* cmd #17 */

Don't forget to give cred in your open source code :-)

bertouttier
Posts: 3
Joined: Thu May 28, 2015 7:26 pm

Re: Class-D I2S amplifier

Wed Jul 01, 2015 7:52 pm

Ok thanks, we will not forget ;)

Eventually, we got it to work without the i2c commands. But we will check them out anyway. Thanks a lot!

Hanzibal
Posts: 7
Joined: Tue Dec 30, 2014 6:18 pm

Re: Class-D I2S amplifier

Wed Jul 01, 2015 8:41 pm

bertouttier wrote:Eventually, we got it to work without the i2c commands. But we will check them out anyway. Thanks a lot!
That was interesting, could you explain how you managed that without programming the PLL?

Brubacker
Posts: 3
Joined: Thu May 28, 2015 9:39 pm
Location: Herent

Re: Class-D I2S amplifier

Thu Jul 02, 2015 9:52 am

Hanzibal wrote:
bertouttier wrote:Eventually, we got it to work without the i2c commands. But we will check them out anyway. Thanks a lot!
That was interesting, could you explain how you managed that without programming the PLL?
We ended up using the driver for the IQaudIO Pi-DigiAMP+ which is included in Raspbian.
All what was left to do was change the IO pin which we used for the MUTE function.

It worked like a charm with very clear audio coming out of the low quality speakers we attached to it. We used it in combination with Volumio .
The next step will be optimizing the design and putting it all online.

Hanzibal
Posts: 7
Joined: Tue Dec 30, 2014 6:18 pm

Re: Class-D I2S amplifier

Thu Jul 02, 2015 5:11 pm

Ok, well in that case the driver does the programming for you, since I trust you have the i2c lines connected.

If not, I suppose you could just bridge sclk to mclk but that would only work for some resolutions and frequencies. My i2c programming sequence omits the need for an mclk, instead synthesizing that with the PLL derived from sclk.

Is there a full sd card image of your Volumio setup that you could point me to or otherwise?

Brubacker
Posts: 3
Joined: Thu May 28, 2015 9:39 pm
Location: Herent

Re: Class-D I2S amplifier

Fri Oct 02, 2015 8:13 pm

Hanzibal wrote:....
Is there a full sd card image of your Volumio setup that you could point me to or otherwise?
We used the default Volumio SD Card image. And modified the script described in chapter 11 of the IQaudIO manual to unmute our DAC.

We just got the new revision of our boards in, hopefully we can test them soon. This version includes a I²C temperature to act as a fan controller in case it's needed.

erotavlas
Posts: 41
Joined: Wed Mar 11, 2015 5:26 pm

Re: Class-D I2S amplifier

Tue Oct 20, 2015 2:52 pm

Hi,
this is a very interesting project. I made a lot of search on the web with the aim to find a class AB amplifier with integrated DAC and I2S bus. Your solutions is a class D amplifier with at least 96 kHz and at least 100 SNR, but it lacks of 4 output channels of at least 20 W.
I found some IC like TDA7801 http://www.st.com/web/en/catalog/sense_ ... 1/PF217700 that can achieve these performance, but I have not sufficient knowledge in order to design the board. Is there any commercial product with this specification? Do you have any suggestions?

Hanzibal
Posts: 7
Joined: Tue Dec 30, 2014 6:18 pm

Re: Class-D I2S amplifier

Tue Oct 20, 2015 4:29 pm

Well, you could have two TAS5756M chips working together in parallell.

Simply connect the same i2s source to both chips to get dual stereo output of some 30+ watts per channel.

erotavlas
Posts: 41
Joined: Wed Mar 11, 2015 5:26 pm

Re: Class-D I2S amplifier

Wed Oct 21, 2015 7:14 am

Hi,
thank you for your fast reply. Do you know if exist a board with two TAS5756M?
Or can I trivially connect two separate boards two the same raspberry pi?

Hanzibal
Posts: 7
Joined: Tue Dec 30, 2014 6:18 pm

Re: Class-D I2S amplifier

Wed Oct 21, 2015 2:35 pm

I don't know of any commercially available dual-chip add-ons for the RPi and even though I guess the single chip ones are not designed to be stackable onto one another, I suppose it would be possible if the board has i2c adress config jumpers. But trivial, probably not.

qfox
Posts: 1
Joined: Tue Jun 07, 2016 1:09 pm

Re: Class-D I2S amplifier

Tue Jun 07, 2016 1:15 pm

Brubacker wrote:
Hanzibal wrote:
bertouttier wrote:Eventually, we got it to work without the i2c commands. But we will check them out anyway. Thanks a lot!
That was interesting, could you explain how you managed that without programming the PLL?
We ended up using the driver for the IQaudIO Pi-DigiAMP+ which is included in Raspbian.
All what was left to do was change the IO pin which we used for the MUTE function.

It worked like a charm with very clear audio coming out of the low quality speakers we attached to it. We used it in combination with Volumio .
The next step will be optimizing the design and putting it all online.

Did you ever happen to post your design online?

Brubacker
Posts: 3
Joined: Thu May 28, 2015 9:39 pm
Location: Herent

Re: Class-D I2S amplifier

Thu Feb 02, 2017 7:37 am

qfox wrote:

Did you ever happen to post your design online?
The hardware design can be found here it features a small description on configuring your RPi.

Return to “Interfacing (DSI, CSI, I2C, etc.)”