libsoundio
libsoundio copied to clipboard
Always get ALSA "Debug" written to display
I'm not sure if this is a bug with soundio or my setup, but on Ubuntu 16.10, I always get this output to the terminal:
ALSA lib pcm_dsnoop.c:556:(snd_pcm_dsnoop_open) The dsnoop plugin supports only capture stream
ALSA lib pcm_dsnoop.c:556:(snd_pcm_dsnoop_open) The dsnoop plugin supports only capture stream
ALSA lib pcm_dsnoop.c:556:(snd_pcm_dsnoop_open) The dsnoop plugin supports only capture stream
ALSA lib pcm_dmix.c:1041:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm_dmix.c:1041:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm_dmix.c:979:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
ALSA lib pcm_dsnoop.c:556:(snd_pcm_dsnoop_open) The dsnoop plugin supports only capture stream
ALSA lib pcm_dmix.c:979:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
ALSA lib pcm_dsnoop.c:556:(snd_pcm_dsnoop_open) The dsnoop plugin supports only capture stream
ALSA lib pcm_dmix.c:979:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
ALSA lib pcm_dsnoop.c:556:(snd_pcm_dsnoop_open) The dsnoop plugin supports only capture stream
Could someone please advise how to get rid of this? The problem persists in the sio_ programs included with libsoundio. The program still runs as expected without any problems, just this output is annoying.
Thanks
I'm quite annoyed that the ALSA library writes garbage output to stdio. I'm guessing that this output is printed when libsoundio probes ALSA devices to see what their capabilities are. Sadly the ALSA library does not provide a mechansim for disabling log output. If I missed it, and you find such an API, please let me know.
It is indeed ALSA printing to stderr during probing. I noticed it was stderr when I was piping to cat -e and the error messages didn't get the $ at the ends of the lines. I did look through the ALSA API and have't found anything yet. I will inform you if I do find a way to clean up the output.
IIRC you can use snd_lib_error_set_handler
to change the behaviour of ALSA lib error messages
The default handler of snd_lib_error_default
is to print messages to stderr so just give it a function that does something else
Nice find. I'll do that.
JACK does the same. ~~just like ALSA it can be disabled with jack_set_error_function
~~
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
...