Commit c1adc98f authored by Jaroslav Kysela's avatar Jaroslav Kysela Committed by Linus Torvalds

ALSA CVS update - Takashi Iwai <tiwai@suse.de>

PCM Midlevel
- suppress the xrun debug output unless xrun_debug proc is set.
- show stack trace when xrun_debug > 1.
parent c8658bfa
......@@ -428,7 +428,7 @@ struct _snd_pcm_str {
snd_info_entry_t *proc_root;
snd_info_entry_t *proc_info_entry;
#ifdef CONFIG_SND_DEBUG
unsigned int xrun_debug: 1;
unsigned int xrun_debug; /* 0 = disabled, 1 = verbose, 2 = stacktrace */
snd_info_entry_t *proc_xrun_debug_entry;
#endif
};
......
......@@ -403,7 +403,7 @@ static void snd_pcm_xrun_debug_write(snd_info_entry_t *entry, snd_info_buffer_t
snd_pcm_str_t *pstr = (snd_pcm_str_t *)entry->private_data;
char line[64];
if (!snd_info_get_line(buffer, line, sizeof(line)))
pstr->xrun_debug = !!simple_strtoul(line, NULL, 10);
pstr->xrun_debug = simple_strtoul(line, NULL, 10);
}
#endif
......
......@@ -167,6 +167,7 @@ static inline int snd_pcm_update_hw_ptr_post(snd_pcm_substream_t *substream,
substream->pcm->card->number,
substream->pcm->device,
substream->stream ? 'c' : 'p');
if (substream->pstr->xrun_debug > 1)
dump_stack();
}
#endif
......@@ -194,8 +195,11 @@ static inline int snd_pcm_update_hw_ptr_interrupt(snd_pcm_substream_t *substream
if (delta > 0) {
if ((snd_pcm_uframes_t)delta < runtime->buffer_size / 2) {
#ifdef CONFIG_SND_DEBUG
if (runtime->periods > 1)
if (runtime->periods > 1 && substream->pstr->xrun_debug) {
snd_printd(KERN_ERR "Unexpected hw_pointer value [1] (stream = %i, delta: -%ld, max jitter = %ld): wrong interrupt acknowledge?\n", substream->stream, (long) delta, runtime->buffer_size / 2);
if (substream->pstr->xrun_debug > 1)
dump_stack();
}
#endif
return 0;
}
......@@ -232,8 +236,11 @@ int snd_pcm_update_hw_ptr(snd_pcm_substream_t *substream)
if (delta > 0) {
if ((snd_pcm_uframes_t)delta < runtime->buffer_size / 2) {
#ifdef CONFIG_SND_DEBUG
if (runtime->periods > 2)
if (runtime->periods > 2 && substream->pstr->xrun_debug) {
snd_printd(KERN_ERR "Unexpected hw_pointer value [2] (stream = %i, delta: -%ld, max jitter = %ld): wrong interrupt acknowledge?\n", substream->stream, (long) delta, runtime->buffer_size / 2);
if (substream->pstr->xrun_debug > 1)
dump_stack();
}
#endif
return 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment