The question is: why? Why distribute the music that way, why not just attach it to a radio directly, or some RPi that will pull the stream, or just have it prerecorded.
Despite its simplicity, seems to be overengineered.
Because distributing music over multicast works very well, and it's rather simple in nature: You get audio frames as UDP packets, you play them. Because it's multicast, they reach where they should.
> why not just attach it to a radio directly
Because you lose control of what's being played, and there are probably not many "elevator music" radio stations.
> or some RPi that will pull the stream
Because then every location that plays the music has to pull an individual stream, quickly saturating the bandwidth for no reason, instead of just subscribing to the multicast stream.
I also would not say "some RPi" is less engineering, and less maintenance, than the current solution that likely uses an off the shelf multicast audio system.
> or just have it prerecorded
Because you lose control of what's being played without a significant replacement step, when you could just play a multicast stream instead.
> Despite its simplicity, seems to be overengineered.
I'm honestly not convinced I read a less "overengineered" solution so far...
> Because you lose control of what's being played, and there are probably not many "elevator music" radio stations.
Radio is still by far the simplest and most fail-safe solution. But not playing an existing radio station. Rather buying a radio transmitter, like the ones used in churches - strong enough to emit FM throughout the hotel, and yet not requiring a radio license. Then the speakers would just be plain speakers with a FM receiver attached - no more wifi/wired infrastructure involved, routers, ability of the speakers to connect to the wifi, ...
I think this might have been a popular solution once, but my guess is that it came with its own set of problems. Hotels often being pretty big (bigger than most churches, which also tend to be relatively open structures), usage of the license free bands from other devices, audible interference (which you don't care about in ham radio or portables as long as you can still understand what's being said, but for music in a hotel even low interference is bad as soon as it's audible)... though admittedly, I have no experience with radio transmitters for that particular use case.
> I'm honestly not convinced I read a less "overengineered" solution so far...
Prerecorded music on an MP3 player sounds like the one simpler solution, though it wouldn't put the elevators in sync with each other or let you control it remotely.
Yes, but if you want to do even as much as not play the music in the middle of the night, now your MP3 player needs a clock. That clock may drift, or it may drop out completely when the power goes out, unless you synchronize that clock over the network. But if you have network on your MP3 player, you may as well let it subscribe to the multicast stream instead of reading the stream from internal storage. If you do not have network, and you want to change the schedule of when your music plays, have fun to send out some maintenance crew to every single one of those devices. And don't forget any...
In the U.S. at least, most jurisdictions will require the music to be shut off in an emergency -- namely, if the fire alarm goes off. Audio sources commonly are required to have a relay/GPIO input that triggers the shutoff, a network command is not good enough (network switches typically not being life safety rated).
In this hotel scenario, you have one audio source that can be located in a location that can be conveniently tied into the fire alarm relay panel. Stop the audio there and you've stopped it everywhere.
This is pretty much the simplest feasible way to do distributed audio over IP, and it's commonly implemented by commercial distributed audio amplifiers.
The advantage of IP distributed audio is that it functions over the existing IP network, so it avoids the need to wire a high-voltage audio system (which will still require multiple amplifiers in large buildings) or dedicated signal-level wiring to distributed amplifiers. It also tends to be more reliable as the IP network is more robust to issues like crosstalk and poor connections that can turn into frustrating troubleshooting on analog systems.
"Some RPi that pulls the stream" is exactly what this system is except it uses multicast for significantly reduced bandwidth usage and the receivers are presumably commercially-supported distributed audio equipment. No hotel wants to be doing patch management for embedded Linux devices.
I don't think multicast significantly reduces bandwidth usage. Traffic needs to go everywhere anyways. It will probably reduce CPU usage since switches (even dumb ones) can just broadcast the packet at line speed, since it's all in the hardware. There's no need for whatever server is distributing the stream to maintain multiple sockets and copy buffers multiple times.
With unicast, the node originating the stream would have n times the traffic, where n is the number of devices pulling the stream. Further from the originating node in the network topology, each edge would transport as many times the traffic as there are listeners whose traffic travels along that edge. That seems very significant.
With broadcast, all the nodes and edges transport the stream only once, but you can only distribute the stream in the same (L3) network, and within that network you transport the stream even through L2 nodes and edges (i.e. network switches, cables, Wi-Fi channels) where there are no listeners at all. You could in theory repeat those broadcast packets into other networks, but you need to set that up more explicitly, and then every node and edge in that network gets the traffic, too.
With multicast, devices and effectively segments can subscribe to the stream, and all nodes and edges transport the stream at most once, and they can do so across network boundaries while retaining the same property, and using a standardized mechanism that is designed to make the traffic only go where it needs to go as much as the topology allows.
anyfoo is correct but it might help to explain the implementation. Multicast IP works in cooperation with IGMP, a protocol that manages "groups" at the IP layer. In a unicast model, a device that wants a stream asks the server for the stream, and the server starts sending the stream to that device. The server maintains n outgoing connections sending n copies of the stream, one for each subscriber.
With multicast, a device that wants to receive the stream uses IGMP to join the group. The IGMP communication is not with the server, but actually with the router serving the subnetwork. Additionally, larger commercial switches usually implement "IGMP snooping" in which the switch "listens in" on IGMP sessions between its clients and the upstream router. The server maintains only one connection and sends only one copy of the stream, to a multicast group address---there are IP ranges reserved for this purpose. The router, and switches which implement IGMP snooping (or layer 3 switches, there are some variations), forward traffic to the multicast group address on any interface on which a client has used IGMP to join the group. Switches without IGMP support will just forward it on all interfaces. The result is that, at each point in the network, only one copy of the stream is handled. This has significant performance benefits for both the server and the network devices.
As the name implies, multicast is much like broadcast except that devices can opt in or out of receiving the broadcast, and network devices can use knowledge of those IGMP sessions to avoid sending multicast traffic on interfaces where no one cares to receive it. That said, multicast traffic going to network segments where it's not used is not especially harmful besides wasting some capacity on that network segment.
Unfortunately multicast is not workable over the internet for reasons which are difficult to overcome, or IPTV and other synchronous media streaming services would be far less costly to run. On an institutional network, though, multicast can be used to great effect. It's a fairly old method as well. In my first IT job we used to install the operating system on workstations by PXE booting them to an imaging tool and then multicasting the disk image across the network... this way we could do hundreds of machines at once at just about disk saturation rate. This kind of thing isn't readily achievable without the use of multicast or broadcast traffic. The tool was Norton Ghost, which has apparently supported this mode of operation since 1998!
Despite its simplicity, seems to be overengineered.