Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Spotify / Librespot - metadata retrieval POC
#3
(01-26-2024, 02:43 PM)cogitech Wrote: Pulling this over from the other thread. Al, I will still do as you requested below, when I have some time. Maybe today, maybe next week. I want to set up a moOde server on a separate Rpi for testing this stuff.  Earlier I was using my main "production" moode server for testing and messed it up a bit when I fat-fingered the php code. I was able to fix it, but I'd rather make those mistakes on a system that nobody in the home relies on.

_______________________________

Hi,

can you modify the /var/local/www/commandw/spotevent.sh and add the following lines, always, that is, before the very first IF
(then we need to change that script, because ATM for any event other than "started" or "stopped" it just exits... adding these lines before the test at least gets us how-and-when it gets called...)

echo "`date +%Y-%m-%dT%T.%N` - PLAYER_EVENT = ${PLAYER_EVENT}" >> /var/log/moode_spotevent.log
echo "`date +%Y-%m-%dT%T.%N` - OLD_TRACK_ID = ${OLD_TRACK_ID}" >> /var/log/moode_spotevent.log
echo "`date +%Y-%m-%dT%T.%N` -     TRACK_ID = ${TRACK_ID}" >> /var/log/moode_spotevent.log
echo "`date +%Y-%m-%dT%T.%N` -  DURATION_MS = ${DURATION_MS}" >> /var/log/moode_spotevent.log
echo "`date +%Y-%m-%dT%T.%N` -  POSITION_MS = ${POSITION_MS}" >> /var/log/moode_spotevent.log

Then, cast some songs in Spotify, and also do the following:

1. play a song, wait for it to finish, and play the next song. After some time you can stop it.
2. play a song, halfway through select another one to play
3. play a playlist, at least two songs (or do as at point 1)

This to see how many times the script gets called; hopefully only one time per event (STOP / PLAYING / CHANGED)
Cheers, Al.

No worries, set up your working environment from a fresh install.

Then you can just swap an SDcard where you will tackle with out madness...

I was thinking, that to communicate back to the UI we'll probably need a socket, and for that matter also something like mpd running in the background... and something to control it. For ordinary playback at the moment we have MPD and MPC, we shall have something like SMC (S.potify M.etadata C.ontroller), which has an open socket connection towards the Spotify UI: upon metadata change we'll invoke SMC with the relevant data, and it will pipe the data to the UI.
I still have to investigate the whole thing, but I think I can come up with something early next week (if not tonight, I mean...)

But the test I asked you to perform is crucial to be able to determine the load of the script invoked by librespot.
Reply


Messages In This Thread
RE: Spotify / Librespot - metadata retrieval POC - by Nutul - 01-26-2024, 03:14 PM

Forum Jump: