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

bug: Unable to play notifications after failing to restore external music #156

Closed
peti69 opened this issue Jan 10, 2022 · 8 comments
Closed

Comments

@peti69
Copy link

peti69 commented Jan 10, 2022

I am using the latest version of sonos2mqtt from docker hub. When sending

{
  "command":"notify",
  "input":{
    "trackUri":"http://192.168.25.9:5005/clips/doorbell.mp3",
    "onlyWhenPlaying":false,
    "timeout":10,
    "volume":10,
    "delayMs":700
  }
}

to the command topic music (automatic Deezer playlist triggered via Alexa) is stopping, volume is adapted, the mp3 is played, volume is restored but music is not resumed. Morover this warning is shown on the log:

2022-01-10T09:28:21.272Z [Warning] Error executing notify for Küche (RINCON_7828CA11B42001400) 
 SonosError: Sonos error on SetAVTransportURI UPnPError 714 (Illegal MIME-Type)
    at AVTransportService.handleErrorResponse (/usr/src/app/node_modules/@svrooij/sonos/lib/services/base-service.js:231:23)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async AVTransportService.handleRequest (/usr/src/app/node_modules/@svrooij/sonos/lib/services/base-service.js:188:16)
    at async AVTransportService.SoapRequestWithBodyNoResponse (/usr/src/app/node_modules/@svrooij/sonos/lib/services/base-service.js:123:16)
    at async AVTransportService.SetAVTransportURI (/usr/src/app/node_modules/@svrooij/sonos/lib/services/av-transport.service.js:209:45)
    at async SonosDevice.RestoreState (/usr/src/app/node_modules/@svrooij/sonos/lib/sonos-device.js:359:9)
    at async SonosDevice.PlayNotification (/usr/src/app/node_modules/@svrooij/sonos/lib/sonos-device.js:433:13)
    at async Function.ExecuteCommand (/usr/src/app/lib/sonos-command-mapping.js:38:24)
    at async Function.ExecuteControl (/usr/src/app/lib/sonos-command-mapping.js:8:20)
    at async EventEmitter.<anonymous> (/usr/src/app/lib/sonos-to-mqtt.js:84:34) {
  Action: 'SetAVTransportURI',
  FaultCode: 's:Client',
  Fault: 'UPnPError',
  UpnpErrorCode: 714,
  UpnpErrorDescription: 'Illegal MIME-Type'
}

When I send the same command again sonos2mqtt does not show any reaction. I need to restart the container to reproduce the behaviour.

When listening to a radio station everything works as expected and no warning is shown on the log.

Any idea what could be wrong?

@svrooij
Copy link
Owner

svrooij commented Jan 11, 2022

Yeah I know what is wrong.

This application is not able to restore playlists that are not started from the Sonos app. Same situation will appear when you started some music from the Spotify app.

Apart from that you might have found a bug in that if it cannot restore to previous music it should not stay stuck in a state where you can no longer play notifications until restart.

@svrooij svrooij changed the title Notify command fails bug: Unable to play notifications after failing to restore external music Jan 11, 2022
@svrooij
Copy link
Owner

svrooij commented Jan 11, 2022

@peti69 maybe I can fix the not restoring part if you could help me by sending the metadata found in the status topic.

Off course the other part (being stuck in a state the won’t play notifications anymore), should also be fixed, but that seems an easy fix.

@svrooij svrooij added the bug label Jan 11, 2022
@peti69
Copy link
Author

peti69 commented Jan 13, 2022

Hello @svrooij,

This is the metadata you asked for:

{
  "uuid": "RINCON_7828CA11B42001400",
  "model": "Sonos One",
  "name": "Küche",
  "groupName": "Küche",
  "coordinatorUuid": "RINCON_7828CA11B42001400",
  "currentTrack": {
    "Title": "doorbell.mp3",
    "UpnpClass": "object.item.audioItem.musicTrack",
    "Duration": "0:00:06",
    "ItemId": "-1",
    "ParentId": "-1",
    "TrackUri": "http://192.168.25.9:5005/clips/doorbell.mp3",
    "ProtocolInfo": "http-get:*:audio/mpeg:*"
  },
  "enqueuedMetadata": {
    "Title": "Alexa",
    "UpnpClass": "object.item.audioItem",
    "ItemId": "-1",
    "ParentId": "-1"
  },
  "transportState": "STOPPED",
  "playmode": "NORMAL",
  "ts": 1642105473971,
  "volume": {
    "Master": 5,
    "LF": 100,
    "RF": 100
  },
  "mute": {
    "Master": false,
    "LF": false,
    "RF": false
  },
  "bass": 0,
  "treble": 0,
  "nextTrack": {
    "UpnpClass": "object.item.audioItem.musicTrack",
    "Duration": "0:00:00",
    "ItemId": "-1",
    "ParentId": "-1",
    "TrackUri": "https://cdnt-proxy-0.dzcdn.net/api/1/6fe0b276d4824a3f3bc7a23003a4d27b03095830782e059c1c223112ae00ae7d1e7b4becbd9d8e074c46ec734800912b486878aa05003ea31f14be9d6207d58204f02831a90351d0001cfdfd55671931.mp3?hdnea=exp=1642330614~acl=/api/1/6fe0b276d4824a3f3bc7a23003a4d27b03095830782e059c1c223112ae00ae7d1e7b4becbd9d8e074c46ec734800912b486878aa05003ea31f14be9d6207d58204f02831a90351d0001cfdfd55671931.mp3*~data=user_id=0,application_id=607507641~hmac=8c7ab0bec509124f9a2638163ead1556c03eb16bf01aef3ce84f8be559264e77&"
  }
}

