GNOME Bugzilla – Bug 545646
Doesn't play some Internet Radios
Last modified: 2009-03-29 12:58:33 UTC
There are some stations that play for me using Totem (GStreamer), but don't play using Banshee 1.2.0 Example URI's: * http://www.dr.dk/netradio/Metafiler/asx/dr_p2_64.asx No error reported to command line, just doesn't play. * mmsh://dms-cl-021.skypro-media.net/drs3?MSWMExt=.asf Error reported to command line: System.InvalidOperationException: Only HTTP and local playlist access is supported
I see this a lot: [Error 11:53:22.907] GStreamer stream error: TypeNotFound System.InvalidOperationException: Only HTTP and local playlist access is supported at Banshee.Playlists.Formats.PlaylistParser.Parse (Banshee.Base.SafeUri uri) [0x00000] at Banshee.Streaming.RadioTrackInfo.LoadStreamUri (System.String uri) [0x00000] Trying to get BBC Radio 1, BBC Sheffield and Hallam FM to work..
Alexander, For the first URI, it seems to be a bug in the ASX parsing code, I'll attach a patch. For the second URI, as the message says, you need to have an URI that starts with http://.
Created attachment 115677 [details] [review] Fix the xml parsing of asx files Actually parse the content of "entry" nodes. Without this patch, the second while loop is never executed, because when we get there xml_reader.Depth = 1.
*** Bug 545775 has been marked as a duplicate of this bug. ***
*** Bug 546146 has been marked as a duplicate of this bug. ***
Created attachment 115873 [details] [review] Support mixed case asx parsing ASX files should have all tags in caps, yet sometimes they don't. This patch adds support for both cases. Bertrand, I included your suggestion. You're right, it's better that way.
*** Bug 510782 has been marked as a duplicate of this bug. ***
Félix, in fact, I like your patch better than mine. It seems to fix the two issues. But the file is in DOS format (line termination). Could you please re-attach it in Unix format ?
Could be a little simpler/cleaner like this: element["uri"] = ResolveUri (xml_reader["HREF"] ?? xml_reader["href"]);
Created attachment 115933 [details] [review] final (hopefully) version This time in Unix format instead of DOS, and including the suggestion from Gabriel Burt
Looks good to me, please commit Bertrand.
Committed, thanks for your persistence Félix ! ;)
I can confirm that the patch works correctly for http://www1.streaming.net.nz/meta/tvworks-rock.asx
The URI I gave in the original bug report (http://www.dr.dk/netradio/Metafiler/asx/dr_p2_64.asx) still doesn't play for me. Error message is "[Error 19:43:31.235] GStreamer stream error: CodecNotFound" Totem on the same system plays that URI without problems. I can though also confirm that the URI in comment #13 works.
I've seen the same problem as Alex in comment #14. I'm having trouble with the first URI and this one: http://217.196.35.12/asx/skyradiolovesongs.asx Both of these work fine in totem, so it's not an actual codec problem, though the error messages would have us believe that. The command line out put is: [Debug 07:31:40.551] Attempting to parse radio playlist - http://217.196.35.12/asx/skyradiolovesongs.asx [Debug 07:31:40.669] Playing Radio Stream - http://217.196.35.31/preroll/skyradiolovesongs.mp3 [Debug 07:31:40.670] Player state change: Idle -> Loading [Debug 07:31:40.783] (libbanshee:player) bp_stop: setting state to GST_STATE_NULL [Debug 07:31:40.783] Player state change: Loading -> Idle [Error 07:31:40.787] GStreamer stream error: TypeNotFound [Debug 07:31:41.290] Querying model for track to play in Song:Next mode [Debug 07:31:41.311] Attempting to parse radio playlist - http://217.196.35.12/asx/skyradiolovesongs.asx [Debug 07:31:41.403] Playing Radio Stream - http://217.196.35.31/preroll/skyradiolovesongs.mp3 [Debug 07:31:41.403] Player state change: Idle -> Loading [Debug 07:31:41.535] (libbanshee:player) bp_stop: setting state to GST_STATE_NULL [Debug 07:31:41.535] Player state change: Loading -> Idle [Error 07:31:41.540] GStreamer stream error: TypeNotFound [Debug 07:31:42.042] Querying model for track to play in Song:Next mode [Debug 07:31:42.045] Attempting to parse radio playlist - http://217.196.35.12/asx/skyradiolovesongs.asx [Debug 07:31:42.136] Playing Radio Stream - http://217.196.35.31/preroll/skyradiolovesongs.mp3 [Debug 07:31:42.137] Player state change: Idle -> Loading [Debug 07:31:42.242] (libbanshee:player) bp_stop: setting state to GST_STATE_NULL [Debug 07:31:42.242] Player state change: Loading -> Idle [Error 07:31:42.244] GStreamer stream error: TypeNotFound [Debug 07:31:42.745] Querying model for track to play in Song:Next mode [Debug 07:31:42.749] Attempting to parse radio playlist - http://217.196.35.12/asx/skyradiolovesongs.asx [Debug 07:31:42.841] Playing Radio Stream - http://217.196.35.31/preroll/skyradiolovesongs.mp3 [Debug 07:31:42.841] Player state change: Idle -> Loading [Debug 07:31:42.948] (libbanshee:player) bp_stop: setting state to GST_STATE_NULL [Debug 07:31:42.948] Player state change: Loading -> Idle [Error 07:31:42.951] GStreamer stream error: TypeNotFound [Debug 07:31:43.451] Querying model for track to play in Song:Next mode [Debug 07:31:43.460] Attempting to parse radio playlist - http://217.196.35.12/asx/skyradiolovesongs.asx [Debug 07:31:43.552] Playing Radio Stream - http://217.196.35.31/preroll/skyradiolovesongs.mp3 [Debug 07:31:43.552] Player state change: Idle -> Loading [Debug 07:31:43.658] (libbanshee:player) bp_stop: setting state to GST_STATE_NULL [Debug 07:31:43.658] Player state change: Loading -> Idle [Error 07:31:43.661] GStreamer stream error: TypeNotFound [Debug 07:31:43.661] (libbanshee:player) bp_stop: setting state to GST_STATE_NULL
I tried the skyradio station. The ASX playlist lists to files, the first being a prerun/ad/intro type thing. But the file it points to is empty, which I think triggers a gst error which causes Banshee to move on to the next track - in the track list, not within the ASX playlist, unfortunately. At least I think that's what's happening.
Ok, there are two different problems here. As Gabriel said, in the skyradio station, the trouble is that the asx points first to an empty mp3, and then to the real stream. So the trouble is that the asx playlist is treated as a Track, and even if it has several different streams, only the first one gets played. I have it patched locally, but the patch is (still) very ugly. I'll try to improve it a bit before posting. The second problem is GStreamer not being able to play http://wmscr1.dr.dk/e02ch02m?wmcontentbitrate=70000. That's the dr.dk stream. GStreamer says it won't play it, it's not Banshee's fault. Now, I can hear you all yelling 'Totem and Rhythmbox play it!' No, they don't. They cheat, and we should cheat, too. The url that Totem and Rhythmbox play is mmsh://wmscr1.dr.dk/e02ch02m?wmcontentbitrate=70000. In http://svn.gnome.org/svn/totem-pl-parser/branches/gnome-2-22/plparse/totem-pl-parser-wm.c, search mmsh, and you'll see who is to blame.
Created attachment 116702 [details] [review] http to mssh I'm very afraid of secondary effects of these patch, even if totem and rhythmbox apparently do the same thing. Please do test.
Heh, I like the comment in the totem code. Ok, I've tried applying this patch this morning and it seems to be working pretty good. No knock on effects so far. Looking at the code, I don't imagine there will be. It's pretty self contained and can only affects asx streams anyway. I've tried a bunch of the radio stations that are included with banshee as well as all the problem ones listed in this bug and they all seem to run ok. Looks like a good patch to me.
Félix, Thanks for the patch. It works for me and allows me to listen to the URI in the first report. The fix looks safe, and totem-pl-parser has it for quite some time.
A little worried that there might be .asx playlists that really do use/require http:// Ideally (maybe?) we could simply add artificial element(s) to the playlist for the mms:// link(s) and if there was an error, Banshee would try the next item. If you think this patch fixes more than it solves, please commit. Please use StartsWith ("http", StringComparison.CurrentCultureIgnoreCase) to catch HTTP:// URLs, though. Assuming you agree what I said in my first paragraph sounds sane, let's keep this bug open still though.
Patch committed with Gabriel's improvement, thanks Félix ! I don't think totem-pl-parser falls back to http if mmsh fails, but the suggestion to do it seems good. Keeping the bug open, per above comment.
This other stream does not work on Banshee-1.4.1: http://www.polskieradio.pl/st/RadioPolonia.asx (as reported for Fedora, https://bugzilla.redhat.com/show_bug.cgi?id=469309) Interestingly, the TVWorks station works (http://www1.streaming.net.nz/meta/tvworks-rock.asx) on Banshee, but not with Totem, whereas RadioPolonia works with Totem but not Banshee.
*** Bug 566201 has been marked as a duplicate of this bug. ***
(In reply to comment #24) > *** Bug 566201 has been marked as a duplicate of this bug. *** > Ok but this bug is still in 1.4.3! Looks like nothing has been done..
The truth is, Zdravko, that a lot has been done. However, this bug is about parsing asx radio files. Your non-working url belongs to a different category that banshee doesn't support right now. It's not hard to support, but I've been completely unable to find any documentation regarding the format (not that it's a complex format, just that reading some docs is always nice). Apparently, this file is auto generated by Microsoft Windows Media Services when any application that's not Windows Media Player requests a streaming file (http://support.microsoft.com/kb/279467). It also requires the http to mssh dirty trick we use in ordinary asx files.
Created attachment 130988 [details] [review] Support for "Reference" files In the PlaylistFormatDescription I've used almost the same info from ASX since both really represent the same type of stream. Otherwise, works with the url from bug #566201
Thanks for the patch, Félix ! I found this page that describes this kind of files : http://msdn.microsoft.com/en-us/library/bb970445(VS.85).aspx Based on that, and after looking at the code from totem-pl-parser (http://svn.gnome.org/viewvc/totem-pl-parser/trunk/plparse/totem-pl-parser-wm.c?view=markup), I think a better name would be AsfReferencePlaylistFormat. The string comparison in MagicHandler should probably be case insensitive. There are also a few formatting issues : some indents with tabs, and the brace should be on the same line as the condition : if (condition) {
Created attachment 131526 [details] [review] ASF Reference playlist format Name changed... check Formatting issues... check "Specification" review... check Case insentive... check Now it trims the url, and supports both RefX and RefXX
(In reply to comment #29) > Created an attachment (id=131526) [edit] > ASF Reference playlist format > > Name changed... check > Formatting issues... check > "Specification" review... check > Case insentive... check > > Now it trims the url, and supports both RefX and RefXX > Thanks Felix, I can confirm that this has fixed the issue and I can now play the url!!
Created attachment 131544 [details] [review] ASF Reference playlist format I forgot removing a Console.WriteLine in the previous patch Glad to hear it's working for you, Zdravko
Committed, with small additional changes that I missed the first time : more case insensitivity and code formatting. Thanks !