All of lore.kernel.org
 help / color / mirror / Atom feed
* sDMA on i.mx7d
@ 2017-02-14 22:24 Alexandre Belloni
  2017-02-15  7:25 ` Stefan Agner
  0 siblings, 1 reply; 13+ messages in thread
From: Alexandre Belloni @ 2017-02-14 22:24 UTC (permalink / raw)
  To: linux-arm-kernel

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* sDMA on i.mx7d
  2017-02-14 22:24 sDMA on i.mx7d Alexandre Belloni
@ 2017-02-15  7:25 ` Stefan Agner
  2017-02-15 10:36   ` Fabio Estevam
  2017-02-15 11:07   ` Alexandre Belloni
  0 siblings, 2 replies; 13+ messages in thread
From: Stefan Agner @ 2017-02-15  7:25 UTC (permalink / raw)
  To: linux-arm-kernel

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* sDMA on i.mx7d
  2017-02-15  7:25 ` Stefan Agner
@ 2017-02-15 10:36   ` Fabio Estevam
  2017-02-15 11:07   ` Alexandre Belloni
  1 sibling, 0 replies; 13+ messages in thread
From: Fabio Estevam @ 2017-02-15 10:36 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Alexandre,

On Wed, Feb 15, 2017 at 5:25 AM, Stefan Agner <stefan@agner.ch> wrote:
> 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 haven't noticed this issue on a warp7 board.

Could you please share your .wav files and reproduction steps?

Thanks

^ permalink raw reply	[flat|nested] 13+ messages in thread

* sDMA on i.mx7d
  2017-02-15  7:25 ` Stefan Agner
  2017-02-15 10:36   ` Fabio Estevam
@ 2017-02-15 11:07   ` Alexandre Belloni
  2017-02-15 22:44     ` Stefan Agner
  1 sibling, 1 reply; 13+ messages in thread
From: Alexandre Belloni @ 2017-02-15 11:07 UTC (permalink / raw)
  To: linux-arm-kernel

On 14/02/2017 at 23:25:34 -0800, Stefan Agner wrote:
> 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?
> 

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)

> > 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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* sDMA on i.mx7d
  2017-02-15 11:07   ` Alexandre Belloni
@ 2017-02-15 22:44     ` Stefan Agner
  2017-02-16 10:42       ` Alexandre Belloni
  0 siblings, 1 reply; 13+ messages in thread
From: Stefan Agner @ 2017-02-15 22:44 UTC (permalink / raw)
  To: linux-arm-kernel

On 2017-02-15 03:07, Alexandre Belloni wrote:
> On 14/02/2017 at 23:25:34 -0800, Stefan Agner wrote:
>> 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?
>>
> 
> 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)
> 

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* sDMA on i.mx7d
  2017-02-15 22:44     ` Stefan Agner
@ 2017-02-16 10:42       ` Alexandre Belloni
  2017-02-16 15:36         ` Fabio Estevam
  0 siblings, 1 reply; 13+ messages in thread
From: Alexandre Belloni @ 2017-02-16 10:42 UTC (permalink / raw)
  To: linux-arm-kernel

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* sDMA on i.mx7d
  2017-02-16 10:42       ` Alexandre Belloni
@ 2017-02-16 15:36         ` Fabio Estevam
  2017-02-16 16:40           ` Alexandre Belloni
  0 siblings, 1 reply; 13+ messages in thread
From: Fabio Estevam @ 2017-02-16 15:36 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Alexandre,

On Thu, Feb 16, 2017 at 8:42 AM, Alexandre Belloni
<alexandre.belloni@free-electrons.com> wrote:

> 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?

^ permalink raw reply	[flat|nested] 13+ messages in thread

* sDMA on i.mx7d
  2017-02-16 15:36         ` Fabio Estevam
@ 2017-02-16 16:40           ` Alexandre Belloni
  2017-02-16 16:47             ` Lucas Stach
  0 siblings, 1 reply; 13+ messages in thread
From: Alexandre Belloni @ 2017-02-16 16:40 UTC (permalink / raw)
  To: linux-arm-kernel

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
> <alexandre.belloni@free-electrons.com> wrote:
> 
> > 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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* sDMA on i.mx7d
  2017-02-16 16:40           ` Alexandre Belloni
