RE: [alsa-devel] [PATCH 3/4] ASoC: SAMSUNG: Change platform driver for SMDKs

2011-06-12 Thread Sangbeom Kim
On Thu, Jun 10, 2011 at 4:27 PM, Jassi Brar wrote:
> Though if then everything works fine with system and internal DMA,
> maybe it is better to assign platform_name string at runtime from some
> module parameter, and leaving the default to normal system DMA ?
OK, I will leaving the default to system DMA,
 
> > But I had found some problem and want to share.
> > Like this patch, If different platform driver is used for each channel,
> > 1st channel is overwritten by platform driver of 2nd channel.
> > Have you ever experienced before like this problem?
> IIRC, I successfully tested using system DMA with primary and iDMA
> with secondary channel. Only the sec chan would keep playing when
> the system went to suspend. Though tt was long time ago and I don't
> remember
> which Samsung kernel version.
Your test condition is little different with my test condition.
You are using wrapper architecture. 
But I used each driver architecture.
Like in this patch, I assigned like below

{ /* Primary DAI i/f */
.name = "WM8994 AIF1",
.stream_name = "Pri_Dai",
.cpu_dai_name = "samsung-i2s.0",
.codec_dai_name = "wm8994-aif1",
.platform_name = "samsung-audio",
.codec_name = "wm8994-codec",
.init = smdk_wm8994_init_paiftx,
.ops = &smdk_ops,
},
{ /* Sec_Fifo Playback i/f */
.name = "Sec_FIFO TX",
.stream_name = "Sec_Dai",
.cpu_dai_name = "samsung-i2s.4",
.codec_dai_name = "wm8994-aif1",
.platform_name = "samsung-idma",
.codec_name = "wm8994-codec",
.ops = &smdk_ops,
},

Primary is used by system dma,
Secondary is used by idma,

I try to use secondary by aplay, It can work fine.

==
[root@samsung ~]# /mars/bin/aplay -Dplughw:0,1,0
/mars/share/sounds/alsa/Front_Center.wav
Entered idma_open
Playing WAVE '/mars/share/sounds/alsa/Front_Center.wav' [I2S] Initialize
sec_fifo idma
[I2S] Done hw params 
Entered idma_hw_params
idma_setcallbk:125 dma_period=2000
DmaAddr=@202 Total=96000bytes PrdSz=8192 #Prds=11 dma_area=0xd084
Entered idma_mmap
Entered idma_prepare
: Signed 16 bit Little Endian, Rate 48000 Hz, Mono
Entered idma_trigger
Entered idma_pointer, regs=d0822000
Pointer 2020004 
Snip.
Entered idma_pointer, regs=d0822000
Pointer 202e00c 
Entered idma_pointer, regs=d0822000
Pointer 203000c 
Entered idma_pointer, regs=d0822000
Pointer 203200c 
Entered idma_pointer, regs=d0822000
Pointer 203400c 
Entered idma_pointer, regs=d0822000
Pointer 203600c 
Entered idma_trigger
Entered idma_hw_free
Entered idma_hw_free
Entered idma_close, prtd = cedb8bc0
[root@Samsung ~]#

==
There is no problem and sound is good,

But If I try to use primary i/f, It can't work properly.

==
[root@samsung ~]# /mars/bin/aplay -Dplughw:0,0,0
/mars/share/sounds/alsa/Front_Center.wav
Entered dma_open
Playing WAVE '/mars/share/sounds/alsa/Front_Center.wav' : Signed 16 bit
Little Endian, Rate 48000 Hz, Mono
[I2S] Done hw params 
Entered dma_hw_params
params cf82e6b0, client cf82e6b0, channel 16
Entered idma_mmap
Entered dma_prepare
Entered dma_enqueue
dma_enqueue: loaded 0, limit 12
dma_loaded: 0
dma_loaded: 1
dma_loaded: 2
dma_loaded: 3
dma_loaded: 4
dma_loaded: 5
dma_loaded: 6
dma_loaded: 7
dma_loaded: 8
dma_loaded: 9
dma_loaded: 10
dma_loaded: 11
Entered dma_trigger
Entered idma_pointer, regs=d0822000
Pointer 202 
Entered audio_buffdone

