-
-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't connect to AVTransport #43
Comments
Hello @Mikescops, I know that error is not super useful. It means that one of the DLNA calls to your device returned a bad HTTP error code. That could be related to bad file format, bad handling of a specific file name. I can provide a version of Go2TV that provides some debug level logs to get to the bottom of the issue but first it would be good to share some info on your setup.
|
I tried with both 👍
I tried to cast a FLAC audio file (I also tried the transcode option too without success, tho' it seems to be for video)
I have a SONY HT-A9, which is a pretty recent device.
The error is consistent over time.
Yes i tried with MP3 too, and also tried on a Windows computer. All in all, this doesn't seems to be dependant on the codecs as the receiver is able to receive such formats (bitrates too). The error is consistent over time and platform. If that helps, here is the UPNP xml file: Click to expand<root>
<specVersion>
<major>1</major>
<minor>0</minor>
</specVersion>
<device>
<deviceType>urn:schemas-upnp-org:device:MediaRenderer:1</deviceType>
<friendlyName>HT-A9</friendlyName>
<manufacturer>Sony Corporation</manufacturer>
<manufacturerURL>http://www.sony.net/</manufacturerURL>
<modelName>HT-A9</modelName>
<modelNumber>BAR-2021</modelNumber>
<UDN>uuid:00000000-0000-1010-8000-f84e17521a0b</UDN>
<dlna:X_DLNACAP>playcontainer-0-1</dlna:X_DLNACAP>
<dlna:X_DLNADOC>DMR-1.50</dlna:X_DLNADOC>
<av:X_StandardDMR>1.1</av:X_StandardDMR>
<iconList>
<icon>
<mimetype>image/png</mimetype>
<width>120</width>
<height>120</height>
<depth>24</depth>
<url>/a9_device_icon_120.png</url>
</icon>
<icon>
<mimetype>image/jpeg</mimetype>
<width>120</width>
<height>120</height>
<depth>24</depth>
<url>/a9_device_icon_120.jpg</url>
</icon>
<icon>
<mimetype>image/png</mimetype>
<width>48</width>
<height>48</height>
<depth>24</depth>
<url>/a9_device_icon_48.png</url>
</icon>
<icon>
<mimetype>image/jpeg</mimetype>
<width>48</width>
<height>48</height>
<depth>24</depth>
<url>/a9_device_icon_48.jpg</url>
</icon>
</iconList>
<serviceList>
<service>
<serviceType>urn:schemas-upnp-org:service:RenderingControl:1</serviceType>
<serviceId>urn:upnp-org:serviceId:RenderingControl</serviceId>
<SCPDURL>/RenderingControlSCPD.xml</SCPDURL>
<controlURL>/upnp/control/RenderingControl</controlURL>
<eventSubURL>/upnp/event/RenderingControl</eventSubURL>
</service>
<service>
<serviceType>urn:schemas-upnp-org:service:ConnectionManager:1</serviceType>
<serviceId>urn:upnp-org:serviceId:ConnectionManager</serviceId>
<SCPDURL>/ConnectionManagerSCPD.xml</SCPDURL>
<controlURL>/upnp/control/ConnectionManager</controlURL>
<eventSubURL>/upnp/event/ConnectionManager</eventSubURL>
</service>
<service>
<serviceType>urn:schemas-upnp-org:service:AVTransport:1</serviceType>
<serviceId>urn:upnp-org:serviceId:AVTransport</serviceId>
<SCPDURL>/AVTransportSCPD.xml</SCPDURL>
<controlURL>/upnp/control/AVTransport</controlURL>
<eventSubURL>/upnp/event/AVTransport</eventSubURL>
</service>
<service>
<serviceType>urn:schemas-sony-com:service:ScalarWebAPI:1</serviceType>
<serviceId>urn:schemas-sony-com:serviceId:ScalarWebAPI</serviceId>
<SCPDURL>/ScalarWebApiSCPD.xml</SCPDURL>
<controlURL>/ScalarAPI</controlURL>
<eventSubURL />
</service>
</serviceList>
<av:X_ScalarWebAPI_DeviceInfo>
<av:X_ScalarWebAPI_Version>1.0</av:X_ScalarWebAPI_Version>
<av:X_ScalarWebAPI_BaseURL>http://192.168.1.32:10000/sony</av:X_ScalarWebAPI_BaseURL>
<av:X_ScalarWebAPI_ServiceList>
<av:X_ScalarWebAPI_ServiceType>guide</av:X_ScalarWebAPI_ServiceType>
<av:X_ScalarWebAPI_ServiceType>audio</av:X_ScalarWebAPI_ServiceType>
<av:X_ScalarWebAPI_ServiceType>avContent</av:X_ScalarWebAPI_ServiceType>
<av:X_ScalarWebAPI_ServiceType>system</av:X_ScalarWebAPI_ServiceType>
<av:X_ScalarWebAPI_ServiceType>appControl</av:X_ScalarWebAPI_ServiceType>
</av:X_ScalarWebAPI_ServiceList>
</av:X_ScalarWebAPI_DeviceInfo>
<av:X_CIS_DeviceInfo>
<av:X_CIS_Version>1,2</av:X_CIS_Version>
<av:X_CIS_v1Info>
<av:X_CIS_Port>33335</av:X_CIS_Port>
</av:X_CIS_v1Info>
<av:X_CIS_v2Info>
<av:X_CIS_Port>33336</av:X_CIS_Port>
</av:X_CIS_v2Info>
</av:X_CIS_DeviceInfo>
</device>
</root> And the AVTransportSCPD.xml : Click to expand<scpd>
<specVersion>
<major>1</major>
<minor>0</minor>
</specVersion>
<actionList>
<action>
<name>SetAVTransportURI</name>
<argumentList>
<argument>
<name>InstanceID</name>
<direction>in</direction>
<relatedStateVariable>A_ARG_TYPE_InstanceID</relatedStateVariable>
</argument>
<argument>
<name>CurrentURI</name>
<direction>in</direction>
<relatedStateVariable>AVTransportURI</relatedStateVariable>
</argument>
<argument>
<name>CurrentURIMetaData</name>
<direction>in</direction>
<relatedStateVariable>AVTransportURIMetaData</relatedStateVariable>
</argument>
</argumentList>
</action>
<action>
<name>SetNextAVTransportURI</name>
<argumentList>
<argument>
<name>InstanceID</name>
<direction>in</direction>
<relatedStateVariable>A_ARG_TYPE_InstanceID</relatedStateVariable>
</argument>
<argument>
<name>NextURI</name>
<direction>in</direction>
<relatedStateVariable>NextAVTransportURI</relatedStateVariable>
</argument>
<argument>
<name>NextURIMetaData</name>
<direction>in</direction>
<relatedStateVariable>NextAVTransportURIMetaData</relatedStateVariable>
</argument>
</argumentList>
</action>
<action>
<name>GetMediaInfo</name>
<argumentList>
<argument>
<name>InstanceID</name>
<direction>in</direction>
<relatedStateVariable>A_ARG_TYPE_InstanceID</relatedStateVariable>
</argument>
<argument>
<name>NrTracks</name>
<direction>out</direction>
<relatedStateVariable>NumberOfTracks</relatedStateVariable>
</argument>
<argument>
<name>MediaDuration</name>
<direction>out</direction>
<relatedStateVariable>CurrentMediaDuration</relatedStateVariable>
</argument>
<argument>
<name>CurrentURI</name>
<direction>out</direction>
<relatedStateVariable>AVTransportURI</relatedStateVariable>
</argument>
<argument>
<name>CurrentURIMetaData</name>
<direction>out</direction>
<relatedStateVariable>AVTransportURIMetaData</relatedStateVariable>
</argument>
<argument>
<name>NextURI</name>
<direction>out</direction>
<relatedStateVariable>NextAVTransportURI</relatedStateVariable>
</argument>
<argument>
<name>NextURIMetaData</name>
<direction>out</direction>
<relatedStateVariable>NextAVTransportURIMetaData</relatedStateVariable>
</argument>
<argument>
<name>PlayMedium</name>
<direction>out</direction>
<relatedStateVariable>PlaybackStorageMedium</relatedStateVariable>
</argument>
<argument>
<name>RecordMedium</name>
<direction>out</direction>
<relatedStateVariable>RecordStorageMedium</relatedStateVariable>
</argument>
<argument>
<name>WriteStatus</name>
<direction>out</direction>
<relatedStateVariable>RecordMediumWriteStatus</relatedStateVariable>
</argument>
</argumentList>
</action>
<action>
<name>GetTransportInfo</name>
<argumentList>
<argument>
<name>InstanceID</name>
<direction>in</direction>
<relatedStateVariable>A_ARG_TYPE_InstanceID</relatedStateVariable>
</argument>
<argument>
<name>CurrentTransportState</name>
<direction>out</direction>
<relatedStateVariable>TransportState</relatedStateVariable>
</argument>
<argument>
<name>CurrentTransportStatus</name>
<direction>out</direction>
<relatedStateVariable>TransportStatus</relatedStateVariable>
</argument>
<argument>
<name>CurrentSpeed</name>
<direction>out</direction>
<relatedStateVariable>TransportPlaySpeed</relatedStateVariable>
</argument>
</argumentList>
</action>
<action>
<name>GetPositionInfo</name>
<argumentList>
<argument>
<name>InstanceID</name>
<direction>in</direction>
<relatedStateVariable>A_ARG_TYPE_InstanceID</relatedStateVariable>
</argument>
<argument>
<name>Track</name>
<direction>out</direction>
<relatedStateVariable>CurrentTrack</relatedStateVariable>
</argument>
<argument>
<name>TrackDuration</name>
<direction>out</direction>
<relatedStateVariable>CurrentTrackDuration</relatedStateVariable>
</argument>
<argument>
<name>TrackMetaData</name>
<direction>out</direction>
<relatedStateVariable>CurrentTrackMetaData</relatedStateVariable>
</argument>
<argument>
<name>TrackURI</name>
<direction>out</direction>
<relatedStateVariable>CurrentTrackURI</relatedStateVariable>
</argument>
<argument>
<name>RelTime</name>
<direction>out</direction>
<relatedStateVariable>RelativeTimePosition</relatedStateVariable>
</argument>
<argument>
<name>AbsTime</name>
<direction>out</direction>
<relatedStateVariable>AbsoluteTimePosition</relatedStateVariable>
</argument>
<argument>
<name>RelCount</name>
<direction>out</direction>
<relatedStateVariable>RelativeCounterPosition</relatedStateVariable>
</argument>
<argument>
<name>AbsCount</name>
<direction>out</direction>
<relatedStateVariable>AbsoluteCounterPosition</relatedStateVariable>
</argument>
</argumentList>
</action>
<action>
<name>GetDeviceCapabilities</name>
<argumentList>
<argument>
<name>InstanceID</name>
<direction>in</direction>
<relatedStateVariable>A_ARG_TYPE_InstanceID</relatedStateVariable>
</argument>
<argument>
<name>PlayMedia</name>
<direction>out</direction>
<relatedStateVariable>PossiblePlaybackStorageMedia</relatedStateVariable>
</argument>
<argument>
<name>RecMedia</name>
<direction>out</direction>
<relatedStateVariable>PossibleRecordStorageMedia</relatedStateVariable>
</argument>
<argument>
<name>RecQualityModes</name>
<direction>out</direction>
<relatedStateVariable>PossibleRecordQualityModes</relatedStateVariable>
</argument>
</argumentList>
</action>
<action>
<name>GetTransportSettings</name>
<argumentList>
<argument>
<name>InstanceID</name>
<direction>in</direction>
<relatedStateVariable>A_ARG_TYPE_InstanceID</relatedStateVariable>
</argument>
<argument>
<name>PlayMode</name>
<direction>out</direction>
<relatedStateVariable>CurrentPlayMode</relatedStateVariable>
</argument>
<argument>
<name>RecQualityMode</name>
<direction>out</direction>
<relatedStateVariable>CurrentRecordQualityMode</relatedStateVariable>
</argument>
</argumentList>
</action>
<action>
<name>Stop</name>
<argumentList>
<argument>
<name>InstanceID</name>
<direction>in</direction>
<relatedStateVariable>A_ARG_TYPE_InstanceID</relatedStateVariable>
</argument>
</argumentList>
</action>
<action>
<name>Play</name>
<argumentList>
<argument>
<name>InstanceID</name>
<direction>in</direction>
<relatedStateVariable>A_ARG_TYPE_InstanceID</relatedStateVariable>
</argument>
<argument>
<name>Speed</name>
<direction>in</direction>
<relatedStateVariable>TransportPlaySpeed</relatedStateVariable>
</argument>
</argumentList>
</action>
<action>
<name>Pause</name>
<argumentList>
<argument>
<name>InstanceID</name>
<direction>in</direction>
<relatedStateVariable>A_ARG_TYPE_InstanceID</relatedStateVariable>
</argument>
</argumentList>
</action>
<action>
<name>Seek</name>
<argumentList>
<argument>
<name>InstanceID</name>
<direction>in</direction>
<relatedStateVariable>A_ARG_TYPE_InstanceID</relatedStateVariable>
</argument>
<argument>
<name>Unit</name>
<direction>in</direction>
<relatedStateVariable>A_ARG_TYPE_SeekMode</relatedStateVariable>
</argument>
<argument>
<name>Target</name>
<direction>in</direction>
<relatedStateVariable>A_ARG_TYPE_SeekTarget</relatedStateVariable>
</argument>
</argumentList>
</action>
<action>
<name>Next</name>
<argumentList>
<argument>
<name>InstanceID</name>
<direction>in</direction>
<relatedStateVariable>A_ARG_TYPE_InstanceID</relatedStateVariable>
</argument>
</argumentList>
</action>
<action>
<name>Previous</name>
<argumentList>
<argument>
<name>InstanceID</name>
<direction>in</direction>
<relatedStateVariable>A_ARG_TYPE_InstanceID</relatedStateVariable>
</argument>
</argumentList>
</action>
<action>
<name>SetPlayMode</name>
<argumentList>
<argument>
<name>InstanceID</name>
<direction>in</direction>
<relatedStateVariable>A_ARG_TYPE_InstanceID</relatedStateVariable>
</argument>
<argument>
<name>NewPlayMode</name>
<direction>in</direction>
<relatedStateVariable>CurrentPlayMode</relatedStateVariable>
</argument>
</argumentList>
</action>
<action>
<name>GetCurrentTransportActions</name>
<argumentList>
<argument>
<name>InstanceID</name>
<direction>in</direction>
<relatedStateVariable>A_ARG_TYPE_InstanceID</relatedStateVariable>
</argument>
<argument>
<name>Actions</name>
<direction>out</direction>
<relatedStateVariable>CurrentTransportActions</relatedStateVariable>
</argument>
</argumentList>
</action>
</actionList>
<serviceStateTable>
<stateVariable sendEvents="yes">
<name>LastChange</name>
<dataType>string</dataType>
</stateVariable>
<stateVariable sendEvents="no">
<name>TransportState</name>
<dataType>string</dataType>
<allowedValueList>
<allowedValue>STOPPED</allowedValue>
<allowedValue>PLAYING</allowedValue>
<allowedValue>PAUSED_PLAYBACK</allowedValue>
<allowedValue>TRANSITIONING</allowedValue>
<allowedValue>NO_MEDIA_PRESENT</allowedValue>
</allowedValueList>
</stateVariable>
<stateVariable sendEvents="no">
<name>TransportStatus</name>
<dataType>string</dataType>
<allowedValueList>
<allowedValue>OK</allowedValue>
<allowedValue>ERROR_OCCURRED</allowedValue>
</allowedValueList>
</stateVariable>
<stateVariable sendEvents="no">
<name>PlaybackStorageMedium</name>
<dataType>string</dataType>
<allowedValueList>
<allowedValue>NETWORK</allowedValue>
</allowedValueList>
</stateVariable>
<stateVariable sendEvents="no">
<name>RecordStorageMedium</name>
<dataType>string</dataType>
<allowedValueList>
<allowedValue>NOT_IMPLEMENTED</allowedValue>
</allowedValueList>
</stateVariable>
<stateVariable sendEvents="no">
<name>PossiblePlaybackStorageMedia</name>
<dataType>string</dataType>
</stateVariable>
<stateVariable sendEvents="no">
<name>PossibleRecordStorageMedia</name>
<dataType>string</dataType>
</stateVariable>
<stateVariable sendEvents="no">
<name>CurrentPlayMode</name>
<dataType>string</dataType>
<allowedValueList>
<allowedValue>NORMAL</allowedValue>
<allowedValue>REPEAT_ONE</allowedValue>
<allowedValue>REPEAT_ALL</allowedValue>
<allowedValue>SHUFFLE</allowedValue>
<allowedValue>SHUFFLE_REPEAT</allowedValue>
</allowedValueList>
<defaultValue>NORMAL</defaultValue>
</stateVariable>
<stateVariable sendEvents="no">
<name>TransportPlaySpeed</name>
<dataType>string</dataType>
<allowedValueList>
<allowedValue>1</allowedValue>
</allowedValueList>
</stateVariable>
<stateVariable sendEvents="no">
<name>RecordMediumWriteStatus</name>
<dataType>string</dataType>
<allowedValueList>
<allowedValue>NOT_IMPLEMENTED</allowedValue>
</allowedValueList>
</stateVariable>
<stateVariable sendEvents="no">
<name>CurrentRecordQualityMode</name>
<dataType>string</dataType>
<allowedValueList>
<allowedValue>NOT_IMPLEMENTED</allowedValue>
</allowedValueList>
</stateVariable>
<stateVariable sendEvents="no">
<name>PossibleRecordQualityModes</name>
<dataType>string</dataType>
</stateVariable>
<stateVariable sendEvents="no">
<name>NumberOfTracks</name>
<dataType>ui4</dataType>
<allowedValueRange>
<minimum>0</minimum>
<maximum>1</maximum>
</allowedValueRange>
</stateVariable>
<stateVariable sendEvents="no">
<name>CurrentTrack</name>
<dataType>ui4</dataType>
<allowedValueRange>
<minimum>0</minimum>
<maximum>1</maximum>
<step>1</step>
</allowedValueRange>
</stateVariable>
<stateVariable sendEvents="no">
<name>CurrentTrackDuration</name>
<dataType>string</dataType>
</stateVariable>
<stateVariable sendEvents="no">
<name>CurrentMediaDuration</name>
<dataType>string</dataType>
</stateVariable>
<stateVariable sendEvents="no">
<name>CurrentTrackMetaData</name>
<dataType>string</dataType>
</stateVariable>
<stateVariable sendEvents="no">
<name>CurrentTrackURI</name>
<dataType>string</dataType>
</stateVariable>
<stateVariable sendEvents="no">
<name>AVTransportURI</name>
<dataType>string</dataType>
</stateVariable>
<stateVariable sendEvents="no">
<name>AVTransportURIMetaData</name>
<dataType>string</dataType>
</stateVariable>
<stateVariable sendEvents="no">
<name>NextAVTransportURI</name>
<dataType>string</dataType>
</stateVariable>
<stateVariable sendEvents="no">
<name>NextAVTransportURIMetaData</name>
<dataType>string</dataType>
</stateVariable>
<stateVariable sendEvents="no">
<name>RelativeTimePosition</name>
<dataType>string</dataType>
</stateVariable>
<stateVariable sendEvents="no">
<name>AbsoluteTimePosition</name>
<dataType>string</dataType>
</stateVariable>
<stateVariable sendEvents="no">
<name>RelativeCounterPosition</name>
<dataType>i4</dataType>
</stateVariable>
<stateVariable sendEvents="no">
<name>AbsoluteCounterPosition</name>
<dataType>i4</dataType>
</stateVariable>
<stateVariable sendEvents="no">
<name>CurrentTransportActions</name>
<dataType>string</dataType>
</stateVariable>
<stateVariable sendEvents="no">
<name>A_ARG_TYPE_SeekMode</name>
<dataType>string</dataType>
<allowedValueList>
<allowedValue>TRACK_NR</allowedValue>
<allowedValue>REL_TIME</allowedValue>
</allowedValueList>
</stateVariable>
<stateVariable sendEvents="no">
<name>A_ARG_TYPE_SeekTarget</name>
<dataType>string</dataType>
</stateVariable>
<stateVariable sendEvents="no">
<name>A_ARG_TYPE_InstanceID</name>
<dataType>ui4</dataType>
</stateVariable>
</serviceStateTable>
</scpd> |
Thank you for that. I compiled a debug version of Go2TV for Linux. Would it be possible to run it from a terminal (in GUI mode), try to cast your file again and send me the output of the terminal. I should probably add a debug flag in future releases too. |
Here is the answer: Click to expandREQUEST: <?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:SetAVTransportURI xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
<InstanceID>0</InstanceID>
<CurrentURI>http://192.168.1.85:3500/output.flac</CurrentURI>
<CurrentURIMetaData>
<DIDL-Lite xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:sec="http://www.sec.co.kr/"
xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/">
<item restricted="false" id="0" parentID="-1">
<sec:CaptionInfo sec:type="srt">http://192.168.1.85:3500/.</sec:CaptionInfo>
<sec:CaptionInfoEx sec:type="srt">http://192.168.1.85:3500/.</sec:CaptionInfoEx>
<upnp:class>object.item.audioItem.musicTrack</upnp:class>
<dc:title>output.flac</dc:title>
<res protocolInfo="http-get:*:audio/x-flac:*">http://192.168.1.85:3500/output.flac</res>
<res protocolInfo="http-get:*:text/srt:*">http://192.168.1.85:3500/.</res>
</item>
</DIDL-Lite>
</CurrentURIMetaData>
</u:SetAVTransportURI>
</s:Body>
</s:Envelope>
RESPONSE: <?xml version="1.0"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<s:Fault>
<faultcode>s:Client</faultcode>
<faultstring>UPnPError</faultstring>
<detail>
<UPnPError xmlns="urn:schemas-upnp-org:control-1-0">
<errorCode>501</errorCode>
<errorDescription>Action SetAVTransportURI failed
</errorDescription>
</UPnPError>
</detail>
</s:Fault>
</s:Body>
</s:Envelope> 500 Internal Server Error
REQUEST: <?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:Play xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
<InstanceID>0</InstanceID>
<Speed>1</Speed>
</u:Play>
</s:Body>
</s:Envelope>
RESPONSE: <?xml version="1.0"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<s:Fault>
<faultcode>s:Client</faultcode>
<faultstring>UPnPError</faultstring>
<detail>
<UPnPError xmlns="urn:schemas-upnp-org:control-1-0">
<errorCode>701</errorCode>
<errorDescription>Action Play failed
</errorDescription>
</UPnPError>
</detail>
</s:Fault>
</s:Body>
</s:Envelope> 500 Internal Server Error Edit: I also confirm that |
Thank you. That's a hard one to get to the bottom of given that I dont have the device to run various checks. What I can do, is provide a version of Go2TV later in the day where I remove the SecCaption items from the request (and anything subtitle related that sits there by default) and see if that helps. |
Ok sure, let's do this 😄 |
Ty. Could you please test this version and see if it make a difference? Usually the mitigation step for those 501 errors is to retry, which in our case does not work. |
Nope, not working either, same error... ClickREQUEST: <?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:SetAVTransportURI xmlns:u="urn:schemas-upnp-org:service:AVTransport:1"><InstanceID>0</InstanceID><CurrentURI>http://192.168.1.85:3500/toto.flac</CurrentURI><CurrentURIMetaData><DIDL-Lite xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sec="http://www.sec.co.kr/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/"><item restricted="false" id="0" parentID="-1"><upnp:class>object.item.audioItem.musicTrack</upnp:class><dc:title>toto.flac</dc:title><res protocolInfo="http-get:*:audio/x-flac:*">http://192.168.1.85:3500/toto.flac</res></item></DIDL-Lite></CurrentURIMetaData></u:SetAVTransportURI></s:Body></s:Envelope>
RESPONSE: <?xml version="1.0"?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><s:Fault><faultcode>s:Client</faultcode><faultstring>UPnPError</faultstring><detail><UPnPError xmlns="urn:schemas-upnp-org:control-1-0"><errorCode>501</errorCode><errorDescription>Action SetAVTransportURI failed |
OK, not unexpected. From a quick search it seems that your speaker work fine with BubbleUPNP on android. I'll try to reverse engineer the calls and see if there are any discrepancies. Keeping the ticket open as there are certainly improvements to introduce to the UPNP protocol implementation. |
This bridge to LMS by @philippe44 is also working well: https://github.com/philippe44/LMS-to-uPnP I'll also take a look to your code to see if I can make it work (if I find enough time) 👍 |
So I did a bit of investigation and tested both BubbleUPNP & the bridge to LMS BubbleUPNP <?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://192.168.88.253:57645/external/audio/media/186608.flac</CurrentURI>
<CurrentURIMetaData>
<DIDL-Lite
xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/"
xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/"
xmlns:sec="http://www.sec.co.kr/"
xmlns:pv="http://www.pv.com/pvns/">
<item id="parent/186608" parentID="parent" restricted="1">
<upnp:class>object.item.audioItem.musicTrack</upnp:class>
<dc:title>Symphony No.6 (1st movement)</dc:title>
<dc:creator>Ludwig van Beethoven</dc:creator>
<upnp:artist>Ludwig van Beethoven</upnp:artist>
<upnp:albumArtURI>http://192.168.88.253:57645/external/audio/albums/32.jpg</upnp:albumArtURI>
<upnp:genre>Classical</upnp:genre>
<upnp:album>www.mfiles.co.uk</upnp:album>
<res protocolInfo="http-get:*:audio/flac:DLNA.ORG_OP=01;DLNA.ORG_FLAGS=01700000000000000000000000000000" bitsPerSample="16" bitrate="71416" sampleFrequency="44100" nrAudioChannels="2" size="51997326" duration="0:12:08.000">http://192.168.88.253:57645/external/audio/media/186608.flac</res>
</item>
</DIDL-Lite>
</CurrentURIMetaData>
</u:SetAVTransportURI>
</s:Body>
</s:Envelope> bridge to LMS <s:Envelope
xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<u:SetAVTransportURI
xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
<InstanceID>0</InstanceID>
<CurrentURI>http://192.168.88.250:59955/bridge-4.flac</CurrentURI>
<CurrentURIMetaData>
<DIDL-Lite
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/"
xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/"
xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/">
<item id="1" parentID="0" restricted="1">
<dc:title>Innocence</dc:title>
<dc:creator>Hoff Ensemble: Jan Gunnar Hoff, Audun Kleive &amp; Anders Jormin</dc:creator>
<upnp:genre>Jazz</upnp:genre>
<upnp:artist>Hoff Ensemble: Jan Gunnar Hoff, Audun Kleive &amp; Anders Jormin</upnp:artist>
<upnp:album>POLARITY ... an acoustic jazz project</upnp:album>
<upnp:originalTrackNumber>1</upnp:originalTrackNumber>
<upnp:albumArtURI>http://192.168.88.250:9000/music/46b89aec/cover_.jpg</upnp:albumArtURI>
<upnp:class>object.item.audioItem.musicTrack</upnp:class>
<res duration="0:05:07.293" protocolInfo="http-get:*:audio/x-flac:DLNA.ORG_OP=00;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=09700000000000000000000000000000">http://192.168.88.250:59955/bridge-4.flac</res>
</item>
</DIDL-Lite>
</CurrentURIMetaData>
</u:SetAVTransportURI>
</s:Body>
</s:Envelope> and this is the Go2TV example you provided above <?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:SetAVTransportURI
xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
<InstanceID>0</InstanceID>
<CurrentURI>http://192.168.1.85:3500/toto.flac</CurrentURI>
<CurrentURIMetaData>
<DIDL-Lite
xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:sec="http://www.sec.co.kr/"
xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/">
<item restricted="false" id="0" parentID="-1">
<upnp:class>object.item.audioItem.musicTrack</upnp:class>
<dc:title>toto.flac</dc:title>
<res protocolInfo="http-get:*:audio/x-flac:*">http://192.168.1.85:3500/toto.flac</res>
</item>
</DIDL-Lite>
</CurrentURIMetaData>
</u:SetAVTransportURI>
</s:Body>
</s:Envelope> The biggest difference is in the "res protocolInfo" element where I dont pass the extra flags. I thought that this was optional given that the same flags are being served as headers by the webserver as seen here https://github.com/alexballas/go2tv/blob/main/httphandlers/httphandlers.go#L273 Furthermore according to the specification I also went through the DIDL-LITE xsd schema uploaded here and there is snippet that says
Which is respected by the Bridge but not BubbleUPNP In the Go2TV example For TL/DR:I really don't understand where things go wrong. The UPNP protocol is so loosely integrated by the vendors that things never are consistent across devices. However, I did push some changes to the devel branch to better match the other applications. <?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:SetAVTransportURI
xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
<InstanceID>0</InstanceID>
<CurrentURI>http://192.168.88.250:3500/2L-45_stereo_01_FLAC_88k_24b.flac</CurrentURI>
<CurrentURIMetaData>
<DIDL-Lite
xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:sec="http://www.sec.co.kr/"
xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/">
<item id="1" parentID="0" restricted="1">
<dc:title>2L-45_stereo_01_FLAC_88k_24b.flac</dc:title>
<upnp:class>object.item.audioItem.musicTrack</upnp:class>
<res protocolInfo="http-get:*:audio/x-flac:DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000">http://192.168.88.250:3500/2L-45_stereo_01_FLAC_88k_24b.flac</res>
</item>
</DIDL-Lite>
</CurrentURIMetaData>
</u:SetAVTransportURI>
</s:Body>
</s:Envelope> What I didn't include is the "duration" element which was a common thing for both BubbleUPNP & the bridge to LMS. First I'd like to see if those changes make any difference and if not I'll give the Here is a compiled version for linux: go2tv_3.zip |
I'm so sorry but it stills not working 😢 |
I made some tests using Postman, and I got the same error with the 3 different payloads. I'll have to capture the calls on my side then. EDIT1: curl --location --request POST 'http://192.168.1.32:54380/upnp/control/AVTransport' \
--header 'Content-Type: text/xml; charset="utf-8"' \
--header 'SOAPAction: "urn:schemas-upnp-org:service:AVTransport:1#SetAVTransportURI"' \
--header 'Connection: Keep-Alive' \
--header 'User-Agent: toto' \
--header 'Host: 192.168.1.32:54380' \
--data-raw '<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<u:SetAVTransportURI xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
<InstanceID>0</InstanceID>
<CurrentURI>http://192.168.1.85:3500/output.flac</CurrentURI>
<CurrentURIMetaData><DIDL-Lite xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/" xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/" xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/"><item id="1" parentID="0" restricted="1"><dc:title>Du propre</dc:title><dc:creator>Orelsan, Skread</dc:creator><upnp:genre></upnp:genre><upnp:artist>Orelsan, Skread</upnp:artist><upnp:album>Civilisation</upnp:album><upnp:originalTrackNumber>0</upnp:originalTrackNumber><upnp:class>object.item.audioItem.musicTrack</upnp:class><res duration="0:03:27.000" protocolInfo="http-get:*:audio/flac:DLNA.ORG_OP=00;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=09700000000000000000000000000000">http://192.168.1.85:3500/output.flac</res></item></DIDL-Lite></CurrentURIMetaData>
</u:SetAVTransportURI>
</s:Body>
</s:Envelope>
' The result is still an error 501 and I can't find what it means 👎 <?xml version="1.0"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<s:Fault>
<faultcode>s:Client</faultcode>
<faultstring>UPnPError</faultstring>
<detail>
<UPnPError xmlns="urn:schemas-upnp-org:control-1-0">
<errorCode>501</errorCode>
<errorDescription>Action SetAVTransportURI failed
</errorDescription>
</UPnPError>
</detail>
</s:Fault>
</s:Body>
</s:Envelope> EDIT2: i can't find what's wrong... EDIT3: i'm starting to think this is due to how the audio file is served, not the soap request... Some header might be wrong like the |
Ty for that. Would it be possible to grab the headers when using the proxy with Wireshark? Also could you please share the protocol info of you Sony's? You can grab that with this script here https://github.com/alexballas/dlnaprotocolinfo. Unfortunately I only compiled it for windows. |
So getting the packets during
Then I tested to
I built your go tool for linux and i got this:
😭 EDIT: I played a bit with Postman and found out the issue: It should be <?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:GetProtocolInfo xmlns:u="urn:schemas-upnp-org:service:ConnectionManager:1"></u:GetProtocolInfo></s:Body></s:Envelope> So the reply is :
Sounds like there is the expected |
Can you push your branch with the debug logs? I'm trying to find out what's going on (tho' I never did golang x) ) |
Hey, apologies for the delay. Due to health reasons I won't be able to write any code / access a PC for a couple of days, but I'm available through my phone. Regarding the content features, this is something that go2tv also sets. The supported DLNA ORG_FLAGS can be checked with the other app I shared. Edit: apologies, I miss clicked and resolved the ticket. Reopened it |
Oh, so sorry to hear that, get better soon! I'll try to investigate more, but I never seen such weird issue :( |
So I finally found what's happening, and it's because we didn't push the media type in the headers, so the player was lost somehow. Now that this is fixed, there is another issue, the sound starts playing but stops after a few seconds. When looking at the network, it seems that the player sends a STOPPED event (which triggers an unsubscribe from go2tv) right after we set the transportURI. Once again I have no idea why the player is doing this, but I'll take a look. EDIT: In go2tv case what happens when the stop even is received is that we emit I tried to ignore the stop message at the beginning and it works well. Problem is that it won't fit most players because I still think that's an issue coming from this model. EDIT2: I filled in a support ticket on Sony's help center. |
Apologies I'm still on phone but I think I can answer most of it. First of all a big thank you for the stellar analysis! When I can, I'll check the integration documents again to confirm if the file type in the header is optional or not. I'll add it off since it works for you. As for the Stop that it sends right away, it's not the first time I Ve seen it. My Samsung tv also do it. Check my code comment here: go2tv/httphandlers/httphandlers.go Line 128 in 7ca1a13
Does the sound stop after a while with all files types? Mp3s also? |
Yes, it's consistent over file types. If you have a closer look, you'll see that the STOPPED notify is the second notify, there is a first one that just announces the track: <?xml version="1.0"?><e:propertyset xmlns:e="urn:schemas-upnp-org:event-1-0"><e:property><LastChange><Event xmlns="urn:schemas-upnp-org:metadata-1-0/AVT/">
<InstanceID val="0">
<CurrentTrack val="0"/>
</InstanceID>
</Event>
</LastChange></e:property></e:propertyset> I also spotted an issue where you try to update the state even for messages that are not state updates. I decided to ignore only the first STOPPED event then (it shouldn't impact players that do not have this behavior). So the following happens on the seq variable:
See the following PRs:
NEW BUG |
Had a quick looks at the STOPPED PR. When I first saw this behaviour in one of my devices I didn't know if it's a bug In the client or something is should consider as part of the code. So what I did was to introduce a call sequence ID to block the first call and potentially use this info in the future for something else. If you see, this is the only place where sequence id is used. In theory we can only add a check inside UpdateMRstate that check if previous state == "" and newstate == "STOPPED" to return false. |
Thing is previousstate from the device request is populated at "Play", but this is doable by taking the previous state from the local saved state. Both ways work well, I agree that storing the sequence ID is also interesting. Let me know what you prefer I'll update the code. |
Would it be possible to check something for me? Is the sequence of notifications
If yes, the we can do the following The sequence code can be scrapped |
Yes I confirm that's the case, I updated the PR. |
Ty! I'll have a look. Can you please confirm that the two PR now fully resolve the issues with your Sonys? |
There is still an issue with the pause action but should be fine for now. I based on master. |
That's good, thank you! Worth raising a new defect for the pause one. Similarly to your investigation here, we would need to see what responses Sonys send with the pause action. |
Yes, I think there is room for improvement in the way the code is organized. Because some calls to the TV are made directly from the gui folder and it's difficult to understand what exactly is called when you receive an event or emit one. |
Understood. The idea behind emmit messages is for each UI to implement the screen interface https://github.com/alexballas/go2tv/blob/main/httphandlers/httphandlers.go#L31. It should then be up to the UI to process those notification callbacks and decide how to further control the UI flow. In theory you can have a UI that does not deal at all with the notifications the DMR sends. This is a transparent process for the http handler that pushes those notifications. |
So I had a deeper look at the content type and in my tests I got same for a flac file
Just trying to understand if this indeed the issue EDIT: EDIT2: |
Nice catch! |
Fixed with 1.12.0, resolving |
Hello,
Thanks for building this tool.
I can't connect to my DLNA speakers as I am getting the following error:
I'm running the tool on Ubuntu 20, and the speakers are working well with other DLNA renderer (like the default one in Windows).
Let me know if you need more information.
The text was updated successfully, but these errors were encountered: