Hi,
I've been trying to get a PCM3168s codec with a Colibri iMX7 using TDM
on SAI2.
I've got it working properly with the 4.1.35 kernel from Toradex (based
on the 4.1.15 from Freescale).
It is working fine with and without providing a firmware to the sDMA.
But, I couldn't get that to work with v4.9. I actually managed to
reproduce the issue using the SGTL5000 so I don't have any patch on top
of v4.9.
I really suspect the DMA driver as the issue varies with the selected
period/buffer size.
Basically, the samples in a period are in the correct order but the
periods are mixed up.
This is what I'm playing in a loop:
http://free-electrons.com/~alexandre/source.png
This is the output I get:
http://free-electrons.com/~alexandre/playback.png
The configuration for the cyclic transfer seems to be fine and I don't
know enough about the sdma to investigate further.
I can try to backport b7d2648ac3d4 "dmaengine: imx-sdma: Add i.MX7
support" to v4.8 and test I you think that can be useful
--
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
Hi Alexandre,
On 2017-02-14 14:24, Alexandre Belloni wrote:
Hi,
I've been trying to get a PCM3168s codec with a Colibri iMX7 using TDM
on SAI2.
I've got it working properly with the 4.1.35 kernel from Toradex (based
on the 4.1.15 from Freescale).
It is working fine with and without providing a firmware to the sDMA.
But, I couldn't get that to work with v4.9. I actually managed to
reproduce the issue using the SGTL5000 so I don't have any patch on top
of v4.9.
I guess you are using the on module SGTL5000 to reproduce?
When I added audio support I remember that the sound seemed to be ok to
me. Is the corruption such that you can hear it?
I really suspect the DMA driver as the issue varies with the selected
period/buffer size.
Basically, the samples in a period are in the correct order but the
periods are mixed up.
Maybe a endian issue?
This is what I'm playing in a loop:
http://free-electrons.com/~alexandre/source.png
This is the output I get:
http://free-electrons.com/~alexandre/playback.png
The configuration for the cyclic transfer seems to be fine and I don't
know enough about the sdma to investigate further.
I can try to backport b7d2648ac3d4 "dmaengine: imx-sdma: Add i.MX7
support" to v4.8 and test I you think that can be useful
I'll do a test with v4.9 on Colibri iMX7 internal SGTL5000.
--
Stefan
Hi Alexandre,
On Wed, Feb 15, 2017 at 5:25 AM, Stefan Agner [off-list ref] wrote:
Hi Alexandre,
On 2017-02-14 14:24, Alexandre Belloni wrote:
quoted
Hi,
I've been trying to get a PCM3168s codec with a Colibri iMX7 using TDM
on SAI2.
I've got it working properly with the 4.1.35 kernel from Toradex (based
on the 4.1.15 from Freescale).
It is working fine with and without providing a firmware to the sDMA.
But, I couldn't get that to work with v4.9. I actually managed to
reproduce the issue using the SGTL5000 so I don't have any patch on top
of v4.9.
I guess you are using the on module SGTL5000 to reproduce?
When I added audio support I remember that the sound seemed to be ok to
me. Is the corruption such that you can hear it?
I haven't noticed this issue on a warp7 board.
Could you please share your .wav files and reproduction steps?
Thanks
On 14/02/2017 at 23:25:34 -0800, Stefan Agner wrote:
On 2017-02-14 14:24, Alexandre Belloni wrote:
quoted
Hi,
I've been trying to get a PCM3168s codec with a Colibri iMX7 using TDM
on SAI2.
I've got it working properly with the 4.1.35 kernel from Toradex (based
on the 4.1.15 from Freescale).
It is working fine with and without providing a firmware to the sDMA.
But, I couldn't get that to work with v4.9. I actually managed to
reproduce the issue using the SGTL5000 so I don't have any patch on top
of v4.9.
I guess you are using the on module SGTL5000 to reproduce?
Yes, using the on module sgtl5000 of a colibri on an iris.
When I added audio support I remember that the sound seemed to be ok to
me. Is the corruption such that you can hear it?
You can hear it but not if you are playing a simple sine at a frequency
that is a multiple of 10 (e.g. 440Hz)
quoted
I really suspect the DMA driver as the issue varies with the selected
period/buffer size.
Basically, the samples in a period are in the correct order but the
periods are mixed up.
Maybe a endian issue?
I don't think so.
--
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
On 14/02/2017 at 23:25:34 -0800, Stefan Agner wrote:
quoted
On 2017-02-14 14:24, Alexandre Belloni wrote:
quoted
Hi,
I've been trying to get a PCM3168s codec with a Colibri iMX7 using TDM
on SAI2.
I've got it working properly with the 4.1.35 kernel from Toradex (based
on the 4.1.15 from Freescale).
It is working fine with and without providing a firmware to the sDMA.
But, I couldn't get that to work with v4.9. I actually managed to
reproduce the issue using the SGTL5000 so I don't have any patch on top
of v4.9.
I guess you are using the on module SGTL5000 to reproduce?
Yes, using the on module sgtl5000 of a colibri on an iris.
quoted
When I added audio support I remember that the sound seemed to be ok to
me. Is the corruption such that you can hear it?
You can hear it but not if you are playing a simple sine at a frequency
that is a multiple of 10 (e.g. 440Hz)
Compiled v4.9 and played a song, I could clearly hear constant "noise"
during playback.
I went back to my v4.8-rc3 + some patches applied back when I tested
audio and submitted the device tree change, and the noise isn't there.
In a "I feel lucky" manor I just reverted the last patch 5881826ded79
("dmaengine: imx-sdma - update the residue calculation for cyclic
channels") and the song sounded clean as always again!
Alexandre, does reverting this helps your issue too?
+Nandor, Author of said patch. Any idea?
--
Stefan
On 15/02/2017 at 14:44:12 -0800, Stefan Agner wrote:
Compiled v4.9 and played a song, I could clearly hear constant "noise"
during playback.
I went back to my v4.8-rc3 + some patches applied back when I tested
audio and submitted the device tree change, and the noise isn't there.
In a "I feel lucky" manor I just reverted the last patch 5881826ded79
("dmaengine: imx-sdma - update the residue calculation for cyclic
channels") and the song sounded clean as always again!
Alexandre, does reverting this helps your issue too?
I confirm it is the culprit.
+Nandor, Author of said patch. Any idea?
--
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
On 16/02/2017 at 13:36:28 -0200, Fabio Estevam wrote:
Hi Alexandre,
On Thu, Feb 16, 2017 at 8:42 AM, Alexandre Belloni
[off-list ref] wrote:
quoted
I confirm it is the culprit.
Does this mean that PCM3168s codec works fine on imx7 using SAI on
4.9.x plus the revert?
It does work after the revert but the driver needs a small modification
to accommodate TDM instead of i2s. I'll send that.
--
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
Am Donnerstag, den 16.02.2017, 17:40 +0100 schrieb Alexandre Belloni:
On 16/02/2017 at 13:36:28 -0200, Fabio Estevam wrote:
quoted
Hi Alexandre,
On Thu, Feb 16, 2017 at 8:42 AM, Alexandre Belloni
[off-list ref] wrote:
quoted
I confirm it is the culprit.
Does this mean that PCM3168s codec works fine on imx7 using SAI on
4.9.x plus the revert?
And there is already a fix for this in 4.10:
85f57752b33c (dmaengine: imx-sdma - correct the dma transfer residue
calculation)
This fixes audio output on i.MX6 and should probably be sent to -stable.
Can you see if applying this patch gets rid of the issues on i.MX7?
Regards,
Lucas
On 16/02/2017 at 17:47:19 +0100, Lucas Stach wrote:
Am Donnerstag, den 16.02.2017, 17:40 +0100 schrieb Alexandre Belloni:
quoted
On 16/02/2017 at 13:36:28 -0200, Fabio Estevam wrote:
quoted
Hi Alexandre,
On Thu, Feb 16, 2017 at 8:42 AM, Alexandre Belloni
[off-list ref] wrote:
quoted
I confirm it is the culprit.
Does this mean that PCM3168s codec works fine on imx7 using SAI on
4.9.x plus the revert?
And there is already a fix for this in 4.10:
85f57752b33c (dmaengine: imx-sdma - correct the dma transfer residue
calculation)
This fixes audio output on i.MX6 and should probably be sent to -stable.
Can you see if applying this patch gets rid of the issues on i.MX7?
It does too, thanks!
It is probably worth having it on 4.9.
--
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
From: Han, Nandor GE Healthcare <hidden> Date: 2017-02-17 09:13:43
On 16/02/2017 19:08, Alexandre Belloni wrote:
On 16/02/2017 at 17:47:19 +0100, Lucas Stach wrote:
quoted
Am Donnerstag, den 16.02.2017, 17:40 +0100 schrieb Alexandre Belloni:
quoted
On 16/02/2017 at 13:36:28 -0200, Fabio Estevam wrote:
quoted
Hi Alexandre,
On Thu, Feb 16, 2017 at 8:42 AM, Alexandre Belloni
[off-list ref] wrote:
quoted
I confirm it is the culprit.
Does this mean that PCM3168s codec works fine on imx7 using SAI on
4.9.x plus the revert?
And there is already a fix for this in 4.10:
85f57752b33c (dmaengine: imx-sdma - correct the dma transfer residue
calculation)
This fixes audio output on i.MX6 and should probably be sent to -stable.
Can you see if applying this patch gets rid of the issues on i.MX7?
It does too, thanks!
It is probably worth having it on 4.9.
Hi,
Thanks for mention the problem and confirm that the above patch fixed
the issue.
I'm a bit surprised about the issue that Stefan mention, which in his
case was a "noise". In my case was more like a sound interruption (I was
testing on a iMX6).
But good to hear that works :)
Regards,
Nandor
--
Regards,
Nandi
Nandor,
On Fri, Feb 17, 2017 at 7:13 AM, Han, Nandor (GE Healthcare)
[off-list ref] wrote:
Hi,
Thanks for mention the problem and confirm that the above patch fixed the
issue.
I'm a bit surprised about the issue that Stefan mention, which in his case
was a "noise". In my case was more like a sound interruption (I was testing
on a iMX6).
But good to hear that works :)
As 4.9 is broken, could you please submit the fix to kernel 4.9 and Cc stable?
From: Han, Nandor GE Healthcare <hidden> Date: 2017-02-20 08:27:38
On 19/02/2017 23:55, Fabio Estevam wrote:
Nandor,
On Fri, Feb 17, 2017 at 7:13 AM, Han, Nandor (GE Healthcare)
[off-list ref] wrote:
quoted
Hi,
Thanks for mention the problem and confirm that the above patch fixed the
issue.
I'm a bit surprised about the issue that Stefan mention, which in his case
was a "noise". In my case was more like a sound interruption (I was testing
on a iMX6).
But good to hear that works :)
As 4.9 is broken, could you please submit the fix to kernel 4.9 and Cc stable?
Fabio,
I will try to send it ASAP when I find some free time (I will try
this week)
--
Regards,
Nandi