Skip to contentSkip to conversation

Remove xrun debugging?

DISCUSSION Lee Revell 7 participants 11 messages Apr 23, 2006 – Apr 24, 2006

lore
Share & tools
lore

Lee Revell

author
#0 lore raw

Can the xrun debug feature of ALSA please be removed? It was obsoleted long ago by the latency tracing feature of the -rt kernel, and has not been used to find a bug since 2004. At this point it's just confusing to users.

Lee

-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

#1 lore raw

So is it even useful in posting to bug reports? I think part
of the problem is that the only useful docs on xruns I've seen are either over my understanding or say to turn on xrun debug.

Quoted 6 lines · You

Can the xrun debug feature of ALSA please be removed? It was obsoleted long ago by the latency tracing feature of the -rt kernel, and has not been used to find a bug since 2004. At this point it's just confusing to users.

Lee

-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

#2 lore raw
In reply to Lee Revell
Quoted 4 lines · On Sun, 23 Apr 2006 00:43:24 -0400 Lee Revell <[email protected]> wrote:

Can the xrun debug feature of ALSA please be removed? It was obsoleted long ago by the latency tracing feature of the -rt kernel, and has not been used to find a bug since 2004. At this point it's just confusing to users.

It still might prove useful for non -rt users. I don't know exactly how useful, but maybe it's really a documentation bug. Put a note in the helpfile that much finer debugging can be done with the -rt kernels.

Flo

Signature · 9 lines
Palimm Palimm!
http://tapas.affenbande.org


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
author
#3 lore raw
Quoted 11 lines · Florian Schmidt
Quoted 4 lines · On Sun, 23 Apr 2006 00:43:24 -0400 Lee Revell <[email protected]> wrote:

Can the xrun debug feature of ALSA please be removed? It was obsoleted long ago by the latency tracing feature of the -rt kernel, and has not been used to find a bug since 2004. At this point it's just confusing to users.

It still might prove useful for non -rt users. I don't know exactly how useful, but maybe it's really a documentation bug. Put a note in the helpfile that much finer debugging can be done with the -rt kernels.

I don't think it's useful at all - any bugs that it could have found were fixed long ago. I have not seen useful output from it in a year and a half.

Lee

-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

#4 lore raw
Quoted 7 lines · On Sun, 23 Apr 2006 12:18:34 -0400 Lee Revell <[email protected]> wrote:
Quoted 3 lines

It still might prove useful for non -rt users. I don't know exactly how useful, but maybe it's really a documentation bug. Put a note in the helpfile that much finer debugging can be done with the -rt kernels.

I don't think it's useful at all - any bugs that it could have found were fixed long ago. I have not seen useful output from it in a year and a half.

That doesn't mean it won't prove useful in the future. But i don't know. Takashi? Jaroslav?

Flo

Signature · 9 lines
Palimm Palimm!
http://tapas.affenbande.org


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
author
#9 lore raw
In reply to John Rigg
Quoted 14 lines · John Rigg
Quoted 13 lines · Lee Revell
Quoted 11 lines · Florian Schmidt
Quoted 4 lines · On Sun, 23 Apr 2006 00:43:24 -0400 Lee Revell <[email protected]> wrote:

Can the xrun debug feature of ALSA please be removed? It was obsoleted long ago by the latency tracing feature of the -rt kernel, and has not been used to find a bug since 2004. At this point it's just confusing to users.

It still might prove useful for non -rt users. I don't know exactly how useful, but maybe it's really a documentation bug. Put a note in the helpfile that much finer debugging can be done with the -rt kernels.

Quoted 8 lines
Quoted 3 lines

I don't think it's useful at all - any bugs that it could have found were fixed long ago. I have not seen useful output from it in a year and a half.

Not everyone can use the -rt kernel. Last time I tried it there were still issues with x86_64 SMP (multiple single CPUs, not dual chip). Admittedly this was a couple of months ago, but on my dual Opteron I'm still running vanilla 2.6.14.4.

The latency tracer is available as a separate patch against the mainline kernel.

Lee

-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

#8 lore raw
In reply to Lee Revell
Quoted 9 lines · Lee Revell
Quoted 8 lines · Florian Schmidt
Quoted 4 lines · On Sun, 23 Apr 2006 00:43:24 -0400 Lee Revell <[email protected]> wrote:

Can the xrun debug feature of ALSA please be removed? It was obsoleted long ago by the latency tracing feature of the -rt kernel, and has not been used to find a bug since 2004. At this point it's just confusing to users.

