BUG: artistRadio not working
What happened
Hi, I'm trying to use artist radio in a library dependent on this one. For some reason it's giving UPnP error 804, while all other Spotify features do work. Artist, playlist etc do work.
I'm not sure if it's something within this library or if it's being called incorrectly/incompletely. I'm hopeful someone here can point out what's going wrong. Thank you for your time and this awesome library!
Using node-red-contrib-sonos-plus, https://github.com/hklages/node-red-contrib-sonos-plus/blob/99b3afa567de8418f203d8e5375650c33cdbf4eb/src/sonos-universal.js#L1804, artistRadio does not work.
See also https://github.com/hklages/node-red-contrib-sonos-plus/issues/277
What did you expect to happen
Artist radio to start playing.
How to reproduce it (minimal and precise)
Install node-red. Install the latest version of node-red-contrib-sonos-plus. Configure a universal node with "group.queue.uriSpotify" Inject "spotify:artistRadio:72qVrKXRp9GeFQOesj0Pmv" (taken from https://sonos.svrooij.io/metadata)
This triggers the following code:
const validated = await validatedGroupProperties(msg)
const groupData = await getGroupCurrent(tsPlayer, validated.playerName)
const tsCoordinator = new SonosDevice(groupData.members[0].urlObject.hostname)
tsCoordinator.urlObject = groupData.members[0].urlObject
// position in queue = 0 (at the end), enqueue next true (only effective in shuffle mode)
const result = await tsCoordinator.AddUriToQueue(validatedUri, 0, true)
Debug logging
2024-02-12T17:52:18.703Z sonos:service:zonegrouptopology:192.168.0.109 GetZoneGroupState()
2024-02-12T17:52:18.743Z sonos:metadata Guessing metadata for spotify:artistRadio:72qVrKXRp9GeFQOesj0Pmv
2024-02-12T17:52:18.745Z sonos:service:avtransport:192.168.0.109 AddURIToQueue({ InstanceID: 0, EnqueuedURI: 'x-sonosapi-radio:spotify:artistRadio:72qVrKXRp9GeFQOesj0Pmv?sid=9&flags=8300&sn=7', EnqueuedURIMetaData: { Title: 'Artist radio', CdUdn: 'SA_RINCON2311_X_#Svc2311-0-Token', TrackUri: 'x-sonosapi-radio:spotify%3aartistRadio%3a72qVrKXRp9GeFQOesj0Pmv?sid=9&flags=8300&sn=7', ItemId: '100c206cspotify%3aartistRadio%3a72qVrKXRp9GeFQOesj0Pmv', UpnpClass: 'object.item.audioItem.audioBroadcast.#artistRadio', ParentId: '10052064spotify%3aartist%3a72qVrKXRp9GeFQOesj0Pmv' }, DesiredFirstTrackNumberEnqueued: 0, EnqueueAsNext: true })
2024-02-12T17:52:18.914Z sonos:service:avtransport:192.168.0.109 Sonos error on AddURIToQueue { faultcode: 's:Client', faultstring: 'UPnPError', detail: { UPnPError: { errorCode: 804 } } }
12 Feb 18:52:18 - [error] [sonos-universal:5298733c96e7dce5] group.queue.urispotify:Sonos error on AddURIToQueue UPnPError 804 (undefined) :: Details: {"stack":"SonosError: Sonos error on AddURIToQueue UPnPError 804 (undefined)\n at AVTransportService.handleErrorResponse (/data/node_modules/@svrooij/sonos/lib/services/base-service.js:227:23)\n at runMicrotasks (<anonymous>)\n at processTicksAndRejections (node:internal/process/task_queues:96:5)\n at async AVTransportService.handleRequestAndParseResponse (/data/node_modules/@svrooij/sonos/lib/services/base-service.js:199:15)\n at async AVTransportService.AddURIToQueue (/data/node_modules/@svrooij/sonos/lib/services/av-transport.service.js:75:41)\n at async SonosDevice.AddUriToQueue (/data/node_modules/@svrooij/sonos/lib/sonos-device.js:95:16)\n at async Object.groupQueueUriFromSpotify [as group.queue.urispotify] (/data/node_modules/node-red-contrib-sonos-plus/src/sonos-universal.js:1816:20)","message":"Sonos error on AddURIToQueue UPnPError 804 (undefined)","Action":"AddURIToQueue","FaultCode":"s:Client","Fault":"UPnPError","UpnpErrorCode":804,"name":"SonosError"}
Environment
- sonos-ts version: v2.6.0-beta.5
- OS: docker on linux
- node version (
node -v): v16.20.2
Checklist
Please confirm the following before creating the issue.
- [x] Environment specified
- [x] Checked issues for duplicates
- [x] Debug log added
If I do the command with the official computer controller, it sends this message:
<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>x-sonosapi-radio:spotify%3aartistRadio%3a72qVrKXRp9GeFQOesj0Pmv?sid=9&flags=8300&sn=2</CurrentURI>
<CurrentURIMetaData><DIDL-Lite xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/" xmlns:r="urn:schemas-rinconnetworks-com:metadata-1-0/" xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/"><item id="100c206cspotify%3aartistRadio%3a72qVrKXRp9GeFQOesj0Pmv" parentID="10052064spotify%3aartist%3a72qVrKXRp9GeFQOesj0Pmv" restricted="true"><dc:title>Guus Meeuwis Radio</dc:title><upnp:class>object.item.audioItem.audioBroadcast.#artistRadio</upnp:class><dc:creator>Guus Meeuwis</dc:creator><upnp:albumArtURI>https://i.scdn.co/image/ab6761610000e5ebf5eda5ecd45cdbc2cc3c184a</upnp:albumArtURI><r:albumArtist>Guus Meeuwis</r:albumArtist><r:description>Guus Meeuwis</r:description><desc id="cdudn" nameSpace="urn:schemas-rinconnetworks-com:metadata-1-0/">SA_RINCON2311_X_#Svc2311-0-Token</desc></item></DIDL-Lite></CurrentURIMetaData>
</u:SetAVTransportURI>
</s:Body>
</s:Envelope>
if send sonos.SetAVTransportURI('spotify:artistRadio:72qVrKXRp9GeFQOesj0Pmv') it sends this.
<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>x-sonosapi-radio:spotify%3aartistRadio%3a72qVrKXRp9GeFQOesj0Pmv?sid=9&flags=8300&sn=7</CurrentURI>
<CurrentURIMetaData><DIDL-Lite xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/" xmlns:r="urn:schemas-rinconnetworks-com:metadata-1-0/" xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/"><item id="100c206cspotify%3aartistRadio%3a72qVrKXRp9GeFQOesj0Pmv" restricted="true" parentID="10052064spotify%3aartist%3a72qVrKXRp9GeFQOesj0Pmv"><dc:title>Artist radio</dc:title><upnp:class>object.item.audioItem.audioBroadcast.#artistRadio</upnp:class><desc id="cdudn" nameSpace="urn:schemas-rinconnetworks-com:metadata-1-0/">SA_RINCON2311_X_#Svc2311-0-Token</desc></item></DIDL-Lite></CurrentURIMetaData>
</u:SetAVTransportURI>
</s:Body>
</s:Envelope>
They differ a little bit, but I think the most noteable difference is the sn=7 vs sn=2 in the CurrentURI. I've seen this before and in seems that this is related to at which index the connection to spotify (or other music service) is stored. Not sure if it's related. To test this out yourself, you need to play an artist radio get the CurrentTrackURI for me.
Or you can use wireshark off course.
For now it temporarily seems broken, I'm not even sure is artist radio ever worked. 😊
Awesome, I'll look into the URL asap, hopefully tomorrow afternoon.
@danielvandenberg95 can you provide the url?
You can re-open if this is still relevant