Skip to content
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

[SOLVED] No valid XML returned for AudioPro Speakers #363

Open
zynexiz opened this issue Nov 22, 2018 · 10 comments
Open

[SOLVED] No valid XML returned for AudioPro Speakers #363

zynexiz opened this issue Nov 22, 2018 · 10 comments

Comments

@zynexiz
Copy link

zynexiz commented Nov 22, 2018

I just installed pulseaudio-dlna on KaOS installation, and it works great for some of my speakers (Sony and Chomecast). But fails on my two AudioPro speakers. They work with other soulutions like AirAudio and BubbleUPnP (Android) and Kodi.

Get the error No valid XML returned.. from the output. I looked at the URL, and I see the xml itself, and it looks legit (comparing to the Sony).

Here's the XML from it;

<?xml version="1.0"?>
<root
  xmlns="urn:schemas-upnp-org:device-1-0"
  xmlns:ms=" urn:microsoft-com:wmc-1-0"
  xmlns:pnpx="http://schemas.microsoft.com/windows/pnpx/2005/11"
  xmlns:df="http://schemas.microsoft.com/windows/2008/09/devicefoundation">
	<specVersion>
		<major>1</major>
		<minor>0</minor>
	</specVersion>
	<device
	  ms:X_MS_SupportsWMDRM="true">
		<dlna:X_DLNADOC xmlns:dlna="urn:schemas-dlna-org:device-1-0">DMR-1.50</dlna:X_DLNADOC>
		<pnpx:X_compatibleId>MS_DigitalMediaDeviceClass_DMR_V001
				</pnpx:X_compatibleId>
		<pnpx:X_deviceCategory>MediaDevices
				</pnpx:X_deviceCategory>
		<pnpx:X_hardwareId>BridgecoCE2DM870_0xBD VEN_14E7&amp;DEV_0001&amp;REV_01
				</pnpx:X_hardwareId>
		<df:X_deviceCategory>Multimedia.DMR
				</df:X_deviceCategory>
		<deviceType>urn:schemas-upnp-org:device:MediaRenderer:1</deviceType>
		<friendlyName>Samlingsrum</friendlyName>
		<manufacturer></manufacturer>
		<manufacturerURL></manufacturerURL>
		<modelDescription>AudioPro_AA1</modelDescription>
		<modelName>AudioPro_AA1</modelName>
		<modelNumber></modelNumber>
		<modelURL></modelURL>
		<serialNumber>CC9093043C4F</serialNumber>
		<UDN>uuid:5f9ec1b3-ed59-1900-4530-cc9093043c4f</UDN>
		<UPC>123810928305</UPC>
		<iconList>
			<icon>
				<mimetype>image/jpeg</mimetype>
				<width>48</width>
				<height>48</height>
				<depth>24</depth>
				<url>/BCO_device_sm_icon.jpg</url>
			</icon>
			<icon>
				<mimetype>image/jpeg</mimetype>
				<width>120</width>
				<height>120</height>
				<depth>24</depth>
				<url>/BCO_device_lrg_icon.jpg</url>
			</icon>
			<icon>
				<mimetype>image/png</mimetype>
				<width>48</width>
				<height>48</height>
				<depth>24</depth>
				<url>/BCO_device_sm_icon.png</url>
			</icon>
			<icon>
				<mimetype>image/png</mimetype>
				<width>120</width>
				<height>120</height>
				<depth>24</depth>
				<url>/BCO_device_lrg_icon.png</url>
			</icon>
		</iconList>
		<serviceList>
			<service>
				<serviceType>urn:schemas-upnp-org:service:RenderingControl:1</serviceType>
				<serviceId>urn:upnp-org:serviceId:RenderingControl</serviceId>
				<SCPDURL>/RenderingControl/desc.xml</SCPDURL>
				<controlURL>/RenderingControl/ctrl</controlURL>
				<eventSubURL>/RenderingControl/evt</eventSubURL>
			</service>
			<service>
				<serviceType>urn:schemas-upnp-org:service:ConnectionManager:1</serviceType>
				<serviceId>urn:upnp-org:serviceId:ConnectionManager</serviceId>
				<SCPDURL>/ConnectionManager/desc.xml</SCPDURL>
				<controlURL>/ConnectionManager/ctrl</controlURL>
				<eventSubURL>/ConnectionManager/evt</eventSubURL>
			</service>
			<service>
				<serviceType>urn:schemas-upnp-org:service:AVTransport:1</serviceType>
				<serviceId>urn:upnp-org:serviceId:AVTransport</serviceId>
				<SCPDURL>/AVTransport/desc.xml</SCPDURL>
				<controlURL>/AVTransport/ctrl</controlURL>
				<eventSubURL>/AVTransport/evt</eventSubURL>
			</service>
		</serviceList>
		<presentationURL>http://192.168.1.188</presentationURL>
	</device>