Quoted 7 lines
Quoted 3 lines

It still might prove useful for non -rt users. I don't know exactly how useful, but maybe it's really a documentation bug. Put a note in the helpfile that much finer debugging can be done with the -rt kernels.

I don't think it's useful at all - any bugs that it could have found were fixed long ago. I have not seen useful output from it in a year and a half.

Not everyone can use the -rt kernel. Last time I tried it there were still issues with x86_64 SMP (multiple single CPUs, not dual chip). Admittedly this was a couple of months ago, but on my dual Opteron I'm still running vanilla 2.6.14.4.

John

-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

#5 lore raw
In reply to Florian Schmidt
Quoted 7 lines · Florian Schmidt
Quoted 4 lines · On Sun, 23 Apr 2006 12:18:34 -0400 Lee Revell <[email protected]> wrote:
Quoted 3 lines

It still might prove useful for non -rt users. I don't know exactly how useful, but maybe it's really a documentation bug. Put a note in the helpfile that much finer debugging can be done with the -rt kernels.

Quoted 6 lines
Quoted 3 lines

I don't think it's useful at all - any bugs that it could have found were fixed long ago. I have not seen useful output from it in a year and a half.

That doesn't mean it won't prove useful in the future. But i don't know. Takashi? Jaroslav?

I think that we can make the code optional for now. Patch for review is attached.

Jaroslav

-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, SUSE Labs

core/Kconfig +10 -0
diff -r a3bd04093933 core/Kconfig
@@ -171,3 +171,13 @@ config SND_DEBUG_DETECT
 	help
 	  Say Y here to enable extra-verbose log messages printed when
 	  detecting devices.
+
+config SND_PCM_XRUN_DEBUG
+	bool "Enable PCM ring buffer overrun/underrun debugging"
+	default n
+	depends on SND_PCM && SND_DEBUG
+	help
+	  Say Y to enable the PCM ring buffer overrun/underrun debugging.
+	  It is no usually required, but if you have trouble with
+	  sound clicking when system is loaded, it may help to determine
+	  the process or driver which causes the scheduling gaps.
core/pcm.c +3 -3
diff -r a3bd04093933 core/pcm.c
@@ -436,7 +436,7 @@ static void snd_pcm_substream_proc_statu
 	snd_iprintf(buffer, "appl_ptr    : %ld\n", runtime->control->appl_ptr);
 }
 
