Bug 98139 - gstreamer crossfade hogs CPU
Summary: gstreamer crossfade hogs CPU
Status: RESOLVED WORKSFORME
Alias: None
Product: amarok
Classification: Applications
Component: general (show other bugs)
Version: 1.2-CVS
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-29 11:26 UTC by Mircea Bardac
Modified: 2006-06-11 12:32 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mircea Bardac 2005-01-29 11:26:22 UTC
Version:           1.1-cvs20050128 (using KDE KDE 3.3.2)
Installed from:    Unlisted Binary Package
Compiler:          GCC 3.4.3 
OS:                Linux

Gstreamer 0.8.8
Gst-plugins 0.8.7

Crossfade (in/out): tried 200ms, 2000ms (default), 1000ms... same result

Behaviour:
1. before starting the 1st song, a ~2s break in playing occurs... and then the fade in starts.. song continues with no problem
2. between 1st and 2nd song, before the crossfading should occur, the same ~2s break appears and then the crossfading is done and the 2nd song continues. 

It hogs (50% CPU - this is what KDE System Guard shows up for my HT CPU) between:
amarok: [CollectionDB] ......
and
amarok: [Gst-Engine] XFade-in finished.

This doesn't happen with Xine-engine.
In the Xine-engine case I get 
amarok: [CollectionDB] SELECT ....
and immediately...
amarok: [xine-engine] sleep: ... (lots of lines)
amarok: [xine-engine] sleep: 240000 volume: 0
amarok: [xine-engine] [virtual Fader::~Fader()]

Let me know if I can provide more feedback.
amarok's output doesn't seem to reveal anything suspicious.
Comment 1 Mark Kretschmann 2005-01-31 08:32:41 UTC
Is this with ogg vorbis files? Does it also happen for mp3?
Comment 2 Mircea Bardac 2005-01-31 11:01:11 UTC
It happens with mp3 files, I haven't tested with OGG.

