From 3c892c1c88008edbd026db0d7a14ea14cc759910 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E9=82=B1=E5=BB=BA=E6=96=8C?= Date: Fri, 27 Apr 2012 15:07:26 +0800 Subject: [PATCH] i2s/pcm : add i2s dma bufferdone callback debug source --- sound/soc/rk29/rk29_pcm.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/sound/soc/rk29/rk29_pcm.c b/sound/soc/rk29/rk29_pcm.c index 8630a4ab5a0b..6285a94f50e4 100755 --- a/sound/soc/rk29/rk29_pcm.c +++ b/sound/soc/rk29/rk29_pcm.c @@ -28,6 +28,8 @@ #include "rk29_pcm.h" +#define PCM_DMA_DEBUG 0 + #if 0 #define DBG(x...) printk(KERN_INFO x) #else @@ -137,7 +139,22 @@ void rk29_audio_buffdone(void *dev_id, int size, { struct snd_pcm_substream *substream = dev_id; struct rockchip_runtime_data *prtd; - +#if PCM_DMA_DEBUG + static ktime_t before = {0},after = {0}; + s64 t; + before = after; + after = ktime_get(); + t = ktime_to_us(ktime_sub(after, before)); + if(result == RK29_RES_OK) + { + if(t > 23220+73 && t != ktime_to_us(after)) // 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); + } +// printk(KERN_DEBUG "a %d %d\n", size, result); +#endif DBG("Enter::%s----%d\n",__FUNCTION__,__LINE__); if (!substream) -- 2.34.1