Comments (9)
What is in your script. It does not appear to handle the initialization command properly.
from squeezelite.
#!/nix/store/4vzal97iq3dmrgycj8r0gflrh51p8w1s-bash-5.2p26/bin/bash
case $1 in
0)
power=down
;;
1)
power=up
;;
2)
# silently drop
exit 0
;;
*)
echo "Unsupported arg: $@"
exit 1
;;
esac
/nix/store/zfrpn9bq8z3xaxwqrz0vcb91mfbdhkss-minidsp-0.1.10-pre/bin/minidsp --daemon-url http://127.0.0.1:5380 status
case $? in
0)
minidsp=up
;;
1)
minidsp=down
;;
esac
echo "minidsp=$minidsp,squeezelite=$power"
if [ $minidsp != $power ]; then
out=`/nix/store/dzs2chgxcwzpwplcw6wvv8nzkn01yr7y-curl-8.6.0-bin/bin/curl -X POST localhost:3000/api/v1/miniDSP/KEY_SLEEP -d power`
echo "toggled minidsp power: $out"
else
echo "minidsp already in desired state"
fi
from squeezelite.
is the initialization command 2
? because that's seemingly sent before either on or off.
from squeezelite.
from squeezelite.
It actually does now (2 handled with exit 0). The log above did not handle that cleanly, but it makes no difference. squeezelite still sends 0/1/0 which leaves the system powered on (as it can't respond that quickly).
from squeezelite.
unfortunately, squeezelite has to initialize, then it has to get a status from LMS, which is why it toggles.
While it happens fast, squeezelite waits for the script to exit before doing anything. You can add a very small amount of delay to your script, but that can create other squeezelite problems. Why can the daemon not respond to a command sequence?
from squeezelite.
Why can the daemon not respond to a command sequence?
I'm actually triggering state changes through lirc to send a remote command. It then takes the device a couple seconds to transition itself.
from squeezelite.
Would it make sense for squeezelite to wait until after it has communicated with LMS before running the script (or triggering the GPIO assuming it's the same case)?
from squeezelite.
That would be a good solution. Also, there's an issue where if you use the -C option then it's power-cycling based on the device open status rather than the state of the LMS player power button (issue #205), and it would be great to be able to deal with that ar the same time.
from squeezelite.
Related Issues (20)
- flac and ogf streams HOT 3
- output threshold is incorrect HOT 2
- Power controls (gpio/script) tied to output device being open rather than soft power button state
- Build fails on 1466 (commit c89faf3) HOT 15
- Build error in flac.c on revision 1466 HOT 2
- Whole-album flacs with embedded cuesheet playback broken by commit c89faf3 Ogg metadata (and a bit more) HOT 11
- Version 1476 - Error compiling on X86 and Raspberry 4 HOT 13
- Request: Create Release HOT 4
- OggFlac chaining HOT 2
- unhandled grfe HOT 4
- squeezelite-pulse sync issues
- Issue with mp3 playback on Alpine Linux with recent squeezelite versions HOT 8
- Crash on Arch Linux
- Building on macOS does not use libraries installed by package managers HOT 5
- macOS M1 binary release Squeezelite.app is corrupted HOT 2
- Compiling: error with gpio.h HOT 3
- Meta-package squeezelite-2.0.0.1488-aarch64 HOT 1
- Squeezelite-2.0.0.1488 dont play FLAC radios HOT 1
- Native DSD not working HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from squeezelite.