Home of the Squeezebox™ & Transporter® network music players.
Page 1 of 4 123 ... LastLast
Results 1 to 10 of 39
  1. #1
    Senior Member
    Join Date
    Apr 2005
    Location
    UK/London
    Posts
    1,708

    Using Amazon Alexa device as LMS player

    There are a few implementations here of using voice to control playing of LMS stuff on Squeezeboxes but I don't think I have seen one that makes the Alexa device a Squeezebox player, except via Bluetooth.

    There is some 3rd party software that you can point at the same audio collection and have it play it through the Alexa device (e.g. Plex and My Media for Alexa so perhaps there is no need for anything else ... but I though I would have a go anyway.

    Result ... it works but is somewhat clunky.

    If one of the developers of the existing LMS/Alexa tools would like to include the capability in their stuff then I am more than happy to share the code (the guts of it is only a few lines) but it is very easy to explain.

    Since the device does not support AirPlay or UPnP-AV (or whatever) then it is not possible to push content to it using existing LMS plugins - afaik.

    However, when it plays audio from a streaming server it does it directly from the device (and even asks for ICY metadata, I think to help the server identify that this is a media request rather than to do anything with that returned data itself).

    So the trick it to get it to request that content.

    I wrote a very simple Alexa skill that responds to an Open/Play request and returns the URL of a .pls file that can be reached via https. When the device requests the .pls file I generate one containing the local LAN IP address of LMS in the form ...
    http://lmsip:9000/stream.mp3?player=Echo
    The device then starts playing the stream (it requires the .pls to be reached via https but does not require the stream itself to be delivered that way) ... of course the problem then is to deliver some content to the stream but you can do that from any of the LMS control points and you choose "AlexaMediaPlayer - Alexa" or similar as the player.

    While it works, it is not elegant.

    Making it work for multiple people from the same service would require the end-use to register (something I have not done) because each LMS installation would be at a different local IP address.
    Also registration would make it possible to support multiple Alexa devices at the same installation and give them different player names (not sure how LMS will handle multiple devices all claiming to be the same player name ... but from memory it sort of works).

    A small LMS plugin could make it easier to register and pass to the remote server (where the Alexa skill resides) the local LAN address & port of LMS.

    This does not require any port forwarding tricks or opening up the LAN to the outside world any more than any use of Alexa.

    Playing using the LMS /stream.mp3 route does have some issues - for example because of the various bits of buffering going on it is unlikely to work well in a sync group (if you can hear multiple devices at the same time).
    Changing a playlist and adding a new song to "play now" takes longer than you would expect because of that buffering ... took over 30 seconds for the current song to stop.

    But it works ...
    Paul Webster
    http://dabdig.blogspot.com
    Author Radio France (FIP etc) plugin

  2. #2
    Senior Member
    Join Date
    Mar 2017
    Posts
    999
    Not related to the subject of this thread (have no Alexa devices)... but, what's happened to the volume control in your screen shot? You have the volume percentage under the 'i' icon, but no speaker icon. Have you been editing the Material files, or is this a bug with Material?

  3. #3
    Senior Member
    Join Date
    Apr 2005
    Location
    UK/London
    Posts
    1,708
    Not edited the skin.
    That was Safari on iPad - iOS 12.
    Does not do that for other LMS players ... so perhaps it is related to it playing http://lmsip:9000/stream.mp3
    Does LMS know that it cannot change the volume so perhaps something Material is looking for is not present.
    Paul Webster
    http://dabdig.blogspot.com
    Author Radio France (FIP etc) plugin

  4. #4
    Senior Member
    Join Date
    Mar 2017
    Posts
    999
    Quote Originally Posted by Paul Webster View Post
    Not edited the skin.
    That was Safari on iPad - iOS 12.
    Does not do that for other LMS players ... so perhaps it is related to it playing http://lmsip:9000/stream.mp3
    Does LMS know that it cannot change the volume so perhaps something Material is looking for is not present.
    This happens when the player is off. When a player is off, I hide the volume button - but forgot to also hide the label! Fixed for next release.

  5. #5
    Senior Member
    Join Date
    Apr 2005
    Location
    UK/London
    Posts
    1,708
    I didn't turn it off but it had stopped at that point so perhaps LMS turned it off by itself.
    Paul Webster
    http://dabdig.blogspot.com
    Author Radio France (FIP etc) plugin

  6. #6
    Senior Member meep's Avatar
    Join Date
    Aug 2007
    Location
    Ireland
    Posts
    230
    Hi Paul

    Looks good.

    I tried this as part of the Hab Tunes plugin by streaming the LMS mp3 stream to the Echo. It worked OK sometimes but often exhibited such a significant dayl (>60 seconds) as to make it unusable.

    I'll have a deeper look when I get more time. Might indeed be something worth working on together.

    Peter


    ALEXA LMS SKILL: http://www.hab-tunes.com | Twitter: #habtunes
    Personal HA BLOG: http://mediaserver8.blogspot.com

    Squeezebox x2 | Squeezebox Radio x 2 | Squeezebox Duet x2

  7. #7
    Senior Member
    Join Date
    May 2008
    Location
    Canada
    Posts
    4,978
    I can probably adapt one of my bridges so that the experience is better than the stream.mp3. The bridge can be the HTTP server where Alexa is pointed at, that's no issue. Now there are 2 options for the "control plane" (track, play, stop, pause, volume ...)

    1- As with other bridges, the commands come from LMS and are relayed to the skill. I would need to know how to do that and probably a small Perl part would have to tell the bridge where/how to "contact" the skills. That Perl part is either itself a new player model and we can extend the slimproto, or we invent a different way to send this necessary information

    2- The commands are directly sent by the Perl plugin part to the Alexa skill, in addition to the slimproto commands which are still needed to be sent to the bridge. In that case, I think it's mandatory to create a new player model.

    Option 1- vs 2- depends, for me, how complex it is to relay the commands to the Alexa skill and get some feedback. This is a really important part as it helps a lot to feedback to LMS that a track has started to play and where it is - there are some very complicated implications not doing that. In my latest version of the UPnP/CC bridges, I added this "flow" mode where the player guesses the time in the device, but that's really not ideal. Having confirmation of play/pause/stop/trackid/trackposition from the skill really helps

    Just thinking out of loud
    LMS 7.7, 7.8 and 7.9 - 5xRadio, 3xBoom, 4xDuet, 1xTouch, 1 SB2. Sonos PLAY:3, PLAY:5, Marantz NR1603, JBL OnBeat, XBoxOne, XBMC, Foobar2000, ShairPortW, JRiver 21, 2xChromecast Audio, Chromecast v1 and v2, , Pi B3, B2, Pi B+, 2xPi A+, Odroid-C1, Odroid-C2, Cubie2, Yamaha WX-010, AppleTV 4, Airport Express, GGMM E5

  8. #8
    Senior Member
    Join Date
    May 2008
    Location
    Canada
    Posts
    4,978
    I was thinking about it more and re-using my CastBridge will probably be the easiest

    1- it as an HTTP webserver to offer audio
    2- it can be a passthrough or translate LMS audio into wav,aif,pcm,flac,mp3 (with resample) and includes icy metadata when possible
    3- it has SSL to talk to the Cast device (I assume skills need some security)
    4- It has JANSSON libraries
    5- It has a thread per player to send commandl to the CC (skill) and grab position and status, an a thread to received responses or async elements from the CC (skill)
    6- It has an async search mechansim (which I assume is not needed here)

    If the skill can do a few things, it might be super easy (damn, I should have wrote that) and a new friend to LMS ecosystem
    LMS 7.7, 7.8 and 7.9 - 5xRadio, 3xBoom, 4xDuet, 1xTouch, 1 SB2. Sonos PLAY:3, PLAY:5, Marantz NR1603, JBL OnBeat, XBoxOne, XBMC, Foobar2000, ShairPortW, JRiver 21, 2xChromecast Audio, Chromecast v1 and v2, , Pi B3, B2, Pi B+, 2xPi A+, Odroid-C1, Odroid-C2, Cubie2, Yamaha WX-010, AppleTV 4, Airport Express, GGMM E5

  9. #9
    Senior Member
    Join Date
    Apr 2005
    Location
    UK/London
    Posts
    1,708
    Philippe ... do you have any devices with built-in Alexa?
    Paul Webster
    http://dabdig.blogspot.com
    Author Radio France (FIP etc) plugin

  10. #10
    Senior Member
    Join Date
    May 2008
    Location
    Canada
    Posts
    4,978
    Quote Originally Posted by Paul Webster View Post
    Philippe ... do you have any devices with built-in Alexa?
    I have an Alexa
    LMS 7.7, 7.8 and 7.9 - 5xRadio, 3xBoom, 4xDuet, 1xTouch, 1 SB2. Sonos PLAY:3, PLAY:5, Marantz NR1603, JBL OnBeat, XBoxOne, XBMC, Foobar2000, ShairPortW, JRiver 21, 2xChromecast Audio, Chromecast v1 and v2, , Pi B3, B2, Pi B+, 2xPi A+, Odroid-C1, Odroid-C2, Cubie2, Yamaha WX-010, AppleTV 4, Airport Express, GGMM E5

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •