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

Unknown UPnP class in subscription #301

Closed
xxdede opened this issue Apr 18, 2015 · 6 comments

Comments

Projects
None yet
2 participants
@xxdede
Copy link
Contributor

commented Apr 18, 2015

Hi,
I'm trying to use subscription events and I did the following:

>>> device = soco.SoCo('172.16.1.24')
>>> sub = device.avTransport.subscribe()

and I got the following output:

INFO:soco.events:Event listener started
INFO:soco.events:Event listener running on ('172.16.1.13', 1400)
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 172.16.1.24
DEBUG:requests.packages.urllib3.connectionpool:"SUBSCRIBE /MediaRenderer/AVTransport/Event HTTP/1.1" 200 None
INFO:soco.events:Subscribed to http://172.16.1.24:1400/MediaRenderer/AVTransport/Event, sid: uuid:RINCON_000E58FAA7AE01400_sub0000005999
>>> INFO:soco.events:Event 0 received for AVTransport service on thread <Thread(Thread-2, started 4364713984)> at 1429346882.85
DEBUG:soco.events:Event content: <e:propertyset xmlns:e="urn:schemas-upnp-org:event-1-0"><e:property><LastChange>&lt;Event xmlns=&quot;urn:schemas-upnp-org:metadata-1-0/AVT/&quot; xmlns:r=&quot;urn:schemas-rinconnetworks-com:metadata-1-0/&quot;&gt;&lt;InstanceID val=&quot;0&quot;&gt;&lt;TransportState val=&quot;STOPPED&quot;/&gt;&lt;CurrentPlayMode val=&quot;NORMAL&quot;/&gt;&lt;CurrentCrossfadeMode val=&quot;0&quot;/&gt;&lt;NumberOfTracks val=&quot;4&quot;/&gt;&lt;CurrentTrack val=&quot;1&quot;/&gt;&lt;CurrentSection val=&quot;0&quot;/&gt;&lt;CurrentTrackURI val=&quot;x-rincon-mp3radio://94.23.72.28&quot;/&gt;&lt;CurrentTrackDuration val=&quot;0:00:00&quot;/&gt;&lt;CurrentTrackMetaData val=&quot;&amp;lt;DIDL-Lite xmlns:dc=&amp;quot;http://purl.org/dc/elements/1.1/&amp;quot; xmlns:upnp=&amp;quot;urn:schemas-upnp-org:metadata-1-0/upnp/&amp;quot; xmlns:r=&amp;quot;urn:schemas-rinconnetworks-com:metadata-1-0/&amp;quot; xmlns=&amp;quot;urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/&amp;quot;&amp;gt;&amp;lt;item id=&amp;quot;-1&amp;quot; parentID=&amp;quot;-1&amp;quot; restricted=&amp;quot;true&amp;quot;&amp;gt;&amp;lt;res protocolInfo=&amp;quot;x-rincon-mp3radio:*:*:*&amp;quot;&amp;gt;x-rincon-mp3radio://94.23.72.28&amp;lt;/res&amp;gt;&amp;lt;r:streamContent&amp;gt;&amp;lt;/r:streamContent&amp;gt;&amp;lt;r:radioShowMd&amp;gt;&amp;lt;/r:radioShowMd&amp;gt;&amp;lt;dc:title&amp;gt;94.23.72.28&amp;lt;/dc:title&amp;gt;&amp;lt;upnp:class&amp;gt;object.item&amp;lt;/upnp:class&amp;gt;&amp;lt;/item&amp;gt;&amp;lt;/DIDL-Lite&amp;gt;&quot;/&gt;&lt;r:NextTrackURI val=&quot;mms://94.23.72.28&quot;/&gt;&lt;r:NextTrackMetaData val=&quot;&amp;lt;DIDL-Lite xmlns:dc=&amp;quot;http://purl.org/dc/elements/1.1/&amp;quot; xmlns:upnp=&amp;quot;urn:schemas-upnp-org:metadata-1-0/upnp/&amp;quot; xmlns:r=&amp;quot;urn:schemas-rinconnetworks-com:metadata-1-0/&amp;quot; xmlns=&amp;quot;urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/&amp;quot;&amp;gt;&amp;lt;item id=&amp;quot;-1&amp;quot; parentID=&amp;quot;-1&amp;quot; restricted=&amp;quot;true&amp;quot;&amp;gt;&amp;lt;res protocolInfo=&amp;quot;mms:*:*:*&amp;quot;&amp;gt;mms://94.23.72.28&amp;lt;/res&amp;gt;&amp;lt;dc:title&amp;gt;94.23.72.28&amp;lt;/dc:title&amp;gt;&amp;lt;upnp:class&amp;gt;object.item&amp;lt;/upnp:class&amp;gt;&amp;lt;/item&amp;gt;&amp;lt;/DIDL-Lite&amp;gt;&quot;/&gt;&lt;r:EnqueuedTransportURI val=&quot;x-rincon-mp3radio://94.23.72.28&quot;/&gt;&lt;r:EnqueuedTransportURIMetaData val=&quot;&amp;lt;DIDL-Lite xmlns:dc=&amp;quot;http://purl.org/dc/elements/1.1/&amp;quot; xmlns:upnp=&amp;quot;urn:schemas-upnp-org:metadata-1-0/upnp/&amp;quot; xmlns:r=&amp;quot;urn:schemas-rinconnetworks-com:metadata-1-0/&amp;quot; xmlns=&amp;quot;urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/&amp;quot;&amp;gt;&amp;lt;item id=&amp;quot;R:0/0/17&amp;quot; parentID=&amp;quot;R:0/0&amp;quot; restricted=&amp;quot;true&amp;quot;&amp;gt;&amp;lt;dc:title&amp;gt;Happy m2o&amp;lt;/dc:title&amp;gt;&amp;lt;upnp:class&amp;gt;object.item.audioItem.audioBroadcast.sonos-favorite&amp;lt;/upnp:class&amp;gt;&amp;lt;desc id=&amp;quot;cdudn&amp;quot; nameSpace=&amp;quot;urn:schemas-rinconnetworks-com:metadata-1-0/&amp;quot;&amp;gt;SA_RINCON65031_&amp;lt;/desc&amp;gt;&amp;lt;/item&amp;gt;&amp;lt;/DIDL-Lite&amp;gt;&quot;/&gt;&lt;PlaybackStorageMedium val=&quot;NETWORK&quot;/&gt;&lt;AVTransportURI val=&quot;x-rincon-mp3radio://94.23.72.28&quot;/&gt;&lt;AVTransportURIMetaData val=&quot;&amp;lt;DIDL-Lite xmlns:dc=&amp;quot;http://purl.org/dc/elements/1.1/&amp;quot; xmlns:upnp=&amp;quot;urn:schemas-upnp-org:metadata-1-0/upnp/&amp;quot; xmlns:r=&amp;quot;urn:schemas-rinconnetworks-com:metadata-1-0/&amp;quot; xmlns=&amp;quot;urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/&amp;quot;&amp;gt;&amp;lt;item id=&amp;quot;R:0/0/17&amp;quot; parentID=&amp;quot;R:0/0&amp;quot; restricted=&amp;quot;true&amp;quot;&amp;gt;&amp;lt;dc:title&amp;gt;Happy m2o&amp;lt;/dc:title&amp;gt;&amp;lt;upnp:class&amp;gt;object.item.audioItem.audioBroadcast.sonos-favorite&amp;lt;/upnp:class&amp;gt;&amp;lt;desc id=&amp;quot;cdudn&amp;quot; nameSpace=&amp;quot;urn:schemas-rinconnetworks-com:metadata-1-0/&amp;quot;&amp;gt;SA_RINCON65031_&amp;lt;/desc&amp;gt;&amp;lt;/item&amp;gt;&amp;lt;/DIDL-Lite&amp;gt;&quot;/&gt;&lt;NextAVTransportURI val=&quot;&quot;/&gt;&lt;NextAVTransportURIMetaData val=&quot;&quot;/&gt;&lt;CurrentTransportActions val=&quot;Set, Play, Stop, Pause, Seek, Next, Previous&quot;/&gt;&lt;r:CurrentValidPlayModes val=&quot;&quot;/&gt;&lt;TransportStatus val=&quot;OK&quot;/&gt;&lt;r:SleepTimerGeneration val=&quot;0&quot;/&gt;&lt;r:AlarmRunning val=&quot;0&quot;/&gt;&lt;r:SnoozeRunning val=&quot;0&quot;/&gt;&lt;r:RestartPending val=&quot;0&quot;/&gt;&lt;TransportPlaySpeed val=&quot;NOT_IMPLEMENTED&quot;/&gt;&lt;CurrentMediaDuration val=&quot;NOT_IMPLEMENTED&quot;/&gt;&lt;RecordStorageMedium val=&quot;NOT_IMPLEMENTED&quot;/&gt;&lt;PossiblePlaybackStorageMedia val=&quot;NONE, NETWORK&quot;/&gt;&lt;PossibleRecordStorageMedia val=&quot;NOT_IMPLEMENTED&quot;/&gt;&lt;RecordMediumWriteStatus val=&quot;NOT_IMPLEMENTED&quot;/&gt;&lt;CurrentRecordQualityMode val=&quot;NOT_IMPLEMENTED&quot;/&gt;&lt;PossibleRecordQualityModes val=&quot;NOT_IMPLEMENTED&quot;/&gt;&lt;/InstanceID&gt;&lt;/Event&gt;</LastChange></e:property></e:propertyset>
----------------------------------------
Exception happened during processing of request from ('172.16.1.24', 58122)
Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 593, in process_request_thread
    self.finish_request(request, client_address)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 334, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 649, in __init__
    self.handle()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/BaseHTTPServer.py", line 340, in handle
    self.handle_one_request()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/BaseHTTPServer.py", line 328, in handle_one_request
    method()
  File "/Users/dede/Documents/Sviluppo/Python/SoCo/soco/events.py", line 230, in do_NOTIFY
    variables = parse_event_xml(content)
  File "/Users/dede/Documents/Sviluppo/Python/SoCo/soco/events.py", line 136, in parse_event_xml
    value = from_didl_string(value)[0]
  File "/Users/dede/Documents/Sviluppo/Python/SoCo/soco/data_structures.py", line 77, in from_didl_string
    raise DIDLMetadataError("Unknown UPnP class: %s" % item_class)
