mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-06 13:29:56 -05:00
add utility functions to dump alsa PCM state
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2219 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
b9c10f2c56
commit
98b0152d7c
2 changed files with 46 additions and 0 deletions
|
|
@ -894,3 +894,46 @@ void pa_alsa_0dB_capture(snd_mixer_elem_t *elem) {
|
||||||
|
|
||||||
snd_mixer_selem_set_capture_volume_all(elem, v);
|
snd_mixer_selem_set_capture_volume_all(elem, v);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void pa_alsa_dump(snd_pcm_t *pcm) {
|
||||||
|
int err;
|
||||||
|
snd_output_t *out;
|
||||||
|
|
||||||
|
pa_assert(pcm);
|
||||||
|
|
||||||
|
pa_assert_se(snd_output_buffer_open(&out) == 0);
|
||||||
|
|
||||||
|
if ((err = snd_pcm_dump(pcm, out)) < 0)
|
||||||
|
pa_log_debug("snd_pcm_dump(): %s", snd_strerror(err));
|
||||||
|
else {
|
||||||
|
char *s = NULL;
|
||||||
|
snd_output_buffer_string(out, &s);
|
||||||
|
pa_log_debug("snd_pcm_dump():\n%s", pa_strnull(s));
|
||||||
|
}
|
||||||
|
|
||||||
|
pa_assert_se(snd_output_close(out) == 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void pa_alsa_dump_status(snd_pcm_t *pcm) {
|
||||||
|
int err;
|
||||||
|
snd_output_t *out;
|
||||||
|
snd_pcm_status_t *status;
|
||||||
|
|
||||||
|
pa_assert(pcm);
|
||||||
|
|
||||||
|
snd_pcm_status_alloca(&status);
|
||||||
|
|
||||||
|
pa_assert_se(snd_output_buffer_open(&out) == 0);
|
||||||
|
|
||||||
|
pa_assert_se(snd_pcm_status(pcm, status) == 0);
|
||||||
|
|
||||||
|
if ((err = snd_pcm_status_dump(status, out)) < 0)
|
||||||
|
pa_log_debug("snd_pcm_dump(): %s", snd_strerror(err));
|
||||||
|
else {
|
||||||
|
char *s = NULL;
|
||||||
|
snd_output_buffer_string(out, &s);
|
||||||
|
pa_log_debug("snd_pcm_dump():\n%s", pa_strnull(s));
|
||||||
|
}
|
||||||
|
|
||||||
|
pa_assert_se(snd_output_close(out) == 0);
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -82,4 +82,7 @@ int pa_alsa_calc_mixer_map(snd_mixer_elem_t *elem, const pa_channel_map *channel
|
||||||
void pa_alsa_0dB_playback(snd_mixer_elem_t *elem);
|
void pa_alsa_0dB_playback(snd_mixer_elem_t *elem);
|
||||||
void pa_alsa_0dB_capture(snd_mixer_elem_t *elem);
|
void pa_alsa_0dB_capture(snd_mixer_elem_t *elem);
|
||||||
|
|
||||||
|
void pa_alsa_dump(snd_pcm_t *pcm);
|
||||||
|
void pa_alsa_dump_status(snd_pcm_t *pcm);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue