This project is continuation of Onion music server project of mine. Main motivation is improve sound quality and get rid of some Onion wierd issues that i have no skills nor time to solve. Project unique is i2s connection application for OrangePi Zero board that have no I2S soldered out by vendor. Also i see this as good example of working with cheap alternatives to raspberry boards - as you will see something that you would expect to work out of the box - will take a lot of your time in fact to make it work. As this is not finished, i don't have fancy pictures of finished project, but i need to put it down now or never.
Kidding, but for comparison i really did started with that and configured everything i would like to have from this project on '5$' raspberry zero. So here it is
What is missing on that images is external usb ethernet card and amp that was used in previous project. In fact i will reuse amp setup in every following configuration since amp part is equally compatible with onion, raspberrypi or orangepi configuration. Green relay module will be described later, but is essentially same relay module that i've used in prev project. But back to topic.
3) last step is to configure relay module. and i will describe it in next instruction since it is exactly the same as for OrangePI. And this project is actualy for latter one, so let's leave something for it.
Next step is actually start adopting this basic setup to OrangePI Zero.
Step #1 - Connect I2S Sabre sound card
I started working with OrangePI Zero for the sake of price and simplicity. And immediately were struck by the fact that vendor forgot to solder I2S on the board header. In early versions this was solvable by soldering couple of resistors on the board (more details here) but in my revision this possibility was removed. Technicaly speaking the probem is that PA20/PCM0_DOUT pin is used by vendor to enable and disable WIFI module and not available for my use anymore.
This is from early version schematics, but since newer is not published i will work with this one
So what i will do - i will solder out wifi power switch completely (and lose it forever, since i don't need it, but there is also an option also to enable it permanently) and add wire to unit's solder pad.
We are looking for tsot-5 element
And we will find it near wifi chip
(sorry, forgot to make 'before' photo, so this is soldered out state). Pad #3 is where we should solder PA20 header and pad #5 we should solder to +5V to enable wifi permanenty. In my case i skip last part.
Then other connections will look like this:
So far that's it, relay module will be covered later.
Next step is configure Sound Card in Armbian.
Step #3 - Configure I2S sound card
Since Armbian 5.30 it switched to device tree to setup device perepherials. Along with this change somehow a lot of features lost their support, therefore it is not as straightforward to enable I2S.
I prepeared github repo to do it quickly
So first get it from github
git clone https://github.com/anabolyc/pcm5102a-for-armbian-orangepi-zero
We need to add user overlays to enable I2S (disabled by default) and enable sound card on that port
sudo armbian-add-overlay i2s-sound.dts
this will compile overlay script, put compiled file under /boot/overlay-user and add to /boot/armbianEnv.txt line
You need to reboot to changes to take effect, but this will not work just yet. Problem is we are referencing to pcm5102a kernel module there, and this one is not included to armbian for some reason. Therefore we will build it on the same board using current kernel sources. So please check if you have build symlink
$ ls -al /lib/modules/$(uname -r)/build
lrwxrwxrwx 1 root root 36 Nov 17 13:42 /lib/modules/4.14.78-sunxi/build -> /usr/src/linux-headers-4.14.81-sunxi
Iif it is missing - just create it manually be running