Install "rpi-source" software.
The "rpi-source" command automaticaly downloads the kernel source that matched running linux kernel version.
https://github.com/notro/rpi-source/wiki
to install:
sudo wget https://raw.githubusercontent.com/notro/rpi-source/master/rpi-source -O /usr/bin/rpi-source && sudo chmod +x /usr/bin/rpi-source && /usr/bin/rpi-source -q --tag-update
Install dtc by package system.
sudo apt-get install device-tree-compiler
If bc is not installed, must install bc.
sudo apt-get install bc
The GCC version must match the gcc that used to build the kernel, the required version can be checked by
sudo cat /proc/version
Install GCC-4.9.x by package system.
sudo apt-get install gcc-4.9 g++-4.9
Change default GCC
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 10
update-alternatives --config gcc
Check GCC version is 4.9.x.
gcc --version
Choose place of kernel source files & directory, e.g. '.' current folder.
rpi-source -d .
if rpi-source gives kernel version mismatch, use
sudo apt-get install raspberrypi-kernel-headers
make
sudo make modules_install
make dtbs
sudo make install_dtbo
remove existing dtoverlay Add following lines.
dtoverlay=hifibunny3-q2m
dtparam=i2c_arm=on
Use aplay -l command to check audio card is added.
aplay -l
sudo nano /etc/sysctl.conf
add following to the end of the file:
net.core.default_qdisc=fq
net.ipv4.tcp_congestion_control=bbr
In terminal, run:
sudo sysctl -p
check:
sysctl net.ipv4.tcp_congestion_control
This driver only works with the ES9038Q2M DAC connected through i2c/i2s.
Supports volume control and DoP, tested on Moode Audio. SoX resampling needs to be set to '32 bit/ *kHz' for proper DoP function.
DAC is setup in MASTER mode with NCO to support both 44.1KHz and 48KHz family with a single crystal.
Crystal freq is assumed to be 100MHz, if other freq are used, ES9038Q2M_NCO_0~ES9038Q2M_NCO_3 values need to be adjusted.
ES9038Q2M datasheet can be found at http://file2.dzsc.com/product/18/05/25/829029_170233543.pdf (I do not manage this site).