Bug 198008 - Phonon gstreamer backend does not play files with non-ASCII chars in name on non-UTF8-locales
Summary: Phonon gstreamer backend does not play files with non-ASCII chars in name on ...
Status: RESOLVED FIXED
Alias: None
Product: phonon-backend-gstreamer
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: Matthias Kretz
URL:
Keywords:
: 268741 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-06-26 23:53 UTC by Gunter Ohrner
Modified: 2011-04-27 21:15 UTC (History)
12 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.4.4


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gunter Ohrner 2009-06-26 23:53:41 UTC
Version:           4.3.1 (using KDE 4.2.4)
OS:                Linux
Installed from:    Debian testing/unstable Packages

Using the gstreamer phonon backend, I cannot play media files containing non-ASCII characters (or residing in a directory of which the name contains such characters) either using dragon or Amarok.

Moving the files into a directory containing an ASCII-only name / renaming the media file itself works around this bug.
Comment 1 Martin Sandsmark 2009-06-27 00:58:10 UTC
I  take it this is also on a non-utf8 system?
Comment 2 Gunter Ohrner 2009-06-27 10:38:11 UTC
Yes, sorry, that was a vital piece of information I forgot to mention... :-/
It's the same system, iso 8859-15 encoding.

I tried gstreamer in order to be able to play my music collection using Amarok, as it does not work with xine, as reported. However, unfortunately, the gstreamer backend also failed.

Is there a way to enable debug logging for phonon gstreamer? I just guessed and tried "export PHONON_GSTREAMER_DEBUG=1", but this probably would have been too easy, it did not work. ;)
Comment 3 Nicolas L. 2009-09-27 13:44:56 UTC
you can use debugs with PHONON_DEBUG=1 PHONON_GST_DEBUG=3 my_program


is this still valid with a newer phonon release ? ( if it possible that you test with trunk release version ? )
Comment 4 Markus Torstensson 2009-11-16 19:24:58 UTC
KDE 4.3.1


I comfirm this bug. I have the same problem. Had to remove #, [, ] from path name to be able to play the file in Amarok (2.1.1). 

Here's the dump debug logging:

"PGST(2): Using GStreamer 0.10.25"                          
"PGST(2): AudioOutput using alsa audio sink"                
"PGST(3): Found new audio device default  (DeviceManager 0x82998e0)" 
"PGST(2): AudioOutput using alsa audio sink"                         
"PGST(3): Found new audio device hw:0,0  (DeviceManager 0x82998e0)"  
"PGST(2): AudioOutput using alsa audio sink"                         
"PGST(3): Found new audio device hw:0,1  (DeviceManager 0x82998e0)"  
"PGST(2): AudioOutput using alsa audio sink"                         
"PGST(3): Found new audio device hw:0,2  (DeviceManager 0x82998e0)"  
"PGST(2): AudioOutput using alsa audio sink"                         
"PGST(2): virtual bool Phonon::Gstreamer::AudioOutput::setOutputDevice(const Phonon::AudioOutputDevice&)  (AudioOutput 0x82a7d20)"                              
"PGST(2): virtual bool Phonon::Gstreamer::AudioOutput::setOutputDevice(const Phonon::AudioOutputDevice&)setProperty(device,x-phonon:CARD=0,DEV=0) succeeded  (AudioOutput 0x82a7d20)"                                                           
"PGST(2): virtual bool Phonon::Gstreamer::AudioOutput::setOutputDevice(const Phonon::AudioOutputDevice&)go to old state on devicex-phonon:CARD=0,DEV=0 succeeded  (AudioOutput 0x82a7d20)"                                                      
"PGST(2): Backend connected Phonon::Gstreamer::MediaObject to Phonon::Gstreamer::AudioOutput"                                                                   
"PGST(2): Backend connected Phonon::Gstreamer::MediaObject to Phonon::Gstreamer::VolumeFaderEffect"
"PGST(2): Backend connected Phonon::Gstreamer::VolumeFaderEffect to Phonon::Gstreamer::AudioOutput"
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
091116 19:23:03  InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
Object::connect: No such signal KLineEdit::downPressed()
"PGST(3): Bus: state-changed (fakesink)  (MediaObject 0x82c3c10)"
amarok:  **********************************************************************************************
amarok:  ** AMAROK WAS STARTED IN NORMAL MODE. IF YOU WANT TO SEE DEBUGGING INFORMATION, PLEASE USE: **
amarok:  ** amarok --debug                                                                           **
amarok:  **********************************************************************************************
"PGST(3): Bus: state-changed (typefind)  (MediaObject 0x82c3c10)"
"PGST(3): Bus: state-changed (decodebin0)  (MediaObject 0x82c3c10)"
"PGST(3): Bus: state-changed (pipeline0)  (MediaObject 0x82c3c10)"
"PGST(3): gstreamer: pipeline state set to ready  (MediaObject 0x82c3c10)"
kiosk@linux-o1hu:~> "PGST(2): file:///home/kiosk/Skrivbord/[#Ghibli] Hauru no Ugoku Shiro Saundotorakku [2004]/02 Joe Hisaishi - Youki na keikihei.mp3 is not a valid URI"
"PGST(2): Begin source load  (MediaObject 0x82c3c10)"
"PGST(3): Bus: state-changed (fakesink)  (MediaObject 0x82c3c10)"
"PGST(3): Bus: state-changed (typefind)  (MediaObject 0x82c3c10)"
"PGST(3): Bus: state-changed (decodebin0)  (MediaObject 0x82c3c10)"
"PGST(3): Bus: state-changed (pipeline0)  (MediaObject 0x82c3c10)"
"PGST(3): gstreamer: pipeline state set to ready  (MediaObject 0x82c3c10)"
"PGST(3): Bus: state-changed (typefind)  (MediaObject 0x82c3c10)"
Comment 5 Marcos Dione 2009-11-19 11:21:10 UTC
can you test again? there have been some changes lately in the backends about strange chars in filepaths.
Comment 6 Ronan Arraes Jardim Chagas 2009-11-29 19:16:39 UTC
I can confirm this bug.

