Chapter 16. Useful Functions

Table of Contents

snd_printk() and friends

snd_printk() and friends

ALSA provides a verbose version of the printk() function. If a kernel config CONFIG_SND_VERBOSE_PRINTK is set, this function prints the given message together with the file name and the line of the caller. The KERN_XXX prefix is processed as well as the original printk() does, so it's recommended to add this prefix, e.g.

  snd_printk(KERN_ERR "Oh my, sorry, it's extremely bad!\n");


There are also printk()'s for debugging. snd_printd() can be used for general debugging purposes. If CONFIG_SND_DEBUG is set, this function is compiled, and works just like snd_printk(). If the ALSA is compiled without the debugging flag, it's ignored.

snd_printdd() is compiled in only when CONFIG_SND_DEBUG_VERBOSE is set. Please note that CONFIG_SND_DEBUG_VERBOSE is not set as default even if you configure the alsa-driver with --with-debug=full option. You need to give explicitly --with-debug=detect option instead.