Bug 90317 - gstreamer plugin refuses to play some mp3's
Summary: gstreamer plugin refuses to play some mp3's
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: general (show other bugs)
Version: 1.1
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-27 12:04 UTC by Damir Perisa
Modified: 2008-01-12 16:21 UTC (History)
0 users

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 Damir Perisa 2004-09-27 12:04:14 UTC
Version:           1.1 (using KDE 3.3.0, Arch Linux)
Compiler:          gcc version 3.4.2
OS:                Linux (i686) release 2.6.8.1-mm4

amarok: [Gst-Engine] Loading url: file:/mnt/sda1/musik/cds/Cranberries/Everybody%20Else%20Is%20Doing%20It,%20So%20Why%20Can%27t%20We/01%20%5BThe%20Cranberries%5D%20I%20Still%20Do.mp3
amarok: [InputPipeline::InputPipeline()] 
amarok: [virtual bool GstEngine::play(uint)] 
amarok: ERROR: [GStreamer Error] Internal GStreamer error: pad problem.  File a bug. ** gstpad.c(2490): gst_pad_set_explicit_caps: /thread10/bin28/spider67/mad29:
failed to negotiate (try_set_caps with "audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)16, depth=(int)16, rate=(int)48000, channels=(int)2" returned REFUSED)

some mp3's play ok, but some, like this one, are simply skipped :-(

this is very annoying, as the xine-engine plays songs ok, but i cannot hear them (volumes ok) and arts-engine seems to be broken too:

amarok: [aRts-Engine] Loading url: file:/mnt/sda1/musik/cds/Beatles/blue/01%20%5BBeatles%5D%20Strawberry%20fields%20forever.mp3
amarok: aRts-Engine: url.path()     == /mnt/sda1/musik/cds/Beatles/blue/01 [Beatles] Strawberry fields forever.mp3
amarok: aRts-Engine: url.protocol() == file
amarok: aRts-Engine: url.host()     == 
amarok: aRts-Engine: url.port()     == 0
amarok: ERROR: [ArtsEngine::connectTimeout()] Cannot initialize PlayObject! Skipping this track.

so the only engine that _works_ is the gstreamer-engine, but this refuses to play some files
Comment 1 Damir Perisa 2004-09-27 12:07:50 UTC
just found out: the arts engine is not broken! switching from gstreamer-engine to arts-engine requires a restart of amarok (as somehow, amarok keeps esd occupied also when not playing when gstreamer-engine with esd is selected) --- this may also maybe explain xine-engine trouble (not hearing things)

however, gstreamer-engine is still refusing some files ... always with the same trouble:

amarok: ERROR: [GStreamer Error] Internal GStreamer error: pad problem.  File a bug. ** gstpad.c(2490): gst_pad_set_explicit_caps: /thread10/bin28/spider67/mad29: 
 failed to negotiate (try_set_caps with "audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)16, depth=(int)16, rate=(int)48000, channels=(int)2" returned REFUSED) 
Comment 2 Damir Perisa 2004-09-27 12:13:27 UTC
switching from (not working) xine-engine to arts-engine does not require a restart - (maybe because xine is not at all using a sound device that stays locked, because when xine is choosen, i cannot hear anything, but it looks like it is playing things)
Comment 3 Damir Perisa 2004-09-27 12:23:31 UTC
finally found out how to make xine engine work!!!!
 
1)  run amarok
2)  choose xine engine
2b) do NOT try to play anything
3)  quit amarok (so that it saves the settings) 
4)  run amarok again - voilà: xine-engine produces sound!!!!
Comment 4 Mark Kretschmann 2004-09-27 12:25:47 UTC
On Monday 27 September 2004 12:07, Damir Perisa wrote:
> however, gstreamer-engine is still refusing some files 

This is an internal bug with GStreamer's caps negotiation. However, the 
problem does not occur with "simple" playback, like when you do gst-launch. 
It is only exposed by our crossfading code, which is in general more 
demanding for GStreamer.

There could be a workaround for this problem, but I have not found one so far. 
I would be glad if you posted this bug to GStreamer's bugzilla.

