diff --git a/spa/plugins/alsa/alsa-pcm.c b/spa/plugins/alsa/alsa-pcm.c index 223116f49..d0d1e6cb6 100644 --- a/spa/plugins/alsa/alsa-pcm.c +++ b/spa/plugins/alsa/alsa-pcm.c @@ -718,6 +718,7 @@ static int enum_dsd_formats(struct state *state, uint32_t index, uint32_t *next, int res, err; snd_pcm_t *hndl; snd_pcm_hw_params_t *params; + snd_pcm_format_mask_t *fmask; struct spa_pod_frame f[2]; if ((index & 0xffff) > 0) @@ -727,6 +728,12 @@ static int enum_dsd_formats(struct state *state, uint32_t index, uint32_t *next, snd_pcm_hw_params_alloca(¶ms); CHECK(snd_pcm_hw_params_any(hndl, params), "Broken configuration: no configurations available"); + snd_pcm_format_mask_alloca(&fmask); + snd_pcm_hw_params_get_format_mask(params, fmask); + + if (!snd_pcm_format_mask_test(fmask, SND_PCM_FORMAT_DSD_U32_BE)) + return 0; + CHECK(snd_pcm_hw_params_set_rate_resample(hndl, params, 0), "set_rate_resample"); spa_pod_builder_push_object(b, &f[0], SPA_TYPE_OBJECT_Format, SPA_PARAM_EnumFormat);