-
Notifications
You must be signed in to change notification settings - Fork 455
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
Adding Metadata -- prefered method? #803
Comments
There is no generic way to add meta tags. I've started with it in the |
Ah, maybe I could pick your brain about how you see metadata support evolving? let json = json!(
{ "metadata" : {
"track_id": spotify_id.to_base62(),
"track_name": track.name,
"artist_id": artist_ids,
"artist_name": artist_names,
"album_id": album.id.to_base62(),
"album_name": album.name,
"duration_ms": track.duration,
"albumartId": covers,
"position_ms": position_ms.unwrap_or(0),
}});
Take care! :-) |
@ashthespy Could I get some more details on how you're sharing metadata between your server and clients? I'm trying to brainstorm a way to get the data out to multiple volumio clients. What I envision is probably a dirty way to go about it, but since I only use spotify connect to play music back I want to package the data on the server where the spotify connect plugin is located, send it to the clients (who's only installed plugin is a snapclient) to have it then broadcast to the UI |
I think the preferred method for adding metadata in case of Librespot is to have it integrated into the librespot stream source, but without any |
I currently have metadata only within Volumio's ecosystem, but not on other clients, which is why this issue ;-)
Ah, I was hoping that you had some plans for a stream agnostic way of incorporating metadata, instead of a custom metadata parser for each stream. W.t.r to But this still leaves a few thoughts from my side on the preferred method to get metadata in -- We could patch it to add more information in a parseable manner to stdout, (Additional metadata is currently lacking as this is done from the player thread that is nonblocking, but this is an implementation detail that isn't of much interest to you ;-)) |
Can we use Snapsever's Relatedly, I noticed |
@kingosticks the meta branch is kind of stalled. The idea was to have a toolbox of some generic meta-readers that can be assigned to a streaming source. This is the "If the mountain will not come to Mohammed, Mohammed will go to the mountain" approach. |
I've considered using mpris for PiMuiscbox but I concluded it wasn't worth the dbus faff. The main issue we have with Mopidy-Mpris is that, because it's dbus, for everything to see each other they all need to be on the same bus. Mopidy is flexible and can join either system or user bus but other programs (such a gnome tray applet etc) are not and will only join the user bus which means being then forced to run snapcast as a user service also (sort of related to the pulseaudio quirks). Not the end of the world but its not quite as good as it may first appear. Having said that, the Just Boom player software uses mpris for integrating everything and they've written simple mpris (system bus) wrappers around things that don't speak mpris themselves (like librespot). |
damn, i see. I was already wondering why mpDris2 emphasizes that it's running in the user session. |
Update on this: I've started to add generic meta data and stream control support. There is an early version of the documentation in the develop branch In a nutshell:
The server will send JSON RPC commands to the script's stdin and receive responses and notification from it's stdout. Commands are for instance Metadata, properties and control commands are exposed to Snapserver's RPC interface, so that clients can get the metadata and control specific streams via the Snapserver's websocket interface. This is still work in progress and changes almost every day, but the interface is starting to get "stable". As proof of concept I'm developing a control script for MPD, based on mpDris2 and a Snapcast to MPRIS script for the desktop as well as on an integration into Snapweb, maybe also in Snapdroid. As a teaser: this is how it looks like at the moment: |
Hello, I have tried to download the develop version of snapserver in order to setup the stream plugin, I installed the dependencies (python-mpd2 and musicbrainzngs) and specified the controlscript in my source. The problem is that when i try to test a method using telnet it returns "Method not found", code -32601. The JSON RPC API works fine tho. Do you have any ideas on what could be my issue here? |
What method are you trying through which telnet interface? |
I tried using Plugin.Stream.Player.GetProperties |
This API is exposed by the Metadata plugin, not by the Snapserver, i.e. |
Oh, I understand, then where do I need to execute the stream plugin methods in order for it to recognize them? |
I've updated the documentation (which if far from being finished yet). To summarize: |
I noticed that there is some rudimentary "metadata" implemented already for the
librespot
by reading off the stderr output.snapcast/server/streamreader/librespot_stream.cpp
Lines 138 to 145 in 1f98c79
I have wrapped
librespot
to create a pipe with proper metadata and would like to incorporate some metadata support into snapcast for Spotify.From a quick look at the codebase, this can be done similar to how the
shairport-sync
metadata stream is read, but then would require patching thelibrespot_stream.cpp
with yet another "custom" implementation.As I am not very well versed with this codebase, I would like to ask if is there already a
stream
agnostic way to add metadata to a particular stream?I could then plug my
librespot
based daemon to output to this preferred stream as well, and then configure the server to read the audio stream + metadata stream.The text was updated successfully, but these errors were encountered: