Daily Archives: 2024-04-16

VoCore2: OpenWrt 23.05 Sound Part

Finally sound part works. Thanks to contributor patches.

The problem is caused by DMA did not correctly stopped before I2S stop, then DMA write to invalid memory address then casued watch dog reset the hole system, no oops.

Patches has upload to: https://github.com/Vonger/vocore2/tree/master/openwrt.2305

OpenWrt source code patch openwrt.patch folder, linux kernel patch at kernel.sound folder, need to copy to target/linux/ramips/patches-5.15

In menuconfig, need to select kmod-mt7628-es8388, kmod-i2c-mt7628 etc… For simple just copy menu.config to .config in your openwrt folder, will compile everything.

VoCore2: OpenWrt 23.05 Part2

Continuing with my last blog, the sound part. Last time I found there was a problem, some kernel code was broken because I could patch and compile it but once I ran aplay the kernel would crash.

I checked openwrt 18 and openwrt 19, the patch worked well for both of them, but from openwrt 20, the latest version, none of them worked.

I compared their source code about the sound card main reference clock, its output 12M was normal; I2C, I2S, which were used to control and send data, this part was normal too; sound card part driver es8328.c and es8328-i2c.c both seemed fine to me. Only one doubt was the DMA driver, we sent data to memory and it carried data to I2S then the sound card played sound. One more thing was DMA driver was moved to staging in linux kernel, that meant somebody found the problem too. If DMA has any bug like writing data to a place that surprises the kernel, the unhappy kernel crashes with no apparent reason and reboots itself.

So its time to hack the linux kernel again…Good luck to me.

I think the DMA driver’s source code has not changed, but the linux kernel somehow has changed. That brought a new problem. The code is in drivers/staging/ralink-gdma/ralink-gdma.c, this linux kernel is 5.15.137.