PDA

View Full Version : Internet radio on demand (.asp?) problems



pburehaell
2008-08-23, 08:55
Hi all,

My experiences so far with Squeezebox are very good, but now I have come across a problem.

I'm living i Sweden, where the swedish radio provides a lot of internet radio stations, as well as a lot of broadcasts that can be replayed again on demand.

On the site they provide an url to the latest broadcast, and it uses the format:
www.sr.se/webbradio/include/CreatePlaylist.asp?SkipDetect=1&id=2078&type=latestbroadcast&AvailableAudioFormats=3&AudioFormat=3&IsBlock=1

This works in Internet Explorer, where it opens an external Media Player window and plays the stream.

When I put this in as the url for an internet radio station in SqueezeCenter (version 7.1 - 22170) I get no indication there is anything wrong with it. But I cannot play it.
On the controller it reads "Now Playing Nothing", or that the playlist is empty.

Does anyone know if there is some plugin that might be able to handle this kind of dynamic url, or if there is a way to extract the actual url for the stream (or multiple streams)?

Thanks for any input!

BR
Patrik

brillo
2008-08-23, 10:48
Hi there.

Try mms://lyssna-wm.sr.se/autorec/p4/melodikrysset/srp4riks_2008-08-23_120559_1442_w4.wma

Looking at the url, I'm guessing that each day you're going to have to alter the url slightly to reflect the current date (e.g., today = 2008-08-23).

pburehaell
2008-08-23, 11:54
Thanks brillo,

This was definitely a ste in the right direction.
I am able to play this stream without any problems, but the first problem is that the broadcast we now use as an example is divided into two sections, and this is the url of the first section. How can I find the url of the second section?

Btw, brillo, how did you find out the url of the stream?

So, my second question:

Why can Windows media play the stream when I insert it into the address field, and why doesn't it work the same way in SqueezeCentre 7.1? (Looking for a long term solution here :-)

Once again thanks!

BR
Patrik

bpa
2008-08-23, 11:57
There is a bug in the parsing of the ASX file given by your URL.

Log the bug.

bpa
2008-08-23, 12:09
If you are running Linux or OSX then you could try the following bug fix. I think it will not break other URLs.

In the file Slim/Formats/Playlists/ASX.pm Add the line in red to the code starting at line 96.



REF:
for my $ref ( @{$refs} ) {
if ( my $href = $ref->{HREF} ) {
next if $href !~ /^(http|mms)/i;
push @entries, {
title => $title,
href => $href,
};

# Only one link in a REF station should be played
last REF;
}
}

pburehaell
2008-08-23, 12:37
Hi bpa,

Thanks for your suggestion. I realize now that I should have mentioned in my original post that I'm running XP SP2 on a PC.

I did file a bug report, as you suggested and in there I also put in some more information, i.e. that this URL used as an example actually contains two 30 min broadcasts, one after the other.

I have the same problem though with other broadcasts on the same format that only direct to one stream item.

The fix you showed in your last post, would it resolve the problems for any number of items in the returned playlist (only disregarding duplicates in terms of player format)?

And secondly - would it work in XP?

Thank you very much for your help!

BR
Patrik

bpa
2008-08-23, 14:13
did file a bug report, as you suggested and in there I also put in some more information, i.e. that this URL used as an example actually contains two 30 min broadcasts, one after the other.

Actually the problem is not 2 URLs but that one of the URL uses "rtsp" which is bizarre. The full ASX is shown below.





<ASX version="3.0">
<ENTRY>
<TITLE>Melodikrysset Del 1 av 2</TITLE>
<ABSTRACT>Melodikrysset - l�dag 23 augusti 2008 12:06</ABSTRACT>
<REF HREF= "rtsp://lyssna-wm.sr.se/autorec/p4/melodikrysset/srp4riks_2008-08-23_120559_1442_w4.wma"/>
<REF HREF= "mms://lyssna-wm.sr.se/autorec/p4/melodikrysset/srp4riks_2008-08-23_120559_1442_w4.wma"/>
<REF HREF= "http://lyssna-wm.sr.se/autorec/p4/melodikrysset/srp4riks_2008-08-23_120559_1442_w4.wma"/>
</ENTRY>
<ENTRY>
<TITLE>Melodikrysset Del 2 av 2</TITLE>
<ABSTRACT> - l�dag 23 augusti 2008 12:33</ABSTRACT>
<REF HREF= "rtsp://lyssna-wm.sr.se/autorec/p4/melodikrysset/srp4riks_2008-08-23_123259_1622_w4.wma"/>
<REF HREF= "mms://lyssna-wm.sr.se/autorec/p4/melodikrysset/srp4riks_2008-08-23_123259_1622_w4.wma"/>
<REF HREF= "http://lyssna-wm.sr.se/autorec/p4/melodikrysset/srp4riks_2008-08-23_123259_1622_w4.wma"/>
</ENTRY>
</ASX>




