Introduction: Stream IOS Audio to Chromecast - Cheap Sonos
A while ago, I got bored with having 1 Audio Receiver and decided I wanted something a bit more. I decided a Multiroom audio setup was naturally the next step. I began looking into existing projects and found that most you had to pay for, and adding new features to it looked to be more of a headache than I really wanted.
So naturally, I decided to build my own Multi Room Audio setup that takes advantage of multiple projects and simply combines them into one.
The project is located at https://github.com/bareinhard/iOS-Audio-to-Chromecast
I have spent a lot of time trying to make it as simple as possible and ready to use out of the box.
As such, it is extremely easy to install but does require some specific things.
What's different about this than other similar projects?
From my understanding most of the solutions to accomplish a similar goal will require an application on each device that will want to play iOS music to the Chrome Cast Audio devices.
Whats nice about this project is that after the first initial installation outline below, the only thing that will be required on each new device wanting to stream music to the Chrome Cast audio devices, is that the device will need to connect to the AirPlay device and begin music. After you set the proper sink with 1 device (given the Pi hasn't been rebooted since) the music should start streaming to the last used sink (Chrome Cast Audio Device/Group). There are 2 options for changing the output devices (via terminal, or the Web UI).
What is needed?
- Raspberry Pi 2/3
- Ethernet (Preferred, haven't tried with Wifi Only)
- SDCard running Ubuntu MATE
- Keyboard and mouse for setup (only a keyboard is actually needed, but a mouse makes it a bit easier)
- 2+ Chromecast Audios, 1 will work, but then its not really multiroom
- Google Home App
- You will need to download ubuntu mate, Ubuntu MATE ,click here
- Then unzip the .img.xz file with WinZip or your favorite zip program.
- From there load the image onto your SD Card (I found this will take a good 30-40 minutes)
- Now start up your Pi with the SD card loaded up.
- Setup Ubuntu to your liking ( I found logging in automatically to work best with how this project works )
- Open up a terminal
- run sudo apt-get install git -y
- then, git clone https://github.com/bareinhard/iOS-Audio-to-Chromecast
- then, cd iOS-Audio-to-Chromecast
- then, chmod +x ./install.sh
- then, sudo ./install.sh
- Follow the prompts, the install should take a good chunk of time over 20 minutes (depending on how recently you have updated). Once completed please reboot.
- Now the important parts, setup your chromecast audios and create device groups inside the Google Home App. You simply go to your devices in the top right of the app, then click the settings for any Chromecast Audio device and tap create groups. Here is how you will be able to add more devices in the Web UI.
- Now go to your Pi's address on port 2221 in your web browser. Example: 192.168.0.18:2221, the web browser will show a page with all the devices found on your network
Everything is functional after the reboot
How to begin?
- On your iOS device, start playing music then navigate to AirPlay in your Control Panel (swipe up from the bottom). Tap on the AirPlay, then locate the device that you named in the install script
- Now navigate to your web browser with the pi's address on port 2221, example 192.168.0.18:2221
- To change the output of the music (to different rooms aka sinks) simply click on the desired button (names are under the buttons), shortly music should begin streaming to your chromecast audio.
The Web UI was made for use with chrome, some functionality may be missing in other browsers. Thats it?
For the moment yes. That being said I am still working on getting a working bluetooth connection (without the hassle of having to pair manually each time), and integrate devices such as the Amazon Echo, or other devices that aren't iOS or Chromecast capatible.
Additionally, I am always looking to add new content and better features to my projects. So feel free to reach out and suggest some new ideas, or things that aren't quite working right.
Hope you all enjoy it!