DIDLMetadataError: Unknown UPnP class: object.item.audioItem.audioBroadcast.sonos-favorite
----------------------------------------

It seems I've a problem with the class sonos-favorite, am I doing something wrong?
I'm using the latest version of SoCo (master).

Thanks in advance,
Dede

@KennethNielsen

This comment has been minimized.

Copy link
Member

commented Apr 26, 2015

Hallo @xxdede

Thanks for reporting this.

Can you try out the iss301 branch in my repository; https://github.com/KennethNielsen/SoCo/tree/iss301 and see if that fixes it.

@lawrenceakka FYI: For this sonos defined class, we obviously do not have the spec, so I just assumes that it has the same spec as the class it derives from (which also seems to be the assumption for DidlMusicAlbumFavorite). So I have simply tried to fix it by adding a new class DidlAudioBroadcastSonosFavorite that derives from DidlAudioBroadcast.

Regards Kenneth

@KennethNielsen KennethNielsen self-assigned this Apr 26, 2015

@KennethNielsen KennethNielsen added the Bug label Apr 26, 2015

@KennethNielsen

This comment has been minimized.

Copy link
Member

commented Apr 26, 2015

Oh yeah, I should probably mention, that as the last line in the stack trace alludes to, his bug seems to be triggered when doing something with audio broadcast (radio station) favourites. So in order to test my fix, you should be doing something similar with your controller as you where when you triggered the bug i.e. most likely something that has to do with browsing or playing Sonos favourite radio stations.

