Philip P. Ide

Author, programmer, science enthusiast, half-wit.
Life is sweet. Have you tasted it lately?

User Tools

Site Tools


blog:articles:raspberry:mpd_multiroom

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
blog:articles:raspberry:mpd_multiroom [2024/06/16 14:49] – created Phil Ideblog:articles:raspberry:mpd_multiroom [2024/06/21 13:09] (current) Phil Ide
Line 1: Line 1:
 +~~NOCACHE~~
 ====== Whole-home Music ====== ====== Whole-home Music ======
  
Line 51: Line 52:
 ===== Snapcast Features ===== ===== Snapcast Features =====
  
-You put some music on, and now your whole house is blaring the music out, and you may only want certain rooms playing music at any particular time. Snapcast provides a web page on port 1708 of your music centre e.g. <code>http://music:1708</code>which allows you to turn individual rooms on/off as you like.+You put some music on, and now your whole house is blaring the music out, and you may only want certain rooms playing music at any particular time. Snapcast provides a web page on port 1708 of your music centre e.g. <code>http://music:1708</code>.. which allows you to turn individual rooms on/off as you like.
  
 Before you turn anything off though, you may have noticed something else: all speakers in all rooms are synchronised, with none of them lagging behind any others. This is because Snapcast streams the music data in packets which have a timestamp set in the future - the receiving client waits until that moment to play the music. If any of the speakers are out of synch, adjust the latency value in the server configuration, the restart the server with the command <code>sudo systemctl restart snapserver</code> Before you turn anything off though, you may have noticed something else: all speakers in all rooms are synchronised, with none of them lagging behind any others. This is because Snapcast streams the music data in packets which have a timestamp set in the future - the receiving client waits until that moment to play the music. If any of the speakers are out of synch, adjust the latency value in the server configuration, the restart the server with the command <code>sudo systemctl restart snapserver</code>
 +
 +You'll also notice that the Snapcast web page also allows you to stream to your web browser. This means that you can stream to a device via Snapcast //or// via the MPD http stream.
 +
 +===== Turn into an Alarm Clock =====
 +
 +I've written some scripts for both Linux and Windows to turn the music system into an alarm clock. If you are running an Apple system, I'm sure you can make these scripts work for you. The scripts are written in PHP and are therefore cross-platform.
 +
 +It is necessary to create a playlist on MPD called "Alarm". You can put anything you like in the playlist, and you can change the contents (so you don't have to change the scripts!). My advice is don't use Beethoven's 5th, unless you're evil.
 +
 +The first script is run as a cron job (or a Windows Scheduler task), and turns all the speakers off in the home except the device you designate as your bedroom unit. It then loads the Alarm playlist and starts it running.
 +
 +The second script I run on boot of my desktop, and it turns the bedroom speakers off, and enables a list of designated speakers, so I don't have to manually turn them on myself - because why do it yourself when you can automate it?
 +
 +The scripts are on GitHub at [[https://github.com/stroggprog/mpd_snap_alarm|mpd_snap_alarm]] (note the imaginative name for the repository). There is a full explanation of how it all works, how to configure it and everything else you need to know except how to paint your toenails.
 +
 +I have other repositories there too at [[https://github.com/stroggprog|stroggprog]]. You can only see the public ones, but others will made public when the projects reach a certain level of maturity.
 +
 +~~socialite~~
 +~~DISCUSSION~~
blog/articles/raspberry/mpd_multiroom.1718549369.txt.gz · Last modified: 2024/06/16 14:49 by Phil Ide

Except where otherwise noted, content on this wiki is licensed under the following license: Copyright © Phil Ide
Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki