rxv icon indicating copy to clipboard operation
rxv copied to clipboard

Crash on detecting N560

Open tari opened this issue 7 years ago • 0 comments

I have a CRX-N560D on my network that crashes rxv when trying to detect devices because it doesn't define a controlURL or unitDescURL. ssdp.rxv_discover fails when it tries to take the text content of these elements that don't exist.

A simple workaround is to check whether the calls to xml.find succeed and bail out without throwing an exception if they fail. That said, I'd prefer to add support for this device- it uses a similar but incompatible protocol that I expect can be fit into the existing API.


In short, I imagine:

  • An abstract class defining the public API (Receiver perhaps) that implements common parts of the protocol.
  • A subclass with the current implementation for currently-supported devices (RXV).
  • Another subclass that implements the same API for the N560 and related devices.
  • Some kind of device detection in find to instantiate the correct subclass for a detected device.

The feature set for a public API differs mostly in that the N560 has no sense of zones- the code may act as though there is one with a fixed name at all times. Internally, there appears to be a fixed set of inputs and no way to query which are available so the supported operations for each input need to be known statically (relatively easy, but probably implies a model number check in initialization).

For reference, the desc.xml returned during discovery:

<?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"
  xmlns:yamaha="urn:schemas-yamaha-com:device-1-0">
	<yamaha:X_device><yamaha:X_URLBase>http://192.168.127.211:80/</yamaha:X_URLBase><yamaha:X_serviceList><yamaha:X_service><yamaha:X_specType>urn:schemas-yamaha-com:service:X_YamahaRemoteControl:1</yamaha:X_specType><yamaha:X_controlURL>/YamahaRemoteControl/ctrl</yamaha:X_controlURL></yamaha:X_service></yamaha:X_serviceList></yamaha:X_device>
	<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 Multimedia.DMR MediaDevice.DMC
				</pnpx:X_deviceCategory>
		<pnpx:X_hardwareId>VEN_0033&amp;DEV_0006&amp;REV_01
				</pnpx:X_hardwareId>
		<df:X_deviceCategory>Multimedia.DMR
				</df:X_deviceCategory>
		<deviceType>urn:schemas-upnp-org:device:MediaRenderer:1</deviceType>
		<friendlyName>CRX-N560D 8B231</friendlyName>
		<manufacturer>Yamaha Corporation</manufacturer>
		<manufacturerURL>http://www.yamaha.com/</manufacturerURL>
		<modelDescription>Network Player</modelDescription>
		<modelName>CRX-N560D</modelName>
		<modelNumber>N560D</modelNumber>
		<modelURL>http://www.yamaha.com/</modelURL>
		<serialNumber>027189C3</serialNumber>
		<UDN>uuid:5f9ec1b3-ed59-1900-4530-00a0dea8b231</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.127.211/</presentationURL>
	</device>
</root>

tari avatar Apr 07 '17 11:04 tari