Hey this sounds great!
To make this easier, you will probably want to fork the https://github.com/radxa/kernel.git repo to your own github account. You can then clone that repo. You can then also push your changes back to your fork of that repo.
After that, the easiest way to understand what you have done is
to link us to the changes on github. Once you get to this stage,
we can also pull your version of the kernel and build it.
I am happy to build what you produce and test is compiles, however I can't test it on the hardware because I don't have any.
Matt
Hello Guysi managed to get the wm8731 ai stereo to work with the radxa rk3399 rockpi 4(b).the steps are basicly the same for the Mainline Kernel and the vendor version which is 4.4.154.
i´m not a coder or kernel guy. and i don´t say this is the perfect way i did it. i do not even know everything i changed is necessary.
so perhaps there are some guys out there who will also post their ideas or help make everything " how a code should be implemented."
The hardware pinout on the rockpi4 is announced to be the same pinout as the rpi this is why i choose the device. you can hook up the device without burning something.
the steps are the nearly the same for both kernel versions. but for mainline you have to choose the mainline audioinjector code from rpi source. i also used the armbian dev build environment making everythin easier.
This is the vendor wiki and the steps describe how to build the vendor kernel
1- Start with "Get the kernel source" and clone/ download the source from github2- cd to the directory " /arch/arm64/boot/dts/rockchip/overlays-rockpi4/ " and add" audioinjector-wm8731-audio.dtbo \ " as line 16 the the Makefile.it should look like:...hifiberry-dacplus.dtbo \
audioinjector-wm8731-audio.dtbo \
raspberrypi-7-inch-lcd.dtbo \
...
3- in the same directory add the file "audioinjector-wm8731-audio-overlay.dts"(the attachment i made )4- in the same directory add the following to the hw_intfc.conf :#audioinjector-wm8731-audio on I2C7. Need set: intfc:i2c7=on
#intfc:dtoverlay=audioinjector-wm8731-audio
5- cd to the directory /sound/soc/rockchip/ an add the following to the Kconfig file :config SND_AUDIOINJECTOR_PI_SOUNDCARD
tristate "Support for audioinjector.net Pi add on soundcard"
select SND_SOC_WM8731
help
Say Y or M if you want to add support for audioinjector.net Pi Hat
6- in the same directory inside the Makefile add to line 36snd-soc-audioinjector-pi-soundcard-objs := audioinjector-pi-soundcard.o
and after the last line addobj-$(CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD) += snd-soc-audioinjector-pi-soundcard.o
7- to the same directory add this file audioinjector-pi-soundcard.c from attachment (original from raspi sourcethe changes to audioinjector-pi-soundcard.c file belongs to the i2c code and to the bclk_ratio inside hw_params
look inside the file i attached and compare with source
8- follow up the vendors guide to build the kernel and to additional steps with "make menuconfig"
and check settings selectedDevice Drivers -> Sound card support -> Advanced Linux Sound Architecture -> ALSA for SoC audio support -> Support for audioinjector.net Pi add on soundcard
also unselect following because for me did some error while compiling :Device Drivers -> Sound card support -> Advanced Linux Sound Architecture -> ALSA for SoC audio support -> CODEC driver -> Rockchip RK3308 CODEC
andDevice Drivers -> Sound card support -> Advanced Linux Sound Architecture -> ALSA for SoC audio support -> CODEC driver -> RK3328 CODEC
9- for example follow the guide building the *.deb packages and install them.
10- booting up should now show the audioinjector stereo device. don´t care about the errors as long as u get from dmesg : audioinjector-stereo sound-ext-card: wm8731-hifi <-> ff890000.i2s mapping ok
11- follow https://www.alsa-project.org/wiki/Setting_the_default_device to select your default deviceand reboot again
don´t forget to unmute the device inside alsamixer
Sorry for my bad english and have fun with your audioinjector stereo on rk3399
Mit freundlichen Grüßen - King regardsSteffen Heilmann
-- Our latest product launching now on Kickstarter : https://bit.ly/2Qr1557 Checkout the community email list : https://lists.audioinjector.net/mailman/listinfo/people