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.