Sign up here and you can log into the forum!

UMSP Plugin: Shoutcast

UMSP Plugin Depot, the place for sharing plugins & info about them. No requests, just plugins/code.

Re: UMSP Plugin: Shoutcast   

Postby pan » Thu Nov 17, 2011 11:12 am

Thanks mad_ady, indeed it was a temporary issue.

Just out of curiosity, is it possible to have more than 10 "Last played" ? I tried manually setting

SHOUTCAST_NUMBER_OF_STATIONS='20'

but I could not change that parameter. Maybe there's not enough room to retain that much info.
1.02.21_V_WDLXTV.COM_WDLXTV_LIVE-0.5.1.1
1.05.04_V_WDLXTV.COM_EXT3-BOOT_LIVE-0.5.1.1
pan
WDTVer
 
Posts: 27
Joined: Sat Sep 04, 2010 9:56 am

Re: UMSP Plugin: Shoutcast   

Postby superbigjay » Thu Nov 17, 2011 11:16 am

did you try from wec?

from mad_ady initial post:
added the possibility to save the last X played stations, and to quickly play them again (configurable via WEC).
WDTV-LIVE-PLUS : WDLXTV-PLUS ver 0.5.1.1 (FW Base 1.05.04)
WDTV-LIVE : WDLXTV-LIVE ver 0.5.1.1 (FW Base 1.05.04)
... and also a PBO : MEDE8ER 1026
superbigjay
OCDLXer
 
Posts: 236
Joined: Sun Sep 04, 2011 7:58 am
Location: Montreal, Quebec, Canada

Re: UMSP Plugin: Shoutcast   

Postby pan » Thu Nov 17, 2011 11:37 am

That's what I did: wdlxtv ip -> WDLXTV config -> UMSP tab -> Shoutcast

but there you have a dropdown list and can only set a maximum of 10 last played.

So I tried the "config" tab, clicked "config entry" and typed in

SHOUTCAST_NUMBER_OF_STATIONS='20'

and saved but it won't retain that setting, or am I doing something wrong?

Tried this on 1.05.04, didn't try on 1.02.21
1.02.21_V_WDLXTV.COM_WDLXTV_LIVE-0.5.1.1
1.05.04_V_WDLXTV.COM_EXT3-BOOT_LIVE-0.5.1.1
pan
WDTVer
 
Posts: 27
Joined: Sat Sep 04, 2010 9:56 am

Re: UMSP Plugin: Shoutcast   

Postby superbigjay » Thu Nov 17, 2011 11:47 am

I must admit I haven't played much with this plugin...

Probably the plugin only support 1 page of "last stations".
And 10 entries is the maximum a page can display??
mad_ady will be able to confirm this...
Jay
WDTV-LIVE-PLUS : WDLXTV-PLUS ver 0.5.1.1 (FW Base 1.05.04)
WDTV-LIVE : WDLXTV-LIVE ver 0.5.1.1 (FW Base 1.05.04)
... and also a PBO : MEDE8ER 1026
superbigjay
OCDLXer
 
Posts: 236
Joined: Sun Sep 04, 2011 7:58 am
Location: Montreal, Quebec, Canada

Re: UMSP Plugin: Shoutcast   

Postby mad_ady » Thu Nov 17, 2011 1:10 pm

The way I save these last played stations is in a /conf/config variable (I don't remember off the top of my head what it was called). For each station I save the station id and part of the station name. I think there is a limit to how much text a config variable can store (I think it's close to 256 characters), so you will be limited by this.
I haven't tested it though. This is why I think I set that limit.

The limit is only in WEC; you can override it via telnet with this command:
Code: Select all
config_tool -c SHOUTCAST_NUMBER_OF_STATIONS=20
User avatar
mad_ady
Developer
 
Posts: 3001
Joined: Fri Nov 05, 2010 9:08 am
Location: Bucharest, Romania

Re: UMSP Plugin: Shoutcast   

Postby PaulF » Fri Dec 09, 2011 5:26 am

I noticed that streams played on VLC displayed the current song. Two weeks later, several web searches, deciphering several methods in a few different computer languages, many many tcpdumps, I finally got the shoutcast proxy to work. The code seems simple, now.

Anyway, I logInfo the meta data and turned on logInfo messages in shoutcast-proxy.php:
Code: Select all
$logLevel = L_INFO;


The log file is /tmp/umsp-log.txt and will have you song played list. The dupes come from the fact when the steams start, the WD software connects twice. Maybe a bug(more tcpdumps, I guess)