Snip

Pointer 202 
Entered audio_buffdone
Entered idma_pointer, regs=d0822000
Pointer 202 
Entered dma_trigger
Entered audio_buffdone
Entered dma_prepare
Entered audio_buffdone
Entered audio_buffdone
Entered dma_enqueue
dma_enqueue: loaded 0, limit 12
dma_loaded: 0
dma_loaded: 1
dma_loaded: 2
dma_loaded: 3
dma_loaded: 4
dma_loaded: 5
dma_loaded: 6
dma_loaded: 7
dma_loaded: 8
dma_loaded: 9
dma_loaded: 10
dma_loaded: 11
underrun!!! (at least 0.072 ms long)
Entered dma_trigger
Entered idma_pointer, regs=d0822000
Pointer 202 
Entered audio_buffdone
Entered idma_pointer, regs=d0822000
Pointer 202 
Snip
Entered audio_buffdone
Entered idma_pointer, regs=d0822000
Pointer 202 
Entered dma_trigger
Entered audio_buffdone
Entered dma_prepare
Entered audio_buffdone
Entered audio_buffdone
Entered audio_buffdone
Entered audio_buffdone
Entered dma_enqueue
dma_enqueue: loaded 0, limit 12
dma_loaded: 0
dma_loaded: 1
dma_loaded: 2
dma_loaded: 3
dma_loaded: 4
dma_loaded: 5
dma_loaded: 6
dma_loaded: 7
dma_loaded: 8
dma_loaded: 9
dma_loaded: 10
dma_loaded: 11
Entered dma_trigger
underrun!!! (at least 0.030 ms long)
Entered audio_buffdone
Entered i

Re: [alsa-devel] [PATCH 3/4] ASoC: SAMSUNG: Change platform driver for SMDKs

2011-06-10 Thread Jassi Brar
On Fri, Jun 10, 2011 at 3:46 PM, Mark Brown
 wrote:
> On Fri, Jun 10, 2011 at 03:42:27PM +0530, Jassi Brar wrote:
>> On Fri, Jun 10, 2011 at 3:19 PM, Mark Brown
>
>> > If iDMA is always a better choice on CPUs that support it then the
>> > cpu_is_() macros might be a good way to make the selection?
>
>> Actually I remembered just after I posted - iDMA wouldn't support capture.
>> So iDMA is a bad choice after all.
>
> So I guess the relevant boards would be better off adding a separate DAI
> to allow applications to select the DAI they want at runtime?

oops!  he is changing platform driver for the secondary i/f which
doesn't support
capture in the first place. So I think it can be done, though we need
to see if it
would be better to provide a way(control ?) to userspace to select
between sys/internal dma.
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [alsa-devel] [PATCH 3/4] ASoC: SAMSUNG: Change platform driver for SMDKs

2011-06-10 Thread Mark Brown
On Fri, Jun 10, 2011 at 03:42:27PM +0530, Jassi Brar wrote:
> On Fri, Jun 10, 2011 at 3:19 PM, Mark Brown

> > If iDMA is always a better choice on CPUs that support it then the
> > cpu_is_() macros might be a good way to make the selection?

> Actually I remembered just after I posted - iDMA wouldn't support capture.
> So iDMA is a bad choice after all.

So I guess the relevant boards would be better off adding a separate DAI
to allow applications to select the DAI they want at runtime?
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [alsa-devel] [PATCH 3/4] ASoC: SAMSUNG: Change platform driver for SMDKs

2011-06-10 Thread Jassi Brar
On Fri, Jun 10, 2011 at 3:19 PM, Mark Brown
 wrote:
