Skip to content

ALSA printing undesirable warnings to console (AlsaErrorHandler needs work?) #163

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
PortAudio-admin opened this issue Feb 13, 2011 · 4 comments
Labels
good first issue Good for newcomers linux Affects Linux P3 Priority: Normal src-alsa ALSA Host API /src/hostapi/alsa
Milestone

Comments

@PortAudio-admin
Copy link
Collaborator

Issue created by @RossBencina

[Trac: Originally assigned to none]

Ralph Irving submits:

Since the snd_lib_error_set_handler(AlsaErrorHandler) call was commented
out in r1543 of trunk/src/hostapi/alsa/pa_linux_alsa.c The ALSA
implementation now prints all ALSA lib messages to stderr, which is the
default if an error handler is not defined.

Before this change all error messages from the library were hidden, now
there is a flurry of messages when enumerating devices which don't exist.
The FindDeviceName function does this with the predefinedNames structure
at line 991 in r1605 of src/hostapi/alsa/pa_linux_alsa.c

Here is an example of the messages now displayed since this change if
the current sound device doesn't support the "feature" listed in the
predefined names.

ALSA lib pcm.c:2190:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.front
ALSA lib pcm.c:2190:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2190:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2190:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm.c:2190:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround40
ALSA lib pcm.c:2190:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround41
ALSA lib pcm.c:2190:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround50
ALSA lib pcm.c:2190:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround51
ALSA lib pcm.c:2190:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround71
ALSA lib pcm.c:2190:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2190:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2190:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2190:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2190:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2190:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2190:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2190:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2190:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline

Device enumeration is just one example of these ALSA lib messages output
but all messages from ALSA are displayed on the console now.

Perhaps the original thought that the error handler wasn't providing any
useful benefit was incorrect as mentioned in this comment in the r1543
diff;

+/** Uncommented because AlsaErrorHandler is unused for anything good yet.

I get regular inquires from users of squeezeslave worried that something
is broken since this change, when in fact the messages can be ignored.

I think that perhaps the AlsaErrorHandler needs to be reinstalled with the
additional changes described in the commit to avoid the seg fault of
course, as this helps hide the ALSA layer from PA.

@PortAudio-admin
Copy link
Collaborator Author

Comment by @RossBencina

My 2cents:
It seems to me that PA shouldn't really block all ALSA messages or we run the risk of missing real problems.

Perhaps we could just install the error handler while probing for unknown devices? or print everything ourselves from the error handler and then suppress errors like this that we know we're causing ourselves.

@PortAudio-admin
Copy link
Collaborator Author

Comment by @RossBencina

TRAC migration: propagating ticket status from TRAC

@PortAudio-admin PortAudio-admin added linux Affects Linux P3 Priority: Normal good first issue Good for newcomers src-alsa ALSA Host API /src/hostapi/alsa labels Sep 24, 2020
@PortAudio-admin PortAudio-admin added this to the V19 milestone Sep 24, 2020
dreamlayers added a commit to dreamlayers/gadgets that referenced this issue Nov 23, 2024
dreamlayers added a commit to dreamlayers/synaesthesia that referenced this issue Nov 23, 2024
dreamlayers added a commit to dreamlayers/synaesthesia that referenced this issue Nov 23, 2024
dreamlayers added a commit to dreamlayers/colourwaterfall that referenced this issue Nov 23, 2024
@thebluetropics
Copy link

hey this issue still exists, it still prints undesirable warnings to the console somehow

@rkapuaala
Copy link

These warning messages would be useful if the audio system were not working, but my audio system is working and every time I use the mic a stream of warnings is printed to stdrout about the sound cards not being found and being unable to open a slave.... yet the mic works, the sound works. So, if it works, what value are the warning messages?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers linux Affects Linux P3 Priority: Normal src-alsa ALSA Host API /src/hostapi/alsa
Projects
None yet
Development

No branches or pull requests

3 participants