Good morning everybody,
in the Slimdevices forums (LMS, squeezelite etc.) we've been looking for a way
to shut down a Raspberry Pi automatically after playing some music when no
sound is detected on the sound card any longer. This can be helpful in our
cases where we are recording or streaming "vinyl" from vintage turntables into
a multiroom enabled system like LMS.
For creating and transmitting the vinyl stream (FLAC), I use Liquidsoap and
Icecast. That works pretty fine, and I'm very thankful for having discovered
Liquidsoap.
My recipe is:
#!/usr/bin/liquidsoap
# set the path and permissions for the logfile
set("log.file.path","/var/log/liquidsoap/phono.log")
set("log.file.perms",777)
#set("log.unix_timestamps",true)
#input from soundcard
phono = input.alsa(bufferize=true,fallible=false,device="hw:0")
#stream it to local icecast, default port and password
output.icecast(%ogg(%flac(samplerate=44100,channels=2,compression=5,bits_per_sample=16)),
mount="/phono", name="Phono", format="audio/ogg", description="Turntable
FLAC", url="http://192.168.178.200”", genre = "Misc", phono)
Now we have been looking at the on_blank operator described in
http://liquidsoap.fm/doc-dev/blank.html, which seems to be able to do the job
of shutting down the Pi after finishing the playback of a vinyl record. I
created a shut down script (shut_on_blank.sh, owner: root) and tried to insert:
def handler()
system("/etc/liquidsoap/shut_on_blank.sh")
end
source = on_blank(handler,phono)
into the .liq file above, but the result was that the entire stream generation
didn't work any longer.
What am I doing wrong?
The second question that arose was whether the length of the blank to be
detected as such can be configured with on_blank, too - as it seems to be
possible with max_blank= for strip_blank. When searching through the mailing
list, I also found a post saying that the default threshold for blank detection
is -40db, and that it can be adjusted - but not how/where. It seems that we
weren't able to find further information on this in the docs.
Thanks for your help & best regards
Martin
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users