</root>
@zynexiz
Copy link
Author

zynexiz commented Dec 19, 2018

It's very silent here, and the last commit is 1,5y old. Is this project abandoned?

@risingape
Copy link

I just stumbled across the same problem with my Samsung e750 speakers.

The problem seems to be the leading whitespace in line 4:
xmlns:ms=" urn:microsoft-com:wmc-1-0" should read xmlns:ms="urn:microsoft-com:wmc-1-0"

@zynexiz
Copy link
Author

zynexiz commented May 2, 2019

You are right, how did I miss that. Not sure if that makes the error, but it seems like the closest solution. I just wounder if the problem lay within pulseaudio-dlna itself, or one of the dependence that render the xml itself.

@zynexiz
Copy link
Author

zynexiz commented May 2, 2019

@risingape I just looked again and compared my AudioPro with my Sony speaker. Sony did not include xmlns:ms=" urn:microsoft-com:wmc-1-0" at all, but AudioPro do. Guess your Samsung have this string to?

@risingape
Copy link

Of course, I am not 100% certain yet. But I parsed the corrected XML response successfully.

@zynexiz
Copy link
Author

zynexiz commented May 2, 2019

@risingape Sounds that this could be the issue then. I'm trying to review the code and see if there is something I can change. Never coded in Python before, so i'm not sure if I will find a solution though. How did you feed the correct code to pa-dlna? Tried it once, but never got it to work.

@zynexiz
Copy link
Author

zynexiz commented May 2, 2019

I added some debugging code to render.py, that showed the output of the repaired XML code (in debug mode you get error Got broken xml, trying to fix it before No valid XML returned..). The output there seems to actually fix the whit space problem, the output I got from xml string on line 565 is xmlns:ms="urn:microsoft-com:wmc-1-0", but still throws an error.

Original output:

05-02 14:33:33 pulseaudio_dlna.plugins.upnp.renderer          DEBUG    Response from UPNP device (http://192.168.1.187:8080/description.xml)
<?xml version="1.0"?>
<root
  xmlns="urn:schemas-upnp-org:device-1-0"
  xmlns:ms=" urn:microsoft-com:wmc-1-0"
  xmlns:pnpx="http://schemas.microsoft.com/windows/pnpx/2005/11"
  xmlns:df="http://schemas.microsoft.com/windows/2008/09/devicefoundation">

Fixed output (my own added code):

05-02 14:33:33 pulseaudio_dlna.plugins.upnp.renderer          DEBUG    Output repair: 
<?xml version="1.0"?>
<root
  xmlns="urn:schemas-upnp-org:device-1-0"
  xmlns:ms="urn:microsoft-com:wmc-1-0"
  xmlns:pnpx="http://schemas.microsoft.com/windows/pnpx/2005/11"
  xmlns:df="http://schemas.microsoft.com/windows/2008/09/devicefoundation">

@zynexiz
Copy link
Author

zynexiz commented May 2, 2019

Ha! I found the problem. It seems to be a error when applying workarounds. If I commented out line 554-557 in /usr/lib/python2.7/site-packages/pulseaudio_dlna/plugins/upnp/render.py I got everything to work. It was nothing in the XML file itself that trow this error.

#                if device_manufacturer is not None and device_manufacturer.text.lower() == 'yamaha corporation':
#                    upnp_device.workarounds.append(
#                        pulseaudio_dlna.workarounds.YamahaWorkaround(xml))

It's a error in the if statement if device_manufacturer is not None and \ device_manufacturer.text.lower() == 'yamaha corporation'. In my AudioPro the device_manufacturer string was empty in the XML, hence trowing the error.

@zynexiz zynexiz changed the title No valid XML returned for AudioPro Speakers [SOLVED] No valid XML returned for AudioPro Speakers May 2, 2019
@risingape
Copy link

Great! Yes, I can confirm.

@zynexiz
Copy link
Author

zynexiz commented May 2, 2019

It's not a perfect solution, but it works if you don't have any Yamaha stuff in your network.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants