alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* asoc: fsl_dma_hw_free being called twice at end of playback
@ 2010-05-03 20:51 Timur Tabi
  2010-05-03 21:02 ` Mark Brown
  2010-05-03 23:57 ` Raymond Yau
  0 siblings, 2 replies; 4+ messages in thread
From: Timur Tabi @ 2010-05-03 20:51 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, ALSA development

In my 8610 ASoC driver, I'm seeing the DMA driver's .hw_free function being
called twice whenever playback ends.  I've added some printk's to demonstrate:

snd_pcm_common_ioctl1:2543
snd_pcm_hw_free:543
soc_pcm_hw_free:761 c023983c
fsl_dma_hw_free:720 substream=df029d00 dma_private=df440000 stream=0
snd_pcm_release_substream:2022
soc_pcm_hw_free:761 c023983c
fsl_dma_hw_free:720 substream=df029d00 dma_private=df440000 stream=0
fsl_dma_close:759 substream=df029d00 dma_private=df440000

So the ioctl is being called only once, but the both snd_pcm_hw_free() and
snd_pcm_release_substream() are calling the .hw_free function.

Is this normal?  I don't know how to handle this, other than to add some
boolean to my private data structure that indicates whether the resources
have been freed or not.

-- 
Timur Tabi
Linux kernel developer at Freescale

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

* Re: asoc: fsl_dma_hw_free being called twice at end of playback
  2010-05-03 20:51 asoc: fsl_dma_hw_free being called twice at end of playback Timur Tabi
@ 2010-05-03 21:02 ` Mark Brown
  2010-05-03 21:05   ` Timur Tabi
  2010-05-03 23:57 ` Raymond Yau
  1 sibling, 1 reply; 4+ messages in thread
From: Mark Brown @ 2010-05-03 21:02 UTC (permalink / raw)
  To: Timur Tabi; +Cc: ALSA development, Liam Girdwood

On 3 May 2010, at 21:51, Timur Tabi <timur@freescale.com> wrote:

> In my 8610 ASoC driver, I'm seeing the DMA driver's .hw_free  
> function being
> called twice whenever playback ends.  I've added some printk's to  
> demonstrate:

Is this with or without Liam's multiple CODEC work?

> snd_pcm_common_ioctl1:2543
> snd_pcm_hw_free:543
> soc_pcm_hw_free:761 c023983c
> fsl_dma_hw_free:720 substream=df029d00 dma_private=df440000 stream=0
> snd_pcm_release_substream:2022
> soc_pcm_hw_free:761 c023983c
> fsl_dma_hw_free:720 substream=df029d00 dma_private=df440000 stream=0
> fsl_dma_close:759 substream=df029d00 dma_private=df440000
>
> So the ioctl is being called only once, but the both snd_pcm_hw_free 
> () and
> snd_pcm_release_substream() are calling the .hw_free function.
>
> Is this normal?  I don't know how to handle this, other than to add  
> some
> boolean to my private data structure that indicates whether the  
> resources
> have been freed or not.
>
> -- 
> Timur Tabi
> Linux kernel developer at Freescale

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

* Re: asoc: fsl_dma_hw_free being called twice at end of playback
  2010-05-03 21:02 ` Mark Brown
@ 2010-05-03 21:05   ` Timur Tabi
  0 siblings, 0 replies; 4+ messages in thread
From: Timur Tabi @ 2010-05-03 21:05 UTC (permalink / raw)
  To: Mark Brown; +Cc: ALSA development, Liam Girdwood

Mark Brown wrote:
> On 3 May 2010, at 21:51, Timur Tabi <timur@freescale.com> wrote:
> 
>> In my 8610 ASoC driver, I'm seeing the DMA driver's .hw_free  
>> function being
>> called twice whenever playback ends.  I've added some printk's to  
>> demonstrate:
> 
> Is this with or without Liam's multiple CODEC work?

With.


-- 
Timur Tabi
Linux kernel developer at Freescale

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

* Re: asoc: fsl_dma_hw_free being called twice at end of playback
  2010-05-03 20:51 asoc: fsl_dma_hw_free being called twice at end of playback Timur Tabi
  2010-05-03 21:02 ` Mark Brown
@ 2010-05-03 23:57 ` Raymond Yau
  1 sibling, 0 replies; 4+ messages in thread
From: Raymond Yau @ 2010-05-03 23:57 UTC (permalink / raw)
  To: ALSA Development Mailing List

2010/5/4 Timur Tabi <timur@freescale.com>

> In my 8610 ASoC driver, I'm seeing the DMA driver's .hw_free function being
> called twice whenever playback ends.  I've added some printk's to
> demonstrate:
>
> snd_pcm_common_ioctl1:2543
> snd_pcm_hw_free:543
> soc_pcm_hw_free:761 c023983c
> fsl_dma_hw_free:720 substream=df029d00 dma_private=df440000 stream=0
> snd_pcm_release_substream:2022
> soc_pcm_hw_free:761 c023983c
> fsl_dma_hw_free:720 substream=df029d00 dma_private=df440000 stream=0
> fsl_dma_close:759 substream=df029d00 dma_private=df440000
>
> So the ioctl is being called only once, but the both snd_pcm_hw_free() and
> snd_pcm_release_substream() are calling the .hw_free function.
>
> Is this normal?  I don't know how to handle this, other than to add some
> boolean to my private data structure that indicates whether the resources
> have been freed or not.
>
> --
> Timur Tabi
> Linux kernel developer at Freescale
>

http://www.alsa-project.org/~tiwai/writing-an-alsa-driver/ch05s06.html#pcm-interface-operators-hw-free-callback

This function is always called before the close callback is called. Also,
the callback may be called multiple times, too. Keep track whether the
resource was already released.

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

end of thread, other threads:[~2010-05-03 23:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-03 20:51 asoc: fsl_dma_hw_free being called twice at end of playback Timur Tabi
2010-05-03 21:02 ` Mark Brown
2010-05-03 21:05   ` Timur Tabi
2010-05-03 23:57 ` Raymond Yau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).