![]() |
Alternative renderers and metadata - Printable Version +- Moode Forum (https://moodeaudio.org/forum) +-- Forum: Community (https://moodeaudio.org/forum/forumdisplay.php?fid=18) +--- Forum: General Discussion (https://moodeaudio.org/forum/forumdisplay.php?fid=21) +--- Thread: Alternative renderers and metadata (/showthread.php?tid=2608) Pages:
1
2
|
Alternative renderers and metadata - TheOldPresbyope - 05-31-2020 [2020-06-03: Updates to Airplay and Squeezelite bullets] [2020-06-09: Update to Spotify bullet; remove topical reference to SpaceX launch.] Those with long memories may recall my little side project two years ago to display the output of currentsong.txt on an Odroid Show2. http://moodeaudio.org/forum/showthread.php?tid=211&pid=1563#pid1563. The thread started by @mancio61's post about Airplay metadata reminded me of this project---I could use it easily to monitor whether the shairport-sync metadata reader is still unreliable as it was when Tim dropped it from moOde. [NOTE- the second part of Tim's reply holds true regardless.] Once I had that thought, I figured I should review the metadata situation with all the alternative renderers:
Regards, Kent [1] the subject keeps coming up in the issues log. The response seems to be, put it in librespotd, but the librespotd repo hasn't be touched since it was created two years ago. Curiously, the companion librespot-java repo explicitly proclaims "this implementation provides a useful API to request metadata". After all, if I have the SpotifyURI for the current track (along with authentication credentials), I can directly query the Spotify API for the metadata; the local client should do it for me. RE: Alternative renderers and metadata - exocet - 06-01-2020 WRT Spotify, I think Volumio is now using Spocon (which wraps librespot-java) which not only displays metadata/artwork, but is also gapless. Gapless Spotify support is the one thing that keeps me from moving Moode into "full production". RE: Alternative renderers and metadata - TheOldPresbyope - 06-01-2020 (06-01-2020, 11:36 PM)exocet Wrote: WRT Spotify, I think Volumio is now using Spocon (which wraps librespot-java) which not only displays metadata/artwork, but is also gapless. Gapless Spotify support is the one thing that keeps me from moving Moode into "full production". Sweet, spocon is a Debian-based package with an MIT license. It's not in the Raspbian distro so requires a bit more effort to use. OTOH librespot-java has an Apache license, not an MIT license like librespot has. Not sure what implications that would have for Tim. Thanks for the pointer. Regards, Kent RE: Alternative renderers and metadata - Tim Curtis - 06-02-2020 The java thing is just a point-in-time work around. The librespot devs have already made the commits to enable gapless in the core librespot repo. They just haven't tagged a release yet. https://github.com/librespot-org/librespot My preference is to wait until they do a release then I'll integrate it into moOde :-) RE: Alternative renderers and metadata - TheOldPresbyope - 06-02-2020 (06-02-2020, 12:48 AM)Tim Curtis Wrote: The java thing is just a point-in-time work around. The librespot devs have already made the commits to enable gapless in the core librespot repo. They just haven't tagged a release yet. Certainly true vis-a-vis gapless, which is the more compelling issue for most users. My curiosity centers on the sidebar issue of the passage of metadata: what did the librespot-java developer(s) do and why is it (apparently) not an answer for the librespot developers? Regards, Kent RE: Alternative renderers and metadata - Tim Curtis - 06-02-2020 Good question on how the Java librespot project does metadata. The challenge is how to get the metadata and art work from these external players into the Moode UI and have it be as reliable as MPD metadata. Past attempts at Airplay metadata were not successful. RE: Alternative renderers and metadata - mancio61 - 06-02-2020 Hi, today I made some experiments with the shairport-sync-metadata and shairport-sync-metadata-reader program that I linked in the original thread. I install the service following the instructions, and now, when something is sent to the RPi through AirPlay (e.g. using the Tidal app on my iPhone), I'm able to see the results of the reader on the console (only Album Name, Artist and Title track are catched, but is better than nothing...). Ok, now I try to extend the python script that populate my OLED display, in order to get the output of the reader , parse it and print the info on it. Maybe for a Linux expert shall be an easy task , but I'm literally a goat on Linux, so my temptative to do it failed. I create a simple script to test the stuff. The idea is to run in asynch way a subprocess, passing the command "cat /tmp/shairport-sync-metadata | shairport-sync-metadata-reader > currentairplaysong.txt" in order to redirect the output of the reader to a file. Then, in a loop, read the file and extract from it the info (title, artist,...). I tried with subprocess.Popen(cmd) but it fails... Is there a simple way in Python to directly get asynocronusly the result the shairport-sync-metadata-reader (that I supposed to be a PIPE)? Something like (in metacode): p = openPIPE (result of shairport-sync-metadata-reader) while true line = p.readlines() key,val = extract(line) send key,val to display... end while I know that it shall be a very basic piece of code, but, as I said, never worked with Linux in my life ... Help !! Thanks in advance Andrea RE: Alternative renderers and metadata - TheOldPresbyope - 06-02-2020 [Please don't hijack threads. You have already started a thread for your project. My purpose in creating this thread was to have a place to focus on the topic of getting metadata from alternative renderers without hijacking your thread in turn. That's why I created it here in the "Community>Uncatagorized" section and not, e.g., in the "moOde audio player>Support" section..] I suggest you read all of https://appcodelabs.com/show-artist-song-metadata-using-airplay-on-raspberry-pi (skipping the part about the display itself since you have your own code for that) and try exercising the Python module presented in the "writing the code" section (again, without the part about the display). Apart from the need to redefine the render() function to fit your display code, that code would seem to do pretty much what you just outlined. I did this myself the other day to see how the metadata varied as I tried different combinations of connecting/disconnecting Airplay sources, selecting tracks, starting and stopping playback. The cut-down code I used follows. There are some interesting anomalies as tracks change because the metadata dribbles in. Regards, Kent Code: #!/usr/bin/env python3 RE: Alternative renderers and metadata - mancio61 - 06-02-2020 Kent, I apologize , you're right. I wrote in the wrong thread, hope it will not happen again. Thanks for the suggestion (this is exactly the way I modified the python script cutting the "device" part) Ciao, Andrea RE: Alternative renderers and metadata - mancio61 - 06-03-2020 (05-31-2020, 03:04 PM)TheOldPresbyope Wrote: Hi Kent, it can help, in the Python script that I use currently to update my display, there's a part, that I never used (SQUEEZELITE = False...) , dedicated to Squeezelite, able to retrieve music info from LMS Server (try to attach it but with no success) |