airsonos icon indicating copy to clipboard operation
airsonos copied to clipboard

Adapt to speakers getting grouped / un-grouped

Open ndfred opened this issue 7 years ago • 3 comments

If I start AirSonos, then group speakers I will still see two speakers in the AirPlay list. If I group speakers, then start AirSonos I will see only one speaker, but it will be named after the speaker I started the group with rather than the name of the group.

If possible it would be nice to detect grouping / un-grouping events and update the list of AirPlay speakers as a consequence. Naming grouped speakers correctly would be a nice addition too.

ndfred avatar Apr 28 '17 09:04 ndfred

+1. Automated restarting of airsonos when groupings change would be excellent.

My first "solution" to this issue was to use Screens app on my iPhone to remote into my Macbook Pro, which I run as a server to host things like AirSonos. Once in my Macbook, I Ctrl-C the existing airsonos instance running in terminal and start again.

The next step was to use SSH instead of Screens. I could run airsonos from the SSH app.But as soon as I closed the iPhone app, airsonos would stop running. My "hack" to get around this is pretty simple:

  1. SSH into server.
  2. Run "screen"
  3. Launch airsonos via screen.
  4. Disconnect from screen.
  5. Close terminal app.

If I do this, airsonos remains running. When I change groupings, I remote back into the server, reattach to the screen (screen -r). Ctrl-C the existing airsonos instance, run airsonos again, disconnect from screen, and go one with my day.

I can think of two ways this could be easier:

  1. Automated restarting of airsonos with groupings change -- gold standard
  2. A quick command to manually restart airsonos from the command line. I tried using npm restart airsonos But that gave me an error and had no effect.

ThatGit10 avatar May 23 '17 04:05 ThatGit10

That's pretty much what I do as well, easiest would really be to detect group changes and re-configure accordingly

ndfred avatar Jul 09 '17 10:07 ndfred

This is a good idea (if it's possible!). For now, my solution is to use the "Workflow" app on iOS to run this script over SSH:

ps aux | grep airsonos | grep -v grep | awk '{print "BEFORE\nid:",$2"\nCPU:",$3"%\nSince:",$9}'
killall node
airsonos > /dev/null 2>&1 &
echo ""
ps aux | grep airsonos | grep -v grep | awk '{print "AFTER\nid:",$2"\nCPU:",$3"%\nSince:",$9}'
exit

markjaquith avatar Aug 10 '17 20:08 markjaquith