Opened 10 years ago

Closed 10 years ago

#6292 closed defect (fixed)

Mythmusic cannot play mp3 songs in greek filenames

Reported by: yianniv Owned by: stuartm
Priority: critical Milestone: 0.22
Component: Plugin - MythMusic Version: head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

As it says. The "Play" indicator remains on (I think this is important), no sound plays, no progress on the song. Keys respond OK, nevertheless. I can press STOP, PLAY, etc, and the indicators turn on. Greek ID3 tags with English filenames work OK. English songs + ID tags OK. The problem occurs in both the local filesystem and an NFS mount.

Tried it with and without visualizers.

Scanning for new music has no problem, Greek songs are found normally as before. They just don't play.

I can't remember exactly, but around changeset 19730 music was OK. I am running s2api patches, but so did I when everything was OK.

Videos in Greek filenames play OK, if this helps.

Tried on two different pcs, Backend + Frontend: Debian Lenny RC1, Frontend: Opensuse 11.0

Output of mythbackend --version:

MythTV Version : 20036M MythTV Branch : trunk Library API : 0.22.20090220-1 Network Protocol : 44 QT Version : 4.4.3 Options compiled in:

linux release using_oss using_alsa using_arts using_jack using_backend using_directfb using_dvb using_firewire using_frontend using_hdpvr using_iptv using_ivtv using_libfftw3 using_lirc using_mheg using_opengl_video using_opengl_vsync using_qtwebkit using_v4l using_x11 using_xrandr using_xv using_xvmcusing_xvmc_vld using_xvmcw using_bindings_perl using_bindings_python using_opengl using_vdpau using_ffmpeg_threads using_libavc_5_3 using_live using_mheg

TIA,

Yianni.

Change History (18)

comment:1 Changed 10 years ago by yianniv

Update:

I don't know if it is relevant, but if I deselect all songs (any language), exit the selection screen, go into the selection screen again and select one song (any language), the song starts playing as soon as I press ESC to go to the main Mythmusic menu, before even I press Play Music. If I then enter the Play Music screen, the Play indicator is off but the song is playing.

Is this normal?

Yianni.

comment:2 Changed 10 years ago by t-p@…

I've same problem with directories and .flac song files containing Finnish alphabets like Ä and Ö. I think the problem started when external mad, vorbis and flac decoders were replaced with AVF decoder (ticket 19477).

comment:3 Changed 10 years ago by yianniv

No, I am pretty sure it was working in 19730, and some versions later (I update very often). The error I get in the shell I ran mythfrontend from is:

"Could open file with the AV decoder. Error: -2".

This message is in the avfdecoder.cpp file. Recent changesets that patched it are at least 19763 and 19817.

comment:4 in reply to:  2 Changed 10 years ago by yianniv

Replying to t-p@iki.fi:

I've same problem with directories and .flac song files containing Finnish alphabets like Ä and Ö. I think the problem started when external mad, vorbis and flac decoders were replaced with AVF decoder (ticket 19477).

I am sorry to doubt you, t-p@…, you were correct. Patch 19477 definitely caused the problem. I just checked with a fresh install on another PC.

Can someone PLEASE fix this??? I think there are a lot of non-English speaking people out here having the same problem.

Would the developers like me to provide more data on this? I would be more than willing to provide any.

Thanks,

Yianni.

comment:5 Changed 10 years ago by stuartm

Component: MythTV - GeneralPlugin - MythMusic
Milestone: unknown0.22
Owner: changed from Isaac Richards to stuartm

To be blunt, this is trunk, things will break and you shouldn't be running trunk if you don't want to take that risk. This will be fixed before the release of 0.22, sooner if someone takes an interest.

If you take the time to investigate the cause and either detail that here or, better yet, provide a patch then that might make things go faster.

comment:6 in reply to:  5 Changed 10 years ago by anonymous

Replying to stuartm:

To be blunt, this is trunk, things will break and you shouldn't be running trunk if you don't want to take that risk. This will be fixed before the release of 0.22, sooner if someone takes an interest.

I don't mind you being blunt, and I have every confidence that someone will sort it out sooner or later. It's just that I'm expecting the WAF to be dropping rapidly around here...

If you take the time to investigate the cause and either detail that here or, better yet, provide a patch then that might make things go faster.

I will definitely try and find what is causing this, unfortunately, however, my programming skills don't involve any flavour of C. I wish I could provide the patch but I doubt it. I will certainly try to debug it, though.

Thank you again for your time.

comment:7 Changed 10 years ago by yianniv

I started debugging the av_open_input_file function. My attempt is crude, but I came up with this:

The av_open_input_file function called in avfdecoder.cpp file is declared in mythtv/libs/libavformat/utils.c (please correct me if my assumption is wrong!)

The variable 'filename' in avfdecoder.cpp is in Greek ("/home/mythtv/Laika/01-Κάνε κάτι να χάσω το τραίνο.mp3"). So far so good. But if I printf the variable in utils.c, "/home/mythtv/Laika/01-???? ???? ?? ???? ?? ??????.mp3" comes out.

The exact code in utils.c that returns the error is:

