PDA

View Full Version : Multiple servers - changing player to new server FROM the server?



jimwillsher
2007-03-10, 00:22
Is there any way within the server web interface to transfer a player from one server to another?

I use Ubuntu server to run slimserver. It's a server, so no GUI.

Radio Scotland doesn't seem to be covered by any of the squeeze network services, so that only leaves AlienBBC. Rather than clutter up my mailserver with mplayer etc, I have installed slimserver and AlienBBC on a Virtual PC image on my desktop PC. All works well.

My question (eventually): Is there any way to "take control" of a player from within the web interface? I know that I can go downstairs and press and hold the left arrow on the slim remote to choose a different server, but is there any way to transfer players from within the server interface? Both the Ubuntu instance of slimserver and the VPC instance are on the same LAN, both could see each other, and the player sees both.

But am I missing something? For example, is there a way to view all players on the LAN, even those which are not associated with the server, and "take control" or "transfer player to this server" etc?

If not...would this be a viable suggestion for 7.0 ?



Jim

Mark Lanctot
2007-03-10, 14:17
No. What you see when you press and hold left on the remote is the player's firmware interface. It's one of the few things that the player can do on its own, without a server of any kind.

SlimServer doesn't have access to the player's firmware at this level.


If not...would this be a viable suggestion for 7.0 ?

I can't speak for the developers, but given the extensive change requested (SlimServer access to the player firmware functions) and the rarity of the issue (yours is the first I have seen) I'd doubt it.

Firmware-level access might make a few other nice things possible, like going through network setup from SlimServer, including wireless encryption passphrases. As I said, I'm not a developer, but it does not sound easy at all.

jimwillsher
2007-03-11, 03:04
Ok, many thanks.

erland
2007-03-11, 03:27
Do you always want to transfer all players to the other server, or is it important to be able to just transfer a single player ?

If you want to transfer all players this might be possible to solve with some routing mechanism outside SlimServer. As an example I think it is possible to setup a "virtual IP address" that you can switch which server it shall be connected to. This way the players can always be connected to the virtual address and you just change which real address the virtual one is connected to. I think this shall be possible since I know that you can setup a remote ssh connection today if you want a SqueezeBox at a remote location and this is basically the same thing.

If you want to be able to switch single players to another server, you should be able to do it by setting up a virtual IP address for each player.

Unfortunately I don't have any more details exactly how to configure this, but I think the concept might work.

jimwillsher
2007-03-11, 03:31
No, it's just ad-hoc. I use my Ubuntu server as my main server, but have to switch toa Windows installation to use AlienBBC. (The Linux server is on all the time, the PC is not). So when I think "I'll listen to radio" when I'm at my PC I want to "take control" of the player from the web, rather than walk to the player, find the remote, and reassign it to the different server.

I suppose it means I have a use for the remote control at long last :-)


Jim

Marc Sherman
2007-03-11, 06:19
jimwillsher wrote:
> No, it's just ad-hoc. I use my Ubuntu server as my main server, but have
> to switch toa Windows installation to use AlienBBC. (The Linux server
> is on all the time, the PC is not). So when I think "I'll listen to
> radio" when I'm at my PC I want to "take control" of the player from
> the web, rather than walk to the player, find the remote, and reassign
> it to the different server.

Why do you have to use windows for alienbbc? I'm running alienbbc on my
linux box just fine.

- Marc

jimwillsher
2007-03-11, 06:32
When you're running a linux server (e.g. no GUI) there's just too many dependencies involved.


Jim

Marc Sherman
2007-03-11, 06:44
jimwillsher wrote:
> When you're running a linux server (e.g. no GUI) there's just too many
> dependencies involved.

Not in my experience. It was actually quite trivial to set up alienbbc
on my (headless) debian server.

- Marc

jimwillsher
2007-03-11, 07:01
ok, I'll give it another whirl. I know the docs will be on the web, but if you have any tips then I'd appreciate them.

Cheers,


Jim

andyg
2007-03-11, 07:04
You should be able to write a little plugin to do this. The 'serv' command in recent firmwares allows you to reconnect a player to another IP address. Here's some sample code:



use Net::IP;

my $ip = Net::IP->new('10.1.2.3');
my $host = pack 'N', $ip->intip;
$client->sendFrame( 'serv', \$host );

Marc Sherman
2007-03-11, 07:10
jimwillsher wrote:
> ok, I'll give it another whirl. I know the docs will be on the web, but
> if you have any tips then I'd appreciate them.

Sorry, no tips to offer, because it was really just a matter of
following the readme that was packaged with it straight through. I
didn't have to do anything special. I did already have mplayer installed
on my machine (from debian-multimedia.org) before I started, so if you
don't have it already, you'll need to install it. I don't know if Ubuntu
includes mplayer itself, but if it doesn't, you can add this to your
sources.list:

# Christian Marillat's media repository (lame, mplayer, mythtv, etc)
deb http://www.debian-multimedia.org testing main
deb http://www.debian-multimedia.org unstable main

- Marc

Mark Lanctot
2007-03-11, 09:28
You should be able to write a little plugin to do this. The 'serv' command in recent firmwares allows you to reconnect a player to another IP address. Here's some sample code:



use Net::IP;

my $ip = Net::IP->new('10.1.2.3');
my $host = pack 'N', $ip->intip;
$client->sendFrame( 'serv', \$host );


Wow - well, see what I meant when I say I couldn't speak for the developers? :-)

I was going to say 'file an enhancement request at bugs.slimdevices.com' but the enchancement is already there!

mherger
2007-03-11, 13:11
> ok, I'll give it another whirl. I know the docs will be on the web, but
> if you have any tips then I'd appreciate them.

