I2S Read and Write - Stops after 10 sec

We are working with Audio codec interface with Hikey960 . We are facing some issue while we run i2s read and write operation. We are using tinyplay for testing i2s read and write operation .

Issue is that when we run the command tinyplay sine1hz.wav -d 1 on hikey960
It prints following details.

Playing sample: 2 ch, 48000 hz, 16 bit 1920000 bytes

But after 10 seconds we are getting error message as below,

Error playing sample and the application stops .

We run the ‘strace’ command over the same function . It has been noticed
at line 581: mmap failure.
at line 591: IOCTL Failure.

Is it related to any kernel version issue ? Any body have idea on this.
Is there any other method for testing i2s read and write operation from audio codec ?
Can any body help me to fix this issue .

Anything actually happening on the i2s pins?
What kernel version (including head commit) are you running?
What are the exact changes you made to it to accommodate your codec(s)?

Yes . While we check the i2s pin by using Oscilloscope we could find pulse coded data on i2s pin until wave file playing stops.
We also verified all the clock freequencies - its also coming properly

we are using Branch android-hikey-linaro-4.9 version
Repo https://android.googlesource.com/kernel/hikey-linaro

HEAD commit : 7c09ed7b46a4505b0aa53a3da683461a45257d9f

kernel git details
git remote add jcmvbkbc https://github.com/jcmvbkbc/hikey-linaro.git
git fetch jcmvbkbc android-hikey-linaro-4.9-xrp
git merge jcmvbkbc/android-hikey-linaro-4.9-xrp

We haven’t done any changes in kernel specific to our codec.
we were able to run tinyplay for 10 sec with 48KHz 16 bit 2channel audio.
But after 10 sec it stops with error print . “Error playing sample”
We are using Analog Devices Codec Board - EVAL-ADAU1777Z

How long is your sample file?

Hmm, could you clarify which of those kernels you are experiencing this problem with? Is it the one from android.googlesource.com? Or the one from github?

Sample file is 20sec long
Yes we are using google source one please see the git checkout details etc .
https://android.googlesource.com/kernel/hikey-linaro
git checkout -b android-hikey-linaro-4.9 origin/android-hikey-linaro-4.9
Added xrp code
git remote add jcmvbkbc https://github.com/jcmvbkbc/hikey-linaro.git
git fetch jcmvbkbc android-hikey-linaro-4.9-xrp
git merge jcmvbkbc/android-hikey-linaro-4.9-xrp

Same difference. You are NOT using the kernel from Google, you’re using a bunch of 3rd party commits that muck around with the audio DSP.

Please try again to use the kernel as is from Google’s repository, with NO 3RD PARTY CHANGES, or the prebuilt kernel from device/linaro/hikey-kernel/ – if you are able to reproduce the problem at that point, then we can look into what is happening, otherwise I am going to assume that you broke it with those changes.

2 Likes

Yes You are right . Issue was not there without 3rd party changes.

Thanks for your support

1 Like

Great. If you actually require those commits (and to be honest, I don’t know what they’re actually for), then your best option would be to try to contact their author for assistance.