Here's what's working right now for me, including metadata updates to an
Azuracast radio. It's slightly above "hack" status, but appears to be
working. I get really small pops every now and again, and I haven't
narrowed it down to metadata updates, or something with buffering, or
just the inherent issues with flac->pcm->ogg->mp3 workflow here. You
can listen at https://rad10x.com/
To get it working, configure your ices.conf with the delta below. Save
the metadata-update-script.sh, make it executable, and just run it in
the background, it doesn't output anything normally. Then setup the
pulseaudio, squeezelite, and parec piped to ices. Queue music up and
your should see things operating. The script to do the metadata does
no error checking, so permissions, etc, may throw it off. But it should
be pretty clear what it's doing. I didn't bother getting rid of the
quotes in the Title/Artist, that's for the next iteration.
Any questions, feel free to ask.
ices-conf.xml file. You need to make sure your PID file matches the
Metatdata update script below, and your input needs a file to read
metadata from. This is not the complete config, just the items you need
to ensure you have. Update the file names as needed.
Code:
--------------------
<ices>
<pidfile>/home/jukebox/ices.pid</pidfile>
<input>
<module>stdinpcm</module>
<param name="rate">44100</param>
<param name="channels">2</param>
<param name="metadata">1</param>
<param name="metadatafilename">/home/jukebox/metadata.txt</param>
</input>
</ices>
--------------------
Metadata Update bash script.
MAC needs to updated to the MAC address of the squeezebox client (you
can look at the LMS Settings->Information Tab to find it.
METATIME is how often to scan for metadata updates.
ICESPID is the pid file written, so we can send the USR1 signal to
retransmit the metadata.
METAFILE needs to match the ICES.CONF file above.
METATEMP is just used for temporary caching, we only update metadata on
song changes.
Code:
--------------------
#!/bin/bash
LMSIP=127.0.0.1
MAC=10:bf:48:7b:36:c3
METATIME=5
ICESPID=/home/jukebox/ices.pid
METAFILE=/home/jukebox/metadata.txt
METATEMP=/home/jukebox/metatemp.txt
while [ 1 ]
do
command='{"id": 1, "method": "slim.request", "params":["'$MAC'", ["'artist'",
"'?'"]]}'
artist=`eval "curl -q -s -X POST -d '"$command"' "$LMSIP":9000/jsonrpc.js"`
echo $artist |grep -Po '"_artist":".*?"' | cut -d: -f 2 >$METATEMP
command='{"id": 2, "method": "slim.request", "params":["'$MAC'", ["'title'",
"'?'"]]}'
title=`eval "curl -q -s -X POST -d '"$command"' "$LMSIP":9000/jsonrpc.js"`
echo $title | grep -Po '"_title":".*?"' | cut -d: -f 2 >>$METATEMP
diff -q ${METATEMP} ${METAFILE} >/dev/null
status=$?
if [ $status -ne 0 ] ; then
cp -f ${METATEMP} ${METAFILE}
kill -USR1 `cat ${ICESPID}`
#echo "Updating Track Info"
fi
sleep $METATIME
done
--------------------
Pulse Radio Setup - Squeezelite outputs audio to "Radio" channel, and
PAREC pulls PCM from it:
Code:
--------------------
#Startup Pulseaudio
pulseaudio --start
#Create the Radio "sink"
pactl load-module module-null-sink sink_name=Radio
sink_properties="device.description='Radio'"
#Run squeezelite, ensure that you have the pulse audio version
squeezelite -o Radio
#Run the metadata-update.sh script in the background (the script above)./m
./metadata-update.sh &
#Run PAREC piped into ICES
parec | ices ices-conf.xml
--------------------
------------------------------------------------------------------------
Matt Drown's Profile: http://forums.slimdevices.com/member.php?userid=69476
View this thread: http://forums.slimdevices.com/showthread.php?t=112809
_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/plugins