You can see the current data by browsing to:
Code: Select all
http://<wdtvlive ip>/umsp/plugins/shoutcast/shoutcast_now_playing.php


My html is really simple so character encoding might not work in all cases. Feel free to suggest changes.
User avatar
PaulF
Developer
 
Posts: 420
Joined: Sat May 08, 2010 8:34 pm
Location: Oregon

Re: UMSP Plugin: Shoutcast   

Postby mad_ady » Fri Dec 09, 2011 9:30 am

PaulF wrote: The dupes come from the fact when the steams start, the WD software connects twice. Maybe a bug(more tcpdumps, I guess)


It's not a bug. The first time, the proxy connects and makes a request with the HEAD method to get content-type and length. Then it makes the same request with GET. Sometimes it can make multiple requests (depending on container).
User avatar
mad_ady
Developer
 
Posts: 3001
Joined: Fri Nov 05, 2010 9:08 am
Location: Bucharest, Romania

Re: UMSP Plugin: Shoutcast   

Postby PaulF » Fri Dec 09, 2011 11:11 am

mad_ady wrote:
PaulF wrote: The dupes come from the fact when the steams start, the WD software connects twice. Maybe a bug(more tcpdumps, I guess)


It's not a bug. The first time, the proxy connects and makes a request with the HEAD method to get content-type and length. Then it makes the same request with GET. Sometimes it can make multiple requests (depending on container).
The tcpdump traces show the WD doing multiple GETs of the stream from the UPNP port. When I said possible(same as maybe) bug, I meant the WD SW is goofy for some reason. The proxy is only one way so I have a feeling the proxy is ignoring some returning status request or a time out or ??? As always, I do this stuff as a learning experience and I have a lot more to learn. My final goal is to display the playing song title on the WD's playing screen. Any ideas? I spent a day or so reading the UPNP specs and the only way I found to change the dc:title metadata on the fly is to do a set current URI action in the transport service. That works, but it puts a few second gap in the sound while the service re-GETs the stream. I wonder if there is a way to change the OSD variables on the fly.

I hope you don't mind me messing with the plugin. I can back my changes out, if you like. BTW what is the length of a stream?
User avatar
PaulF
Developer
 
Posts: 420
Joined: Sat May 08, 2010 8:34 pm
Location: Oregon

Re: UMSP Plugin: Shoutcast   

Postby mad_ady » Fri Dec 09, 2011 11:30 am

I have no problems with your changes (as long as they don't break the plugin :P). In fact, keep 'em coming :)

tcpdump is fine for analysis, but it can be a bit cumbersome to dig through the data.
I've had a quick look through the proxy code, and it's not the best proxy I've written :) In fact the GET method is hardcoded in the socket query, even if the WDTV asks for HEAD the first time. It works because either way it gets its headers and can get the data it wants.
You can get extra information by adding this line in the proxy (on line 10 for instance):
Code: Select all
_logInfo("Starting execution. \$_SERVER is:".serialize($_SERVER));


All the juicy parameters are passed by WDTV in the $_SERVER hash. Here you can see the request it tries to make, the URL and various parameters (including position inside the stream). Also, dumping the headers you send and receive to umsp-log can save you from doing packet captures.

The length of a stream is variable, and is imposed in the reply from shoutcast. I've had streams running for 11+ hours.

Setting the current song name is a great idea. I don't know how you can pass this parameter after playback has started, though... I remember DJArty tried to find out something similar a few weeks ago, but he was trying to override the xml that did the rendering (mounting on top of it), but he failed because DMAOSD would not refresh the image. It might be impossible without restarting the stream, sadly...
User avatar
mad_ady
Developer
 
Posts: 3001
Joined: Fri Nov 05, 2010 9:08 am
Location: Bucharest, Romania

Re: UMSP Plugin: Shoutcast   

Postby mad_ady » Sun Dec 11, 2011 11:35 pm

@PaulF: Here's an idea: you can implement the track display in the proxy (even if it introduces a gap and forces restart of the playback), as long as it is user selectable (via WEC). You allow the user to enable track names (and make a mention it will introduce gaps in playback), but you leave it off by default so that current users are not affected.

Should work fine until you come up with a better alternative (if there is one).
User avatar
mad_ady
Developer
 
Posts: 3001
Joined: Fri Nov 05, 2010 9:08 am
Location: Bucharest, Romania

PreviousNext

Return to UMSP Plugins

Who is online

Users browsing this forum: No registered users and 2 guests