> On Fri, Jun 10, 2011 at 12:56:45PM +0530, Jassi Brar wrote:
>> On Fri, Jun 10, 2011 at 12:46 PM, Sangbeom Kim  wrote:
>
>> > I only focused on S5PV210 and S5PV310.
>> > I didn't consider s3c and s5p series.
>> > In the next version, I will delete it.
>
>> Though if then everything works fine with system and internal DMA,
>> maybe it is better to assign platform_name string at runtime from some
>> module parameter, and leaving the default to normal system DMA ?
>
> If iDMA is always a better choice on CPUs that support it then the
> cpu_is_() macros might be a good way to make the selection?

Actually I remembered just after I posted - iDMA wouldn't support capture.
So iDMA is a bad choice after all.
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [alsa-devel] [PATCH 3/4] ASoC: SAMSUNG: Change platform driver for SMDKs

2011-06-10 Thread Mark Brown
On Fri, Jun 10, 2011 at 12:56:45PM +0530, Jassi Brar wrote:
> On Fri, Jun 10, 2011 at 12:46 PM, Sangbeom Kim  wrote:

> > I only focused on S5PV210 and S5PV310.
> > I didn't consider s3c and s5p series.
> > In the next version, I will delete it.

> Though if then everything works fine with system and internal DMA,
> maybe it is better to assign platform_name string at runtime from some
> module parameter, and leaving the default to normal system DMA ?

If iDMA is always a better choice on CPUs that support it then the
cpu_is_() macros might be a good way to make the selection?
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [alsa-devel] [PATCH 3/4] ASoC: SAMSUNG: Change platform driver for SMDKs

2011-06-10 Thread Jassi Brar
On Fri, Jun 10, 2011 at 12:46 PM, Sangbeom Kim  wrote:
> On Thu, Jun 9, 2011 at 4:04 PM, Jassi Brar wrote:
>> NAK.
>> It will break the most common user - SMDK6410, as s3c6410 doesn't have any
>> I2S internal DMA.
>> Please try to test the changes before submitting. I know it's boring,
>> but it's even more important :)
>>
>> Thanks
>
> I only focused on S5PV210 and S5PV310.
> I didn't consider s3c and s5p series.
> In the next version, I will delete it.
Though if then everything works fine with system and internal DMA,
maybe it is better to assign platform_name string at runtime from some
module parameter, and leaving the default to normal system DMA ?

> But I had found some problem and want to share.
> Like this patch, If different platform driver is used for each channel,
> 1st channel is overwritten by platform driver of 2nd channel.
> Have you ever experienced before like this problem?
IIRC, I successfully tested using system DMA with primary and iDMA
with secondary channel. Only the sec chan would keep playing when
the system went to suspend. Though tt was long time ago and I don't remember
which Samsung kernel version.
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [alsa-devel] [PATCH 3/4] ASoC: SAMSUNG: Change platform driver for SMDKs

2011-06-10 Thread Sangbeom Kim
On Thu, Jun 9, 2011 at 4:04 PM, Jassi Brar wrote:
> NAK.
> It will break the most common user - SMDK6410, as s3c6410 doesn't have any
> I2S internal DMA.
> Please try to test the changes before submitting. I know it's boring,
> but it's even more important :)
> 
> Thanks

I only focused on S5PV210 and S5PV310.
I didn't consider s3c and s5p series.
In the next version, I will delete it.
But I had found some problem and want to share.
Like this patch, If different platform driver is used for each channel,
1st channel is overwritten by platform driver of 2nd channel.
Have you ever experienced before like this problem?

Thanks, 
SB Kim

--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [alsa-devel] [PATCH 3/4] ASoC: SAMSUNG: Change platform driver for SMDKs

2011-06-09 Thread Sangbeom Kim
On Thu, Jun 09, 2011 at 07:47PM +0900, Mark Brown wrote:
> 
> When you resubmit for the API change update it'd be helpful to update
> the changelog to explain why the platforms are being changed to use only
> internal DMA - what is the advantage this offers over regular DMA?  This
> will help users understand how they should configure their own systems.

OK, In the next vesion, I will add detail changelog for other users.

Thanks 
SB Kim

--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html