Skip to content

MarkusNoll/Allwinner_H3_I2S_Slave

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

Allwinner H3 I2S-Slave Devicetree Overlay

Those are the resources to build up a bidrectional I2S slave interface on an Allwinner H3 SoC (I tested on a OrangePi One) running Armbian.
It uses a custom dummy-codec driver and therefore it can be interfaced as dumb I²S interface to DSPs / FPGAs etc.. and doesn't expect an I²C codec being present. As it is a I2S-slave interface, the BCLK and WCLK must be supply externally to the H3 SoC.

PA19 -> I2S-CLK
PA18 -> I2S-WCLK
PA20 -> I2S-OUT
PA21 -> I2S-DIN

I tested in following configuration: wclk=48kHz, bclk=3.072MHz, 2*32 Bit framing

First step: Build the dummy-codec kernel-module. Just enter $make. Make sure Kernel-Headers are available for your platform.
Second step: Build and install devicetree overlay with $armbian-add-overlay sun8i-h3-i2s0-slave.dts
Third step: Reboot
Fourth step: As the codec-kernel module is only compiled, but not installed, you have to load it manually with $sudo insmod spdif-rxtx.ko. Check other tutorials how to make kernel-modules permanent.

Afterwards, you can check if the devices are present with $aplay -l or $arecord -l
Alsa IO

Afterwards, try making a loopback with: alsaloop -C hw:1,0 -P hw:1,0...

In case you're playing something with MPV or record something, make sure you have set the correct sample-rate.
$ arecord -f S16_LE -r 48000 -c 2 -d 10 -D "hw:1,0" test.wav

$mpv https://edge01.stream.charivari.de/955charivari-webradio?aggregator=charivari_de_link --audio-display=no --audio-channels=stereo --audio-samplerate=48000 --audio-format=s32 --ao=alsa -audio-device=alsa/plughw:CARD=DAC,DEV=0

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published