LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] snd-hda-intel: don't print using snd_printdd on device open
@ 2008-02-17 10:31 Adel Gadllah
2008-02-18 2:40 ` Chuck Ebbert
2008-02-18 6:54 ` Takashi Iwai
0 siblings, 2 replies; 4+ messages in thread
From: Adel Gadllah @ 2008-02-17 10:31 UTC (permalink / raw)
To: kernel list; +Cc: tiwai, Chuck Ebbert
Hi,
When CONFIG_SND_DEBUG_DETECT is set the hda-intel driver prints verbose
info like this:
ALSA sound/pci/hda/hda_intel.c:1259: azx_pcm_prepare: bufsize=0x4400,
fragsize=0x1100, format=0x11
ALSA sound/pci/hda/hda_codec.c:682: hda_codec_setup_stream: NID=0x7,
stream=0x5, channel=0, format=0x11
ALSA sound/pci/hda/hda_codec.c:682: hda_codec_setup_stream: NID=0x3,
stream=0x5, channel=0, format=0x11
ALSA sound/pci/hda/hda_codec.c:682: hda_codec_setup_stream: NID=0x3,
stream=0x0, channel=0, format=0x0
ALSA sound/pci/hda/hda_codec.c:682: hda_codec_setup_stream: NID=0x7,
stream=0x0, channel=0, format=0x0
ALSA sound/pci/hda/hda_codec.c:682: hda_codec_setup_stream: NID=0x3,
stream=0x0, channel=0, format=0x0
Every time when an app opens the sound device.
This makes it impossible for distribution to enable this config option
(to get more debug information for bug reports),
because its way too noisy.
SND_DEBUG_DETECT should only print stuff once when loading the driver.
There are some options to fix this:
1) don't print anything in functions that gets called when the device gets
opened/prepared for output.
2) use snd_printd instead of snd_printdd and make
CONFIG_SND_DEBUG_DETECT not depend on CONFIG_SND_DEBUG (this should be
done anyway)
3) introduce a CONFIG_SND_DEBUG_DETECT_VERBOSE and snd_printddv and use
it in this places (this one should be disabled by distributions then)
The attached patch implements 1) if 2) or 3) is preferred I can send a
patch to do this.
Please CC me when replying
----------
snd-hda-intel: don't print using snd_printdd on device open
Signed-off-by: Adel Gadllah <adel.gadllah@gmail.com>
CC: Takashi Iwai <tiwai@suse.de>
CC: Chuck Ebbert <cebbert@redhat.com>
diff -upNr linux-2.6.24.2.orign/sound/pci/hda/hda_codec.c
linux-2.6.24.2/sound/pci/hda/hda_codec.c
--- linux-2.6.24.2.orign/sound/pci/hda/hda_codec.c 2008-02-11
06:51:11.000000000 +0100
+++ linux-2.6.24.2/sound/pci/hda/hda_codec.c 2008-02-17
11:08:58.000000000 +0100
@@ -677,9 +677,6 @@ void snd_hda_codec_setup_stream(struct h
if (!nid)
return;
- snd_printdd("hda_codec_setup_stream: "
- "NID=0x%x, stream=0x%x, channel=%d, format=0x%x\n",
- nid, stream_tag, channel_id, format);
snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_CHANNEL_STREAMID,
(stream_tag << 4) | channel_id);
msleep(1);
diff -upNr linux-2.6.24.2.orign/sound/pci/hda/hda_intel.c
linux-2.6.24.2/sound/pci/hda/hda_intel.c
--- linux-2.6.24.2.orign/sound/pci/hda/hda_intel.c 2008-02-11
06:51:11.000000000 +0100
+++ linux-2.6.24.2/sound/pci/hda/hda_intel.c 2008-02-17
11:10:16.000000000 +0100
@@ -1249,9 +1249,6 @@ static int azx_pcm_prepare(struct snd_pc
return -EINVAL;
}
- snd_printdd("azx_pcm_prepare: bufsize=0x%x, fragsize=0x%x, "
- "format=0x%x\n",
- azx_dev->bufsize, azx_dev->fragsize, azx_dev->format_val);
azx_setup_periods(azx_dev);
azx_setup_controller(chip, azx_dev);
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] snd-hda-intel: don't print using snd_printdd on device open
2008-02-17 10:31 [PATCH] snd-hda-intel: don't print using snd_printdd on device open Adel Gadllah
@ 2008-02-18 2:40 ` Chuck Ebbert
2008-02-18 6:48 ` Takashi Iwai
2008-02-18 6:54 ` Takashi Iwai
1 sibling, 1 reply; 4+ messages in thread
From: Chuck Ebbert @ 2008-02-18 2:40 UTC (permalink / raw)
To: Adel Gadllah; +Cc: kernel list, tiwai
From: Adel Gadllah <adel.gadllah@gmail.com>
snd-hda-intel: don't print using snd_printdd on device open
When CONFIG_SND_DEBUG_DETECT is set the hda-intel driver prints verbose
info like this:
ALSA sound/pci/hda/hda_intel.c:1259: azx_pcm_prepare: bufsize=0x4400,
fragsize=0x1100, format=0x11
ALSA sound/pci/hda/hda_codec.c:682: hda_codec_setup_stream: NID=0x7,
stream=0x5, channel=0, format=0x11
ALSA sound/pci/hda/hda_codec.c:682: hda_codec_setup_stream: NID=0x3,
stream=0x5, channel=0, format=0x11
ALSA sound/pci/hda/hda_codec.c:682: hda_codec_setup_stream: NID=0x3,
stream=0x0, channel=0, format=0x0
ALSA sound/pci/hda/hda_codec.c:682: hda_codec_setup_stream: NID=0x7,
stream=0x0, channel=0, format=0x0
ALSA sound/pci/hda/hda_codec.c:682: hda_codec_setup_stream: NID=0x3,
stream=0x0, channel=0, format=0x0
Don't print anything in functions that get called when the device gets
opened/prepared for output.
Signed-off-by: Adel Gadllah <adel.gadllah@gmail.com>
Signed-off-by: Chuck Ebbert <cebbert@redhat.com>
CC: Takashi Iwai <tiwai@suse.de>
---
Orignal patch was mangled by sender's mail software.
diff -upNr linux-2.6.24.2.orign/sound/pci/hda/hda_codec.c linux-2.6.24.2/sound/pci/hda/hda_codec.c
--- linux-2.6.24.2.orign/sound/pci/hda/hda_codec.c 2008-02-11 06:51:11.000000000 +0100
+++ linux-2.6.24.2/sound/pci/hda/hda_codec.c 2008-02-17 11:08:58.000000000 +0100
@@ -677,9 +677,6 @@ void snd_hda_codec_setup_stream(struct h
if (!nid)
return;
- snd_printdd("hda_codec_setup_stream: "
- "NID=0x%x, stream=0x%x, channel=%d, format=0x%x\n",
- nid, stream_tag, channel_id, format);
snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_CHANNEL_STREAMID,
(stream_tag << 4) | channel_id);
msleep(1);
diff -upNr linux-2.6.24.2.orign/sound/pci/hda/hda_intel.c linux-2.6.24.2/sound/pci/hda/hda_intel.c
--- linux-2.6.24.2.orign/sound/pci/hda/hda_intel.c 2008-02-11 06:51:11.000000000 +0100
+++ linux-2.6.24.2/sound/pci/hda/hda_intel.c 2008-02-17 11:10:16.000000000 +0100
@@ -1249,9 +1249,6 @@ static int azx_pcm_prepare(struct snd_pc
return -EINVAL;
}
- snd_printdd("azx_pcm_prepare: bufsize=0x%x, fragsize=0x%x, "
- "format=0x%x\n",
- azx_dev->bufsize, azx_dev->fragsize, azx_dev->format_val);
azx_setup_periods(azx_dev);
azx_setup_controller(chip, azx_dev);
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] snd-hda-intel: don't print using snd_printdd on device open
2008-02-18 2:40 ` Chuck Ebbert
@ 2008-02-18 6:48 ` Takashi Iwai
0 siblings, 0 replies; 4+ messages in thread
From: Takashi Iwai @ 2008-02-18 6:48 UTC (permalink / raw)
To: Chuck Ebbert; +Cc: Adel Gadllah, kernel list
At Sun, 17 Feb 2008 21:40:32 -0500,
Chuck Ebbert wrote:
>
> From: Adel Gadllah <adel.gadllah@gmail.com>
>
> snd-hda-intel: don't print using snd_printdd on device open
>
> When CONFIG_SND_DEBUG_DETECT is set the hda-intel driver prints verbose
> info like this:
>
> ALSA sound/pci/hda/hda_intel.c:1259: azx_pcm_prepare: bufsize=0x4400,
> fragsize=0x1100, format=0x11
> ALSA sound/pci/hda/hda_codec.c:682: hda_codec_setup_stream: NID=0x7,
> stream=0x5, channel=0, format=0x11
> ALSA sound/pci/hda/hda_codec.c:682: hda_codec_setup_stream: NID=0x3,
> stream=0x5, channel=0, format=0x11
> ALSA sound/pci/hda/hda_codec.c:682: hda_codec_setup_stream: NID=0x3,
> stream=0x0, channel=0, format=0x0
> ALSA sound/pci/hda/hda_codec.c:682: hda_codec_setup_stream: NID=0x7,
> stream=0x0, channel=0, format=0x0
> ALSA sound/pci/hda/hda_codec.c:682: hda_codec_setup_stream: NID=0x3,
> stream=0x0, channel=0, format=0x0
>
> Don't print anything in functions that get called when the device gets
> opened/prepared for output.
Why? This debug option is explicitly for debugging purposes, and I
see no reason why such behavior is prohibited.
Takashi
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] snd-hda-intel: don't print using snd_printdd on device open
2008-02-17 10:31 [PATCH] snd-hda-intel: don't print using snd_printdd on device open Adel Gadllah
2008-02-18 2:40 ` Chuck Ebbert
@ 2008-02-18 6:54 ` Takashi Iwai
1 sibling, 0 replies; 4+ messages in thread
From: Takashi Iwai @ 2008-02-18 6:54 UTC (permalink / raw)
To: Adel Gadllah; +Cc: kernel list, Chuck Ebbert
At Sun, 17 Feb 2008 11:31:09 +0100,
Adel Gadllah wrote:
>
> Hi,
>
> When CONFIG_SND_DEBUG_DETECT is set the hda-intel driver prints verbose
> info like this:
>
> ALSA sound/pci/hda/hda_intel.c:1259: azx_pcm_prepare: bufsize=0x4400,
> fragsize=0x1100, format=0x11
> ALSA sound/pci/hda/hda_codec.c:682: hda_codec_setup_stream: NID=0x7,
> stream=0x5, channel=0, format=0x11
> ALSA sound/pci/hda/hda_codec.c:682: hda_codec_setup_stream: NID=0x3,
> stream=0x5, channel=0, format=0x11
> ALSA sound/pci/hda/hda_codec.c:682: hda_codec_setup_stream: NID=0x3,
> stream=0x0, channel=0, format=0x0
> ALSA sound/pci/hda/hda_codec.c:682: hda_codec_setup_stream: NID=0x7,
> stream=0x0, channel=0, format=0x0
> ALSA sound/pci/hda/hda_codec.c:682: hda_codec_setup_stream: NID=0x3,
> stream=0x0, channel=0, format=0x0
>
> Every time when an app opens the sound device.
> This makes it impossible for distribution to enable this config option
> (to get more debug information for bug reports),
Grr... why distrubionts need to set this option blindly at all?
> because its way too noisy.
> SND_DEBUG_DETECT should only print stuff once when loading the driver.
>
> There are some options to fix this:
>
> 1) don't print anything in functions that gets called when the device gets
> opened/prepared for output.
>
> 2) use snd_printd instead of snd_printdd and make
> CONFIG_SND_DEBUG_DETECT not depend on CONFIG_SND_DEBUG (this should be
> done anyway)
>
> 3) introduce a CONFIG_SND_DEBUG_DETECT_VERBOSE and snd_printddv and use
> it in this places (this one should be disabled by distributions then)
CONFIG_SND_DEBUG_DETECT is just a verbose debug option and thus
wrongly named. snd_printdd() there is the exactly intended behavior.
The real fix is to rename CONFIG_SND_DEBUG_DETECT to
CONFIG_SND_DEBUG_VERBOSE or so.
thanks,
Takashi
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-02-18 6:55 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-17 10:31 [PATCH] snd-hda-intel: don't print using snd_printdd on device open Adel Gadllah
2008-02-18 2:40 ` Chuck Ebbert
2008-02-18 6:48 ` Takashi Iwai
2008-02-18 6:54 ` Takashi Iwai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).