From 0f64e658fd34923a3be815582be500b8248019a0 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 3 Mar 2009 07:58:18 +0100 Subject: alsa: fall back to 32 bit samples if 16 is not supported There are a few high-end devices (e.g. ICE1724) which cannot even play 16 bit audio. Try the 32 bit fallback, which we already implemented for 24 bit. --- src/output/alsa_plugin.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/output/alsa_plugin.c b/src/output/alsa_plugin.c index 510f3761b..83df3279f 100644 --- a/src/output/alsa_plugin.c +++ b/src/output/alsa_plugin.c @@ -255,7 +255,8 @@ configure_hw: } err = snd_pcm_hw_params_set_format(ad->pcm, hwparams, bitformat); - if (err == -EINVAL && audio_format->bits == 24) { + if (err == -EINVAL && (audio_format->bits == 24 || + audio_format->bits == 16)) { /* fall back to 32 bit, let pcm_convert.c do the conversion */ err = snd_pcm_hw_params_set_format(ad->pcm, hwparams, SND_PCM_FORMAT_S32); -- cgit v1.2.3