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
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