2008-12-10 15:02:47

by drago01

[permalink] [raw]
Subject: [PATCH] make usbaudio less noisy when CONFIG_SND_DEBUG_VERBOSE is not set

This puts changes the usbaudio debug messages to be less noisy, when
CONFIG_SND_DEBUG_VERBOSE is not set.

Some distrubutions (ex: fedora) enable CONFIG_SND_DEBUG to get more debug
information from their users, but some messages can be triggered very
frequently and therefore flood the logs.

This patch fixes this by only print them when CONFIG_SND_DEBUG_VERBOSE is set.

Cc: Takashi Iwai <[email protected]>
Cc: Chuck Ebbert <[email protected]>
Signed-off-by: Adel Gadllah <[email protected]>

diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c
index bbd70d5..6ddaa86 100644
--- a/sound/usb/usbaudio.c
+++ b/sound/usb/usbaudio.c
@@ -351,7 +351,7 @@ static int retire_capture_urb(struct
snd_usb_substream *subs,
for (i = 0; i < urb->number_of_packets; i++) {
cp = (unsigned char *)urb->transfer_buffer +
urb->iso_frame_desc[i].offset;
if (urb->iso_frame_desc[i].status) {
- snd_printd(KERN_ERR "frame %d active: %d\n", i,
urb->iso_frame_desc[i].status);
+ snd_printdd(KERN_ERR "frame %d active: %d\n", i,
urb->iso_frame_desc[i].status);
// continue;
}
len = urb->iso_frame_desc[i].actual_length / stride;
@@ -1299,7 +1299,7 @@ static int init_usb_sample_rate(struct
usb_device *dev, int iface,
if ((err = snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0), GET_CUR,
USB_TYPE_CLASS|USB_RECIP_ENDPOINT|USB_DIR_IN,
SAMPLING_FREQ_CONTROL << 8, ep, data, 3, 1000)) < 0) {
- snd_printk(KERN_WARNING "%d:%d:%d: cannot get freq at ep 0x%x\n",
+ snd_printdd(KERN_WARNING "%d:%d:%d: cannot get freq at ep 0x%x\n",
dev->devnum, iface, fmt->altsetting, ep);
return 0; /* some devices don't support reading */
}