mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
alsa: log warning for unhandled formats
When we can't enumerate a single supported format, log a warning with the supported formats and access. See #526
This commit is contained in:
parent
da2fa8a599
commit
134f27a201
1 changed files with 19 additions and 0 deletions
|
|
@ -335,6 +335,25 @@ spa_alsa_enum_format(struct state *state, int seq, uint32_t start, uint32_t num,
|
|||
}
|
||||
}
|
||||
}
|
||||
if (j == 0) {
|
||||
char buf[1024];
|
||||
int i, offs;
|
||||
|
||||
for (i = 0, offs = 0; i <= SND_PCM_FORMAT_LAST; i++) {
|
||||
if (snd_pcm_format_mask_test(fmask, (snd_pcm_format_t)i))
|
||||
offs += snprintf(&buf[offs], sizeof(buf) - offs,
|
||||
"%s ", snd_pcm_format_name((snd_pcm_format_t)i));
|
||||
}
|
||||
spa_log_warn(state->log, "unsupported card: formats:%s", buf);
|
||||
|
||||
for (i = 0, offs = 0; i <= SND_PCM_ACCESS_LAST; i++) {
|
||||
if (snd_pcm_access_mask_test(amask, (snd_pcm_access_t)i))
|
||||
offs += snprintf(&buf[offs], sizeof(buf) - offs,
|
||||
"%s ", snd_pcm_access_name((snd_pcm_access_t)i));
|
||||
}
|
||||
spa_log_warn(state->log, "unsupported card: access:%s", buf);
|
||||
return -ENOTSUP;
|
||||
}
|
||||
if (j > 1)
|
||||
choice->body.type = SPA_CHOICE_Enum;
|
||||
spa_pod_builder_pop(&b, &f[1]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue