Squeezebox Player Music Source - Printable Version
+- XBMC Community Forum (http://forum.xbmc.org)
+-- Forum: Development (/forumdisplay.php?fid=32)
+--- Forum: Development (/forumdisplay.php?fid=93)
+--- Thread: Squeezebox Player Music Source (/showthread.php?tid=114290)
- sdsnyr94 - 2012-02-05 16:20
bossanova808 Wrote:And here's a python library for CLI control...
Knowing from your signature and previous posts you have made that you are a fan of Openelec, have you ever gotten squeezeslave to work on it? I think I tried a while back without success.
Information on the Squeezebox Protocol is available here. Wouldn't it be easier to have the add-on communicate directly rather than use squeezeslave? This way you just need to download the add-on -> connect to server -> play music. This would be easier for the noobs and Openelec users.
- bossanova808 - 2012-02-06 02:36
Well, I am thinking from the bang for back perspective.
There are basically two approaches:-
1. Write a full client that uses SlimProto (basically a TCP level client) to pull direct commands from LMS and the streaming audio, and hand this off to XBMC's audio player. This will be a significant amount of work I think....especially things like sync, which are non trivial. You'd have to co-ordinate, down to the millisecond, the xbmc audio player's timing with the timing of other syned players in the group. On all XBMC platforms ideally. I suspect this would be way hard, and binary add on support isn't even in place yet really.
2. The second approach is to leverage an existing infrastructure to do this - squeezeslave works on linux, windows and os-x already, and unlike other options for streaming from LMS, already supports sync etc. It's pretty full featured (it can even mimic an Slimp3 type display right on the command line!).
I don't see the point in duplicating all this work again - of course ultimately, that would be nice, but if you start off with a general SB controller (rather than a player) in XBMC - you can then easily point it at your other SBs, but also the local squeezeslave, and very quickly get some local audio playback going and, and some visualisation too.
I had a very simple python script doing this from XBMC last night in about 10 mins work... I triggered the squeezeslave connect from python and in the LMS interface told it to sync to the other players and wa la, away it went. Pretty quick effective demo.
If you want to write a slimproto handler, that would be awesome, but it's beyond my skills/time to do right now, and I think a controller add on running over a locally installed squeezeslave would be very useful and a more effective way of starting, at least. Ultimately whichever way you go, there will likely be a controller part of the add on, for control and visualisation, and a player add on that either hands off to XBMC or plays directly to audio sinks.
And no, right now, without that PCM patch (I would think that would go in after Eden as ctspiff has said he'll take charge after that), you can't currently hand the stream to XBMC as I understand it. So for now, that approach is right out...so the best place to start is with a python controller to Squeezeboxes to can also point to a locally running squeezeslave...also, the xbmc music support (playlist management, etc) is primitive at best at the moment, so a really nice add on (not saying I have time for this, but I will try!) - could offer an 'ipeng' or Moose like experience but wrapped up into XBMC...
I have not yet got squeezeslave in OE going, I have not even tried, but it doesn't look that hard from the thread on it, basically export the LD_LIB_PATH and run it, maybe making sure the xbmc will share alsa as well....but I develop on my crummy window laptop so that's where I started.
All that said, if you just want to connect to server, play music, then surely just waiting and then using uPnP/DLNA once that patch in place will be the easiest for sure. But that won't sync - see http://wiki.slimdevices.com/index.php/Synchronization#Supported_Synchronization
...given the amount of potential buffering involved etc, it's not even sure that in all scenarios squeezeplay will support sync but you can bet they've put more effort into it than will be easily done via xbmc.
- bossanova808 - 2012-02-06 02:38
(I *definitely* don't have the skills to get into synchonisation at the xbmc level - that would be hairy stuff). Python I am getting better with, and XBMC plugins too - so that's where I am coming from - what I can achieve, with reasonable effort. But I don't want to threadjack, someone with mad skillz might be able to do WAY better. And I hope they do!!
- Powderking - 2012-02-06 13:16
It sounds great what you write. Unfortunately I don't have any experience with addons. So I thought it doesn't make any difference if I start with a binary or python addon.
I'm probably the opposite of you: I have no experience but half a year time (about 80% of a week).
Wouldn't it be possible to use the visualisation and controller part of xbmc with the binary addon?
I don't understand why
Quote:the xbmc music support (playlist management, etc) is primitive at best at the moment"Maybe the playlist creation from lms can be used to get intelligent playlists.
- bossanova808 - 2012-02-06 15:32
Ok very quick update - I now have a black screen with two SB like green lines on it and can control the basics of squeezebox navigation and playing via this screen in XBMC...sending it's commands to SqueezeSlave to actually play the audio...very early days yet but I'm on my way now.
@PowderKing - your basic issue with a binary add on is that it won't really integrate with XBMC for some time as I understand it - this is a Frodo feature, so probably 6+ months at the minimum, and more likely end of 2012, given Eden isn't even at RC1 yet. And subsuming the SB music library into XBMC library (which might be nice with all the views etc you get for free) - will be a crazy big job.
I looked at writing it as a music plugin (as opposed to a script), but then you're limited with the basic add things to list, browse like folders type approach, and you're expected to hand off the playing to XBMC (so probably using the unsyncable server/stream/mp3 approach). This would have advantages - built in views, built in now playing visualisation etc, but it's a clunky structure, no syncing would be possible, and I don't think there would be an easy way to trigger an external player/squeezeslave with this approach (not sure) - but it seemed too limited.
If you do integrate into the XBMC library, then while smart playlists may be ok (these would have to somehow be mapped to LMS playlists, which don't really support smart ones I believe) - but the general interface for adding and removing stuff to playlists is really crude so far. I am sure it will get better, but the SB way is remarkably elegant in my view, even on the old skool two line type boxes.
Anyway, my approach should yield quick(ish) results to get people going and trying it out and seeing how sync works in practise (many variables there). So at least it might be a short term solution...
(Code here if anyone is interested...hard coded addresses etc, so just for info but I will package it into an add on in my repo soon so you can try it out maybe):
- Powderking - 2012-02-06 17:49
That's the killer argument that the binary addons won't work at least until Eden is out. Maybe I can come back to the binary addon next semester...
Your work seems promising.
Let me know if I can help you! As I said I have no clue of python but I'm happy to learn new things or help you test it.
I have never installed a plugin that's not in a repo. Can I just dowload the script.xsqueeze directory, zip and install it?
- voip-ninja - 2012-02-06 18:53
I just wanted to let you guys know that I'm also following along with interest. The ability to have my XBMC PC act like a Squeezebox has always been something I've been interested in doing.
Currently I use the Whitebear Media Server on the PC that runs LMS, as this at least allows sharing of my playlists over UPNP to the XBMC PC. Not as good as a true Squeezebox, but enough that I can play my large playlists on my HTPC. Good enough that I donated some $$ to the Whitebear author.
- bossanova808 - 2012-02-07 00:54
Sit tight a few days until I have something basic and vaguely workable and then it will be in my repo. I just wanted to prove the basics could be done, now I need to make it slightly configurable etc., and add the rest of the controls (e.g. you can trigger music to play but you can't stop it yet!
- bossanova808 - 2012-02-07 06:08
Ok I have put 0.0.1 - rough as guts - into my repo - see announce thread here:
- Powderking - 2012-02-07 12:48
Thanks alot for your work!
I will try it this afternoon