After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 757472 - osxaudiosink: Invalid channel positions warning with headerless wav file
osxaudiosink: Invalid channel positions warning with headerless wav file
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
Other Mac OS
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Reported: 2015-11-02 12:49 UTC by vador
Modified: 2016-06-30 08:48 UTC
See Also:
GNOME target: ---
GNOME version: ---

An example wav file that I have tested with (13.94 KB, audio/x-wav)
2015-11-02 12:49 UTC, vador
audioconvert: Handle fallback channel mask for mono correctly (1.98 KB, patch)
2016-06-29 16:15 UTC, Sebastian Dröge (slomo)
committed Details | Review

Description vador 2015-11-02 12:49:32 UTC
Created attachment 314632 [details]
An example wav file that I have tested with

I have tried to playback several WAV files that are mono, PCM but gstreamer can not playback properly. There are various mono audio files that I have tried but couldn't find success case yet, the attachment file is an example for this case.
I can not 100% sure but just guess those files are all "headerless pcm .wav file".

Test case 1) problematic pipeline
 gst-launch-1.0 filesrc location=./infloop.wav ! decodebin ! audioconvert ! volume ! autoaudiosink

Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...

** (gst-launch-1.0:7333): WARNING **: Invalid channel positions

** (gst-launch-1.0:7333): WARNING **: Invalid channel positions
ERROR: from element /GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstWavParse:wavparse0: Internal data flow error.
Additional debug info:
gstwavparse.c(2249): gst_wavparse_loop (): /GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstWavParse:wavparse0:
streaming task paused, reason not-negotiated (-4)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...

** (gst-launch-1.0:7333): WARNING **: Invalid channel positions
Freeing pipeline ...

Test case 2) gstreamer makes sound but sounds *really* bad comparing other audio player
gst-launch-1.0 filesrc location=./infloop.wav ! decodebin ! autoaudiosink
Comment 1 Nicolas Dufresne (ndufresne) 2015-11-02 14:33:15 UTC
About test 2, I've tested with mplayer (it jumps) and VLC won't play it at all. GStreamer sound just like aplay (means a lot of static). It would be nice to tell which other player play it right so we have a reference.

About test 1, I've also tried (on 1.6.1) with both alsasink and pulsesink (the two options I have for autoaudiosink) and none present the warning you have. It would be nice if you could find out which audio sink is being used, and on which OS you are running this.
Comment 2 vador 2015-11-02 23:55:22 UTC
My miss not to mention platform and specific plugins.

Platform is Mac OS X and osxaudiosink, I didn't think it is related with audiosink, because I thought it is casued by audioconvert or wavparse negotiation problem.

in test case 2, I have compared the sound quality with Mac OS X's default "preview" application that properly playback the sample file. and I have also tested this file with Adacity with "import raw data..." Unsigned 8bit PCM, Little-endian, 1 channel (mono), start offset=0 bytes, sample rate 11000 Hz.
Comment 3 Tim-Philipp Müller 2016-05-22 22:32:51 UTC
Not sure what to do about this. Plays seemingly fine for me on Linux, same as mplayer plays it, same as

gst-launch-1.0 filesrc location= /home/tpm/samples/misc/757472-headerless.wav ! audioparse raw-format=u8 channels=1 rate=11000 ! queue ! pulsesink

Needs someone to re-test on OS/X I suppose.
Comment 4 Wonchul Lee 2016-06-29 08:45:20 UTC
For test1, I ran it with latest git master on OSX and it works. Just got an error message regardless of playback.

0:00:00.215131000 61931 0x7fdf118e0ca0 ERROR           audioconvert gstaudioconvert.c:585:void gst_audio_convert_fixate_channels(GstBaseTransform *, GstStructure *, GstStructure *):<audioconvert0> Have no default layout for 1 channels

For test2, it really makes lots of noise with this pipeline (gst-launch-1.0 filesrc location=./infloop.wav ! decodebin ! osxaudiosink) but it seems to be played well after adding audioconvert and volume element in front of the osxaudiosink.

@vador, I don't know that it has been solved recently, but if you're using the previous version of gstreamer could you check it with up-to-date one?
Comment 5 Sebastian Dröge (slomo) 2016-06-29 16:15:33 UTC
Created attachment 330601 [details] [review]
audioconvert: Handle fallback channel mask for mono correctly

It's 0 and no mask should be set for mono at all.
Comment 6 Sebastian Dröge (slomo) 2016-06-29 16:16:39 UTC
Wonchul, the above patch should fix your warnings.
Comment 7 Sebastian Dröge (slomo) 2016-06-29 16:18:02 UTC
Comment on attachment 330601 [details] [review]
audioconvert: Handle fallback channel mask for mono correctly

Attachment 330601 [details] pushed as 5de9d58 - audioconvert: Handle fallback channel mask for mono correctly
Comment 8 Wonchul Lee 2016-06-30 00:55:25 UTC
Sebastian, yup it works with that patch.
Comment 9 Sebastian Dröge (slomo) 2016-06-30 06:24:51 UTC
So anything else needed here? :)
Comment 10 Wonchul Lee 2016-06-30 08:23:24 UTC
I think it's enough to close this bug.