Open GoogleCodeExporter opened 9 years ago
If you are running on a machine which is also running a the jivelite then this
could be scripted and there is already a script for enabling/disabling external
hardware on the CSOS distribution - called TriggerOutput - see
http://forums.slimdevices.com/showthread.php?98834-Second-project-with-the-Commu
nity-Squeeze
Original comment by trio...@btinternet.com
on 23 Aug 2013 at 8:17
This is a fantastic idea. I've been wanting to do the same thing. Although I
wonder if there is another way to achieve it.
Original comment by ryan130...@gmail.com
on 11 Sep 2013 at 11:49
I'd also like to be able to do this. I don't have jivelite installed on my pi
and don't need it's functionality, but I would like to turn my amplifier on and
off and also, ideally, hijack the squeezebox volume controls to adjust my amp's
volume via i2c instead of the volume of the squeezelite player.
Anyone have any suggestions?
Original comment by ben.har...@gmail.com
on 18 Mar 2014 at 2:30
I would like that function too to switch my amplifier On/Off without using
jivelite.
I.e. a command line switch telling squeezelite to write On/Off status to a file.
An other process, that I make, could poll that file and make the IO to Pi's
GPIO.
Original comment by jan.ande...@get2net.dk
on 5 Apr 2014 at 11:23
This is exactly what I have been looking for.
A Perfect way of achieving this would be to allow hook-scripts, such that you
can hook on commands which are processed right now, e.g.
OnPlay - gets executed everytime the play command is issued (beginning of
each song or if you hit play)
OnConnect - gets exectued after connect
OnDisconnect - ... after disconnect
Also, it would be great to have access to certain env-variables, lets say the
current song is
SQLT_SONG_NAME
SQLT_SONG_DURATION
SQLT_SONG_GENRE
SQLT_SONG_ARTIST
Or so. This way controlling an LCD display is very easy.
I know this is actually easy to implement, but a lot of work to
maintain....what if the script fails? Should squeezelite stop? What if you have
infinite loops within the script. The mechanism should be pretty safe.
Whats the authors opinion?
Original comment by nhellw...@gmail.com
on 31 Jul 2014 at 12:18
You should implement this on the LMS server not as part of squeezeplay.
Squeezeplay has no idea of the name, artist or genre information - this is only
available from the server. There are already apis for interfacing to the
server please look at these.
Original comment by trio...@btinternet.com
on 31 Jul 2014 at 8:01
Hello everyone :)
So I think basically there are two things, which are being discussed here:
1. Song informatin etc
2. Interrupts for ALSA On/Off
I agree, the first one should not be part of squeezelite, but lets come to that
later.
I have figured out some way to trigger actions on ALSA On and Off. The basic
idea is to constantly parse the logfile and then use that information to figure
out whats going on right now. Here is what I did:
1. Turn on all log information you can (all=debug). It might work with less, I
have not tried so far.
2. Use this script at the bottom. This script parses the logfile and then
determines if ALSA was attached or not. It works for me on a raspberry pi and
is super efficient. All you have to do is to put your code instead of "Its On"
and "Its Off". It will run forever. I have no Idea how big the log files will
be and if this is going to be a problem, but I will investigate that.
3. Now, if you need Song info and so on, I strongly recommend this project:
http://code.google.com/p/squeezy/
All right..What do you think??
#!/bin/bash
LOGFILE="/var/log/squeezeslite.log"
BAIT='(output)'
tail -F $LOGFILE | grep --line-buffered -E $BAIT | while read CATCH
do
if echo $CATCH | grep -q 'open output'; then
echo "Its On..."
elif echo $CATCH | grep -q 'disabling output' $LOGFILE; then
echo "Its Off..."
fi
done
Original comment by nhellw...@gmail.com
on 29 Aug 2014 at 5:18
I think you should also consider a script which connects to the server and
subscribes to player state commands - this will show you when a player is on or
off and does not rely on squeezelite specific debugs (which may change).
Original comment by trio...@btinternet.com
on 31 Aug 2014 at 10:39
In my case the server is a synology NAS, which I dont want to wake up that
much, so I prefer a client side method.
Well, I could adjust the script to actually parse the network traffic via
tcpdump, that way no log file had to be written and it only depends on the
network commands, which shouldnt change that much. This script could then run
either on client or server side. I might have a look at it ;)
Original comment by nhellw...@gmail.com
on 31 Aug 2014 at 12:10
Turns out that the tcpdump version uses too much cpu on the pi...guess that
wont work.
Does anyone know where the server stores the information about the player
status or is it possible subscribe to a player, as mentioned in the post before?
Original comment by nhellw...@gmail.com
on 31 Aug 2014 at 3:27
Original issue reported on code.google.com by
tutm...@gmail.com
on 23 Aug 2013 at 9:49