Announcement

Collapse
No announcement yet.

Getting Track #, Track Count and Music Source

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #31
    Originally posted by skavan View Post
    Tried again passing in a single empty string parameter:
    hs.PluginPropertyGet("Sonos", "RINCON_000E58A72F9601400", "ZoneThirdPartyMediaServices", {ret})

    Got a more verbose error:
    ERROR in ListAvailableServices for zoneplayer = Family Room with UPNP Error = Read only tag / Transport is locked / Access denied. Error = MyUPnPService.InvokeAction for ServiceID = http://192.168.1.57:1400/xml/DeviceProperties1.xml while sending Action = ListAvailableServices for URI = http://192.168.1.57:1400/DeviceProperties/Control and Request = UPNP Error = faultcode = s:Client, faultstring = UPnPError, detail = 401 with error = The remote server returned an error: (500) Internal Server Error.
    My bad.. thought ListAvailableServices was part of DeviceProperties. It is part of MusicServices .... urgghhh, need to add some code for that because I don't use that service at all

    Comment


      #32
      Originally posted by skavan View Post
      It is sent with a Last Change Event (subscribed to with AVTranport). here's an example extracted from Device SPY. It is directly after the r:NextTrackMetaData entry.

      <r:EnqueuedTransportURI val="x-sonosapi-radio:custom_radio.f559_54d7dbbae992798d9c084b0d?sid=6&amp;f lags=8300&amp;sn=4"/>
      so it should be part of your metadata, no?

      Comment


        #33
        Originally posted by dcorsus View Post
        That's the typo I referred to, try latest attachment
        ListAvailableServices:
        Still errors...I think it doesn't like sending an array. Maybe just send the one field I need? Although the belligerent bugger in me is now curious why one can't send back an array. Perhaps if you make it an object?

        As for "ZoneThirdPartyMediaServicesX" -- I have figured out howto decrypt this...so the encrypted string is exactly what I am looking for.

        s.

        Comment


          #34
          Originally posted by skavan View Post
          ListAvailableServices:
          Still errors...I think it doesn't like sending an array. Maybe just send the one field I need? Although the belligerent bugger in me is now curious why one can't send back an array. Perhaps if you make it an object?

          As for "ZoneThirdPartyMediaServicesX" -- I have figured out howto decrypt this...so the encrypted string is exactly what I am looking for.

          s.
          For ListAvailableServices ... try

          dim Ret as string ()

          or try

          Dim Ret as Object

          See if it makes a difference

          2/ ZoneThirdPartyMediaServicesX should now be readable via ZoneZoneThirdPartyMediaServices property


          Just finished re-coding ListAvailableServices

          Was now looking at your EnqueuedTransportURI and I assume you also need that metaData?

          Care to email me in private how to decrypt?

          Dirk

          Comment


            #35
            Originally posted by dcorsus View Post
            so it should be part of your metadata, no?
            Maybe....but:
            HSPI.CurrentTrackMetaData As String doesn't return the CurrentTrackMetaData. It returns what looks like the insides of the EnqueuedTransportURIMetaData tag!

            I think there are two ways to go:
            1. Either have three properties/methods:
            - CurrentTrackMetaData which contains the insides of <CurrentTrcakmetaData>
            - NextTrackMetaData (ditto)
            - EnqueuedTransportURi (the insides of that) OR:
            2. Have a single property: "LastChange" and stuff the whole LastChange Event String in that, and I'll take it from there.

            s.

            Comment


              #36
              Originally posted by dcorsus View Post
              For ListAvailableServices ... try

              dim Ret as string ()

              or try

              Dim Ret as Object

              See if it makes a difference

              2/ ZoneThirdPartyMediaServicesX should now be readable via ZoneZoneThirdPartyMediaServices property


              Just finished re-coding ListAvailableServices

              Was now looking at your EnqueuedTransportURI and I assume you also need that metaData?

              Care to email me in private how to decrypt?

              Dirk
              ThirdPartyMediaServers returns the encypted String! YEAH!
              ListAvailable still fails:
              "ERROR in ListAvailableServices for zoneplayer = Family Room with UPNP Error = Read only tag / Transport is locked / Access denied. Error = MyUPnPService.InvokeAction for ServiceID = http://192.168.1.57:1400/xml/DeviceProperties1.xml while sending Action = ListAvailableServices for URI = http://192.168.1.57:1400/DeviceProperties/Control and Request = UPNP Error = faultcode = s:Client, faultstring = UPnPError, detail = 401 with error = The remote server returned an error: (500) Internal Server Error."

              Comment


                #37
                Originally posted by skavan View Post
                ThirdPartyMediaServers returns the encypted String! YEAH!
                ListAvailable still fails:
                "ERROR in ListAvailableServices for zoneplayer = Family Room with UPNP Error = Read only tag / Transport is locked / Access denied. Error = MyUPnPService.InvokeAction for ServiceID = http://192.168.1.57:1400/xml/DeviceProperties1.xml while sending Action = ListAvailableServices for URI = http://192.168.1.57:1400/DeviceProperties/Control and Request = UPNP Error = faultcode = s:Client, faultstring = UPnPError, detail = 401 with error = The remote server returned an error: (500) Internal Server Error."
                In this version I (should have) fixed ListAvailableServices
                Added properties EnqueuedTransportURI and EnqueuedTransportURIMetaData

                Dirk
                Last edited by dcorsus; November 19, 2015, 01:18 AM.

                Comment


                  #38
                  Originally posted by dcorsus View Post
                  In this version I (should have) fixed ListAvailableServices
                  Added properties EnqueuedTransportURI and EnqueuedTransportURIMetaData

                  Dirk
                  Forgot to mention I renamed ZoneThirdPartyMediaServices to ZoneThirdPartyMediaServicesX

                  Comment


                    #39
                    OK:
                    1. GetHouseholdID : works
                    2. ZoneThirdPartyMediaServicesX : works
                    3. CurrentTrackMetaData ;; returns EnqueuedTransportURIMetaData when stopped and "" when playing!
                    4. NextTrackmetaData :: works (I think)
                    5. EnqueuedURITransportMetaData... :: works.
                    6. ListAvailableMusicServices :: Still errors....but a new error:

                    "ERROR in ListAvailableServices for zoneplayer = Family Room with UPNP Error = Restricted parent object. Error = Unable to cast object of type 'System.Object[]' to type 'System.String[]'."

                    Comment


                      #40
                      Originally posted by skavan View Post
                      3. CurrentTrackMetaData ;; returns EnqueuedTransportURIMetaData when stopped and "" when playing!

                      6. ListAvailableMusicServices :: Still errors....but a new error:

                      "ERROR in ListAvailableServices for zoneplayer = Family Room with UPNP Error = Restricted parent object. Error = Unable to cast object of type 'System.Object[]' to type 'System.String[]'."
                      Made some changes not to overwrite EnqueuedTransportURIMetaData, CurrentTrackMetaData
                      Made a definition change for ListAvailableServices, see if it works now

                      Dirk

                      Comment


                        #41
                        Originally posted by dcorsus View Post
                        Made some changes not to overwrite EnqueuedTransportURIMetaData, CurrentTrackMetaData
                        Made a definition change for ListAvailableServices, see if it works now

                        Dirk
                        Getting VERY CLOSE:

                        1. GetHouseholdID : works -- but arrives late. Needs to be one of the first commands issued (even before event subscriptions)
                        2. ZoneThirdPartyMediaServicesX : works
                        3. CurrentTrackMetaData ;; returns EnqueuedTransportURIMetaData when stopped and "" when playing!
                        4. NextTrackmetaData :: works (I think)
                        5. EnqueuedURITransportMetaData... :: works.
                        6. ListAvailableMusicServices :: WORKS!!!!

                        So - #1 needs to happen earlier and #3 still is wonky!

                        s.

                        Comment


                          #42
                          Originally posted by skavan View Post
                          1. GetHouseholdID : works -- but arrives late. Needs to be one of the first commands issued (even before event subscriptions)
                          ?? When you call this procedure, it goes straight to the player, so you can only call it when the player is fully discovered which takes at least 30 sec at start-up. We're reading this, how does it make a difference to read this before any event subscriptions. The latter starts as soon as the players come on-line, I can't rewrite the PI for that whilst not understanding the difference.

                          Originally posted by skavan View Post
                          3. CurrentTrackMetaData ;; returns EnqueuedTransportURIMetaData when stopped and "" when playing!
                          It comes from doing a GetMediaInfo and has always been the most reliable information for any media. I make this call each time I receive an Avtransport event, even if that event has MetaData in it, it wasn't always reliable. NextMetaData does come from the event itself. I have a check built in to not overwrite it with an empty string. Are you sure there is nothing wrong on your side? I can check for empty and blanks .... (new version attached).

                          I'm out until next week, good luck

                          Dirk
                          Last edited by dcorsus; November 21, 2015, 07:03 PM.

                          Comment


                            #43
                            Originally posted by dcorsus View Post
                            ?? When you call this procedure, it goes straight to the player, so you can only call it when the player is fully discovered which takes at least 30 sec at start-up. We're reading this, how does it make a difference to read this before any event subscriptions. The latter starts as soon as the players come on-line, I can't rewrite the PI for that whilst not understanding the difference.
                            Sorry for the delay in replying. Pesky day job got in the way.
                            To answer your question above...let' say you are playing an Amazon Cloud Player stream. Metadata starts to flow. One needs the HouseholdID to decrypt the ThirdPartyServicesX data (it is, in fact, the password) and therefore, one can't get "protected" AlbumArt without it. So in the case that metadata starts to flow without knowing the HouseholdID, there will be no AlbumArt.

                            In my little UpnP app, once I get a DeviceAdded response to a device subscription....I immediately get the HouseholdID, Music Services and ZoneGRoupTolpology encrypted data (synchronously) -- and only then do I subscribe to AVTransport.

                            That said, the reality is that HouseholdID is a constant. It doesn't change. It doesn't need to be read on each session...and could be stored as you do with other "Globals"?

                            I hope that all made sense.

                            It comes from doing a GetMediaInfo and has always been the most reliable information for any media. I make this call each time I receive an Avtransport event, even if that event has MetaData in it, it wasn't always reliable. NextMetaData does come from the event itself. I have a check built in to not overwrite it with an empty string. Are you sure there is nothing wrong on your side? I can check for empty and blanks .... (new version attached).

                            I'm out until next week, good luck

                            Dirk
                            Will check the above now and revert.

                            Comment


                              #44
                              OK - checked out latest drop and CurrentTrackMetaData still returns "".
                              Do you mean GetmediaInfo or GetPositionInfo? I think you mean the latter.

                              In any event (pun intended!) - the data isn't coming through!
                              As a backup - perhaps you could just stuff the LastChange metadata (in full) in a GetLastChange method?

                              Comment


                                #45
                                Back in town ....

                                Originally posted by skavan View Post
                                OK - checked out latest drop and CurrentTrackMetaData still returns "".
                                Do you mean GetmediaInfo or GetPositionInfo? I think you mean the latter.
                                I meant GetMediaInfo ....

                                Originally posted by skavan View Post
                                In any event (pun intended!) - the data isn't coming through!
                                As a backup - perhaps you could just stuff the LastChange metadata (in full) in a GetLastChange method?
                                The problem is that most track changes have multiple events, if you tune into a radiostation, you might actually receive plenty of them and some of them have no info or reduced info in them. That's also the reason why I don't bother to keep it in the PI, I only focus on what I need and update the values only when they are present and different.
                                I'll have another look why it is empty because I have a check to prevent it but it doesn't seem to work or something not kosher in your side of the fence.

                                Did you get the HouseholdID to work?

                                Comment

                                Working...
                                X