This is to get around the stupid post counter 1
---------- Post added at 12:55 ---------- Previous post was at 12:53 ----------
And this is the second dummy post...
---------- Post added at 13:07 ---------- Previous post was at 12:55 ----------
Hi all,
The firmware of the LS1000W has indeed several shortcomings:
- poor stability, especially if services aren't accessible
- navigating through the menu can make the DPF reboot or freeze
- the internet-radio based on Shoutcast stopped working, since Shoutcast/AOL
changed their **broken link removed**.
The chances of getting a full chipset documentation and a working toolchain and source code are zilch (except if you commit to buy at least 100.000 units and sign a NDA). I didn't open it, but judging from the poor implementation of the DPF (crashes!) and the fast boot time I suspect that it isn't based on anything fancy (like an embedded Linux system).
Just for the fun of it I decided to **** a work-around for the internet radio by setting up a "Shoutcast directory redirector". It works fine, but I decided to return the DPF anyway.
Someone might find the solution useful (and it might be interesting for other Shoutcast appliances that stopped working due to the API/Server change).
This is what I did:
- I followed
**broken link removed** on redirecting the FrameChannel access. Instead of DHCP and a local DNS I used a static internet connection with the IP-address of "my" DNS server (bind9 / Ubuntu).
- There I used the following zone files:
Add to /etc/bind/named.conf.local
Code:
zone "shoutcast.com" {
type master;
file "shoutcast.db";
};
New file /var/cache/bind/shoutcast.db (123.123.123.123 stands for the IP-address of my apache2 server)
Code:
; BIND data file for shoutcast.com
;
;$ORIGIN shoutcast.com
@ IN SOA my.dns.server.domain. root.shoutcast.com. (
1293230951 ; Serial
3600 ; Refresh
360 ; Retry
2419200 ; Expire
60 ) ; 1min TTL
shoutcast.com. IN MX 10 mail.shoutcast.com.
shoutcast.com. IN NS my.dns.server.domain.
IN A 123.123.123.123
mail A 123.123.123.123
localhost A 127.0.0.1
*.shoutcast.com. A 123.123.123.123
- set up a new apache virtual host:
Code:
<VirtualHost *>
ServerAdmin who@car.es
DocumentRoot /home/shoutcast
ServerName shoutcast.com
ServerAlias *.shoutcast.com
CustomLog /var/log/apache2/shoutcast.access.log combined
ServerSignature Off
</VirtualHost>
- under the document root I created a subdirectory sbin containing the following files:
newxml.phtml
PHP:
<?php
$genre = $_GET['genre'];
$genre = preg_replace('/[^A-Za-z0-9 ]/', '-', $genre);
//echo "genre: $genre";
if (empty($genre)) {
$genreurl = "\"http://api.shoutcast.com/legacy/genrelist?k=so1N15vhCB78Z6k4\"";
}
else {
$genreurl = "\"http://api.shoutcast.com/legacy/genrelist?k=so1N15vhCB78Z6k4&genre=$genre\"";
}
$getgenre = "wget -q -O - $genreurl";
exec($getgenre, $data);
$rpat=array();
$rpat[0] = "/<\?.*\?>/";
$rpat[1] = "/<(\w+) ([^>]*)/";
$rpat[2] = "/>>/";
$rpat[3] = "/\/>/";
$repl=array();
$repl[0] = "";
$repl[1] = "<$1 $2></$1>";
$repl[2] = ">";
$repl[3] = ">";
foreach($data as $value) {
echo preg_replace($rpat, $repl, $value);
}
?>
tunein-station.php:
PHP:
<?php
// wget -q -O - http://yp.shoutcast.com/sbin/tunein-station.pls?id=724006&k=DPF_APPLIANCE_LEGACY
$id = $_GET['id']+0;
// echo "ID: $id <br>";
exec("wget -q -O - http://yp.shoutcast.com/sbin/tunein-station.pls?id=$id&k=DPF_LS1000W",$data);
foreach($data as $value) {
echo "$value\n";
}
?>
Both scripts use wget (you can use static copies of the "new" shoutcast XML files as well), and preg_replace to convert the new XML format into something the appliance understands. PHP should handle PHTML right away, but for processing of the PLS request I needed the following rewrite rule (save as sbin/.htaccess)
Code:
RewriteEngine on
RewriteRule ^tunein-station\.pls$ tunein-station\.php [T=application/x-httpd-php]
That's it. This is my work - feel free to use it any way you see fit.
/Gert