GNOME Bugzilla – Bug 489010
Please change default channel order for WAVE_EXT-less .wav files to follow ALSA's behaviour
Last modified: 2007-10-28 11:46:31 UTC
In gst-libs/gst/riff/riff-media.c:781 the fallback channel order for .WAV files without WAVE_FORMAT_EXTENSIBLE is defined. It defaults to something inspired by WAVEX. All .WAV files I could find on the Internet which lack WAVE_FORMAT_EXTENSIBLE follow a different order however, which happens to be the native one ALSA and AC3 uses. Specifically and most notable chan-id.wav from the SDL surround test files uses the ALSA/AC3 order. The SDL surround test files are arguably the most used test cases for surround sound:
I would thus suggest that GST follows the ALSA/AC3 order, not because some formal standard for .WAV would demand so, but just because this seems to be the order which is most often used for .WAV without WAVE_FORMAT_EXTENSIBLE.
It would be great if this gst-launch pipeline for chan_id.wav would yield proper results out-of-the-box, which it currently does not:
gst-launch filesrc location=chan_id.wav ! wavparse ! pulsesink
I'll take a look at this tomorrow, would be nice if you could try the resulting patch then :)
Created attachment 97733 [details] [review]
Is this patch working fine for you? Apart from your bug it also adds support for more numbers of channels with no channel mask set.
Some discussion on irc led to us deciding that the patch is probably sensible, but we want someone with _actual_ surround hardware to test it.
We also noted that this is NOT the ac3 order (ac3 order is different from the alsa order, and also different from what the existing code does), so we'll fix up the comments to not refer to AC3.
OK, I did some testing now. Works perfectly.
However, before this is being committed, please remove the debug output.
Which debug output?
woops, sorry. May bad. It was the surround patch I recently commited to gst-pulse which was the cause of that debug output. Your patch is fine.
Sorry for the confusion.
Please go a ahead and commit!
Great, thanks for testing :)
2007-10-28 Sebastian Dröge <firstname.lastname@example.org>
Use the ALSA channel layout as default for wav files without channel
layout information. This fixes playback of chan-id.wav on 5.1 systems
for example. Also refactor the channel layout setting a bit and add
more default channel orders. Fixes #489010.