if (!fmt
!(fmt->flags & AVFMT_NOFILE)) {

/* if no file needed do not try to open one */ if ((err=url_fopen(&pb, filename, URL_RDONLY)) < 0) {

goto fail;

}

The followind is the output from the mythfrontend shell. It includes some debugging messages I added, showing variable names + values. The lines starting with dates are the normal VERBOSE messages in avfdecoder.cpp.

I will keep debugging.....


&pd "-1769285760" -filename: "/home/mythtv/Laika/01-???? ???? ?? ???? ?? ??????.mp3" --URL_RDONLY: "0" /home/mythtv/Laika/01-???? ???? ?? ???? ?? ??????.mp32009-02-25 14:04:44.087 0x51d66a8 2009-02-25 14:04:44.087 Filename: "/home/mythtv/Laika/01-Κάνε κάτι να χάσω το τραίνο.mp3" 2009-02-25 14:04:44.087 0x0 2009-02-25 14:04:44.087 0x51d6668 2009-02-25 14:04:44.087 Could open file with the AV decoder. Error: -2

comment:8 Changed 10 years ago by teething12@…

Did you look at this: http://svn.mythtv.org/trac/ticket/5822

I fixed my mythmusic by doing what I wrote there. Make sure you rescan for music after making changes, you may want to clear the table before rescanning.

comment:9 in reply to:  8 Changed 10 years ago by yianniv

Replying to teething12@hotmail.com:

Did you look at this: http://svn.mythtv.org/trac/ticket/5822

I fixed my mythmusic by doing what I wrote there. Make sure you rescan for music after making changes, you may want to clear the table before rescanning.

Thank you for your post, teething12@… . It actually helped a lot, although I am not getting consistent results.

I scanned for music, selected non-english filename songs and they actually played! But when I exited the player, re-entered and selected another song (or many, even only English files) they didn't play. This behaviour is inconsistent. The next time I reselect the same or different songs they may play.

Maybe the QTextCodec::setCodecForLocale(QTextCodec::codecForName("ISO-8859-1")); line has to be entered somewhere else, as well? I tried it in the other functions but with no better results.

And another strange thing:

Greek letters should be sorted after the English letters. Now Greek are sorted first. Still alphabetically, of course, but this shouldn't be happening.

comment:10 Changed 10 years ago by teething12

Interesting. You may need to change ISO-8859-1 to the locale your machine is using, you can see which one you are using by typing "locale", all available ones by typing "locale -a". This is why I didn't make a patch, I was unable to figure out how to determine the locale for the machine through QT and setting it to the machine default wouldn't work.

comment:11 Changed 10 years ago by yianniv

This is really baffling...

If I set the codecForName to "el_GR.UTF-8", which is the locale on all my pcs, sorting of the songs is normal (English letters first, then Greek) but Greek songs don't play (they can be selected, but the progress indicator is idle, as well as the timer). If I select a Greek song while an English one is playing, the timer and progress indicator stay frozen to their previous position.

They only play when I leave it at ISO-8859-1, but they are sorted before the English songs, i.e. ΑΒΓΔΕ... ABCDE... instead of the opposite.

I am running out of ideas. I thing I will leave it as it is for now, using your method, teething12. At least it works. Once again, thank you.

comment:12 Changed 10 years ago by teething12

You would have to leave off the el_GR. and replace ISO-8859-1 with just UTF-8. Good to hear the other method works sort of:)

Good Luck.

comment:13 in reply to:  12 Changed 10 years ago by yianniv

Replying to teething12:

You would have to leave off the el_GR. and replace ISO-8859-1 with just UTF-8.

Yes, I know, trying the "el_GR" part too was my last hope. No cigar, though!

Good to hear the other method works sort of:)

Good Luck.

Thanks.

comment:14 Changed 10 years ago by yianniv

Last update: teething12's method is working!!

Sorry to be so late in reporting it, I hadn't touched mythtv for a while. Yes, I am now certain that teething12's method is working for me, and I bet for others, should they try it. I think exiting mythtv completely and then restarting it does it. Anyway, songs with non-English filenames play every single time now, with no exeptions.

For the people who want to try it, I am providing the patch, although I must again state that it's teething12's work, not mine. I'm just reporting it. Please try it, as far as I'm concerned this problem has been fixed!!

Maybe the people with the #6304 problem should give it a try, too.

Thanks, again, everyone! This is such a great project!

===================================================================
--- mythplugins/mythmusic/mythmusic/filescanner.cpp     (revision 20041)
+++ mythplugins/mythmusic/mythmusic/filescanner.cpp     (working copy)
@@ -82,6 +82,7 @@
  */
 void FileScanner::BuildFileList(QString &directory, MusicLoadedMap &music_files, int parentid)
 {
+    QTextCodec::setCodecForLocale(QTextCodec::codecForName("ISO-8859-1"));
     QDir d(directory);

     if (!d.exists())

comment:15 Changed 10 years ago by teething12 (Lee)

Glad I could help and thanks for adding the patch! Hopefully it can help someone else.

Hmmm interesting to see ISO worked for you too, wonder if that is what it needs for everybody or it is related to MySQL in some way?

It is weird because I even tried retrieving my current locale and passing it into that function, but it wouldn't work even though my current local is ISO-8859-1. It just seems like there should be a less hard coded way to work around it, but since I got it working and really don't know much about QT programming, I haven't looked into it further.

comment:16 Changed 10 years ago by stuartm

Owner: changed from stuartm to Isaac Richards
Priority: minorcritical
Status: newassigned

comment:17 Changed 10 years ago by stuartm

Owner: changed from Isaac Richards to stuartm
Status: assignedaccepted

comment:18 Changed 10 years ago by stuartm

Resolution: fixed
Status: acceptedclosed

(In [21057]) Fix playback of files containing non-ascii characters in mythmusic. Closes #6292

Note: See TracTickets for help on using tickets.