I have the same problem though with other broadcasts on the same format that only direct to one stream item.

The fix you showed in your last post, would it resolve the problems for any number of items in the returned playlist (only disregarding duplicates in terms of player format)?

The fix will work for any ASX playlist which have URLS which are not http or mms (e.g. rtsp) protocol and the non http/mms URL is first in the list of URLs as this combination is the bug.



And secondly - would it work in XP?

The bug fix will work in XP but on Windows Squeezecenter is "compiled" and I assume you do not have the tools to create a new .exe with the fix.

pburehaell
2008-08-23, 14:35
Thanks very much, now the problem makes sense to me.

I will try two different things:
One is (bpa, your assumption is right I presently cannot 'compile') to get the necessary tools to be able to compile the fixed version of ASX.pm.

Second is to contact the webmaster of swedish radio and ask if they could change the order of the different URLs in the playlist. This is actually quite possible that they would do.

I plan to put SqueezeCenter on a QNAP TS 109 II next week, would I still have to run compiled versions on that, or would changes in the files affect SqueezeCenter after a reboot (it runs Linux I think)?

Once again thank you very much!

BR
Patrik

bpa
2008-08-23, 14:56
To run SC on Windows - you can use the free version from ActiveState
http://www.activestate.com/Products/activeperl/index.mhtml

However there may be some issues if your try to run SC as a service.

You only need the development kit (cost some $$$) if you want to create a distrbutable .exe.

It may be easier to wait for a day for a fix and use a nightly build.



The fix you showed in your last post, would it resolve the problems for any number of items in the returned playlist (only disregarding duplicates in terms of player format)?

the problem is not multiple items in a playlist - SC handles that OK now. The problem occurs when the first URL in a list of URLs is not a http or mms url.

If you report the bug with my suggested fix - I think an official fix will be included quickly and you can use the nightly build (including windows .exe) probably in a few days. They may not use my fix but by isolating the bug makes it easier to apply a fix.


Linux version are runs from the source code files so on a QNAP my fix would work.

pburehaell
2008-08-23, 15:27
bpa, thank you very much.

I filed a new bug report, containing your easy fix, and then I marked the old one (#9273) as a duplicate of the new one.

The new bug report is bug #9277.

I am very grateful for your help!

BR
Patrik

bpa
2008-08-23, 16:25
I think there may still be a bug with multiple entries in the playlist but not in ASX parsing. The ASX parser returns two entries but only one shows on the display.

pburehaell
2008-09-02, 13:56
Hi again,

I now have SqueezeCenter 7.2 running in Linux environment on a QNAP TS 109 II, and it's working very well.

However, I am still a little unsure of how I should go about applying the change in ASX.pm that bpa suggested.

What action is it that make Perl reload the ASX.pm (with the suggested changes)?
Is it enough to reboot the server?
Is some othe action required?

Thanks in advance!

BR
Patrik - beginning to learn Perl...

bpa
2008-09-02, 14:19
Just restart SqueezeCenter there should be be no need to reboot the server.

pburehaell
2008-09-02, 14:35
Thanks once again bpa,

Actually I suspected there would be such simple solution, but I was unable to find the answer to this simple question when searching the forums and internet.

Regarding the second issue (only one entry title showing from the ASX playlist), if I interpret you correcly - that both entries play but only one is shown - I have the same behavior in windows media player and real player.

Tomorrow night I will try the fix (currently on a business trip).

BR
Patrik - now a little further along the path to learn Perl...

bpa
2008-09-02, 14:58
Regarding the second issue (only one entry title showing from the ASX playlist), if I interpret you correcly - that both entries play but only one is shown - I have the same behavior in windows media player and real player.


Not quite - the ASX parser returns two entries in the playlist but only one was shown. I am not sure whether the second items played or not as I didn't understand the program. If there is a problem then it is not in ASX parsing.

pburehaell
2008-09-02, 23:03
Now I understand what you mean.

When I get it working I will definitely check.

Thanks once again.

BR
Patrik

pburehaell
2008-09-03, 14:52
Now I restarted SqueezeCenter on my Qnap (using only the SSOTS web interface, but checking that the process really stopped) and it loaded the modified ASX.pm.

But it did not work directly. But this was due to user error in the specific test I used; I had not started the test URL with "http://". That this was the remaining error was possible to see in the SqueezeCenter Log, so I added "http://" and ... it worked!

Thanks for the great support bpa!

Now, regarding only one entry title showing - it is probably a property of the way the distributor (Swedish radio) manages the streams or something... because I can report the same behavior on the Squeezebox as in widows media player and real player: They only show the first title but then when the stream ends (either by playing or fast forwarding), the following stream automatically follows, and the new title is shown.
(The reason they divide it is because in live broadcast there is a news broadcast in between, which is removed when you listen to it afterwards).

I noticed that they fixed this bug (#9277) yesterday, using the fix proposed by bpa. So I wont have to modify the code again when I update to next version.

So now I am very happy indeed!

BR
Patrik