diff options
author | Takashi Iwai <tiwai@suse.de> | 2009-07-23 05:04:13 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-07-23 05:09:03 -0400 |
commit | cedb8118e8cef21a2b73fd9cb70660ac19124c16 (patch) | |
tree | 080bc68c721b8ed24ebff7c809b7e74f6959148f /sound | |
parent | 79452f0a28aa5a40522c487b42a5fc423647ad98 (diff) |
ALSA: pcm - Add logging of hwptr updates and interrupt updates
Added the logging functionality to xrun_debug to record the hwptr
updates via snd_pcm_update_hw_ptr() and snd_pcm_update_hwptr_interrupt(),
corresponding to 16 and 8, respectively.
For example,
# echo 9 > /proc/asound/card0/pcm0p/xrun_debug
will record the position and other parameters at each period interrupt
together with the normal XRUN debugging.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/core/pcm_lib.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c index 3b673e2f991d..065eaf0a386c 100644 --- a/sound/core/pcm_lib.c +++ b/sound/core/pcm_lib.c | |||
@@ -233,6 +233,18 @@ static int snd_pcm_update_hw_ptr_interrupt(struct snd_pcm_substream *substream) | |||
233 | xrun(substream); | 233 | xrun(substream); |
234 | return -EPIPE; | 234 | return -EPIPE; |
235 | } | 235 | } |
236 | if (xrun_debug(substream, 8)) { | ||
237 | char name[16]; | ||
238 | pcm_debug_name(substream, name, sizeof(name)); | ||
239 | snd_printd("period_update: %s: pos=0x%x/0x%x/0x%x, " | ||
240 | "hwptr=0x%lx, hw_base=0x%lx, hw_intr=0x%lx\n", | ||
241 | name, pos, | ||
242 | (int)runtime->period_size, | ||
243 | (int)runtime->buffer_size, | ||
244 | (long)old_hw_ptr, | ||
245 | (long)runtime->hw_ptr_base, | ||
246 | (long)runtime->hw_ptr_interrupt); | ||
247 | } | ||
236 | hw_base = runtime->hw_ptr_base; | 248 | hw_base = runtime->hw_ptr_base; |
237 | new_hw_ptr = hw_base + pos; | 249 | new_hw_ptr = hw_base + pos; |
238 | hw_ptr_interrupt = runtime->hw_ptr_interrupt + runtime->period_size; | 250 | hw_ptr_interrupt = runtime->hw_ptr_interrupt + runtime->period_size; |
@@ -353,6 +365,19 @@ int snd_pcm_update_hw_ptr(struct snd_pcm_substream *substream) | |||
353 | xrun(substream); | 365 | xrun(substream); |
354 | return -EPIPE; | 366 | return -EPIPE; |
355 | } | 367 | } |
368 | if (xrun_debug(substream, 16)) { | ||
369 | char name[16]; | ||
370 | pcm_debug_name(substream, name, sizeof(name)); | ||
371 | snd_printd("hw_update: %s: pos=0x%x/0x%x/0x%x, " | ||
372 | "hwptr=0x%lx, hw_base=0x%lx, hw_intr=0x%lx\n", | ||
373 | name, pos, | ||
374 | (int)runtime->period_size, | ||
375 | (int)runtime->buffer_size, | ||
376 | (long)old_hw_ptr, | ||
377 | (long)runtime->hw_ptr_base, | ||
378 | (long)runtime->hw_ptr_interrupt); | ||
379 | } | ||
380 | |||
356 | hw_base = runtime->hw_ptr_base; | 381 | hw_base = runtime->hw_ptr_base; |
357 | new_hw_ptr = hw_base + pos; | 382 | new_hw_ptr = hw_base + pos; |
358 | 383 | ||