@xxdede

This comment has been minimized.

Copy link
Contributor Author

commented Apr 26, 2015

Hi Kenneth,
I tried your branch and it works.

Before trying your fix I made sure that the problem occurs again (I do not have to do particular things, just subscribe to that controller) and with the standard version of SoCo it triggers the exception, with iss301 branch it goes smoothly.

Thanks a lot! If you need additional details tell me.

Best,
Dede

@KennethNielsen

This comment has been minimized.

Copy link
Member

commented Apr 27, 2015

Great! I don't think I need anything else.

I will let it sit here for a week or so, to allow @lawrenceakka to give feedback if he wishes, since he has done most of the work on the data structures.

Once agains thanks for reporting it.

@KennethNielsen KennethNielsen added this to the 0.11 milestone Apr 27, 2015

@KennethNielsen

This comment has been minimized.

Copy link
Member

commented Apr 27, 2015

Should go in 0.11 #278

@KennethNielsen

This comment has been minimized.

Copy link
Member

commented May 3, 2015

Ok, let's put it in. I'll make a proper PR for traceability.

KennethNielsen added a commit to KennethNielsen/SoCo that referenced this issue May 3, 2015

KennethNielsen added a commit that referenced this issue May 3, 2015

Merge pull request #303 from KennethNielsen/audio-broad-cast-sonos-fa…
…vorite

Audio broad cast sonos favorite, fixes #301
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.