Actually, neither GStreamer nor Xine backend can play files that path contains accents in non-UTF8 locales.

I'm also using ISO-8859-1 encoding and when I take a file with accent, use convmv to convert to UTF-8 and change my default locale to it, than the file is played well. Otherwise, if the enconding of the system and the file remains ISO-8859-1, than it cannot be played, and I have tried with amarok, juk and dragonplayer without luck.
Comment 7 Ronan Arraes Jardim Chagas 2009-11-29 19:17:30 UTC
By the way, I'm using KDE 4.3.3.
Comment 8 Marcos Dione 2009-12-01 12:29:04 UTC
Sorry, I meant svn. the patch will be included in KDE SC 4.4, so maybe we should wait until it's available to you.
Comment 9 Ronan Arraes Jardim Chagas 2009-12-02 11:48:15 UTC
Marcos Dione,
Is it possible to manually patch KDE 4.3.4 with this one?
I can easily do it and give you a feedback, just tell me where can I get this patch and where I have to apply it.
Comment 10 Alan Ezust 2010-01-16 20:52:03 UTC
The patches for both xine and gstreamer can be found here:
https://bugs.kde.org/show_bug.cgi?id=206085#c22

The xine is already in debian testing. but the gstreamer fix is not. 
Perhaps someone should submit it to gstreamer upstream also?
Comment 11 Marcos Dione 2010-02-21 00:00:33 UTC
Ronan: can you try again once KDE SC 4.4 reaches your distro?
Comment 12 Marco.Munderloh 2010-03-12 14:53:07 UTC
I'm using KDE 4.4.1 with Phonon 4.3.80 and I'm still not able to play any file containing special characters on a non-utf8 filesystem. I tried phonon 4.4.0 and still no luck :-(

Amarok 1.4 works fine, but there's no mysql-enabled packet available for openSUSE 11.2 anymore :-(
Comment 13 Rodrigo Herrera 2010-05-20 01:14:02 UTC
I have the same problem. (Amarok doesn't play songs with the title with and accent, or files inside folder with accent).

KDE 4.4.2, Amarok: 2.3.0.1 

[konsole]$ locale
LANG=es_CL
LC_CTYPE="es_CL"
LC_NUMERIC="es_CL"
LC_TIME="es_CL"
LC_COLLATE="es_CL"
LC_MONETARY="es_CL"
LC_MESSAGES="es_CL"
LC_PAPER="es_CL"
LC_NAME="es_CL"
LC_ADDRESS="es_CL"
LC_TELEPHONE="es_CL"
LC_MEASUREMENT="es_CL"
LC_IDENTIFICATION="es_CL"
LC_ALL=

[konsole]$ locale-gen:
Generating locales...
  es_CL.UTF-8... done
  es_CL.ISO-8859-1... done
Generation complete.

[konsole]$ amarok --debug
...
amarok: BEGIN: void EngineController::slotStateChanged(Phonon::State, Phonon::State) 
amarok:   [EngineController] [WARNING!] Phonon failed to play this URL. Error:  "19:04:50: input_file: Fichero no encontrado: >file:///home/rherrera/music/ismael%20serrano/ismael%20serrano%20-%20acu%C3%A9rdate%20de%20vivir%20(2010)/12%20-%20no%20reconozco.mp3<
" 
amarok:   BEGIN: void Playlist::Actions::requestNextTrack() 
amarok:     [Playlist::Actions] so far so good! 
amarok:     BEGIN: void Playlist::Actions::play(quint64, bool) 
amarok:       BEGIN: void EngineController::setNextTrack(Meta::TrackPtr) 
amarok:         [EngineController] locking mutex 
amarok:         [EngineController] locked! 
amarok:         BEGIN: void EngineController::play(const Meta::TrackPtr&, uint) 
amarok:           [EngineController] Just a normal, boring track... :-P 
amarok:           BEGIN: void EngineController::playUrl(const KUrl&, uint) 
amarok:             [EngineController] URL:  "file:///home/rherrera/music/ismael%20serrano/ismael%20serrano%20-%20acu%C3%A9rdate%20de%20vivir%20(2010)/13%20-%20papel%20encontrado%20en%20la%20cocina.mp3" 
amarok:             [EngineController] offset:  0 
amarok:             BEGIN: void EngineController::slotNewTrackPlaying(const Phonon::MediaSource&) 
amarok:               [EngineController] Using gain of 0 with relative peak of 0 
amarok:                returning bookmarkcurrenttrack action 
amarok:               BEGIN: virtual void Amarok::OSD::engineNewTrackPlaying() 
amarok:                 BEGIN: void OSDWidget::show(const QString&, QImage) 
amarok:                 END__: void OSDWidget::show(const QString&, QImage) - Took 0.0019s 
amarok:               END__: virtual void Amarok::OSD::engineNewTrackPlaying() - Took 0.026s 
amarok:               BEGIN: virtual void Amarok::KNotificationBackend::engineNewTrackPlaying() 
amarok:               END__: virtual void Amarok::KNotificationBackend::engineNewTrackPlaying() - Took 0.00011s 
amarok:               BEGIN: virtual void TimecodeObserver::engineNewTrackPlaying() 
amarok:                  curent track name:  "Papel Encontrado En La Cocina" 
amarok:                  Track timecodeable 
amarok:               END__: virtual void TimecodeObserver::engineNewTrackPlaying() - Took 0.00025s 
amarok:               BEGIN: void Playlist::PrettyListView::scrollToActiveTrack() 
amarok:                 [Playlist::PrettyListView] skipping scroll? false 
amarok:               END__: void Playlist::PrettyListView::scrollToActiveTrack() - Took 0.0023s 
amarok:               BEGIN: virtual void Context::ContextView::engineNewTrackPlaying() 
amarok:                 BEGIN: virtual void LyricsEngine::message(const Context::ContextState&) 
amarok:                   BEGIN: void ScriptManager::notifyFetchLyrics(const QString&, const QString&) 
amarok:                      SCRIPT "Lyricwiki" :  "request URL: http://lyrics.wikia.com/lyrics/Ismael_Serrano:Papel_Encontrado_En_La_Cocina" 
amarok:                     BEGIN: static QScriptValue Downloader::init(QScriptContext*, QScriptEngine*, bool) 
amarok:                     END__: static QScriptValue Downloader::init(QScriptContext*, QScriptEngine*, bool) - Took 0.00034s 
amarok:                   END__: void ScriptManager::notifyFetchLyrics(const QString&, const QString&) - Took 0.0016s 
amarok:                 END__: virtual void LyricsEngine::message(const Context::ContextState&) - Took 0.0022s 
amarok:                 BEGIN: virtual void CurrentEngine::message(const Context::ContextState&) 
amarok:                   BEGIN: void CurrentEngine::update() 
amarok:                   END__: void CurrentEngine::update() - Took 0.00041s 
amarok:                 END__: virtual void CurrentEngine::message(const Context::ContextState&) - Took 0.00059s 
amarok:                 BEGIN: void WikipediaEngine::update() 
amarok:                   BEGIN: bool EngineController::isStream() 
amarok:                   END__: bool EngineController::isStream() - Took 0.0001s 
amarok:                    Same entry requested again. Ignoring. 
amarok:                 END__: void WikipediaEngine::update() - Took 0.00036s 
amarok:               END__: virtual void Context::ContextView::engineNewTrackPlaying() - Took 0.0035s 
amarok:               BEGIN: virtual void ProgressWidget::engineNewTrackPlaying() 
amarok:                 BEGIN: virtual void ProgressWidget::engineTrackLengthChanged(qint64) 
amarok:                    new length:  239000 
amarok:                    slider enabled! 
amarok:                   BEGIN: void ProgressWidget::redrawBookmarks(const QString*) 
amarok:                     BEGIN: void Amarok::TimeSlider::clearTriangles() 
amarok:                        number of triangles:  0 
amarok:                        deleted them all... 
amarok:                     END__: void Amarok::TimeSlider::clearTriangles() - Took 0.0002s 
amarok:                      creating load timecode capability 
amarok:                      found  0  timecodes on this track 
amarok:                   END__: void ProgressWidget::redrawBookmarks(const QString*) - Took 0.00088s 
amarok:                 END__: virtual void ProgressWidget::engineTrackLengthChanged(qint64) - Took 0.0012s 
amarok:               END__: virtual void ProgressWidget::engineNewTrackPlaying() - Took 0.0014s 
amarok:                returning bookmarkcurrenttrack action 
amarok:             END__: void EngineController::slotNewTrackPlaying(const Phonon::MediaSource&) - Took 0.12s 
amarok:             [EngineController] track pos after play:  -1 
amarok:           END__: void EngineController::playUrl(const KUrl&, uint) - Took 0.12s 
amarok:         END__: void EngineController::play(const Meta::TrackPtr&, uint) - Took 0.12s 
amarok:       END__: void EngineController::setNextTrack(Meta::TrackPtr) - Took 0.12s 
amarok:     END__: void Playlist::Actions::play(quint64, bool) - Took 0.12s 
amarok:   END__: void Playlist::Actions::requestNextTrack() - Took 0.12s 
amarok:   BEGIN: void EngineSubject::stateChangedNotify(Phonon::State, Phonon::State) 
amarok:      State changed, oldState: 0 -> newState: 5 
amarok:     [Playlist::Actions] [WARNING!] Error, can not play this track. 
amarok:     [Playlist::Actions] [WARNING!] Failure count:  7 
amarok:      returning bookmarkcurrenttrack action 
amarok:   END__: void EngineSubject::stateChangedNotify(Phonon::State, Phonon::State) - Took 0.034s 
amarok: END__: void EngineController::slotStateChanged(Phonon::State, Phonon::State) - Took 0.16s
amarok: BEGIN: void EngineController::slotStateChanged(Phonon::State, Phonon::State) 
amarok:   BEGIN: void EngineSubject::stateChangedNotify(Phonon::State, Phonon::State) 
amarok:      State changed, oldState: 5 -> newState: 0 
amarok:      returning bookmarkcurrenttrack action 
amarok:   END__: void EngineSubject::stateChangedNotify(Phonon::State, Phonon::State) - Took 0.029s 
amarok: END__: void EngineController::slotStateChanged(Phonon::State, Phonon::State) - Took 0.03s 
[...]

:: amarokcollectionscanner .
<?xml version="1.0" encoding="UTF-8" ?><scanner><folder path="/home/rherrera/music/ismael serrano/"/>

<itemcount count="1"/>

<dud/><compilation path="/home/rherrera/music/ismael serrano"/>

</scanner>

[konsole]$ amarokcollectionscanner .
<?xml version="1.0" encoding="UTF-8" ?><scanner><folder path="/home/rherrera/music/ismael serrano/ismael serrano - acuérdate de vivir (2010)/"/>

<itemcount count="17"/>

<tags title="Podría Ser" compilation="checkforvarious" bitrate="188" uniqueid="amarok-sqltrackuid://4e4e2d42effe4795d338245aa62b69eb" filetype="0" track="1" discnumber="11" artist="Ismael Serrano" path="/home/rherrera/music/ismael serrano/ismael serrano - acuérdate de vivir (2010)/01 - podría ser.mp3" filesize="5984617" length="254000" samplerate="44100" album="acuérdate de vivir" comment="" genre="Cantautor" year="2010" audioproperties="true"/>
...
<tags title="Vuelvo" compilation="checkforvarious" bitrate="179" uniqueid="amarok-sqltrackuid://2b6eca56e7104399d75cc3a0e28c1761" filetype="0" track="6" discnumber="11" artist="Ismael Serrano" path="/home/rherrera/music/ismael serrano/ismael serrano - acuérdate de vivir (2010)/06 - vuelvo.mp3" filesize="5494783" length="244000" samplerate="44100" album="acuérdate de vivir" comment="" genre="Cantautor" year="2010" audioproperties="true"/>
...
<tags title="Balance" compilation="checkforvarious" bitrate="165" uniqueid="amarok-sqltrackuid://3380e7e07e0c6977eb0662e451f35776" filetype="0" track="15" discnumber="11" artist="Ismael Serrano" path="/home/rherrera/music/ismael serrano/ismael serrano - acuérdate de vivir (2010)/15 - balance.mp3" filesize="3672243" length="176000" samplerate="44100" album="acuérdate de vivir" comment="" genre="Cantautor" year="2010" audioproperties="true"/>

<dud/><image path="/home/rherrera/music/ismael serrano/ismael serrano - acuérdate de vivir (2010)/front cover.jpg" list="Ismael SerranoAMAROK_MAGICacuérdate de vivir"/>

<compilation path="/home/rherrera/music/ismael serrano/ismael serrano - acuérdate de vivir (2010)"/>

</scanner>
Comment 14 Michael 2010-06-03 02:04:07 UTC
I'm not sure if this is related to the last few entries of bug 172242, but it sounds like the same issue that is happening here.
Comment 15 Thierry MONNEREAU 2010-06-06 12:46:33 UTC
I've found the same bug ?
https://bugs.kde.org/show_bug.cgi?id=206085
Comment 16 Harald Sitter 2011-01-05 17:52:28 UTC
commit 015ed2031c7015f70fe05df8e393b2080a42587b
branch master
Author: Harald Sitter <sitter@kde.org>
Date:   Wed Jan 5 17:51:16 2011 +0100

    Apply QFile::encodeName on local files to ensure proper encoding (uses
    toLocal8Bit internally). This should take care of encoding problems.
    
    TODO for 4.5: evaluate whether we can use this for regular stream URLs
    too.
    
    BUG: 198008

diff --git a/gstreamer/mediaobject.cpp b/gstreamer/mediaobject.cpp
index ab87781..c520a69 100644
--- a/gstreamer/mediaobject.cpp
+++ b/gstreamer/mediaobject.cpp
@@ -489,9 +489,19 @@ bool MediaObject::createPipefromURL(const QUrl &url)
 
     // Create a new datasource based on the input URL
     // add the 'file' scheme if it's missing; the double '/' is needed!
-    QByteArray encoded_cstr_url = (url.scheme() == QLatin1String("") ?
-                    "file://" + url.toEncoded() :
-                    url.toEncoded());
+    QByteArray encoded_cstr_url;
+    if (url.scheme() == QLatin1String("")) {
+        encoded_cstr_url = QFile::encodeName("file://" + url.toString());
+    } else if (url.scheme() == QLatin1String("file")) {
+#ifdef __GNUC__
+#warning TODO 4.5
+#endif
+        // TODO 4.5: investigate whether this is necessary. Harald was a bit worrid
+        // that QFile::encodeName on an actual streaming URI could cause problems.
+        encoded_cstr_url = QFile::encodeName(url.toString());
+    } else {
+        encoded_cstr_url = url.toEncoded();
+    }
     m_datasource = gst_element_make_from_uri(GST_URI_SRC, encoded_cstr_url.constData(), (const char*)NULL);
     if (!m_datasource)
         return false;
Comment 17 Myriam Schweingruber 2011-03-19 15:44:17 UTC
*** Bug 268741 has been marked as a duplicate of this bug. ***
Comment 18 Myriam Schweingruber 2011-04-27 21:15:42 UTC
reassigning to the new bugzilla product for better bug tracing of the various backends. Sorry for the noise.