Would be great if you could fix the two problems.

@svrooij
Copy link
Owner

svrooij commented Jan 13, 2022

This looks like the state when it's playing the doorbell sound. I'm looking for the metadata from right before.

Background:
I need to generate the metadata from the Alexa/Deezer url, to be able to restore playback.

@svrooij
Copy link
Owner

svrooij commented Jan 14, 2022

@peti69 The release coming up should fix the issue where you can get the notification in a state where it wont play any notifications before restarting.

It does not yet fix the Alexa/Deezer issue.

@github-actions
Copy link

🎉 This issue has been resolved in version 3.2.0-beta.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@peti69
Copy link
Author

peti69 commented Jan 15, 2022

Sorry, here the metadata before playing the notification:

{
  "uuid": "RINCON_7828CA11B42001400",
  "model": "Sonos One",
  "name": "Küche",
  "groupName": "Küche",
  "coordinatorUuid": "RINCON_7828CA11B42001400",
  "currentTrack": {
    "Album": "Abba Gold Anniversary Edition",
    "Artist": "ABBA",
    "AlbumArtUri": "https://cdns-images.dzcdn.net/images/cover/0e28b2ad6ec55276c66dae8297c686c6/500x500-000000-80-0-0.jpg",
    "Title": "Take A Chance On Me",
    "UpnpClass": "object.item.audioItem.musicTrack",
    "Duration": "0:04:06",
    "ItemId": "-1",
    "ParentId": "-1",
    "TrackUri": "https://cdnt-proxy-e.dzcdn.net/api/1/0cbeb828087926346dd30da0ee49b33ff0e36f4450a863d0fc67992f3b4ede6f445a082554dfb51dfc1164c7545ef6f7118e1a5b5470242bdccd47eb2daf6477ab02059a41147751b2c78df0f50c9af8.mp3?hdnea=exp=1642459643~acl=/api/1/0cbeb828087926346dd30da0ee49b33ff0e36f4450a863d0fc67992f3b4ede6f445a082554dfb51dfc1164c7545ef6f7118e1a5b5470242bdccd47eb2daf6477ab02059a41147751b2c78df0f50c9af8.mp3*~data=user_id=0,application_id=607507641~hmac=2933f08370d0e86f9950a82fbd53e436e2aff6a17f9af4b1f0a16d424d3d462d&"
  },
  "enqueuedMetadata": {
    "Title": "Alexa",
    "UpnpClass": "object.item.audioItem",
    "ItemId": "-1",
    "ParentId": "-1"
  },
  "transportState": "PLAYING",
  "playmode": "NORMAL",
  "ts": 1642234444976,
  "volume": {
    "Master": 15,
    "LF": 100,
    "RF": 100
  },
  "mute": {
    "Master": false,
    "LF": false,
    "RF": false
  },
  "bass": 0,
  "treble": 0,
  "nextTrack": {
    "UpnpClass": "object.item.audioItem.musicTrack",
    "Duration": "0:00:00",
    "ItemId": "-1",
    "ParentId": "-1",
    "TrackUri": "https://cdnt-proxy-a.dzcdn.net/api/1/ed76c9727e788d99148f79c8cc7584c9a8d3f1a5a369e4aed1a17ae4d7d44630393e42b6f67448f410ea8781719aa7a8449bd0313169b9d23179f55f500dda7f675b046f38c7af4af2dc1bbe7f6fd303.mp3?hdnea=exp=1642459646~acl=/api/1/ed76c9727e788d99148f79c8cc7584c9a8d3f1a5a369e4aed1a17ae4d7d44630393e42b6f67448f410ea8781719aa7a8449bd0313169b9d23179f55f500dda7f675b046f38c7af4af2dc1bbe7f6fd303.mp3*~data=user_id=0,application_id=607507641~hmac=d7376c0830285d3c1d7065691f2459a83e4ba7c32b52ff055541cb764e841482&"
  }
}

@github-actions
Copy link

🎉 This issue has been resolved in version 3.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

No branches or pull requests

2 participants