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 647326 - [pulsesink] Produces crackling sound
[pulsesink] Produces crackling sound
Status: RESOLVED DUPLICATE of bug 646999
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
unspecified
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-04-09 23:30 UTC by Jens Landgré
Modified: 2011-04-15 17:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Output from gst-launch -v playbin2 uri=... (31.22 KB, text/plain)
2011-04-14 17:00 UTC, Jens Landgré
Details
GST_DEBUG=pulse*:5 GST_DEBUG_NO_COLOR=1 gst-launch filesrc location=... (387.30 KB, text/x-log)
2011-04-15 17:12 UTC, Jens Landgré
Details

Description Jens Landgré 2011-04-09 23:30:57 UTC
I have been playing multiple 16 bit flac files flawlessly with Banshee over spdif/iec958. But when I try to play 24 bit flac I get a slightly cracking/popping sound. It sounds like playing an old LP record...
I have tried multiple 24 bit flac files and they all produce the same result.
When playing the exact same files with mplayer the sound is perfect, without any cracking sounds.

I hope you can reproduce it. Listen carefully, the cracking sound is relatively quiet, but definitely loud enough to make it unpleasent to listen to.
Comment 1 Gabriel Burt 2011-04-12 17:23:56 UTC
Can you try with Totem or Rhythmbox (or gst-launch playbin2 uri=..) and see if the problem still occurs?  If so, it's a GStreamer issue.  If not, do you have a View -> Equalizer enabled in Banshee?
Comment 2 Jens Landgré 2011-04-12 19:12:17 UTC
You are right! Exactly the same behaviour in Rhythmbox and gst-launch, so I guess that it is a gstreamer problem. Should have thought about that.
How do you handle gstreamer bugs that affect Banshee. Do you close the bug on Banshee and should I open a new bug report on gstreamer? Or do you keep track on the problem by letting this bug refer to the bug on gstreamer?
Comment 3 Gabriel Burt 2011-04-12 19:16:59 UTC
Changing product to GStreamer
Comment 4 Sebastian Dröge (slomo) 2011-04-13 14:25:04 UTC
Does this only happen when playing over spdif and does it also happen with other 24 bit audio files? I can't test this here unfortunately
Comment 5 Jens Landgré 2011-04-13 17:44:53 UTC
I have tried playing over analog output as well, gives the same result.
After I converted the flac-file to wav and ogg the sound from gst-launch was clear, without cracks/pops. However, I was unable to confirm that the audio was still 24 bit. Couldn't find a tool that could verify this.
Comment 6 Sebastian Dröge (slomo) 2011-04-14 07:52:52 UTC
Does this also happen if you do
gst-launch-0.10 audiotestsrc ! audioconvert ! "audio/x-raw-int,depth=24,width=24" ! alsasink

and does it go away if you do
gst-launch-0.10 filesrc location=/path/to/flac/file ! decodebin2 ! audioconvert ! "audio/x-raw-int,depth=16,width=16" ! alsasink


