GNOME Bugzilla – Bug 705477
directsoundsink: Glitches when playing S8
Last modified: 2013-08-28 22:00:50 UTC
Hi, here is a list of media type that wouldn't play well under windows, medias where tested using the following cmd : C:\gstreamer\1.0\x86\bin>gst-launch-1.0.exe playbin uri=file:///c:/mini_ctt/themedia.ext here are my results : WMA PRO 8ch constant bitrate 96kHz 24b KO WMA PRO 6ch constant bitrate 96kHz 24b KO WMA FULL 2ch Variable bitrate 44kHz OK WMA BASE 2ch Constant bitrate 48kHz OK MP3 KO WAV OK AAC OK AC3 KO MPEG2PS KO MPEG2TS OK WMV...............(Some are OK some are NOT, I can send more details on the different kinds of WMV I got)
Can you provide access to these files and provide more information about how they fail?
here is a file that fails playing on my computer : http://gstreamer.freedesktop.org/media/dlna/strict/audio/NiN_Ghosts_II_12.mp3 I play it using the following cmd : C:\gstreamer\1.0\x86\bin>gst-launch-1.0.exe playbin uri=file:///c:/gstreamer_media/dlna/strict/audio/NiN_Ghosts_II_12.mp3 then I tried to make a wav from it : C:\gstreamer\1.0\x86\bin>gst-launch-1.0.exe filesrc location=c:/gstreamer_media/dlna/strict/audio/NiN_Ghosts_II_12.mp3 ! decodebin ! wavenc ! filesink location=bad.wav the wav is good when playing it in WMP but if I play it using gstlaunch, same noisy output. The sound is saturated and loud. I can send you some DOT files in needed Eric
Ah, so the audio output is distorted? Are you using directsoundsink? Is it better if you resample to a different sample rate before the sink or to a different number of channels or sample format?
*** Bug 705663 has been marked as a duplicate of this bug. ***
Hi, is there a way to had a resampler when creating the pipeline with playbin? or should I use something like "filesrc ! decodebin! resample!autoaudiosink" ?
filesrc ! decodebin ! audioconvert ! audioresample ! "audio/x-raw,format=S16LE,rate=48000" ! directsoundsink filesrc ! decodebin ! audioconvert ! audioresample ! "audio/x-raw,format=S32LE,rate=44100" ! directsoundsink for example. Try a bit with different sample rates and formats.
Created attachment 252505 [details] Mp3 playing badly under windows gst 1.0.9 dot file of a pipeline decoding mp3 with Gst1.0 under windows, format ends as S8 instead of S16LE wich would be more suitable
Hi, I tried the different sample formats and sample rates. S16LE 48kHz is OK S16LE 44100kHz is OK S24LE and S32LE don't work ( audioresample and directsoundsink wont link together) and when building the pipeline using playbin, the audioconverter element converts from S32LE to S8. I've attached the dot file... Eric
So the samplerate does not matter, but if S8 is used by the sink everything fails? Does it work with U8 instead, can you test that?
You need this commit here for testing though: commit 7692e9e569b42ccd2cba297003d2036899428aeb Author: Sebastian Dröge <slomo@circular-chaos.org> Date: Wed Aug 21 16:32:50 2013 +0200 directsoundsink: WAVEFORMATEX is unsigned for 8 bit integers, and signed for others Probably fixes https://bugzilla.gnome.org/show_bug.cgi?id=705477
U8 doesn't work, the audioconvert wont link to the audiosink when format=U8 How should I get the commit you are mentionning?
Are you running on 32 bit or 64 bit Windows? I could get you a binary
I've got a 64bits windows, but running 32b gstreamer has the 64b seemed less usable. (If I remember, there was les plugins/decoders) So a 32b binary should do.
64 bit version has the same plugins, but here's the 32 bit plugin dll. Please replace your existing one with that http://people.freedesktop.org/~slomo/libgstdirectsoundsink.dll
That works nicely, thx
Thanks for testing!
Doesn't it still need investigating why audioconvert ! directsoundsink negotiates to an 8-bit format ? That should never really happen, no? (unless the input is 8-bit)
That's indeed a good question. Too bad that this is rather annoying to debug with 1.0 on Windows because of non-working GST_PTR_FORMAT... There was a bug up to 1.0.2 that could've caused this. Otherwise I don't possibly see how it could happen currently
In theory this pipeline should also negotiate to S8 then, but negotiates to S16LE here: > gst-launch-1.0 audiotestsrc ! capsfilter caps="audio/x-raw,format=S32LE,layout=interleaved,rate=44100,channels=2,channel-mask=0x3" ! audioconvert ! audioresample ! capsfilter caps="audio/x-raw, format = (string) S16LE, layout = (string) interleaved, rate = (int) [ 1, MAX ], channels = (int) [ 1, 2 ]; audio/x-raw, format = (string) S8, layout = (string) interleaved, rate = (int) [ 1, MAX ], channels = (int) [ 1, 2 ];" ! fakesink -v
Actually this: > gst-launch-1.0 audiotestsrc ! capsfilter caps="audio/x-raw,format=S32LE,layout=interleaved,rate=44100,channels=2,channel-mask=(bitmask)0x3" ! audioconvert ! audioresample ! capsfilter caps="audio/x-raw, format = (string) S16LE, layout = (string) interleaved, rate = (int) [ 1, MAX ], channels = (int) [ 1, 2 ]; audio/x-raw, format = (string) S8, layout = (string) interleaved, rate = (int) [ 1, MAX ], channels = (int) [ 1, 2 ];" ! fakesink -v
Also can't reproduce this here with latest 1.0 and directsoundsink and the same input caps... let's close until someone runs into the same problem.
Sebastian, I also have this issue using version 1.1.3. Strangely enough, it plays ok with flac files - but not with mp3 or ogg/vorbis It works with your dll but not with the one I compiled myself. How did you generated the dll ? Have you changed anything to the source code ? I can compile and test anything ... just briefly explain me how.
The fix is only in 1.1.4 (released today), not in 1.1.3 :)
Thank you Tim. What component have you modified ? Maybe I can just patch to avoid compiling the whole.
I believe this is the fix: http://cgit.freedesktop.org/gstreamer/gst-plugins-good/commit/?id=7692e9e569b42ccd2cba297003d2036899428aeb
Great, it works with that fix. Thank you :)
That's one fix, but the more interesting fix - which might be related - is in gst-plugins-base: http://cgit.freedesktop.org/gstreamer/gst-plugins-base/commit/gst/audioconvert?id=cebae4514a077d93f55053cce0d0d8a1ddc51488 (You never want 8-bit audio in the first place, it should negotiate to 16-bit audio).
I see. Ok. Thanks again :)