libsoundio icon indicating copy to clipboard operation
libsoundio copied to clipboard

Always get ALSA "Debug" written to display

Open angaz opened this issue 8 years ago • 5 comments

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

angaz avatar Dec 27 '16 13:12 angaz

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.

andrewrk avatar Dec 27 '16 18:12 andrewrk

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.

angaz avatar Dec 27 '16 18:12 angaz

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

gamax92 avatar Dec 30 '16 21:12 gamax92

Nice find. I'll do that.

andrewrk avatar Dec 31 '16 18:12 andrewrk

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

...

alichraghi avatar Jul 06 '22 09:07 alichraghi