Minor update: I'm using the 1.1 CVS version 2005-01-28 on GNU Linux.
Comment 3 Mark Kretschmann 2005-01-31 11:18:54 UTC
I suppose you mean 1.2-CVS?
Comment 4 Mircea Bardac 2005-01-31 11:46:53 UTC
Err... yeah.
But I don't know why it was packed as 1.1CVS after mxcl's post on the ArchLinux Forums [1] (I'm using ArchLinux). I'll notify the maintainer.

[1] http://bbs.archlinux.org/viewtopic.php?t=9520
Comment 5 Heinrich Wendel 2005-02-02 14:33:15 UTC
same here, changing songs always has a gap with gstreamer, also with crossfading disabled. using the same gstreamer, gst-plugins version.
Comment 6 Mark Kretschmann 2005-02-08 13:58:02 UTC
Make sure you don't have gst-ffmpeg installed, I hear that does weird things.
Comment 7 Heinrich Wendel 2005-02-08 14:11:23 UTC
yes, gst-ffmpeg is the bad guy
Comment 8 Mark Kretschmann 2005-02-08 14:28:18 UTC
Alright, closing this report, and adding an entry to our FAQ.
Comment 9 skrald 2005-02-08 21:26:56 UTC
I do not have gst-ffmpeg installed:
   dpkg -l | grep -i ffmpeg
gives no results. However I do have the mad plugin installed, as suggested in the FAQ:

dpkg -l | grep -i mad   
ii  gstreamer-mad  0.6.4-5.1      MAD MPEG audio decoder plugin for GStreamer
ii  gstreamer0.8-m 0.8.7-3        MAD MPEG audio decoder plugin for GStreamer
ii  libgpgme11     1.0.2-1        GPGME - GnuPG Made Easy
ii  libgpgme6      0.3.16-2       GPGME - GnuPG Made Easy
ii  libid3tag0     0.15.1b-3      ID3 tag reading library from the MAD project
ii  libmad0        0.15.1b-1      MPEG audio decoder library
ii  libmad0-dev    0.15.1b-1      MPEG audio decoder development library

I have the following gstreamer plugins installed:
ii  gstreamer-alsa 0.6.4-5.1      ALSA plugin for GStreamer
ii  gstreamer-audi 0.6.4-5.1      AudioFile plugin for GStreamer
rc  gstreamer-flac 0.6.4-5.1      FLAC plugin for GStreamer
ii  gstreamer-gcon 0.6.4-5.1      GConf support for GStreamer
ii  gstreamer-gnom 0.6.4-5.1      Gnome VFS plugin for GStreamer
ii  gstreamer-mad  0.6.4-5.1      MAD MPEG audio decoder plugin for GStreamer
ii  gstreamer-misc 0.6.4-5.1      Collection of various GStreamer plugins
ii  gstreamer-oss  0.6.4-5.1      OSS plugin for GStreamer
ii  gstreamer-plug 0.6.4-5.1      Simple GStreamer applications
ii  gstreamer-plug 0.6.4-5.1      Various GStreamer library plugins
ii  gstreamer-plug 0.6.4-5.1      Development files for various GStreamer libr
ii  gstreamer-tool 0.6.4-1.1      Tools for use with GStreamer
ii  gstreamer-vorb 0.6.4-5.1      Vorbis plugin for GStreamer
ii  gstreamer0.8-a 0.8.7-3        ATSC A/52 audio decoder plugin for GStreamer
ii  gstreamer0.8-a 0.8.7-3        AA-lib plugin for GStreamer
ii  gstreamer0.8-a 0.8.7-3        ALSA plugin for GStreamer
ii  gstreamer0.8-a 0.8.7-3        aRtsd plugin for GStreamer
ii  gstreamer0.8-a 0.8.7-3        AudioFile plugin for GStreamer
ii  gstreamer0.8-c 0.8.7-3        Colour AsCii Art library plugin for GStreame
ii  gstreamer0.8-c 0.8.7-3        cdparanoia plugin for GStreamer
ii  gstreamer0.8-d 0.8.7-3        DV plugin for GStreamer
ii  gstreamer0.8-d 0.8.7-3        DVD plugin for GStreamer
ii  gstreamer0.8-e 0.8.7-3        Enlightened Sound Daemon plugin for GStreame
ii  gstreamer0.8-f 0.8.7-3        Festival speech synthesis plugin for GStream
ii  gstreamer0.8-f 0.8.7-3        FLAC plugin for GStreamer
ii  gstreamer0.8-g 0.8.7-3        Gnome VFS plugin for GStreamer
ii  gstreamer0.8-g 0.8.7-3        GSM plugin for GStreamer
ii  gstreamer0.8-h 0.8.7-3        colorspace conversion plugin for GStreamer b
ii  gstreamer0.8-j 0.8.7-3        JACK plugin for GStreamer
ii  gstreamer0.8-j 0.8.7-3        JPEG plugin for GStreamer
ii  gstreamer0.8-m 0.8.7-3        MAD MPEG audio decoder plugin for GStreamer
ii  gstreamer0.8-m 0.8.7-3        MikMod decoder plugin for GStreamer
ii  gstreamer0.8-m 0.8.7-3        Collection of various GStreamer plugins
ii  gstreamer0.8-m 0.8.7-3        MPEG1 and MPEG2 video decoder plugin for GSt
ii  gstreamer0.8-o 0.8.7-3        OSS plugin for GStreamer
ii  gstreamer0.8-p 0.8.7-3        Simple GStreamer applications
ii  gstreamer0.8-p 0.8.7-3        All GStreamer plugins
ii  gstreamer0.8-s 0.8.7-3        SDL videosink plugin for GStreamer
ii  gstreamer0.8-s 0.8.7-3        C64 SID decoder plugin for GStreamer
ii  gstreamer0.8-s 0.8.7-3        Speex plugin for GStreamer
ii  gstreamer0.8-s 0.8.7-3        SWF (Macromedia Flash) decoder plugin for GS
ii  gstreamer0.8-t 0.8.7-3        Theora plugin for GStreamer
ii  gstreamer0.8-t 0.8.8-1        Tools for use with GStreamer
ii  gstreamer0.8-v 0.8.7-3        Vorbis plugin for GStreamer
ii  gstreamer0.8-x 0.8.7-3        X videosink plugin for GStreamer
ii  libgstreamer-g 0.8.7-3        GConf support for GStreamer
ii  libgstreamer-p 0.8.7-3        Various GStreamer libraries and library plug
ii  libgstreamer-p 0.8.7-3        Development files for various GStreamer libr
ii  libgstreamer0. 0.6.4-1.1      Core GStreamer libraries, plugins, and utili
ii  libgstreamer0. 0.8.8-1        Core GStreamer libraries, plugins, and utili
ii  libgstreamer0. 0.8.8-1        GStreamer development libraries and headers
ii  libkdegst0.6   0.6.1-8        KDE bindings for GStreamer (shared libraries
Comment 10 Mircea Bardac 2005-02-08 22:39:05 UTC
Removed gst-ffmpeg.
- alsasink produces a tiny annoying gap, exactly when amarok outputs [CollectionDB]... (I think I've reported this before, but on IRC)
- osssink works
Comment 11 skrald 2005-02-10 13:08:29 UTC
I noticed that the gap does not occur in all kinds of fades: When I press "stop" the fade begins without a preceeding gap, but when I change from one song to another, the gap occurs.
Comment 12 Mircea Bardac 2005-02-10 19:15:33 UTC
Using osssink is not very benefic for my system. ALSA handles the sounds everywhere, mixing them if possible (with sounds from other apps).
I've tried switching back to xine-engine BUT it didn't work.

Reinstalling gst-ffmpeg fixed xine-engine (unfortunately, xine-engine does not use alsa).
This makes me think:
1. xine-engine somehow depends on gst-ffmpeg
2. gst-ffmpeg works, but gstreamer-engine does not use it properly.

I have also noticed that gstreamer-engine + alsasink uses a lot more CPU that gstreamer-engine + osssink/xine-engine.

Crossfading in gstreamer-engine is done a lot more properly compared to crossfading in xine-engine. Using xine-engine, stopping a song does not fade out for example. (well.. this is another issue).