I have tried to better understand how spotify playback is implemented
when running through compatible players (e.g. Radio, ...), and how the
SPH takes care of the un-compatible players (e.g. Transporter, Boom,
Duet, ...). 

First of all, if you are lucky and only have Spotify compatbible players
(meaning: spotify playback is enabled by the firmware of thes players),
you can setup your spotify family accounts:

22517

...and attach them to each individual player on mysqueezebox.com - which
is already great:

22519

Now, each (compatible) player is running Spotify with its respective
account that has been maintained - you have full Spotify Family
support.

For the un-compatible players, SPH checks before each playback and
determines what to do. In case of a compabible player canDirectStream
(111), it lets the standard Spotify plugin take over:

(taken from server.log)
[17-04-17 14:12:36.7942]
Plugins::SpotifyProtocolHandler::ProtocolHandler::canDirectStream (111)
Playing via Slim::Plugin::SpotifyLogi::ProtocolHandler:
spotify://track:7u2KwlIqVTQQVPudaTd41e
[17-04-17 14:12:36.7950]
Slim::Plugin::SpotifyLogi::ProtocolHandler::onStream (185)
00:04:20:27:91:68 Sending playback information (username
johanndornbach_sap, bitrate pref 320)

If the player cannot play Spotify streams from within its firmware, it
takes over:
(taken from server.log)
[17-04-17 14:13:11.0152]
Plugins::SpotifyProtocolHandler::ProtocolHandler::canDirectStream (120)
Playing via spotifyd: spotify://track:3Cc3ssgsvdSaEbFT6KHBAv

and logs in with the spotify user maintained in the SPH Plugin settings:

(taken from spotifyd.log)
[18:33:11.192] main:702 relogging in as user: X1.Y2

I have tried to read and understand the Perl scripts on both

Squeezebox\server\Slim\Plugin\SpotifyLogi

and 

InstalledPlugins\Plugins\SpotifyProtocolHandler.

Unfortunately I am a total newbie in Perl and Squeezebox
coding/scripting.

>From what I believe I have understood, I am thinking about the following
concept:

1. Extend the SPH settings

"C:\ProgramData\Squeezebox\Cache\InstalledPlugins\Plugins\SpotifyProtocolHandler\HTML\EN\plugins\SpotifyProtocolHandler\settings\basic.html"

to store let's say 6 Spotify accounts + PWs

2. When the SPH takes over Spotify streaming, get the Spotify user name
attached to the target player from the mysqueezebox.com settings.
Apparently the original Spotify already can do this in 

package Slim::Plugin::SpotifyLogi::ProtocolHandler;

the sub "onStream" seems to have all the information in
"$auth->{username}", where "my $auth  = $client->pluginData('auth');"
and "$client" is sent by the external caller while calling the sub
"onStream".

Can this or something similar be used to get the user from
mysqueezebox.com from within the SPH?

3. Then login with the user we received from from 2. and take the login
PW from 1. (of course only the PW with matching users on both ends), and
start streaming over spotifyd.

What I have not yet understood: this would be very nice if the same
spotify helper

"C:\ProgramData\Squeezebox\Cache\InstalledPlugins\Plugins\SpotifyProtocolHandler\Bin\MSWin32-x86-multi-thread\spotifyd.exe"

could be called / run multiple times with different users at the same
time - because I want to listen to multiple Spotify streams (on
un-compatible players like Duet or Boom) at the same time...

Can anyone tell me if this is a valid approach? If yes, I guess it will
take me forever to produce a correct and working set of Perl coding for
2. and 3. Do you have any ideas how to best start?

Regards,


+-------------------------------------------------------------------+
|Filename: 2.png                                                    |
|Download: http://forums.slimdevices.com/attachment.php?attachmentid=22519|
+-------------------------------------------------------------------+


4 Radios, 2 Boom, 2 Touch working + 1 Touch broken trying to fix, 1
Classic, 1 Duet Controller, 2 Duet Receiver, 1 Musical Fidelity V-DAC on
Duet Receiver.

LMS running on WHS 2011.
------------------------------------------------------------------------
johndoe_2009's Profile: http://forums.slimdevices.com/member.php?userid=31478
View this thread: http://forums.slimdevices.com/showthread.php?t=106849

_______________________________________________
plugins mailing list
plugins@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/plugins

Reply via email to