Page 1 of 1

Sound recording using I2S

Posted: Fri Sep 30, 2016 4:18 pm
by jab
Hello,

The problem regards to this platform:
VoCore1 + dock2.0. OpenWRT 15.05 (14.07 can't boot when compiled on my own, but there isn't significant difference between 14.07 and 15.05 so far I know)

I'm trying to record sound through I2S lines. I can see on oscilloscope and logic analyzer, that clocks and data signals are correct. I can even play data recorded by logic analyzer and the sound is good. But when it goes through I2S controller and DMA, the sound is corrupted. There is periodic clacking noise in whole record (and in the beginning there are some data drop-outs, but this isn't problem for me).
So far I tried to modify both Ralink GDMA and I2S drivers, change burst size, add write memory barrier (wmb() ) when writing to registers, set 'coherent' bit in DMA controller, tried to change clock frequency, ... but nothing helped. In order to determine whether problem is caused by DMA I also tried periodic reading data directly from I2S Read FIFO register with DMA disabled (I wrote my driver for this purpose)... but nothing solved the problem :(

Did someone encountered the same or similar problem?

Thanks

Re: Sound recording using I2S

Posted: Mon Oct 03, 2016 2:02 am
by Vonger
Please check the attachment, mt7628 i2s driver, also my github https://github.com/Vonger/openwrt-chaoscalmer.
I find similar issue and solved them, the patch is for mt7628, you might need to change some registers.
And also please share your code so I will know what is wrong.

Re: Sound recording using I2S

Posted: Tue Oct 04, 2016 10:49 am
by jab
Thank you for reply. Did you test the I2S sound record works on VoCore 2 with your drivers?

I'll try to adjust your drivers for VoCore 1 and let you know whether I was success or not. For the present I couldn't figure out what's wrong in driver code that causes the data corruption...

Re: Sound recording using I2S

Posted: Thu Oct 06, 2016 12:41 pm
by Vonger
Ye, but I suggest you do not use DMA at first, just make everything work, then add DMA, step by step will make it easier.