Loading ...
Sorry, an error occurred while loading the content.

47348Re: [mh] Sending audio to a Logitech Squeezebox from Misterhouse

Expand Messages
  • Lieven Hollevoet
    Aug 13 12:05 PM
    • 0 Attachment
      Hey Brian,

      I was typing a response to your previous mail when this mail arrived: indeed, my feeling is that the interface that is exposed through xPL is rather limited and not very helpful (e.g. when I sent the invalid xPL command yesterday I did not get an error message on either the xPL broadcast address nor did I see anything in the server.log that would have notified me of the incorrect message).

      Moreover: what bothers me on the xPL interface from the moment I wrote it is that I need to constantly poll the different squeezeboxes separately for their status, as there does not seem to be a consistent xpl-trig when the state of the squeezebox changes (e.g. at the end of a playlist). Polling for status: I don’t like that concept. On the CLI we can simply subscribe for this.

      Regarding the CLI response parsing: I don’t see a big problem in that. Do you? I don’t think it would be much different compared to parsing the JSON.

      Best regards,
      Lieven.


      Op 13-aug.-2014, om 20:50 heeft Brian Rudy <brudy@...> het volgende geschreven:

      > OK Lieven, I think I am finally catching up to your line of thought on this. While it does appear that full control is available via xPL, feedback is just too limited. CLI query commands like listing the connected players via 'players 0 2' do not return any results, nor do do they have defined methods for doing so. This would make anything but basic control integration and currently playing feedback a NOP with xPL.
      >
      > The CLI certainly seems to have everything we would need for integration, but CLI responses will likely need parsers for each command. Another option may be a combination of cometd and jsonrpc.js both of which use JSON which provides a bit of structure. These seem to be what the iOS and Android clients use. Here is a snippet of both sides of what I see while pause/playing a track and changing the playback position with Orange Squeeze:
      >
      > POST /jsonrpc.js HTTP/1.1
      > Accept-Charset: UTF-8
      > Content-Type: text/json
      > Accept-Encoding:
      > User-Agent: Dalvik/1.6.0 (Linux; U; Android 4.4.2; DROID RAZR HD Build/KDA20.62-10)
      > Host: 192.168.69.8:9000
      > Connection: Keep-Alive
      > Content-Length: 77
      >
      > {"id":1,"method":"slim.request","params":["6c:f0:49:54:e2:98",["pause","1"]]}HTTP/1.1 200 OK
      > Server: Logitech Media Server (7.9.0 - 1407419807)
      > Connection: Keep-Alive
      > Content-Length: 89
      > Content-Type: application/json
      > X-Time-To-Serve: 0.00181984901428223
      >
      > {"params":["6c:f0:49:54:e2:98",["pause","1"]],"method":"slim.request","id":1,"result":{}}POST /jsonrpc.js HTTP/1.1
      > Accept-Charset: UTF-8
      > Content-Type: text/json
      > Accept-Encoding:
      > User-Agent: Dalvik/1.6.0 (Linux; U; Android 4.4.2; DROID RAZR HD Build/KDA20.62-10)
      > Host: 192.168.69.8:9000
      > Connection: Keep-Alive
      > Content-Length: 72
      >
      > {"id":1,"method":"slim.request","params":["6c:f0:49:54:e2:98",["play"]]}HTTP/1.1 200 OK
      > Server: Logitech Media Server (7.9.0 - 1407419807)
      > Connection: Keep-Alive
      > Content-Length: 84
      > Content-Type: application/json
      > X-Time-To-Serve: 0.00185012817382812
      >
      > {"params":["6c:f0:49:54:e2:98",["play"]],"method":"slim.request","id":1,"result":{}}POST /jsonrpc.js HTTP/1.1
      > Accept-Charset: UTF-8
      > Content-Type: text/json
      > Accept-Encoding:
      > User-Agent: Dalvik/1.6.0 (Linux; U; Android 4.4.2; DROID RAZR HD Build/KDA20.62-10)
      > Host: 192.168.69.8:9000
      > Connection: Keep-Alive
      > Content-Length: 78
      >
      > {"id":1,"method":"slim.request","params":["6c:f0:49:54:e2:98",["time","145"]]}HTTP/1.1 200 OK
      > Server: Logitech Media Server (7.9.0 - 1407419807)
      > Connection: Keep-Alive
      > Content-Length: 90
      > Content-Type: application/json
      > X-Time-To-Serve: 0.0913372039794922
      >
      > {"params":["6c:f0:49:54:e2:98",["time","145"]],"method":"slim.request","id":1,"result":{}}POST /jsonrpc.js HTTP/1.1
      > Accept-Charset: UTF-8
      > Content-Type: text/json
      > Accept-Encoding:
      > User-Agent: Dalvik/1.6.0 (Linux; U; Android 4.4.2; DROID RAZR HD Build/KDA20.62-10)
      > Host: 192.168.69.8:9000
      > Connection: Keep-Alive
      > Content-Length: 77
      >
      > {"id":1,"method":"slim.request","params":["6c:f0:49:54:e2:98",["pause","1"]]}HTTP/1.1 200 OK
      > Server: Logitech Media Server (7.9.0 - 1407419807)
      > Connection: Keep-Alive
      > Content-Length: 89
      > Content-Type: application/json
      > X-Time-To-Serve: 0.0018310546875
      >
      > {"params":["6c:f0:49:54:e2:98",["pause","1"]],"method":"slim.request","id":1,"result":{}}
      >
      >
      >
      >
      > On 08/12/2014 11:52 PM, Brian Rudy wrote:
      >> Thanks Lieven,
      >>
      >> Looking through the CLI specs, it does allow for subscription so I was mistaken in thinking that it did not. I'm still leaning towards xPL though as it has a few additional benefits to just a raw TCP connection.
      >>
      >>
      >> On 08/12/2014 01:30 PM, Lieven Hollevoet wrote:
      >>> Brian,
      >>>
      >>> using the CLI to start the playing of the generated audio works. I have a very ugly version of the code based on the third script of the forum link. The script was written with only a single squeezebox in mind and I have multiple devices.
      >>>
      >>> I’ll integrate the code in a module so that we can reliably interface to our Squeezeboxen to play the generated files (be it TTS or not). How we can hook this up with the MisterHouse TTS code is not clear to me yet, but once we have to possibility to play files it should be possible.
      >>>
      >>> Best regards,
      >>> Lieven.
      >>>
      >>> Op 12-aug.-2014, om 21:50 heeft Lieven Hollevoet
      >>> <lieven@...>
      >>> het volgende geschreven:
      >>>
      >>>
      >>>> Hey Brian,
      >>>>
      >>>> I’m still using the xPL interface to my Squeezeboxen so that I am able to control the power switch of the amplifiers that are connected to them. This works fine.
      >>>>
      >>>> You question triggered me again to look into adding support for playing generated files on the squeezeboxes. I have currently working:
      >>>> * generating TTS data to a wave file (I’m using OS X so TTS in built-in)
      >>>> * playing the generated TTS wave file through the CLI interface of Squeezebox server (using telnet, not from MisterHouse). This step is important as it was not clear to me if you could play auto-generated files that are not indexed by the Squeezebox server application. It appears you can do this, so this is good news.
      >>>>
      >>>> What is not working yet:
      >>>> * using an updated version of the xPL_Squeezebox module to play the TTS file through an xPL command.
      >>>>
      >>>> This is strange, as according to the xPL docs the xPL interface of the Squeezebox server is merely a different interface to the CLI interface of the server, so sending commands through xPL should work (and do work for simple commands like ‘pause’ and ’next’, but not for the more complex commands like ‘playlist play').
      >>>>
      >>>> It is currently not clear to me if I should proceed trying to get the xPL interface up and running. Maybe migrating to the CLI will in the end provide a more stable solution. This is also the route the Micasaverde solution follows.
      >>>> I found this code on a forum that might help us further:
      >>>>
      >>>> http://knx-user-forum.de/knx-eib-forum/4717-misterhouse-und-squeezebox-2.html
      >>>>
      >>>> I still need to examine this further to see if this is what we need.
      >>>>
      >>>> Best regards,
      >>>> Lieven.
      >>>>
      >>>>
      >>>> Op 12-aug.-2014, om 09:37 heeft Brian Rudy
      >>>> <brudy@...>
      >>>> het volgende geschreven:
      >>>>
      >>>>
      >>>>> Hi folks,
      >>>>>
      >>>>> Sorry in advance for replying to this old thread, but it seems to have ended abruptly and I am facing a similar set of questions.
      >>>>>
      >>>>> I have recently started researching Linux-based whole-house audio/music solutions and played a bit with the existing music modules and wanted to share my opinion/findings and solicit your advice.
      >>>>>
      >>>>> Music modules from code/common:
      >>>>> mp3.pl
      >>>>> -requires local (or network-attached) music library. No direct support for external streaming services like Pandora/Spotify/Last.fm
      >>>>>
      >>>>> mp3_xmms.pl
      >>>>> -XMMS no longer appears to be in active development and is difficult to compile/run on modern distros.
      >>>>>
      >>>>> mp3_mpd.pl
      >>>>> -I got stuck in Perl module dependency hell trying to satisfy the dependencies of Audio::MPD and never did manage to get it to install properly.
      >>>>>
      >>>>> mp3_alsaplayer.pl
      >>>>> -I eventually got AlsaPlayer and the Perl module installed, but the player and Perl module seem to have some type of incompatibility as when I invoked playback through MH, AlsaPlayer kept looping the first few seconds of the music over and over again regardless of what I did.
      >>>>>
      >>>>> mp3_slimserver.pl
      >>>>> -I did quite a bit of research here as SlimServer->SqueezeCenter->Squeezebox Server and finally Logitech Media Server that thanks the open source code seems to have quite a bit of community participation and 3rd party development (including new 3rd party LMS-compatible hardware) even though Logitech is no longer selling/supporting Squeezeboxes themselves. I installed LMS 7.9.0 on my MH server and fairly quickly had things up and running with squeezelite on Linux and Squeeze Player for my Android devices. I then attempted to enable mp3_slimserver.pl, but the lack of support for /status.txt (this is likely a bug in LMS 7.9.0) made the module unusable. I then started digging around and found this thread. After a little more fiddling I was able to get my LMS instance and players to register with the xPL module Lieven provided and minimally control them and read their state. I haven't done anything with device synchronization just yet, but am sure there is a way. There is the issue
      >>>>> o
      >>>>>
      >>>>> f music library synchronization between MH and LMS, but it looks like there are many options.
      >>>>>
      >>>>> Now for the question of playing TTS output; It looks like someone found a few ways to do it over on the micasaverde forums and added some hints on their wiki:
      >>>>> http://wiki.micasaverde.com/index.php/Squeezebox#Using_Google.27s_TTS_engine_for_announcements
      >>>>> I'm sure we could so something similar for the other speech synthesis engines as well. To do this properly we would need to first capture the current playlist+playback position and restore these after the TTS playback had ended as Lieven had mentioned.
      >>>>>
      >>>>> Is anyone else using some combination of LMS/Squeezeboxes/squeezelite/raspberry pi/opensqueeze/etc or some other combination of kit with their whole-house audio system and would be willing to provide some input? Ultimately what I am looking to do is have a centrally managed multi-room music/audio system with IP-connected players that is integrated with MH.
      >>>>>
      >>>>> TIA!
      >>>>> -Brian
      >>>>>
      >>>>>
      >>>
      >>>
      >>> ------------------------------------------------------------------------------
      >>>
      >>>
      >>>
      >>> ________________________________________________________
      >>> To unsubscribe from this list, go to:
      >>> https://lists.sourceforge.net/lists/listinfo/misterhouse-users
      >>>
      >>>
      >>>
      >>
      >>
      >>
      >> ------------------------------------------------------------------------------
      >>
      >>
      >>
      >> ________________________________________________________
      >> To unsubscribe from this list, go to:
      >> https://lists.sourceforge.net/lists/listinfo/misterhouse-users
      >>
      >>
      >>
      >
      > ------------------------------------------------------------------------------
      > ________________________________________________________
      > To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users
      >
    • Show all 56 messages in this topic