@ 2017-02-16 16:47             ` Lucas Stach
  2017-02-16 17:08               ` Alexandre Belloni
  0 siblings, 1 reply; 13+ messages in thread
From: Lucas Stach @ 2017-02-16 16:47 UTC (permalink / raw)
  To: linux-arm-kernel

Am Donnerstag, den 16.02.2017, 17:40 +0100 schrieb Alexandre Belloni:
> 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
> > <alexandre.belloni@free-electrons.com> wrote:
> > 
> > > 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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* sDMA on i.mx7d
  2017-02-16 16:47             ` Lucas Stach
@ 2017-02-16 17:08               ` Alexandre Belloni
  2017-02-17  9:13                 ` EXT: " Han, Nandor (GE Healthcare)
  0 siblings, 1 reply; 13+ messages in thread
From: Alexandre Belloni @ 2017-02-16 17:08 UTC (permalink / raw)
  To: linux-arm-kernel

On 16/02/2017 at 17:47:19 +0100, Lucas Stach wrote:
> Am Donnerstag, den 16.02.2017, 17:40 +0100 schrieb Alexandre Belloni:
> > 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
> > > <alexandre.belloni@free-electrons.com> wrote:
> > > 
> > > > 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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* EXT: Re: sDMA on i.mx7d
  2017-02-16 17:08               ` Alexandre Belloni
@ 2017-02-17  9:13                 ` Han, Nandor (GE Healthcare)
  2017-02-19 21:55                   ` Fabio Estevam
  0 siblings, 1 reply; 13+ messages in thread
From: Han, Nandor (GE Healthcare) @ 2017-02-17  9:13 UTC (permalink / raw)
  To: linux-arm-kernel



On 16/02/2017 19:08, Alexandre Belloni wrote:
> On 16/02/2017 at 17:47:19 +0100, Lucas Stach wrote:
>> Am Donnerstag, den 16.02.2017, 17:40 +0100 schrieb Alexandre Belloni:
>>> 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
>>>> <alexandre.belloni@free-electrons.com> wrote:
>>>>
>>>>> 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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* EXT: Re: sDMA on i.mx7d
  2017-02-17  9:13                 ` EXT: " Han, Nandor (GE Healthcare)
@ 2017-02-19 21:55                   ` Fabio Estevam
  2017-02-20  8:27                     ` Han, Nandor (GE Healthcare)
  0 siblings, 1 reply; 13+ messages in thread
From: Fabio Estevam @ 2017-02-19 21:55 UTC (permalink / raw)
  To: linux-arm-kernel

Nandor,

On Fri, Feb 17, 2017 at 7:13 AM, Han, Nandor (GE Healthcare)
<nandor.han@ge.com> 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?

^ permalink raw reply	[flat|nested] 13+ messages in thread

* EXT: Re: sDMA on i.mx7d
  2017-02-19 21:55                   ` Fabio Estevam
@ 2017-02-20  8:27                     ` Han, Nandor (GE Healthcare)
  0 siblings, 0 replies; 13+ messages in thread
From: Han, Nandor (GE Healthcare) @ 2017-02-20  8:27 UTC (permalink / raw)
  To: linux-arm-kernel



On 19/02/2017 23:55, Fabio Estevam wrote:
> Nandor,
>
> On Fri, Feb 17, 2017 at 7:13 AM, Han, Nandor (GE Healthcare)
> <nandor.han@ge.com> 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?
>

Fabio,
   I will try to send it ASAP when I find some free time (I will try 
this week)

-- 
Regards,
     Nandi

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2017-02-20  8:27 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-14 22:24 sDMA on i.mx7d Alexandre Belloni
2017-02-15  7:25 ` Stefan Agner
2017-02-15 10:36   ` Fabio Estevam
2017-02-15 11:07   ` Alexandre Belloni
2017-02-15 22:44     ` Stefan Agner
2017-02-16 10:42       ` Alexandre Belloni
2017-02-16 15:36         ` Fabio Estevam
2017-02-16 16:40           ` Alexandre Belloni
2017-02-16 16:47             ` Lucas Stach
2017-02-16 17:08               ` Alexandre Belloni
2017-02-17  9:13                 ` EXT: " Han, Nandor (GE Healthcare)
2017-02-19 21:55                   ` Fabio Estevam
2017-02-20  8:27                     ` Han, Nandor (GE Healthcare)

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.