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 705477 - directsoundsink: Glitches when playing S8
directsoundsink: Glitches when playing S8
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
1.x
Other Windows
: Normal normal
: 1.0.10
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 705663 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2013-08-05 07:53 UTC by Eric
Modified: 2013-08-28 22:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Mp3 playing badly under windows gst 1.0.9 (16.49 KB, application/msword)
2013-08-21 07:34 UTC, Eric
Details

Description Eric 2013-08-05 07:53:18 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)
Comment 1 Sebastian Dröge (slomo) 2013-08-08 10:02:01 UTC
Can you provide access to these files and provide more information about how they fail?
Comment 2 Eric 2013-08-08 16:17:48 UTC
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
Comment 3 Sebastian Dröge (slomo) 2013-08-12 13:37:30 UTC
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?
Comment 4 Sebastian Dröge (slomo) 2013-08-13 11:40:10 UTC
*** Bug 705663 has been marked as a duplicate of this bug. ***
Comment 5 Eric 2013-08-14 07:57:17 UTC
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" ?
Comment 6 Sebastian Dröge (slomo) 2013-08-14 08:00:55 UTC
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.
Comment 7 Eric 2013-08-21 07:34:15 UTC
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
Comment 8 Eric 2013-08-21 07:35:18 UTC
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
Comment 9 Sebastian Dröge (slomo) 2013-08-21 14:14:15 UTC
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?
Comment 10 Sebastian Dröge (slomo) 2013-08-21 14:41:44 UTC
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
Comment 11 Eric 2013-08-21 15:17:30 UTC
U8 doesn't work, the audioconvert wont link to the audiosink when format=U8

How should I get the commit you are mentionning?
Comment 12 Sebastian Dröge (slomo) 2013-08-21 16:13:47 UTC
Are you running on 32 bit or 64 bit Windows? I could get you a binary
Comment 13 Eric 2013-08-21 16:16:21 UTC
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.
Comment 14 Sebastian Dröge (slomo) 2013-08-21 17:01:46 UTC
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
Comment 15 Eric 2013-08-22 07:17:19 UTC
That works nicely, thx
Comment 16 Sebastian Dröge (slomo) 2013-08-22 07:22:42 UTC
Thanks for testing!
Comment 17 Tim-Philipp Müller 2013-08-22 08:26:05 UTC
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)
Comment 18 Sebastian Dröge (slomo) 2013-08-22 09:44:32 UTC
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
Comment 19 Sebastian Dröge (slomo) 2013-08-22 09:48:36 UTC
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
Comment 20 Sebastian Dröge (slomo) 2013-08-22 09:49:54 UTC
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
Comment 21 Sebastian Dröge (slomo) 2013-08-22 10:23:09 UTC
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.
Comment 22 Alexandru Munteanu 2013-08-28 21:26:11 UTC
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.
Comment 23 Tim-Philipp Müller 2013-08-28 21:40:11 UTC
The fix is only in 1.1.4 (released today), not in 1.1.3 :)
Comment 24 Alexandru Munteanu 2013-08-28 21:43:37 UTC
Thank you Tim.
What component have you modified ?
Maybe I can just patch to avoid compiling the whole.
Comment 26 Alexandru Munteanu 2013-08-28 21:49:40 UTC
Great, it works with that fix. Thank you :)
Comment 27 Tim-Philipp Müller 2013-08-28 21:54:33 UTC
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).
Comment 28 Alexandru Munteanu 2013-08-28 22:00:50 UTC
I see. Ok. Thanks again :)