[alsa-devel] [BUG] dmix reports channel layouts that are not supported

wm4 nfxjfg at googlemail.com
Thu Dec 11 15:48:33 CET 2014


Opening a dmix device (i.e. "default" on most distros), and calling
snd_pcm_query_chmaps() on it, returns some surround audio channel maps,
for example 5.1. Trying to set it with snd_pcm_set_chmap() will fail
with ENXIO. Only setting the stereo channel map succeeds, and I suppose
dmix supports stereo only.

I think this should be considered a bug. dmix probably merely passes
through the channel layout of the underlying device, even though it
supports stereo only - this behavior makes no sense at all. Any device
should strictly report supported channel maps only.

To make matters worse, if you intend to play 5.1, and dmix fails in
the manner described above, then it will report "FL FR NA NA NA NA" as
channel map. This would require the application to pad stereo with 4
channels of silence, which requires extra code and is generally just
stupid.


More information about the Alsa-devel mailing list