unhelpful underrun messages on stderr (stdout?)
When using a program which links in libao, messages like these are common:
ALSA: underrun, at leaast 0ms
The problems with these messages are:
- The program creating the message is not identified
- The library creating the message is not identified
- The library is creating these messages without the linking program's permission
- The program may have a graphical interface, or a network interface, and thus standard out/error are the wrong place for informational messages.
- This occurs during normal operation, when there is no error
- The system may not even have sound output enabled, making this extra-useless.
- Can you get a negative time underrun?
Suggestions
Small improvement:: Clearly label this message as coming from libao, so that it can be identified.
Nicer improvement:: Label this message as coming form libao, but also identify the process generating the message. The program name would be nice, but just the PID would be a start.
Best improvement:: Unless this library is built or initialized in a special debug manner, do not print these messages at all, anywhere. They typically appear on terminals in active use by other programs, and even appear when the programmer of a tool has provided a -q for quiet mode and has carefully avoided sending any output to standard output or error, only to have her or his goals broken by libao, perhaps multiple libraries away.
Optionally, if you think sending them somewhere by default is really important, please provide some way users of programs (not developers against the library!) can specify where these messages are sent. EG. export LIBAO_WARNINGS_LOGFILE=/dev/null