(Please replace alsasink with the sink you're really using)
Comment 7 Jens Landgré 2011-04-14 16:27:16 UTC
I didn't manage to get this command to work:
   gst-launch-0.10 audiotestsrc ! audioconvert !
      "audio/x-raw-int,depth=24,width=24" ! alsasink
It complains that it "Could not negotiate format"

However, both the following two plays nicely:
   gst-launch-0.10 filesrc location=/path/to/flac/file ! decodebin2 !   
    audioconvert ! "audio/x-raw-int,depth=16,width=16" ! alsasink

   gst-launch filesrc location=/path/to/flac/file ! decodebin ! 
     audioconvert ! alsasink

While the "standard" way of playing does not:
   gst-launch playbin uri=/uri/to/flac/file

I was surprised to learn that decodebin does the job better than playbin does. I assumed that playbin was using the decodebin logic somehow.
Comment 8 Sebastian Dröge (slomo) 2011-04-14 16:42:01 UTC
playbin2/playbin is using decodebin internally. The problem here must be caused by something between the decoder and before your sink... or in your sink. It's weird that the pipeline without specifying the audio caps works.

Which sink have you set in gstreamer-properties?
Comment 9 Sebastian Dröge (slomo) 2011-04-14 16:44:32 UTC
Oh never mind. the automatically selected sink works too in your case.

What's the output of
gst-launch-0.10 -v playbin2 uri=file:///path/to/your/flac/file

And I assume this doesn't work either?
Comment 10 Jens Landgré 2011-04-14 17:00:43 UTC
Created attachment 185970 [details]
Output from gst-launch -v playbin2 uri=...

As the output is quite verbose I added it as an attachment.
I hope it helps. I noticed that the width was 32, don't know if that has anything to do with this though.
And, as you suspected, it does not work any better than playbin.
Comment 11 Sebastian Dröge (slomo) 2011-04-15 08:20:05 UTC
Ok, then let's try a few other combinations ;) Note that you're using pulsesink, not alsasink.


gst-launch-0.10 filesrc location=/path/to/your/flac ! decodebin2 ! audioconvert ! "audio/x-raw-int, signed=(boolean)true, width=(int)32, depth=(int)24" ! pulsesink

gst-launch-0.10 filesrc location=/path/to/your/flac ! decodebin2 ! audioconvert ! "audio/x-raw-int, signed=(boolean)true, width=(int)32, depth=(int)32" ! pulsesink

gst-launch-0.10 filesrc location=/path/to/your/flac ! decodebin2 ! audioconvert ! "audio/x-raw-float, width=(int)32" ! pulsesink

And the same with audiotestsrc instead of filesrc and decodebin2. If one produces cracking sound, does it work if you replace pulsesink by alsasink?
Comment 12 Tim-Philipp Müller 2011-04-15 08:30:43 UTC
Also good to test: alsasink device=hw:0  - there was a bug a while back in the conversion layers in alsa that caused crackling for some formats/widths.
Comment 13 Jens Landgré 2011-04-15 16:34:25 UTC
After having tested the various combinations it seems like the error is in the pulsesink. When using the alsasink (which in turn go to pulse via the alsa plugin) the sound is without crackling.
The various audioconversions does not seem to help. Not even when I tried to do a conversion to width=16, depth=16.
Comment 14 Sebastian Dröge (slomo) 2011-04-15 16:53:33 UTC
If you play something with paplay or a non-gstreamer based audio player that uses pulseaudio, do you still have the problem?
Comment 15 Jens Landgré 2011-04-15 16:57:33 UTC
No, when I play using "paplay <flac-file>" the sound is without crackles. The same goes for XBMC which also manages to play the file flawlessly.
Comment 16 Sebastian Dröge (slomo) 2011-04-15 17:01:13 UTC
Ok, great... could you get the debug output with GST_DEBUG=pulse*:5?

For example

GST_DEBUG=pulse*:5 GST_DEBUG_NO_COLOR=1 gst-launch-0.10 audiotestsrc ! pulsesink &> log
Comment 17 Jens Landgré 2011-04-15 17:12:36 UTC
Created attachment 186040 [details]
GST_DEBUG=pulse*:5 GST_DEBUG_NO_COLOR=1 gst-launch filesrc location=...

Attached the debug output. There seem to be quite a few underflows... can that be the reason? I counted 126 underflows during the 13 seconds I played. Can't say that I heard that many crackles though.
Comment 18 Sebastian Dröge (slomo) 2011-04-15 17:18:16 UTC
Which version of gst-plugins-good are you using?
Comment 19 Jens Landgré 2011-04-15 17:26:02 UTC
It is the one that comes with Ubuntu 11.04, i.e. 0.10.28-0ubuntu6
I have both a gstreamer0.10-pulseaudio and a gstreamer0.10-plugins-good.
Comment 20 Sebastian Dröge (slomo) 2011-04-15 17:36:57 UTC
I see, that's a bug in your distro packages unfortunately... added in 0.10.27-1ubuntu1

  * debian/patches/07_pulsesink_allow_larger_packets.patch: 
    - allow larger packets to be sent, prevents pulseaudio 
      from crashing on low-end machines

See bug #646999 and bug #641072.

*** This bug has been marked as a duplicate of bug 646999 ***