Synology

Synology DS Photo+ DLNA Mirroring Reverse Engineering Part 1

I’m using my Synology DS214play NAS for storing all my family pictures and videos on it. Therefore, I’m using the Synology Photo Station application on the NAS. It is a great app for organizing all my photos and videos – especially the wide platform support including apps for iOS, Android, Windows, Mac OS X and also a browser based web client is something I really love.
Being an IT guy, I found some major problems regarding Synology Photo Station that I’m willing to investigate and maybe fix them. First issue in this blog series:

  • Mirror a photo that is displayed in DS Photo+ app to my Samsung TV
  • DS_Photo_DLNA

    Inside the DS Photo+ app, you can view a photo and also mirror this photo to your TV using DLNA. Unfortunately in my home network it didn’t work as expected. The app is displaying my TV (a Samsung UE46ES8090 model) and the TV automatically switches its input mode but then a message is being displayed saying: “The file format is not supported”.

    First thing I did, was using the TV’s built-in DLNA client to access my photos on my Synology NAS and it was working – so the file or the file format was readable / renderable by the TV (the photos are all regular JPEG images).

    I set up a network trace on my router / switch to capture all related traffic between iPad (DS Photo+ app), TV and Synology. First thing I acknowledged is that the communication is as follows:

    Packages

    The following SOAP messages are being sent and received inside the above-captured packages:

  • #1362: DS Photo+ app sends SOAP Request containing SetAVTransportURI to TV
  • <?xml version="1.0" encoding="utf-8" standalone="yes"?>
    <s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
      <s:Body>
        <u:SetAVTransportURI xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
           <InstanceID>0</InstanceID>
           <CurrentURI>http://synology.mydomain.local:80/photo/webapi/thumb.php?api=SYNO.PhotoStation.Thumb&amp;method=get&amp;version=1&amp;id=photo_31393836_313938365f312e6a7067&amp;size=large&amp;PHPSESSID=th0s6u82becglvl6ajljq4l125</CurrentURI>
           <CurrentURIMetaData>&lt;DIDL-Lite xmlns=&quot;urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/&quot; xmlns:upnp=&quot;urn:schemas-upnp-org:metadata-1-0/upnp/&quot; xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; xmlns:dlna=&quot;urn:schemas-upnp-org:metadata-1-0/&quot; xmlns:sec=&quot;http://www.sec.co.kr/&quot;&gt;&lt;item id =&quot;0&quot; parentID=&quot;0&quot; restricted=&quot;1&quot;&gt;&lt;upnp:class&gt;object.item.imageItem&lt;/upnp:class&gt;&lt;dc:title&gt;1986_1.jpg&lt;/dc:title&gt;&lt;res protocolInfo=&quot;http-get:*:image/jpeg:*&quot;&gt;http://synology.mydomain.local:80/photo/webapi/thumb.php?api=SYNO.PhotoStation.Thumb&amp;amp;method=get&amp;amp;version=1&amp;amp;id=photo_31393836_313938365f312e6a7067&amp;amp;size=large&amp;amp;PHPSESSID=th0s6u82becglvl6ajljq4l125&lt;/res&gt;&lt;/item&gt;&lt;/DIDL-Lite&gt;</CurrentURIMetaData>
        </u:SetAVTransportURI>
      </s:Body>
    </s:Envelope>
    

  • #1364: TV respondes containging SetAVTransportURIResponse
  • <?xml version="1.0" encoding="utf-8"?>
    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
      <s:Body>
         <u:SetAVTransportURIResponse xmlns:u="urn:schemas-upnp-org:service:AVTransport:1"></u:SetAVTransportURIResponse> 
      </s:Body>
    </s:Envelope>
    

  • #1386: DS Photo+ app sends SOAP Request containting Play
  • <?xml version="1.0" encoding="utf-8" standalone="yes"?>
    <s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
      <s:Body>
        <u:Play xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
          <InstanceID>0</InstanceID>
          <Speed>1</Speed>
        </u:Play>
      </s:Body>
    </s:Envelope>
    

  • #1389: TV respondes containging PlayResponse
  • <?xml version="1.0" encoding="utf-8"?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
      <s:Body>
        <u:PlayResponse xmlns:u="urn:schemas-upnp-org:service:AVTransport:1"></u:PlayResponse>
      </s:Body>
    </s:Envelope>
    

    Now I have a much better understanding of what’s happening when I select the mirror option inside the DS Photo+ app:

  • The iPad sends a URL to the TV
  • The iPad sends a play signal to the TV
  • The TV is playing the media file from the URL
  • The next steps will be: Testing the URL from the Synology and trying to manually push an image URL to the TV using the above SOAP request.

    You may also like
    Edit Synology Photo Station Album Permissions via Script
    Export NetAtmo weather station data to CSV / Excel
    1 Comment
    • Screen Mirroring Reverse Engineering
      2015-10-13T07:57:09+00:000000000931201510 at 07:57
      Reply

      Please share next part of this article. May be we can exchange the knowledge. i was also going through the important HTTP methods exchanged between the TV and Client Before image is shown.

    Leave Your Comment

    Your Comment*

    Your Name*
    Your Webpage