How to use Ubuntu server 14.04 as Airplay reciever
|
Posts: 2
Threads: 1
Joined: Feb 2016
Reputation:
0
[Not Solved]
Feb 13, 2016, 12:31 PM
Hey I'm interested in knowing how to set this up correctly. I have read this article:
http://blog.earth-works.com/2014/01/14/t...tu-server/
But it is out of date and doesn't work 100%. For example I'm not sure how to get Pulse Audio to start as a service.
Any help would be appreciated
Thanks
Posts: 1,646
Threads: 2
Joined: Aug 2015
Reputation:
42
[Not Solved]
Feb 13, 2016, 01:02 PM
(This post was last modified: Feb 13, 2016, 01:02 PM by Mike.)
You are in luck. I just happen to have an unpublished guide created by Chun de Lac, please test it and let me know if it works.
Apple's AirPlay protocol is a great way to stream audio, video and photos from an AirPlay-enabled device to an AirPlay receiver. This guide will focus on streaming audio only, to an open-source AirPlay audio-receiver Shairport-Sync. Shairport-Sync is an AirPort Express emulator for Linux, with multi-room capability and audio synchronisation, developed by Mike Brady. Shairport-Sync does not support video or photo streaming. Fortunately, Shairport-Sync is very well documented by its author, for more information I encourage you to visit his website. This guide was tested on Cubox-i4Pro, with Igor Pečovnik's Debian Jessie distro v2.8. However, Shairport-Sync should also work well on Raspbian, Ubuntu, Arch Linux and OpenWRT, as its author claims. The final part of this guide is dedicated to a well known 2-seconds delay, that is built into the AirPlay protocol. This 2-seconds lag is probably less important when playing music only, but it might be pretty annoying if you want to watch a video on your tablet or PC, while streaming the audio channel to your AirPlay audio receiver. We will see what applications are well capable of handling the 2-seconds delay, and what solutions are available for the others.
[table id=raspvsbanana /]
Prerequisities and Equipment
My home network configuration is pretty simple, with Cubox-i4Pro and Windows PC connected by ethernet to the wireless router. The iDevices are connected over Wi-Fi.
AirPlay Senders
Nowadays one can stream from many devices, from various platforms and operating systems. This guide is limited to the following AirPlay senders:
- iPad 4 iOS 7.1.2
- iPhone 6 iOS 8.3
- PC with MS Windows 7 64-bit
AirPlay Audio Receiver
Cubox-i4Pro is the device I used for testing this guide, but you can use Raspberry Pi, or other devices installed with Linux operating system.
Sound Card
Cubox-i4Pro is equipped with two embedded sound cards, SPDIF and HDMI. If your device does not have an embedded sound card, or you don't want to use it, you can use an external sound card. I use SPDIF embedded sound card connected with a TOSLINK optical cable to my 10 years old audio amplifier Pioneer VSX-D512.
Install Shairport-Sync
Before installing the Shairport-Sync software, we need to install a number of modules needed to compile it. Run the following commands to install the modules.
Code:
sudo apt-get install autoconf libtool libdaemon-dev libasound2-dev libpopt-dev -y
Install Avahi
Code:
sudo apt-get install avahi-daemon libavahi-client-dev -y
Install OpenSSL
Code:
sudo apt-get install libssl-dev -y
Install this module if you want support for libsoxr-based high-quality resampling. This library is not part of Raspbian yet, instructions for how to build it from source are available at LIBSOXR.md.
Code:
sudo apt-get install libsoxr-dev -y
Go to home directory
Download Shairport-Sync
Code:
git clone https://github.com/mikebrady/shairport-sync.git
Next, go to the shairport-sync directory
and execute the following command
Configure Shairport-Sync, omit the
if the libsoxr library is not available
Code:
./configure --with-alsa --with-avahi --with-ssl=openssl --with-soxr
Compile the source code
Now we have two options. We can just install the compiled source code, or we can build a .deb package and install it, to make eventual uninstallation easier.
Option 1: Install the compiled source code
Restart your system to launch Shairport-Sync at startup
Option 2: Build and install a Debian package
Code:
sudo apt-get install checkinstall -y
sudo checkinstall
At the Debian package creation selection, you need to enter a software version, therefore enter 3 and press ENTER to continue.
Code:
*****************************************
**** Debian package creation selected ***
*****************************************
This package will be built according to these values:
0 - Maintainer: [ root@cubox-i ]
1 - Summary: [ Shairport-Sync ]
2 - Name: [ shairport ]
3 - Version: [ sync ]
4 - Release: [ 1 ]
5 - License: [ GPL ]
6 - Group: [ checkinstall ]
7 - Architecture: [ armhf ]
8 - Source location: [ shairport-sync ]
9 - Alternate source location: [ ]
10 - Requires: [ ]
11 - Provides: [ shairport ]
12 - Conflicts: [ ]
13 - Replaces: [ ]
Enter a number to change any of them or press ENTER to continue:
Now enter the version number, in my case the current version was 2.2.4, see the release notes.
A Debian package will be built and installed.
Restart your system to launch Shairport-Sync at startup
If needed, you can uninstall the package anytime by running
Code:
sudo service shairport-sync stop
sudo dpkg -r shairport
Configuring Shairport-Sync
AirPlay streaming worked right after I installed Shairport-Sync and rebooted my Cubox-i4Pro. A default configuration of Shairport-Sync is installed at
Code:
/etc/init.d/shairport-sync
, the configuation options are well documented by the
author. You also can get an extensive help by launching Shairport-Sync with the -h option.
Changing the name of my AirPlay audio receiver from the default name "Shairport Sync on Cubox-i" to "AirPlay HTPCGuides" was very simple. It can be easily done by adding option
Code:
-a "AirPlay HTPCGuides"
into the init script. Replace AirPlay HTPCGuides by a name you desire. Edit the init script by opening it in a text editor, in this example we will use a nano text editor. If you do not have nano on your system, you can install it by
Code:
sudo apt-get install nano -y
Open the init script
Code:
sudo nano /etc/init.d/shairport-sync
and change the line 66 from
Code:
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- -d || return 2
to
Code:
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- -d -a "AirPlay HTPCGuides" || return 2
Save changes by pressing Ctrl+O, confirm the file name by pressing ENTER and exit the nano text editor by pressing Ctrl+X.
Test the init script by restarting Shairport-Sync
Code:
sudo service shairport-sync restart
If you want to use other than the default sound card, you need to change an argument for ALSA audio system. ALSA arguments follow a
on the command line, see the examples in the init script and on the Shairport-Sync website.
The -d option is the one which allows you to specify the audio device to use. The default soundcard to use is 0 (zero), the value of the -d argument would be hw:0. If you want to use soundcard 1, the value would be hw:1, etc. You can list the sound cards available on your system by launching
.
Code:
root@cubox-i:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: imxspdif [imx-spdif], device 0: S/PDIF PCM snd-soc-dummy-dai-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: imxhdmisoc [imx-hdmi-soc], device 0: i.MX HDMI Audio Tx hdmi-hifi-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
For example, if I would like to use the HDMI audio output device, I'd launch Shairport-Sync by adding -d hw:1 into the init script
Code:
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- -d -a "AirPlay HTPCGuides" -- -d hw:1 || return 2
You can try to switch the audio mixer from software (default) to hardware, by using the ALSA option
(after
). However, with that option Shairport-Sync won't launch on my system. The command alsamixer reported "This sound device does not have any controls", so I removed the
argument and use AirPlay with default audio mixer.
Posts: 2
Threads: 1
Joined: Feb 2016
Reputation:
0
[Not Solved]
Feb 14, 2016, 12:48 AM
Wow thanks for the unbelievably quick reply.
Unfortunately this guide didn't work for me. I'm running Ubuntu server 14.04 on an old laptop that I keep in a closet and I treat as headless. In the first code line the author gives some dependencies to install, but left out
from the list given in the git-hub page. I didn't have that already so by going back I found the issue and was able to get farther along.
Then when I got to either the
or the make your own package step depending on which option I tried, it got me to a point where it said
Code:
cp scripts/shairport-sync.service
cp: missing destination file operand after ‘scripts/shairport-sync.service’
Try 'cp --help' for more information.
I'm pretty new to linux so I had no idea where to go from here.
Fortunately in the documentation on github they have a ppa that hosts it as a package for my version. After adding the repository it was a simple apt-get command and it works great. I did the part in the above guide where it shows how to rename your shairport-sync and that worked.
I don't have the knowledge to know why I had problems.
Thanks again for your help! I was ultimately successful.
Posts: 1
Threads: 0
Joined: Jul 2017
Reputation:
0
[Not Solved]
Jul 27, 2017, 06:14 PM
(This post was last modified: Jul 27, 2017, 06:16 PM by Naturofix.)
(Feb 13, 2016, 12:31 PM)Makeshift Moose Wrote: Hey I'm interested in knowing how to set this up correctly. I have read this article:
http://blog.earth-works.com/2014/01/14/t...tu-server/
But it is out of date and doesn't work 100%. For example I'm not sure how to get Pulse Audio to start as a service.
Any help would be appreciated
Thanks
The Kodi Media player has airplay for audio already built in. Hopefully soon they will be able to re-introduce video support.
Very easy to install, runs on all operating systems
Just enable airplay in system service settings and you're good to go
https://kodi.tv/
Posts: 1
Threads: 0
Joined: Jan 2022
Reputation:
0
[Not Solved]
Jan 04, 2022, 04:31 PM
Audio playback is included in the Kodi Media Player. They should be able to reinstate video support shortly, hopefully. The online game stick merge web browser is featured here.
|
|
Recent Posts
|
Split Tunnel Docker Containers
jonesPhedra Mar 27, 2024, 03:10 AM
|
Plex server not powerful enough, but only with s...
jonesPhedra Mar 27, 2024, 03:02 AM
|
About Swap
jonescelinaa Mar 18, 2024, 02:11 AM
|
game Geometry Dash Scratch
jonescelinaa Jan 31, 2024, 04:21 AM
|
Find My IP Address - Kodi - Updated
jonesPhedra Jan 29, 2024, 02:56 AM
|
Latest unread posts | Unanswered posts |
|