You could probably take SlimCD's version of mplayer - it's a minimum
compilation which has all you need to run AlienBBC, but no GUI elements
etc. Just copy /usr/local/bin/mplayer and probably (not sure it's
needed...) /usr/local/lib/codecs to your system and give it a try.

--

Michael

-----------------------------------------------------------------
http://www.herger.net/SlimCD - your SlimServer on a CD
http://www.herger.net/slim - AlbumReview, Biography, MusicInfoSCR

mherger
2007-03-11, 13:14
> You should be able to write a little plugin to do this. The 'serv'
> command in recent firmwares allows you to reconnect a player to another
> IP address. Here's some sample code:

Woohoo!! I've been asking for this a few months ago and never got an
answer (http://forums.slimdevices.com/showthread.php?t=26084). And I did
write to Richard last night about it, as my own tests did not succeed. But
as I was on a vacation I only tested using SoftSqueeze. I'm not sure it
fully implements the SERV command.

Do you know whether the same command would work if SlimServer was
listening on a non-default port (eg. two instances running on the same
machine)?

I'll have to give your code a try with my physical boxes... Thanks a lot!

--

Michael

-----------------------------------------------------------------
http://www.herger.net/SlimCD - your SlimServer on a CD
http://www.herger.net/slim - AlbumReview, Biography, MusicInfoSCR

mherger
2007-03-11, 13:54
> Here's some sample code:

Hmm... doesn't work for me. Here's what I've got so far (you'll recognize
some more of it, I guess :-)):

sub connectServer {
my $client = shift;

# don't disconnect unless we're still in this mode.
return unless ($client->modeParam('serverswitcher.connect'));

my $host = pack('N',1); # 1 is squeezenetwork

use Net::IP;
my $ip = Net::IP->new('192.168.x.y');
$host = pack 'N', $ip->intip;
$client->sendFrame('serv', \$host);

# if message recieved, client has disconnected
Slim::Control::Request::executeRequest(
$client,
['client', 'forget']);
}

But well... nothing happens. Even with d_slimproto turned on I see nothing.

--

Michael

-----------------------------------------------------------------
http://www.herger.net/SlimCD - your SlimServer on a CD
http://www.herger.net/slim - AlbumReview, Biography, MusicInfoSCR

mherger
2007-03-11, 14:08
> But well... nothing happens. Even with d_slimproto turned on I see
> nothing.

Ok, you said "recent firmware" - no wonder testing with my SliMP3 didn't
work :-). I have it working with a SB3 - thanks a lot!

--

Michael

-----------------------------------------------------------------
http://www.herger.net/SlimCD - your SlimServer on a CD
http://www.herger.net/slim - AlbumReview, Biography, MusicInfoSCR

mherger
2007-03-12, 09:50
So... here's a quickly hacked plugin ServerSwitcher, which allows you to define other servers. They will show up under the web pages plugins section, like the "Switch to Squeezenetwork". You should install the plugin on all the servers to be able to switch back.

There's currently no player menu available. If there's some interest I might enhance it.

Have fun!

jimwillsher
2007-03-13, 04:37
jimwillsher wrote:
> When you're running a linux server (e.g. no GUI) there's just too many
> dependencies involved.

Not in my experience. It was actually quite trivial to set up alienbbc
on my (headless) debian server.

- Marc

You are absolutely right. A doddle! My steps are below, for the benefit of anyone who is nervous about trying it :-)

Cheers!



Jim




Download MPlayer:
wget http://www3.mplayerhq.hu/MPlayer/releases/MPlayer-1.0rc1.tar.bz2

Extract MPlayer:
bunzip2 MPlayer-1.0rc1.tar.bz2
tar -xf MPlayer-1.0rc1.tar

Make and Install MPlayer:
cd MPlayer-1.0rc1
make
make install

Test MPlayer:
mplayer -bandwidth 10000000 -cache 128 -playlist http://www.bbc.co.uk/radio4/realplayer/media/fmg2.rpm


Download Alien:
wget http://www.x2systems.com/AlienBBC/alienbbc-linux-v1.06_6.2-3.tar.gz

Extract Alien:
tar -xzf alienbbc-linux-v1.06_6.2-3.tar.gz

Install Alien
mv Plugins/Alien /usr/local/slimserver/Plugins/

BigTony
2007-07-06, 03:29
I've unzipped the ServerSwitcher in Slimserver/server/plugins - its there with all the other plugins, restarted SS, but nothing appeared under Plugins (i.e. still only Switch to Squeezenetwork). Did I miss something out?

I entered the Plugins Option under Server Settings, my new network address was entered as http:\\192.168.2.3:9000;SecondServer.

Cheers

BT

mherger
2007-07-06, 03:49
> I've unzipped the ServerSwitcher in Slimserver/server/plugins - its
> there with all the other plugins, restarted SS, but nothing appeared
> under Plugins (i.e. still only Switch to Squeezenetwork).

Where exactly is it? Did it create its own folder? What does SlimServer
say if you start it using d_plugins? What operating system are you using?
What SlimServer version?

Michael

BigTony
2007-07-06, 04:00
ok, lots of questions, here are the bits I can answer :-)

OS is WinXP SP2
SS version is 6.5.1

Where exactly is what? the other server is (physically) in another room, but both are on the same network (wireless).

After re-staring SS I noticed that when I went back to look at the settings for ServerSwitcher, they were now blank....

Not sure how to start using d_plugins

BT

mherger
2007-07-06, 04:55
> After re-staring SS I noticed that when I went back to look at the
> settings for ServerSwitcher, they were now blank....

This at least means the plugin is loaded. Did you configure your two
servers under Server Settings/Plugins/ServerSwitcher?

Michael

BigTony
2007-07-06, 11:38
Doh...

putting in both server names was the trick.. guess its not much good being to switch to a different server if you can't switch back!

Many thanks

BT