-#ifdef CONFIG_SND_DEBUG
+#ifdef CONFIG_SND_PCM_XRUN_DEBUG
 static void snd_pcm_xrun_debug_read(struct snd_info_entry *entry,
 				    struct snd_info_buffer *buffer)
 {
@@ -480,7 +480,7 @@ static int snd_pcm_stream_proc_init(stru
 	}
 	pstr->proc_info_entry = entry;
 
-#ifdef CONFIG_SND_DEBUG
+#ifdef CONFIG_SND_PCM_XRUN_DEBUG
 	if ((entry = snd_info_create_card_entry(pcm->card, "xrun_debug",
 						pstr->proc_root)) != NULL) {
 		entry->c.text.read_size = 64;
@@ -501,7 +501,7 @@ static int snd_pcm_stream_proc_init(stru
 
 static int snd_pcm_stream_proc_done(struct snd_pcm_str *pstr)
 {
-#ifdef CONFIG_SND_DEBUG
+#ifdef CONFIG_SND_PCM_XRUN_DEBUG
 	if (pstr->proc_xrun_debug_entry) {
 		snd_info_unregister(pstr->proc_xrun_debug_entry);
 		pstr->proc_xrun_debug_entry = NULL;
core/pcm_lib.c +3 -3
diff -r a3bd04093933 core/pcm_lib.c
@@ -130,7 +130,7 @@ static void xrun(struct snd_pcm_substrea
 static void xrun(struct snd_pcm_substream *substream)
 {
 	snd_pcm_stop(substream, SNDRV_PCM_STATE_XRUN);
-#ifdef CONFIG_SND_DEBUG
+#ifdef CONFIG_SND_PCM_XRUN_DEBUG
 	if (substream->pstr->xrun_debug) {
 		snd_printd(KERN_DEBUG "XRUN: pcmC%dD%d%c\n",
 			   substream->pcm->card->number,
@@ -204,7 +204,7 @@ static inline int snd_pcm_update_hw_ptr_
 	delta = hw_ptr_interrupt - new_hw_ptr;
 	if (delta > 0) {
 		if ((snd_pcm_uframes_t)delta < runtime->buffer_size / 2) {
-#ifdef CONFIG_SND_DEBUG
+#ifdef CONFIG_SND_PCM_XRUN_DEBUG
 			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)
@@ -249,7 +249,7 @@ int snd_pcm_update_hw_ptr(struct snd_pcm
 	delta = old_hw_ptr - new_hw_ptr;
 	if (delta > 0) {
 		if ((snd_pcm_uframes_t)delta < runtime->buffer_size / 2) {
-#ifdef CONFIG_SND_DEBUG
+#ifdef CONFIG_SND_PCM_XRUN_DEBUG
 			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)
#6 lore raw
Quoted 13 lines · Jaroslav Kysela
Quoted 11 lines · Florian Schmidt
Quoted 7 lines · On Sun, 23 Apr 2006 12:18:34 -0400 Lee Revell <[email protected]> wrote:
Quoted 3 lines

It still might prove useful for non -rt users. I don't know exactly how useful, but maybe it's really a documentation bug. Put a note in the helpfile that much finer debugging can be done with the -rt kernels.

I don't think it's useful at all - any bugs that it could have found were fixed long ago. I have not seen useful output from it in a year and a half.

Quoted 5 lines
Quoted 2 lines

That doesn't mean it won't prove useful in the future. But i don't know. Takashi? Jaroslav?

I think that we can make the code optional for now. Patch for review is attached.

I think this is a good approach. I do expect there are still bugs out there in non-x86 land, and this code would be usefull for that.

Jaroslav, a small typo in your additions:
- It is no usually required, but if you have trouble with
+ It is usually not required, but if you have trouble with

Thanks,
Martin

-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

#7 lore raw
In reply to Jaroslav Kysela

At Mon, 24 Apr 2006 10:55:02 +0200 (CEST),

Quoted 8 lines · Jaroslav Kysela

diff -r a3bd04093933 core/Kconfig

core/Kconfig +0 -0
@@ -171,3 +171,13 @@ config SND_DEBUG_DETECT
 	help
 	  Say Y here to enable extra-verbose log messages printed when
 	  detecting devices.

core/Kconfig config SND_DEBUG_DETECT · line 183

Quoted 10 lines
core/Kconfig +10 -0
+
+config SND_PCM_XRUN_DEBUG
+	bool "Enable PCM ring buffer overrun/underrun debugging"
+	default n
+	depends on SND_PCM && SND_DEBUG
+	help
+	  Say Y to enable the PCM ring buffer overrun/underrun debugging.
+	  It is no usually required, but if you have trouble with
+	  sound clicking when system is loaded, it may help to determine
+	  the process or driver which causes the scheduling gaps.

The dependency on SND_PCM should be removed. Otherwise this option won't be shown until a card driver with PCM support is chosen because CONFIG_SND_PCM is not a selection item by user but will be selected by the card driver.

Takashi

-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

#10 lore raw
In reply to Lee Revell

At Sun, 23 Apr 2006 16:53:55 -0400,

Quoted 20 lines · Lee Revell
Quoted 18 lines · John Rigg
Quoted 16 lines · Lee Revell
Quoted 11 lines · Florian Schmidt
Quoted 4 lines · On Sun, 23 Apr 2006 00:43:24 -0400 Lee Revell <[email protected]> wrote:

Can the xrun debug feature of ALSA please be removed? It was obsoleted long ago by the latency tracing feature of the -rt kernel, and has not been used to find a bug since 2004. At this point it's just confusing to users.

It still might prove useful for non -rt users. I don't know exactly how useful, but maybe it's really a documentation bug. Put a note in the helpfile that much finer debugging can be done with the -rt kernels.

I don't think it's useful at all - any bugs that it could have found were fixed long ago. I have not seen useful output from it in a year and a half.

Quoted 7 lines
Quoted 4 lines

Not everyone can use the -rt kernel. Last time I tried it there were still issues with x86_64 SMP (multiple single CPUs, not dual chip). Admittedly this was a couple of months ago, but on my dual Opteron I'm still running vanilla 2.6.14.4.

The latency tracer is available as a separate patch against the mainline kernel.

But you still have to modify the kernel core itself. It's a hard work for many users.

I think it's enough to make the relevant code selective via kernel config like Jaroslav's patch.
Remember that the XRUN stack-trace is disabled as default (you have to turn it on via proc file), and the code size you'll save is small, anyway.

Takashi

-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642