From c519772e808b5dcf148c34c403e7453e9cc87712 Mon Sep 17 00:00:00 2001 From: qjb Date: Wed, 4 Jun 2014 10:46:12 +0800 Subject: [PATCH] soc dma : add audio dma timeout debuginterface --- sound/soc/soc-dmaengine-pcm.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) mode change 100644 => 100755 sound/soc/soc-dmaengine-pcm.c diff --git a/sound/soc/soc-dmaengine-pcm.c b/sound/soc/soc-dmaengine-pcm.c old mode 100644 new mode 100755 index aa924d9b7986..d186e7cc28f2 --- a/sound/soc/soc-dmaengine-pcm.c +++ b/sound/soc/soc-dmaengine-pcm.c @@ -132,11 +132,33 @@ void snd_dmaengine_pcm_set_config_from_dai_data( } EXPORT_SYMBOL_GPL(snd_dmaengine_pcm_set_config_from_dai_data); +#if CONFIG_ARCH_ROCKCHIP +static int debug_audio_timeout = 0; +module_param(debug_audio_timeout, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); +MODULE_PARM_DESC(debug_audio_timeout, "Debug interface Audio DMA buffdone time out"); +#endif static void dmaengine_pcm_dma_complete(void *arg) { struct snd_pcm_substream *substream = arg; struct dmaengine_pcm_runtime_data *prtd = substream_to_prtd(substream); +#if CONFIG_ARCH_ROCKCHIP + if(debug_audio_timeout){ + struct snd_pcm_runtime *runtime = substream->runtime; + static ktime_t before = {0},after = {0}; + s64 t; + before = after; + after = ktime_get(); + t = ktime_to_us(ktime_sub(after, before)); + + if(t > (snd_pcm_lib_period_bytes(substream)/4+32)*1000*1000/runtime->rate + && t != ktime_to_us(after)) // (23220)4096/4/44100 + 32/44100 + { + printk(KERN_DEBUG "Time out:: Audio DMA buffdone time out!!! the time = %lld!\n", t); + } + //printk(KERN_DEBUG "audio DMA callback time = %lld\n", t); + } +#endif prtd->pos += snd_pcm_lib_period_bytes(substream); if (prtd->pos >= snd_pcm_lib_buffer_bytes(substream)) prtd->pos = 0; -- 2.34.1