volumio-snapcast-plugin
volumio-snapcast-plugin copied to clipboard
Enhancement: snapcast cliënt notifying the front-end.
Would be nice if the cliënt could inform volumio it is playing. So it would say snapcast playing in the gui
I've only recently read into the volatile state stuff... problem is there is no metadata, so I'm unsure how to propagate the volatile state.
I am sure about the place though, it should be in the client indeed, so I need to make it a bit fatter, because the streaming state is kept at the server, it will need a ndjson library for communication.
Just brainstorming here, the server knows whether the clients are playing or not, so querying the server using the mac address of the client should suffice.
Ergo; a ndjson request should be sent every x-seconds to query the server whether the stream the client is connected to is (still) playing or not.
Example:
"streams": [{
"id": "VOLUMIO-MPD",
"status": "idle",
"uri": {
"fragment": "",
"host": "",
"path": "/tmp/snapfifo",
"query": {
"buffer_ms": "20",
"codec": "flac",
"mode": "read",
"name": "VOLUMIO-MPD",
"sampleformat": "44100:16:2"
},
"raw": "pipe:///tmp/snapfifo?name=VOLUMIO-MPD&mode=read&sampleformat=44100:16:2",
"scheme": "pipe"
}
}
This part matters:
"status": "idle",
Snapcast's dev branch has now added support for metadata.
That would help alot in populating the volatile state, thanks for the heads up
Sorry, let me correct myself. There is a pull request, not yet merged with support for metadata. https://github.com/badaix/snapcast/pull/319
I've sent a pull request to @badaix but haven't gotten response yet. (30 days now).
Status is that I collect metadata from Shairport and Librespot and I'm currently working on a Pulseaudio interface (instead of the pipe) which will include reading the metadata properties as set by Mopidy and others. Currently its text only but its open for any tag name the user wants, I base on Vorbis types. I aim to implement album art, looking into best way to encode to json, will probably go for base64.
Major issues are the non-activity of Librespot, seems it's currently fragmenting, would hate for that to happen but it really needs some proper meta data api.
I'm also testing a Snapcast version with static groups, ie no groups added/deleted by snapserver except the first default group as I wanted a zone concept more than dynamic groups.
I have not done a lot on the client handing off metadata, just made a class for it to put on stderr. I'm kinda undecided on how to hand off metadata, my only use case is json on stderr to a Kodi addon so any input would be appreciated.
I can see that the your PR on snapcast has been merged. Any progress here to use that metadata and update volumio's front-end?
@Gronis frafall's pull merged, will probably be supported in next release of snapcast and hopefully soon after by this plugin.
Any progress on this?
Frafall has been ill, but just 2 days ago he's back online. https://github.com/badaix/snapcast/issues/308
Would love to see this available!
I'm taking a stab on this. I've got all modules built on my Rpi4; will report back if the base is stable.
@JoakimLindbom great news! I was going to try to implement this feature myself. Any ETA on this? I would like to try the code as soon as possible, cause I'm working on a project that requires this functionality. Thanks!
No ETA. Right now I'm porting Frafall's code for librespot from 2017 to the latest dev branch of the current version. Only 200 commits or so behind...