We shouldn't spam on stderr unconditionally, so let's use ALSA subsystem for
printing errors.
err =
pulse_wait_stream_state(pcm->p, pcm->stream, PA_STREAM_READY);
if (err < 0) {
- fprintf(stderr,
- "*** PULSEAUDIO: Unable to create stream.\n");
+ SNDERR("PulseAudio: Unable to create stream: %s\n", pa_strerror(pa_context_errno(pcm->p->context)));
pa_stream_unref(pcm->stream);
pcm->stream = NULL;
goto finish;
pcm->ss.format = PA_SAMPLE_FLOAT32BE;
break;
default:
- fprintf(stderr, "*** PULSEAUDIO: unsupported format %s\n",
+ SNDERR("PulseAudio: Unsupported format %s\n",
snd_pcm_format_name(io->format));
err = -EINVAL;
goto finish;
return 0;
error:
- fprintf(stderr, "*** PULSEAUDIO: Unable to connect: %s\n",
+ SNDERR("PulseAudio: Unable to connect: %s\n",
pa_strerror(pa_context_errno(p->context)));
pa_threaded_mainloop_unlock(p->mainloop);