get Spotify and Airplay Infos for LCD

I use a 4x20 LCD Display. With python i transfer the current song information to the display.
Here i am using the standard mpc commands like shown here: linux.die.net/man/1/mpc

Is there a general API or how to get the song information from my spotify track?

How to get song infomration from my airplay device?

Thanks Tatoosh

I searched a bit in the www folder an found the json information in /_player_engine_spop.php for spotify.
Here i will grab that info. Is there a better solution?

Hi,

Maybe the info from this site will help you with the Airplay info:

http://acquisitionsyndrome.com/2014/08/using-a-usb-lcd-display-with-your-music-player/

He uses the option to dump the meta info from the playing song in a dir.

You have to do a few adjustments:

Make a dir to save the meta info:

sudo mkdir /etc/shairport

You have to add the -M option and the location (the dir from the first step) to store the info, to the init file:

sudo nano /etc/init.d/shairport

So the start command ends up like this:

/usr/local/bin/shairport -d -a "$NAME" -w -B "mpc stop" -M /etc/shairport

Restart shairport or reboot Volumio.

There is also script to get the info from the directory and sent this to the LCD. He is using an USB-lcd but i think the first part of his code will be usefull for you.

#! /bin/sh cat < /etc/shairport/now_playing | awk -F"=" '!/artwork=/ && !/genre=/ && !/comment=/{print $2 | "tclsh /etc/shairport/smartie/smartie-tail.tcl -tty /dev/ttyUSB0"}' &

I don’t have an Apple device to test…

Harry

Thanks a lot Harry,

your post saves me a lot of time :wink:
By the way, there is a good Android App for rooted devices for Airplay, called Allstream (about 5$).

Next Weekend i will try to change my code and if anyone is interessted, i can share it of course.

Tatoosh

I would be extremely interested. If you can, will you put a little tutorial about what to do? Basically what needs to be installed.

I added the -M option (–meta-dir=) and the covers will be written in the named folder. also the now_playing file is there but empty.
Any suggestions?

The info at https://github.com/abrasive/shairport says:

  • So did you change songs?
  • Did you check the tag-info of your mp3 files?
    *When you are using the Android-app does it sent the meta-info?
    *…

Kind regards

Harry

Hi Harry,

i found a solution: just erased the now_Playing file and created it myself with some demo content.
Now it works with Android Airplay or iPad Airplay!

So it must be permission problems.
Here i have sample code in runeaudio, should also work for volumio:
http://www.runeaudio.com/forum/airplay-songinfo-t770.html

Tatooosh