[Announce] 'MediaServer' *certified* Alexa skill for LMS

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Peter Galbavy
    Senior Member
    • Sep 2009
    • 222

    Originally posted by philchillbill
    No, the http stream has to be unprotected. It is, after all, inside your LAN. Why would you want LMS to be password-protected for local use?
    Because I enable password security on all my LMS instances by default? This is in fact what I use to protect my test proxy for your skills in testing - I don't have proxy passwords, instead using the user and password in LMS in the config and it works for everything except streaming.

    I do also access my LMS from outside my home, and it is password protected without a proxy dance - even if it's not HTTPS protected out of the box - players don't understand HTTPS.

    Another use of a protected stream endpoint would be if my LMS instance were not on the local LAN of the Echo device, e.g. hosted in the fluffy cloud on a VM, for example.

    Comment

    • Peter Galbavy
      Senior Member
      • Sep 2009
      • 222

      Originally posted by philchillbill
      The reason that the Stream commands are now free has to do with all the APL stuff recently added to MediaServer for the visuals. Handling that is way heavier on my back-end than streaming, so it no longer makes sense to see streaming as 'premium'. I also genuinely believe that a device like the Echo Show 8 gen 2 is an affordable 2022 alternative to the Squeezebox Radio. It sounds really good for its size and has a gorgeous full-HD 8" touchscreen to boot. Maybe now people will discover this for themselves...
      Yup! It's what I've been trying I am suitably impressed with the Echo Show 8 /2 sound quality.

      Comment

      • philchillbill
        Senior Member
        • Jan 2019
        • 1085

        Originally posted by Peter Galbavy;
        Because I enable password security on all my LMS instances by default? This is in fact what I use to protect my test proxy for your skills in testing - I don't have proxy passwords, instead using the user and password in LMS in the config and it works for everything except streaming.

        I do also access my LMS from outside my home, and it is password protected without a proxy dance - even if it's not HTTPS protected out of the box - players don't understand HTTPS.

        Another use of a protected stream endpoint would be if my LMS instance were not on the local LAN of the Echo device, e.g. hosted in the fluffy cloud on a VM, for example.
        If you use either ngrok or a reverse-proxy like apache or nginx, they all do the https-to-http translation for you — it does not then matter that LMS cannot support https natively. That's the whole idea behind my approach to remote-access to LMS from the cloud. Remember, if you are not using https, your auth credentials are going as plain text and can be easily intercepted...

        The way account-linking the skill currently works, your auth parameters for the proxy are specified — you cannot specify any native LMS credentials. The Echo 'thinks' it's playing a https stream but that https endpoint (in my back-end) actually just sends it a PLS file which contains the /stream.mp3 endpoint spec as the only item in the playlist (Paul Webster's wonderful invention). If local-LMS credentials were to be included in that PLS file, they'd have to be embedded using the h t t p://username[email protected]:9000/stream.mp3?player=Alexa-XXXXX construct. I don't honestly know if that would even work. But, importantly, I'd have to extend the account-linking form with 2 extra fields to specify those basic-auth parameters and that's complicating it a lot for most people.
        Last edited by philchillbill; 2022-02-15, 16:10.

        Comment

        • Peter Galbavy
          Senior Member
          • Sep 2009
          • 222

          Yeah, the Basic auth details for the proxy, when it doesn't need it, just drops through in the headers to the native HTTP interface and hence the UI works for me.

          In my case using a 3rd party proxy would still NOT work as I am not removing LMS password protection. I have "real" players outside my home and they cannot support HTTPS anyway, so the most basic clear text auth is better than none. The username / password are not shared with any other platform I use so it doesn't matter if they are intercepted - someone can potentially screw up my LMS configs but that's about it, although there will be holes in the server or plugins for the determined.

          I am going to see if I can using nginx to proxy with hardwired auth to /stream.mp3 or see if LMS can somehow unprotect just that endpoint as a test hack - but the former would not work for your skill I assum as the endpoint is derived from the LMS servers own knowledge of it's IP and fixed port and so can't be redirected to a munging proxy solution

          One potential simplification, if you are willing to change your code, is to pass the *same* auth details as for the proxy in the URL in the playlist, like you show, which would have no effect on an unprotected endpoint but could act as a workaround for those like me (sample size obviously one for now) that want to support a Frankenstein like hybrid environment.

          Comment

          • philchillbill
            Senior Member
            • Jan 2019
            • 1085

            Originally posted by Peter Galbavy
            Yeah, the Basic auth details for the proxy, when it doesn't need it, just drops through in the headers to the native HTTP interface and hence the UI works for me.

            In my case using a 3rd party proxy would still NOT work as I am not removing LMS password protection. I have "real" players outside my home and they cannot support HTTPS anyway, so the most basic clear text auth is better than none. The username / password are not shared with any other platform I use so it doesn't matter if they are intercepted - someone can potentially screw up my LMS configs but that's about it, although there will be holes in the server or plugins for the determined.

            I am going to see if I can using nginx to proxy with hardwired auth to /stream.mp3 or see if LMS can somehow unprotect just that endpoint as a test hack - but the former would not work for your skill I assum as the endpoint is derived from the LMS servers own knowledge of it's IP and fixed port and so can't be redirected to a munging proxy solution

            One potential simplification, if you are willing to change your code, is to pass the *same* auth details as for the proxy in the URL in the playlist, like you show, which would have no effect on an unprotected endpoint but could act as a workaround for those like me (sample size obviously one for now) that want to support a Frankenstein like hybrid environment.
            I didn't know that LMS would just ignore basic auth parameters if they were not enabled . That indeed makes it harmless to embed the credentials in the PLS file for streaming. I've just tested that and it worked no problem so I've pushed it live.

            Let me know if it now works for you.

            Comment

            • Peter Galbavy
              Senior Member
              • Sep 2009
              • 222

              It works! Thanks you. Take my money - literally. New subscriber now happy

              One more feature request for "one day" - The Echo Show 15 can be mounted in portrait mode and the normal display looked quite squashed in landscape. I am sure there is also some value to looking at "widgets" for the future too.

              Comment

              • philchillbill
                Senior Member
                • Jan 2019
                • 1085

                Originally posted by Peter Galbavy
                It works! Thanks you. Take my money - literally. New subscriber now happy

                One more feature request for "one day" - The Echo Show 15 can be mounted in portrait mode and the normal display looked quite squashed in landscape. I am sure there is also some value to looking at "widgets" for the future too.
                Glad to oblige. Who knows, it may prove useful to others

                I can play around with the Echo Show 15 layout in the APL web-simulator but the documentation on widgets is totally useless so no idea how to implement them. Over the years, I've suggested dozens of improvements to the Amazon docs when I finally figure something out, but in the case of widgets the baseline is not good enough to get me even started.

                Comment

                • staresy
                  Senior Member
                  • Jun 2005
                  • 722

                  Originally posted by philchillbill
                  Amazon has freshly certified V6.0 of MediaServer.....
                  Many thanks for the new commands (early/recent/from/display), they are working well. The early/recent is very useful with a large collection by a particular artist and makes quick shuffled playback far easier than using a standard touch control interface (as does play by year). Thumbs up for voice control - good work!
                  Location 1: LMS 8.4.x on Rpi4B PCP x3 SB Radios, x1 Touch, x1 Controller : Location 2: LMS 8.4.x on Win 10 Brix Server, x2 SB Radios, x1 Duet Receiver, x1 Controller : Alexa Mediaserver Smart Skill, Material Android, SqueezeliteX control

                  Comment

                  • Peter Galbavy
                    Senior Member
                    • Sep 2009
                    • 222

                    Another minor one, probably mentioned in the long thread somewhere, but just for fun I tried the Alexa Windows app as a player and it doesn't work - but this is probably because it uses some off-net proxy (the private address space that I do not use is a good clue) of it's own, as seen in the IPs below (the bottom player is one of the Echo Show 15s):

                    Click image for larger version

Name:	Screenshot 2022-02-17 075828.png
Views:	1
Size:	19.6 KB
ID:	1574523

                    I doubt this is fixable, and if not already probably worth mentioning in the docs.

                    Comment

                    • philchillbill
                      Senior Member
                      • Jan 2019
                      • 1085

                      Originally posted by Peter Galbavy;
                      Another minor one, probably mentioned in the long thread somewhere, but just for fun I tried the Alexa Windows app as a player and it doesn't work - but this is probably because it uses some off-net proxy (the private address space that I do not use is a good clue) of it's own, as seen in the IPs below (the bottom player is one of the Echo Show 15s):

                      I doubt this is fixable, and if not already probably worth mentioning in the docs.
                      Click image for larger version

Name:	WhatsApp Image 2022-02-17 at 12.54.35.jpeg
Views:	1
Size:	52.2 KB
ID:	1574524

                      I have not tried it in the Windows app but it does work in the Alexa app on the iPhone (see screenshot). Likely on Android too but I cannot verify. But that's all down to how Amazon proxies their stuff and is not on me. So no idea why Windows is different.

                      By the look of the AirPlay logo, it would seem that you can even cast it from the phone to an AirPlay speaker but I have none at hand to test

                      If you start a stream while on WiFi and then switch to 4G it continues ad infinitum. That surprises me TBH. However, if you try and start it while on 4G it says it is going to play but then there is silence. If you stop a stream and later ask Alexa "tell MediaServer to resume" it will continue if the iPhone on WiFi but not on 4G (I then see PlaybackFailed in the logs with as reason "MEDIA_ERROR_INTERNAL_SERVER_ERROR").


                      EDIT: I can confirm I could AirPlay a MediaServer stream from the Alexa app to my Marantz AVR.
                      Last edited by philchillbill; 2022-02-17, 13:34.

                      Comment

                      • Peter Galbavy
                        Senior Member
                        • Sep 2009
                        • 222

                        It's probably my odd setup, Android app does the same - a 172.22.0.x address and nothing. Next time someone with an Apple device visits I'll have a play there too

                        Comment

                        • philchillbill
                          Senior Member
                          • Jan 2019
                          • 1085

                          The APL player-controls received a facelift. @staresy pointed out that the badges for the repeat/shuffle buttons were being cropped on the Echo Show 5. There was a bug in the APL simulator that was hiding this for me and I could not verify on a real device, but the simulator has been updated and now I could see the problem.

                          The badges are now positioned at the top where they won't crop, and the 'Player Controls' text has been removed to allow the whole frame to be less tall. It also now has a border. Let me know if any further tweaks are needed on real devices, but it looks better now on all my physical devices and in the simulator on the ones I don't physically have.

                          Comment

                          • bobefax
                            Junior Member
                            • Feb 2022
                            • 2

                            401 authenitcation error

                            Hi

                            Have installed via the installer on the mediaserver.smartskills.tech site - all simple enough to follow and using powershell on windows to install with ngrog - worked fine.

                            Have linked the skill via amazon and again straight forward to do.

                            Using with Echo dot - 2nd / 3rd gen can connect to the media server - but when I ask Alexa to tell media server xxxxx to do anything I get

                            you need need to take action ngrog reports a 401 authorization failure it might be a temporary service glitch you can try again later if you deliberately changed your credentials relink the skill


                            Can bring up the ngrog status - all good and looks fine via //localhost:4040/status
                            and the skill looks to be still enabled under Amazon.

                            Apologies if this was covered somewhere - but I couldn't find it.

                            Thanks

                            Bob

                            Comment

                            • philchillbill
                              Senior Member
                              • Jan 2019
                              • 1085

                              Originally posted by bobefax
                              Hi

                              Have installed via the installer on the mediaserver.smartskills.tech site - all simple enough to follow and using powershell on windows to install with ngrog - worked fine.

                              Have linked the skill via amazon and again straight forward to do.

                              Using with Echo dot - 2nd / 3rd gen can connect to the media server - but when I ask Alexa to tell media server xxxxx to do anything I get

                              you need need to take action ngrog reports a 401 authorization failure it might be a temporary service glitch you can try again later if you deliberately changed your credentials relink the skill


                              Can bring up the ngrog status - all good and looks fine via //localhost:4040/status
                              and the skill looks to be still enabled under Amazon.

                              Apologies if this was covered somewhere - but I couldn't find it.

                              Thanks

                              Bob
                              Maybe unlink the skill and re-link it from the same browser where you did it the first time so it grabs your uuid. Amazon might have picked up your oauth token erroneously. Rarely happens but I’ve seen it a handful of times.

                              p.s. When you are looking at the :4040 status page you are not using your credentials as that's 'local'. Try to access the assigned ngrok URL from a browser. That way, you'll have to authenticate and this will show you if your credentials are wrong.
                              Last edited by philchillbill; 2022-02-26, 20:55.

                              Comment

                              • bobefax
                                Junior Member
                                • Feb 2022
                                • 2

                                Originally posted by philchillbill
                                Maybe unlink the skill and re-link it from the same browser where you did it the first time so it grabs your uuid. Amazon might have grabbed your oauth token erroneously. Rarely happens but I’ve seen it a handful of times.
                                Thanks seem to have sorted... found the media server on the cloud but no players - turn on my Squeezebox Radio and am listening to music - will now try and get it working via echo's :-)

                                Thanks again for your very quick response.

                                Comment

                                Working...