Comment 5 Damir Perisa 2004-09-27 12:27:59 UTC
summary: (sorry of all these posts)
--------

gstreamer engine: works, but refuses to play some mp3's 

xine engine: works, if after choosing it, you rerun amarok

arts engine: works, but troubles, if device is busy (unfortunately this happens, if you switch from other engine without restarting amarok)

(i wasn't able to compile MAS against ArchLinux CURRENT (gcc 3.4.2), so i cannot try this engine)
Comment 6 Mark Kretschmann 2004-09-27 12:34:32 UTC
..btw: It is not recommended to use esdsink! From my experience all sound server sinks do not work well with the crossfading code. (that's why I've disabled artsdsink completely).

I recommend using alsasink (with dmix if you need software mixing) or osssink.
Comment 7 Damir Perisa 2004-09-27 12:37:59 UTC
in response to comment 4: 

cross-reference: bugs @ gstreamer: http://bugzilla.gnome.org/show_bug.cgi?id=153830
Comment 8 Damir Perisa 2004-09-27 12:47:51 UTC
to comment 5: 
thanx for this tipp - i use xfce4 and it is very practical to use either arts or esd for the very heterogene environement of apps for sound in linux

the best thing for me right now is using arts, as then kde do not error not being able to play notifications --- unfortunately, arts is not the best engine around (performance, compatibility, ...)

i find it really great to have the ability to have the possibility to choose the backend for amarok - however, not all engines are the same (compatiblity ...)

crossfading: how do i disable crossfading for gstreamer-engine? (i don't need it, and it worked ok on 1.0.2 with all my music) --- setting 0ms is not working, as the files are still not able to be played
Comment 9 Damir Perisa 2004-09-27 16:42:03 UTC
tried to start "amarok theFileThatDoesNtPlay.mp3"

result:
[damir@Asteraceae bugmaterial]$ amarok 02\ \[Cranberries\,\ The\]\ Loud\ and\ clear.mp3
[amaroK loader] connecting to /home/damir/.kde/socket-Asteraceae/amarok.loader_socket
[amaroK loader] amaroK not running. Trying to start it..
amarok: BEGIN [static EngineBase* EngineController::loadEngine()]
amarok: [PluginManager] Plugin trader constraint: [X-KDE-amaroK-framework-version] == 3and [X-KDE-amaroK-plugintype] == 'engine' and [X-KDE-amaroK-name] == 'void-engine' and [X-KDE-amaroK-rank] > 0
amarok: [PluginManager] Trying to load: libamarok_void-engine_plugin
amarok: [amaroK::Plugin::Plugin(bool)]
amarok:
amarok: PluginManager Service Info:
amarok: ---------------------------
amarok: name                          : <no engine>
amarok: library                       : libamarok_void-engine_plugin
amarok: desktopEntryPath              : amarok_void-engine_plugin.desktop
amarok: X-KDE-amaroK-plugintype       : engine
amarok: X-KDE-amaroK-name             : void-engine
amarok: X-KDE-amaroK-authors          : (Max Howell,Mark Kretschmann)
amarok: X-KDE-amaroK-rank             : 1
amarok: X-KDE-amaroK-version          : 1
amarok: X-KDE-amaroK-framework-version: 3
amarok:
amarok: END [static EngineBase* EngineController::loadEngine()]
amarok: [browserBar] Initialisation statistics:
amarok:   Init: ContextBrowser
amarok: [ContextBrowser::ContextBrowser(const char*)]
amarok:     Time: 0.15s
amarok:   Init: CollectionBrowser
amarok: [CollectionView::CollectionView(CollectionBrowser*)]
amarok: [void CollectionView::renderView()]
amarok:     Time: 0.09s
amarok:   Init: PlaylistBrowser
amarok:     Time: 0.11s
amarok:   Init: SearchBrowser
amarok:     Time: 0.02s
amarok:   Init: FileBrowser
amarok:     Time: 0.04s
amarok: BEGIN [void App::applySettings(bool)]
amarok: Discovered 170 widgets in PlaylistWindow
amarok: BEGIN [static EngineBase* EngineController::loadEngine()]
amarok: [PluginManager] Plugin trader constraint: [X-KDE-amaroK-framework-version] == 3and [X-KDE-amaroK-plugintype] == 'engine' and [X-KDE-amaroK-name] == 'gst-engine' and [X-KDE-amaroK-rank] > 0
amarok: [PluginManager] Trying to load: libamarok_gstengine_plugin
amarok: [amaroK::Plugin::Plugin(bool)]
amarok: [GstEngine::GstEngine()]
amarok:
amarok: PluginManager Service Info:
amarok: ---------------------------
amarok: name                          : GStreamer Engine
amarok: library                       : libamarok_gstengine_plugin
amarok: desktopEntryPath              : amarok_gstengine_plugin.desktop
amarok: X-KDE-amaroK-plugintype       : engine
amarok: X-KDE-amaroK-name             : gst-engine
amarok: X-KDE-amaroK-authors          : (Mark Kretschmann)
amarok: X-KDE-amaroK-rank             : 255
amarok: X-KDE-amaroK-version          : 1
amarok: X-KDE-amaroK-framework-version: 3
amarok:
amarok: BEGIN [virtual bool GstEngine::init()]
amarok: Thread scheduling priority: 2
amarok: Sound output method: esdsink
amarok: CustomSoundDevice: false
amarok: Sound Device:
amarok: CustomOutputParams: false
amarok: Output Params:
amarok: END [virtual bool GstEngine::init()]
amarok: [static void PluginManager::unload(amaroK::Plugin*)]
amarok: [virtual amaroK::Plugin::~Plugin()]
amarok: [PluginManager] Unloading library: libamarok_void-engine_plugin
amarok: END [static EngineBase* EngineController::loadEngine()]
amarok: END [void App::applySettings(bool)]
amarok: [App] Pruned 0 of 2 amazon cover images.
[amaroK loader] startup successful.
[amaroK loader] exiting.
[damir@Asteraceae bugmaterial]$ amarok: [static void GstEngine::candecode_handoff_cb(GstElement*, GstBuffer*, void*)]
amarok: [Gst-Engine] Loading url: file:/home/damir/daperi.freelinuxhost.com/flow/bugmaterial/02%20%5BCranberries,%20The%5D%20Loud%20and%20clear.mp3
amarok: [InputPipeline::InputPipeline()]
amarok: [virtual bool GstEngine::play(uint)]

(process:3596): GStreamer-WARNING **: element thread0 claimed state-change success,but state didn't change to PLAYING. State is PAUSED (NONE_PENDING pending), fix the element
amarok: WARNING: [Gst-Engine] Could not set input thread to PLAYING.
amarok: [void GstEngine::destroyInput(InputPipeline*)]
amarok: [Gst-Engine] Destroying input pipeline.
amarok: BEGIN [InputPipeline::~InputPipeline()]
amarok: Destroying input bin.
amarok: END [InputPipeline::~InputPipeline()]
amarok: [virtual void LoaderServer::newConnection(int)]
amarok: Received: STARTUP (8 bytes)

then i see the amarok app with playlist with this file

when i press PLAY, this happens:

amarok: [Gst-Engine] Loading url: file:/home/damir/daperi.freelinuxhost.com/flow/bugmaterial/02%20%5BCranberries,%20The%5D%20Loud%20and%20clear.mp3
amarok: [InputPipeline::InputPipeline()]
amarok: [virtual bool GstEngine::play(uint)]
amarok: [static void GstEngine::inputError_cb(GstElement*, GstElement*, GError*, gchar*, void*)]
amarok: [void GstEngine::handleInputError()]
amarok: ERROR: An input bin has signaled an error condition, destroying.
amarok: [void GstEngine::destroyInput(InputPipeline*)]
amarok: [Gst-Engine] Destroying input pipeline.
amarok: BEGIN [InputPipeline::~InputPipeline()]
amarok: Destroying input bin.
amarok: END [InputPipeline::~InputPipeline()]

and amarok disappears (crashes?)
Comment 10 Damir Perisa 2004-09-27 16:42:48 UTC
i uploaded a file causing this trouble to my website:

http://daperi.freelinuxhost.com/flow/bugmaterial/02 [Cranberries, The] Loud and 
clear.mp3 
 
go to http://daperi.freelinuxhost.com/flow/bugmaterial/ and click on the file 
for download (because filename contains spaces, direct link may not work) 
Comment 11 Mark Kretschmann 2004-09-27 22:50:53 UTC
CVS commit by markey: 

FIX:
GStreamer engine was not able to play certain mp3 tracks, printing the error message "Internal GStreamer error: pad problem".

Explanation: 
Problem surfaced when a track had a different sample-rate than 41000. Adding audioscale and audioconvert elements to each input bin fixes the issue.

CCMAIL: 90317-done@bugs.kde.org
CCMAIL: amarok-devel@lists.sf.net


  M +5 -5      gstengine.cpp   1.193
  M +2 -2      gstengine.h   1.76


--- kdeextragear-1/amarok/src/engine/gst/gstengine.cpp  #1.192:1.193
@@ -416,5 +416,5 @@ GstEngine::load( const KURL& url, bool s
     }
 
-    gst_element_link_many( input->src, input->spider, input->volume, 0 );
+    gst_element_link_many( input->src, input->spider, input->audioconvert, input->audioscale, input->volume, 0 );
     // Prepare bin for playing
     gst_element_set_state( input->bin, GST_STATE_READY );
@@ -923,9 +923,7 @@ GstEngine::createPipeline()
     if ( !( m_gst_identity = createElement( "identity", m_gst_outputThread ) ) ) { return false; }
     if ( !( m_gst_volume = createElement( "volume", m_gst_outputThread ) ) ) { return false; }
-    if ( !( m_gst_audioscale = createElement( "audioscale", m_gst_outputThread ) ) ) { return false; }
-    if ( !( m_gst_audioconvert = createElement( "audioconvert", m_gst_outputThread, "audioconvert" ) ) ) { return false; }
 
     // More buffers means less dropouts and higher latency
-    gst_element_set( m_gst_queue, "max-size-buffers", 150, NULL );
+    gst_element_set( m_gst_queue, "max-size-buffers", 100, NULL );
 
     g_signal_connect( G_OBJECT( m_gst_identity ), "handoff", G_CALLBACK( handoff_cb ), 0 );
@@ -933,5 +931,5 @@ GstEngine::createPipeline()
 
     /* link elements */
-    gst_element_link_many( m_gst_adder, m_gst_queue, m_gst_identity, m_gst_volume, m_gst_audioscale, m_gst_audioconvert, m_gst_audiosink, 0 );
+    gst_element_link_many( m_gst_adder, m_gst_queue, m_gst_identity, m_gst_volume, m_gst_audiosink, 0 );
 
     setVolume( m_volume );
@@ -1041,4 +1039,6 @@ InputPipeline::InputPipeline()
     if ( !( bin = GstEngine::createElement( "bin" ) ) ) { goto error; }
     if ( !( spider = GstEngine::createElement( "spider", bin ) ) ) { goto error; }
+    if ( !( audioconvert = GstEngine::createElement( "audioconvert", bin ) ) ) { goto error; }
+    if ( !( audioscale = GstEngine::createElement( "audioscale", bin ) ) ) { goto error; }
     if ( !( volume = GstEngine::createElement( "volume", bin ) ) ) { goto error; }
 

--- kdeextragear-1/amarok/src/engine/gst/gstengine.h  #1.75:1.76
@@ -138,6 +138,4 @@ class GstEngine : public Engine::Base
         GstElement* m_gst_identity;
         GstElement* m_gst_volume;
-        GstElement* m_gst_audioscale;
-        GstElement* m_gst_audioconvert;
         GstElement* m_gst_audiosink;
 
@@ -194,4 +192,6 @@ class InputPipeline
         GstElement* spider;
         GstElement* volume;
+        GstElement* audioconvert;
+        GstElement* audioscale;
 };
 


Comment 12 anvesha a 2008-01-12 16:21:47 UTC
sir am not able to install gstreamer bad plugins....totem is not working..plz suggest me to correct it............