What is difficult with I2S you say? Connect the wiring to the right pins and everything works.

I thought so too, but with the Omega2 minicomputer it turned out to be not so simple. Therefore, I decided to write this article.
Let's start with what I achieved in the end. I connected the TDA1543 microcircuit (I2S stereo DAC with 16 bit amplitude resolution) to the Omega 2 microcomputer. The sound is good, I enjoy listening to the Internet radio station (there should be a joke about audiophile and a warm tube sound). However, I still did not understand the reason for overloading the audio, but only learned how to get around it using the crutch method. And I would really like to hear your ideas on this.
Maybe someone does not vkurse what Omega2. This is a minicomputer on which Linux is based on LEDE, which is essentially an offshoot of OpenWRT. MT7688 processor, 64 MB RAM and 16 MB Flash. In general, you can read more on
Wikipedia ,
here and
here .
It is also important to note that all actions are performed on the original firmware version 0.2.0.And now, let's talk a little about the
pain of how I came to this.
To begin with, everything is transparent, we connect all the I2S TDA's and Omega lines. This is appropriately the CLK clock signal line, the WS channel synchronization line, the DATA data line and the GND line. Plus, we add a couple of resistors and capacitors, but the main thing is the 7-leg trimmer TDA1543. On this leg, you need to apply a zero offset, on this I first fell asleep. The fact is that the TDA1543 microcircuit, unique for its time, is powered by unipolar power. Well, the sound signal is fluctuations with respect to 0 down and up, so you need to shift this zero in the middle of the supply voltage range and get fluctuations relative to this point. In the datasheet, everything is painted, but initially I collected a circuit with a conventional resistor (from these of your Internet sites) and got distortions that I did not understand for a long time. Put a variable resistor and achieve zero offset in the absence of a signal at the input (rest mode) 1.3-1.5 V (at 3.3 V supply). It turns out the following scheme.

Further, following the actions from the
official site onion, we are upgrading to develop the firmware version, to which I2S support was added (I wanted to write in less than a year, but no ... passed). We update and install the necessary packages for sound:
opkg update opkg install alsa-utils mpg123
Switch GPIO to I2S mode with the command:
omega2-ctrl gpiomux set i2s i2s
We copy the test wav file, I used Suzanne Vega - Tom's Diner according to the classics. And try to play using aplay:
aplay za_sebya_i_za_sashky.wav
And hear the distortion. Just a lot of hard overload. There are so many that it may seem that you returned in 2007. But the percussion of the song can be traced in it, it means something is working there, right?
I tried to turn down the volume in alsa mixer - to no avail, because the driver is tuned to the MAX98090 chip, which is controlled by I2C and, accordingly, all settings are simply sent to I2C, and the I2S data itself does not change.
Ok, open the datasheet on MAX98090. And we start to smoke. The microcircuit supports many input data formats: I2S / LJ / RJ / TDM and it can digest a large bit. And the MT7688 processor itself can also be bigger and faster than the Tdashka. Maybe data problems in I2S?
I went gradually poking around with an oscilloscope.
Bit rate 16 bits? Yes. I hung on one channel line WS on another channel line CLK. And convinced of the length of the pulses WS - 16 cycles.
Incorrect working frequency? Not. Frequencies are all appropriate workers. WS - 44100 Hz, CLK - 1411200 Hz.
The format of the type of numbers in the data? The correct character format is used (yes, I thought that unsigned is needed). Checked by creating artificial sines and moving them up and down relative to 0 in the audacity and changing the amplitude. There are no qualitative changes.
Is there generally I2S? probably yes. Firstly, because then everything worked for me (well, or so it seems to me), and secondly, I tried to check with an oscilloscope, although without a logic analyzer it is of course difficult. It may be worthwhile to conduct a more accurate test and bring your Beaglebone here.
It seems that everything is correct, and the guys from the onion forum are working, but the truth is on other chips: MAX98357A and PCM5102. In general, I give up the idea of playing wav'ki and looking for mpg123 to play mp3s. I chop with the -C flag and start to turn down the volume. And here I sat down. When setting the volume level in the mpg123 program at about 1 percent, I get a great sound. Chip swinging at full amplitude. I start the radio with the -f 128 flag:
mpg123 -f 128 http:
And I am greeted by the sounds of a relaxing American blues. By the way, the link to the radio may not be working, I took it
from here .

I start the ramp and gradually increase the amplitude. As a result, I saw that the distortions are chaotic jumps from 0 to the supply voltage and the higher the level the more these jumps. It took several weeks to get Omega to speak. I was very tired and therefore, at this moment I decided to stop - it works the same!
However, I understand that this is impossible so I will be glad to hear your ideas and suggestions. Well, for those who are trying to make Omega speak in torments, I hope I helped you!
Thanks to all!