From 1ff0fb0c69e1a2b85605e04f6af8f18aa8dd0181 Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Fri, 13 Jul 2018 09:15:00 +0100 Subject: [PATCH 01/70] Update RELEASENOTES.md --- RELEASENOTES.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index fa7c36dc..9caa20dd 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -1,6 +1,11 @@ +Version 3.2.1 +==== +**Bug Fix** +* Fix a bug that was causing problems when `soxr` interpolation was chosen. Problems included instability during or after a play session and possibly an extremely slight click on very loud audio. + Version 3.2 ==== -Version 3.2 is equivalent to 3.2RC13. +Version 3.2 is equivalent to 3.2RC13. Please see the [Release Notes for 3.2](https://github.com/mikebrady/shairport-sync/releases/tag/3.2) Version 3.2RC13 ==== From 4f346878835c763ef77d668ee1d3eecf19eeab16 Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Fri, 13 Jul 2018 09:26:16 +0100 Subject: [PATCH 02/70] Update RELEASENOTES.md --- RELEASENOTES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 9caa20dd..b7750513 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -1,7 +1,7 @@ Version 3.2.1 ==== **Bug Fix** -* Fix a bug that was causing problems when `soxr` interpolation was chosen. Problems included instability during or after a play session and possibly an extremely slight click on very loud audio. +* Fix a bug that was causing problems when `soxr` interpolation was chosen. Problems included instability during or after a play session and possibly an extremely slight click on very loud audio. Thanks are due to [hanaguro](https://github.com/hanaguro), [FnasBas](https://github.com/FnasBas), [priitohlo](https://github.com/priitohlo) and [David Krmpotić]https://github.com/davidhq. Version 3.2 ==== From 303d59aa922dd4fe5e132871d4cd4936236efb66 Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Fri, 13 Jul 2018 09:27:44 +0100 Subject: [PATCH 03/70] Update RELEASENOTES.md --- RELEASENOTES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index b7750513..05ee666f 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -1,7 +1,7 @@ Version 3.2.1 ==== **Bug Fix** -* Fix a bug that was causing problems when `soxr` interpolation was chosen. Problems included instability during or after a play session and possibly an extremely slight click on very loud audio. Thanks are due to [hanaguro](https://github.com/hanaguro), [FnasBas](https://github.com/FnasBas), [priitohlo](https://github.com/priitohlo) and [David Krmpotić]https://github.com/davidhq. +* Fix a bug that was causing problems when `soxr` interpolation was chosen. Problems included instability during or after a play session and possibly an extremely slight click on very loud audio. Thanks are due to [hanaguro](https://github.com/hanaguro), [FnasBas](https://github.com/FnasBas), [priitohlo](https://github.com/priitohlo) and [David Krmpotić](https://github.com/davidhq). Version 3.2 ==== From 5bd19c61096b8ddee9443b05f2d07adac2aeabf4 Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Fri, 13 Jul 2018 09:28:54 +0100 Subject: [PATCH 04/70] Update RELEASENOTES.md --- RELEASENOTES.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 05ee666f..2f1d4a7c 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -1,11 +1,13 @@ Version 3.2.1 ==== +Please see the [Release Notes for 3.2](https://github.com/mikebrady/shairport-sync/releases/tag/3.2). + **Bug Fix** * Fix a bug that was causing problems when `soxr` interpolation was chosen. Problems included instability during or after a play session and possibly an extremely slight click on very loud audio. Thanks are due to [hanaguro](https://github.com/hanaguro), [FnasBas](https://github.com/FnasBas), [priitohlo](https://github.com/priitohlo) and [David Krmpotić](https://github.com/davidhq). Version 3.2 ==== -Version 3.2 is equivalent to 3.2RC13. Please see the [Release Notes for 3.2](https://github.com/mikebrady/shairport-sync/releases/tag/3.2) +Version 3.2 is equivalent to 3.2RC13. Please see the [Release Notes for 3.2](https://github.com/mikebrady/shairport-sync/releases/tag/3.2). Version 3.2RC13 ==== From 92629b137f0953ef6dc7297bcf3e41f9d9644ca3 Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Fri, 13 Jul 2018 09:30:42 +0100 Subject: [PATCH 05/70] Update shairport-sync.spec --- shairport-sync.spec | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/shairport-sync.spec b/shairport-sync.spec index a9a3d8ca..cbd25fe1 100644 --- a/shairport-sync.spec +++ b/shairport-sync.spec @@ -1,5 +1,5 @@ Name: shairport-sync -Version: 3.2 +Version: 3.2.1 Release: 1%{?dist} Summary: AirTunes emulator. Multi-Room with Audio Synchronisation # MIT licensed except for tinysvcmdns under BSD, @@ -67,6 +67,8 @@ getent passwd %{name} &> /dev/null || useradd --system -c "%{name} User" \ %license LICENSES %changelog +* Fri Jul 13 2018 Mike Brady 3.1.7 From 8563921b190d18f40ae56a30a32907bb34a67524 Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Fri, 13 Jul 2018 10:52:07 +0100 Subject: [PATCH 06/70] Update RELEASENOTES.md --- RELEASENOTES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 2f1d4a7c..de6a5116 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -3,7 +3,7 @@ Version 3.2.1 Please see the [Release Notes for 3.2](https://github.com/mikebrady/shairport-sync/releases/tag/3.2). **Bug Fix** -* Fix a bug that was causing problems when `soxr` interpolation was chosen. Problems included instability during or after a play session and possibly an extremely slight click on very loud audio. Thanks are due to [hanaguro](https://github.com/hanaguro), [FnasBas](https://github.com/FnasBas), [priitohlo](https://github.com/priitohlo) and [David Krmpotić](https://github.com/davidhq). +* Fix a bug that was causing problems when `soxr` interpolation was chosen. Problems included instability during or after a play session and possibly an extremely slight click on very loud audio. Thanks are due to [hanaguro](https://github.com/hanaguro), [FnasBas](https://github.com/FnasBas), [priitohlo](https://github.com/priitohlo), [David Krmpotić](https://github.com/davidhq) and [artenverho](https://github.com/artenverho). Version 3.2 ==== From c8f9b10e099be72dc40d8e70060a706655e5d319 Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Sat, 21 Jul 2018 11:04:32 +0100 Subject: [PATCH 07/70] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 577a9cbc..8c3a096a 100644 --- a/README.md +++ b/README.md @@ -94,7 +94,7 @@ If you wish to build and install the latest version of Shairport Sync on Debian, **Remove Old Versions Of Shairport Sync** -You should check to see if `shairport-sync` is already installed – you can use the command `$ which shairport-sync` to find where it is located, if installed. If it is installed you should delete it – you may need superuser privileges. After deleting, check again in case further copies are installed elsewhere. +You should check to see if `shairport-sync` is already installed – you can use the command `$ which shairport-sync` to find where it is located, if installed. If it is installed you should delete it – you may need superuser privileges. After deleting, check again in case further copies are installed elsewhere. You should also remove the file `/etc/systemd/system/shairport-sync.service` if it exists. **Determine The Configuration Needed** From 889ab91b00aa80ffcd450547bd5acadf060e6db3 Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Mon, 23 Jul 2018 22:15:55 +0100 Subject: [PATCH 08/70] Update TROUBLESHOOTING.md --- TROUBLESHOOTING.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/TROUBLESHOOTING.md b/TROUBLESHOOTING.md index 262bca6b..6d69a1fb 100644 --- a/TROUBLESHOOTING.md +++ b/TROUBLESHOOTING.md @@ -7,6 +7,8 @@ In this brief document will be listed some problems and some solutions, some pro 1. Before starting, ensure that your software is up-to-date. 2. Set the `interpolation` in the `general` section of the configuration file to `basic` as the `soxr` setting can cause lower-powered devices to bog down at critical times, e.g. see [this report](https://github.com/mikebrady/shairport-sync/issues/631#issuecomment-366305203). +### WiFi and Microwaves +Microwaves can interfere with WiFi -- see [here](http://sciabc.us/F6Gaa) for example. ### WiFi adapter running in power-saving / low-power mode From 601f860a34f13d4ebd10d25545a0387d54f4062f Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Mon, 20 Aug 2018 20:39:11 +0100 Subject: [PATCH 09/70] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8c3a096a..756415a5 100644 --- a/README.md +++ b/README.md @@ -285,9 +285,10 @@ $ sudo systemctl enable shairport-sync **Complete installation into a System V system** -If you have chosen the `--with-systemv` configuration option, enter: +If you have chosen the `--with-systemv` configuration option, then, to enable Shairport Sync to start automatically at system startup, enter: ``` $ sudo update-rc.d shairport-sync defaults 90 10 +$ sudo update-rc.d shairport-sync enable ``` **Man Page** From 619398d950df07ce1a261f0b5882394ae4254ffa Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Tue, 21 Aug 2018 19:53:01 +0100 Subject: [PATCH 10/70] Update to correspond a little better to the upstream instructions. --- LIBSOXR.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/LIBSOXR.md b/LIBSOXR.md index 8a81cfdd..6a6fb871 100644 --- a/LIBSOXR.md +++ b/LIBSOXR.md @@ -14,11 +14,11 @@ On FreeBSD: * Download the `libsoxr source`: ``` -$ git clone git://git.code.sf.net/p/soxr/code libsoxr +$ git clone git://git.code.sf.net/p/soxr/code soxr-code ``` -* `cd` into the `libsoxr` directory and start the build process: +* `cd` into the `soxr-code` directory and start the build process: ``` -$ cd libsoxr +$ cd soxr-code $ ./go ``` Be patient! This takes a long time on a Raspberry Pi -- it looks like it gets stuck around 40% or 50%, but it will finish if you let it. From 4fbd368eb3c6f899c863f22a9ca8d965d193c989 Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Tue, 21 Aug 2018 19:57:46 +0100 Subject: [PATCH 11/70] Update LIBSOXR.md --- LIBSOXR.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LIBSOXR.md b/LIBSOXR.md index 6a6fb871..73b8bceb 100644 --- a/LIBSOXR.md +++ b/LIBSOXR.md @@ -1,7 +1,7 @@ The Raspbian image at the time of writing is the `May 2016` version, with the release date of `2016-05-10`. It does not include `libsoxr`, but it is available as a package via `apt-get`. -Alternatively, `libsoxr` is very easy to compile. Here are very brief instructions to download, compile and install it: +Alternatively, `libsoxr`, part of [The Sox Resampler Library](https://sourceforge.net/projects/soxr/), is very easy to compile. Here are very brief instructions to download, compile and install it: * Install `cmake`. This is used in the building of libsoxr. On Linuxes such as Debian/Ubuntu/Raspbian: ``` @@ -21,7 +21,7 @@ $ git clone git://git.code.sf.net/p/soxr/code soxr-code $ cd soxr-code $ ./go ``` -Be patient! This takes a long time on a Raspberry Pi -- it looks like it gets stuck around 40% or 50%, but it will finish if you let it. +Be patient! This takes a long time on a first-generation Raspberry Pi -- it looks like it gets stuck around 40% or 50%, but it will finish if you let it. Having compiled `libsoxr`, it must now must be installed: ``` From c8f349512337327470549b54586fdcf819e332b8 Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Tue, 21 Aug 2018 20:17:44 +0100 Subject: [PATCH 12/70] Update LIBSOXR.md --- LIBSOXR.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LIBSOXR.md b/LIBSOXR.md index 73b8bceb..cce2f191 100644 --- a/LIBSOXR.md +++ b/LIBSOXR.md @@ -32,7 +32,7 @@ Finally, for Shairport Sync to be able to locate `libsoxr` during compilation, y On Linuxes such as Debian/Ubuntu/Raspbian: ``` -# ldconfig -v +# ldconfig ``` On FreeBSD you must add the location of the `soxr.pc` file to the `PKG_CONFIG_PATH`, if it exists, and define it otherwise. Here is what you do if it doesn't already exist: ``` From 4115ff76cf648839b86d29f86e2da91b6b9ca327 Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Sat, 25 Aug 2018 10:51:18 +0100 Subject: [PATCH 13/70] Update INSTALL.md --- INSTALL.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/INSTALL.md b/INSTALL.md index 6cacd24c..d45477c6 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -11,6 +11,8 @@ Do the usual update and upgrade: # apt-get upgrade # rpi-update ``` +**Note:** it is a particularly good idea to update the Pi's firmware using `rpi-update` because, at this time of writing (September 2018), a [significant improvement](https://github.com/raspberrypi/firmware/commit/200c2f4dd54b2048b5dcb8661ea3f232beb7d81e) has been made to the [timing software](https://github.com/raspberrypi/firmware/issues/1026) of the built-in audio DAC's drivers. + (Separately, if you haven't done so already, consider using the `raspi-config` tool to expand the file system to use the entire card.) ### Activate the Improved Audio Driver @@ -64,7 +66,7 @@ Now to configure Shairport Sync. Here are the important options for the Shairpor // Sample Configuration File for Shairport Sync on a Raspberry Pi using the built-in audio DAC general = { - drift_tolerance_in_seconds = 0.010; + // drift_tolerance_in_seconds = 0.010; // this is no longer necessary if you have updated the Pi's firmware using rpi-update (see above). volume_range_db = 50; }; From 5b548faaf74e5a2237b31cdb25df2505866cafdb Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Sat, 25 Aug 2018 10:55:07 +0100 Subject: [PATCH 14/70] Update CAR INSTALL.md --- CAR INSTALL.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CAR INSTALL.md b/CAR INSTALL.md index bdd40669..38fbb55d 100644 --- a/CAR INSTALL.md +++ b/CAR INSTALL.md @@ -44,6 +44,9 @@ The first thing to do on a Pi would be to use the `raspi-config` tool to expand # apt-get upgrade # rpi-update ``` +**Note:** if you are using a full-size Rapsberry Pi with the built-in DAC, it is a particularly good idea to update the Pi's firmware using `rpi-update` because, at this time of writing (September 2018), a [significant improvement](https://github.com/raspberrypi/firmware/commit/200c2f4dd54b2048b5dcb8661ea3f232beb7d81e) has been made to the [timing software](https://github.com/raspberrypi/firmware/issues/1026) of the built-in audio DAC's drivers. + +(Separately, if you haven't done so already, consider using the `raspi-config` tool to expand the file system to use the entire card.) ### Shairport Sync First, install the packages needed by Shairport Sync: From 0c4ca8d5b9977ea40dbd62766be336b5d1f2b347 Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Sat, 25 Aug 2018 11:05:10 +0100 Subject: [PATCH 15/70] Update README.md --- README.md | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 756415a5..66802510 100644 --- a/README.md +++ b/README.md @@ -357,11 +357,30 @@ Note: Shairport Sync can take configuration settings from command line options. **Raspberry Pi** -The Raspberry Pi Models A and B have a built-in audio DAC that is connected to the device's headphone jack. An updated audio driver has greatly improved the quality of the output – see [#525](https://github.com/mikebrady/shairport-sync/issues/525) for details. To activate the updated driver, add the line: +The Raspberry Pi Models A and B have a built-in audio DAC that is connected to the device's headphone jack. To get the full benefits of recent improvements in the Pi's software and firmware, you should update the Raspberry Pi as follows: + +Do the usual update and upgrade: +``` +# apt-get update +# apt-get upgrade +``` +Update the Pi's firmware: +``` +# rpi-update +``` +Recent improvements include: +* An updated audio driver has greatly improved the quality of the output – see [#525](https://github.com/mikebrady/shairport-sync/issues/525) for details. +* A [significant improvement](https://github.com/raspberrypi/firmware/commit/200c2f4dd54b2048b5dcb8661ea3f232beb7d81e) has been made to the [timing software](https://github.com/raspberrypi/firmware/issues/1026) of the built-in audio DAC's drivers. + +Separately, if you haven't done so already, consider using the `raspi-config` tool to expand the file system to use the entire card. + +To activate the updated audio driver referred to above, add the line: ``` audio_pwm_mode=2 ``` -to `/boot/config.txt`. To make Shairport Sync output to the built-in audio DAC and use its hardware mixer, in the `alsa` section of the configuration file, set the output device and mixer as follows: +to `/boot/config.txt`. + +To make Shairport Sync output to the built-in audio DAC and use its hardware mixer, in the `alsa` section of the configuration file, set the output device and mixer as follows: ``` alsa = { From 9a6734e265d6daa80a387d46698bbf3acf6a31f6 Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Sat, 25 Aug 2018 11:12:11 +0100 Subject: [PATCH 16/70] Update README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 66802510..72fb9703 100644 --- a/README.md +++ b/README.md @@ -357,7 +357,7 @@ Note: Shairport Sync can take configuration settings from command line options. **Raspberry Pi** -The Raspberry Pi Models A and B have a built-in audio DAC that is connected to the device's headphone jack. To get the full benefits of recent improvements in the Pi's software and firmware, you should update the Raspberry Pi as follows: +The Raspberry Pi Models A and B have a built-in audio DAC that is connected to the device's headphone jack. To get the benefits of improvements in the Pi's software and firmware, you should update the Raspberry Pi as follows: Do the usual update and upgrade: ``` @@ -368,9 +368,9 @@ Update the Pi's firmware: ``` # rpi-update ``` -Recent improvements include: +Recent (September 2018) improvements include: * An updated audio driver has greatly improved the quality of the output – see [#525](https://github.com/mikebrady/shairport-sync/issues/525) for details. -* A [significant improvement](https://github.com/raspberrypi/firmware/commit/200c2f4dd54b2048b5dcb8661ea3f232beb7d81e) has been made to the [timing software](https://github.com/raspberrypi/firmware/issues/1026) of the built-in audio DAC's drivers. +* A [significant improvement](https://github.com/raspberrypi/firmware/commit/200c2f4dd54b2048b5dcb8661ea3f232beb7d81e) has been made to the [timing software](https://github.com/raspberrypi/firmware/issues/1026) of the built-in audio DAC's drivers. It should be incorporated in firmware from Raspbian 4.14.66-v7 onwards. Separately, if you haven't done so already, consider using the `raspi-config` tool to expand the file system to use the entire card. @@ -394,7 +394,7 @@ Apart from a loud click when used for the first time after power-up, it is quite From a user's point of view, the effect of using this setting is to move the minimum usable volume all the way down to the bottom of the user's volume control, rather than have the minimum usable volume concentrated very close to the maximum volume. -Another setting to consider is the `general` `drift_tolerance_in_seconds` setting: you should set it to a larger tolerance, say 10 milliseconds – `drift_tolerance_in_seconds=0.010;` – to reduce the amount of overcorrection that seems to occur when using the Raspberry Pi's built-in DAC. +If you have not updated the Pi's firmware as discussed above, then another setting to consider is the `general` `drift_tolerance_in_seconds` setting: you should set it to a larger tolerance, say 10 milliseconds – `drift_tolerance_in_seconds=0.010;` – to reduce the amount of overcorrection that seems to occur when using the Raspberry Pi's built-in DAC. *Command Line Arguments* From 3cd88ee57b576628db552ce93f0a056a1893c506 Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Sat, 25 Aug 2018 11:12:47 +0100 Subject: [PATCH 17/70] Update INSTALL.md --- INSTALL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/INSTALL.md b/INSTALL.md index d45477c6..36703da2 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -11,7 +11,7 @@ Do the usual update and upgrade: # apt-get upgrade # rpi-update ``` -**Note:** it is a particularly good idea to update the Pi's firmware using `rpi-update` because, at this time of writing (September 2018), a [significant improvement](https://github.com/raspberrypi/firmware/commit/200c2f4dd54b2048b5dcb8661ea3f232beb7d81e) has been made to the [timing software](https://github.com/raspberrypi/firmware/issues/1026) of the built-in audio DAC's drivers. +**Note:** it is a particularly good idea to update the Pi's firmware using `rpi-update` because, at this time of writing (September 2018), a [significant improvement](https://github.com/raspberrypi/firmware/commit/200c2f4dd54b2048b5dcb8661ea3f232beb7d81e) has been made to the [timing software](https://github.com/raspberrypi/firmware/issues/1026) of the built-in audio DAC's drivers. It should be incorporated in firmware from Raspbian 4.14.66-v7 onwards. (Separately, if you haven't done so already, consider using the `raspi-config` tool to expand the file system to use the entire card.) From 9bd5b99d3c2280bdb829493fbaf4f608ed832bd6 Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Sat, 25 Aug 2018 11:13:45 +0100 Subject: [PATCH 18/70] Update INSTALL.md --- INSTALL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/INSTALL.md b/INSTALL.md index 36703da2..87c158cd 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -11,7 +11,7 @@ Do the usual update and upgrade: # apt-get upgrade # rpi-update ``` -**Note:** it is a particularly good idea to update the Pi's firmware using `rpi-update` because, at this time of writing (September 2018), a [significant improvement](https://github.com/raspberrypi/firmware/commit/200c2f4dd54b2048b5dcb8661ea3f232beb7d81e) has been made to the [timing software](https://github.com/raspberrypi/firmware/issues/1026) of the built-in audio DAC's drivers. It should be incorporated in firmware from Raspbian 4.14.66-v7 onwards. +**Note:** At this time of writing (September 2018), it is a good idea to update the Pi's firmware using `rpi-update` because a [significant improvement](https://github.com/raspberrypi/firmware/commit/200c2f4dd54b2048b5dcb8661ea3f232beb7d81e) has been made to the [timing software](https://github.com/raspberrypi/firmware/issues/1026) of the built-in audio DAC's drivers. It should be incorporated in firmware from Raspbian 4.14.66-v7 onwards. (Separately, if you haven't done so already, consider using the `raspi-config` tool to expand the file system to use the entire card.) From a2b0344670878091bcf2810e3b8d383aecb17a30 Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Sat, 25 Aug 2018 11:15:33 +0100 Subject: [PATCH 19/70] Update CAR INSTALL.md --- CAR INSTALL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CAR INSTALL.md b/CAR INSTALL.md index 38fbb55d..d02f83fe 100644 --- a/CAR INSTALL.md +++ b/CAR INSTALL.md @@ -44,7 +44,7 @@ The first thing to do on a Pi would be to use the `raspi-config` tool to expand # apt-get upgrade # rpi-update ``` -**Note:** if you are using a full-size Rapsberry Pi with the built-in DAC, it is a particularly good idea to update the Pi's firmware using `rpi-update` because, at this time of writing (September 2018), a [significant improvement](https://github.com/raspberrypi/firmware/commit/200c2f4dd54b2048b5dcb8661ea3f232beb7d81e) has been made to the [timing software](https://github.com/raspberrypi/firmware/issues/1026) of the built-in audio DAC's drivers. +**Note:** If you are following this guide but are using a full-size Rapsberry Pi with the built-in DAC, then, at this time of writing (September 2018) it is a good idea to update the Pi's firmware using `rpi-update` because a [significant improvement](https://github.com/raspberrypi/firmware/commit/200c2f4dd54b2048b5dcb8661ea3f232beb7d81e) has been made to the [timing software](https://github.com/raspberrypi/firmware/issues/1026) of the built-in audio DAC's drivers. It should be incorporated in firmware from Raspbian 4.14.66-v7 onwards. (Separately, if you haven't done so already, consider using the `raspi-config` tool to expand the file system to use the entire card.) From fd790c768631db6ed8e2207d770ae9f5097946b1 Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Tue, 28 Aug 2018 16:52:25 +0100 Subject: [PATCH 20/70] Update INSTALL.md --- INSTALL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/INSTALL.md b/INSTALL.md index 87c158cd..86cd9bec 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -26,7 +26,7 @@ If you are using WiFi, you should turn off WiFi Power Management: ``` # iwconfig wlan0 power off ``` -WiFi Power Management will put the WiFi system in low-power mode when the WiFi system considered inactive, and in this mode it may not respond to events initiated from the network, such as AirPlay requests. Hence, WiFi Power Management should be turned off. (See [TROUBLESHOOTING.md](https://github.com/mikebrady/shairport-sync/blob/master/TROUBLESHOOTING.md#wifi-adapter-running-in-power-saving--low-power-mode) for more details.) +WiFi Power Management will put the WiFi system in low-power mode when the WiFi system is considered inactive, and in this mode it may not respond to events initiated from the network, such as AirPlay requests. Hence, WiFi Power Management should be turned off. (See [TROUBLESHOOTING.md](https://github.com/mikebrady/shairport-sync/blob/master/TROUBLESHOOTING.md#wifi-adapter-running-in-power-saving--low-power-mode) for more details.) Reboot the Pi. From b57a344e9344e3a1dfe5897827eb8f26e8ecee98 Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Tue, 28 Aug 2018 17:00:41 +0100 Subject: [PATCH 21/70] Update INSTALL.md --- INSTALL.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/INSTALL.md b/INSTALL.md index 86cd9bec..229674d7 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -42,6 +42,8 @@ Remove it as follows: ``` Do this until no more copies of `shairport-sync` are found. +You should also remove the file `/etc/systemd/system/shairport-sync.service` if it exists. + ### Build and Install Okay, now let's get the tools and sources for building and installing Shairport Sync. From 3027e50ec3c81eb77bb5eb7d8acdf3dabf9aef86 Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Tue, 28 Aug 2018 17:02:41 +0100 Subject: [PATCH 22/70] Update INSTALL.md --- INSTALL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/INSTALL.md b/INSTALL.md index 229674d7..22b6d8b6 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -42,7 +42,7 @@ Remove it as follows: ``` Do this until no more copies of `shairport-sync` are found. -You should also remove the file `/etc/systemd/system/shairport-sync.service` if it exists. +You should also remove the initialisation script file `/etc/systemd/system/shairport-sync.service` if it exists – a new one will be installed that will point to the version you will have compiled. ### Build and Install Okay, now let's get the tools and sources for building and installing Shairport Sync. From 74de5702412c46ac38426f1e938fda335ce79173 Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Tue, 28 Aug 2018 17:05:46 +0100 Subject: [PATCH 23/70] Update INSTALL.md --- INSTALL.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 22b6d8b6..57d0438d 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -30,7 +30,7 @@ WiFi Power Management will put the WiFi system in low-power mode when the WiFi s Reboot the Pi. -### Remove Old Copies +### Remove Old Copies and Old Startup Scripts Before you begin building Shairport Sync, it's best to search for and remove any existing copies of the application, called `shairport-sync`. Use the command `$ which shairport-sync` to find them. For example, if `shairport-sync` has been installed previously, this might happen: ``` $ which shairport-sync @@ -42,7 +42,7 @@ Remove it as follows: ``` Do this until no more copies of `shairport-sync` are found. -You should also remove the initialisation script file `/etc/systemd/system/shairport-sync.service` if it exists – a new one will be installed that will point to the version you will have compiled. +You should also remove the initialisation script files `/etc/systemd/system/shairport-sync.service` and `/etc/init.d/shairport-sync` if they exist – new ones will be installed in necessary. ### Build and Install Okay, now let's get the tools and sources for building and installing Shairport Sync. From 7587ef99a0841f2ee55bfa1e510dd6f6016a8c9e Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Tue, 28 Aug 2018 17:07:30 +0100 Subject: [PATCH 24/70] Update README.md --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 72fb9703..e7b864d6 100644 --- a/README.md +++ b/README.md @@ -92,10 +92,11 @@ Sincere thanks to all package contributors! If you wish to build and install the latest version of Shairport Sync on Debian, Ubuntu, Fedora or Arch platforms, please continue to follow these instructions. When the program has been compiled and installed, refer to the section on Configuring Shairport Sync that follows. To build Shairport Sync from sources on FreeBSD please refer to [FREEBSD.md](https://github.com/mikebrady/shairport-sync/blob/master/FREEBSD.md). -**Remove Old Versions Of Shairport Sync** +**Remove Old Versions of Shairport Sync and its Startup Scripts** -You should check to see if `shairport-sync` is already installed – you can use the command `$ which shairport-sync` to find where it is located, if installed. If it is installed you should delete it – you may need superuser privileges. After deleting, check again in case further copies are installed elsewhere. You should also remove the file `/etc/systemd/system/shairport-sync.service` if it exists. +You should check to see if `shairport-sync` is already installed – you can use the command `$ which shairport-sync` to find where it is located, if installed. If it is installed you should delete it – you may need superuser privileges. After deleting, check again in case further copies are installed elsewhere. +You should also remove the initialisation script files `/etc/systemd/system/shairport-sync.service` and `/etc/init.d/shairport-sync` if they exist – new ones will be installed in necessary. **Determine The Configuration Needed** From 52af6c6c9a8ed6aa0b96ebaa698bb3b8e1e42ab5 Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Fri, 21 Sep 2018 17:36:49 +0100 Subject: [PATCH 25/70] Unreference the pa stream when finished with it, so that it the sink can go idle. --- audio_pa.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/audio_pa.c b/audio_pa.c index ac1570e0..0d3aa28b 100644 --- a/audio_pa.c +++ b/audio_pa.c @@ -147,6 +147,7 @@ static void deinit(void) { static void start(__attribute__((unused)) int sample_rate, __attribute__((unused)) int sample_format) { + debug(1,"pa start"); uint32_t buffer_size_in_bytes = (uint32_t)2 * 2 * RATE * 0.1; // hard wired in here // debug(1, "pa_buffer size is %u bytes.", buffer_size_in_bytes); @@ -275,7 +276,8 @@ static void stop(void) { audio_umb = audio_lmb + audio_size; audio_occupancy = 0; - // debug(1, "finish with stream"); + debug(1,"pa stop"); + pa_stream_unref(stream); pa_stream_disconnect(stream); } From 0dce0525351fb831236cde1dbec2a9a6f5177752 Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Fri, 21 Sep 2018 17:45:13 +0100 Subject: [PATCH 26/70] Remove debug messages from pa start and pa stop --- audio_pa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/audio_pa.c b/audio_pa.c index 0d3aa28b..59207003 100644 --- a/audio_pa.c +++ b/audio_pa.c @@ -147,7 +147,7 @@ static void deinit(void) { static void start(__attribute__((unused)) int sample_rate, __attribute__((unused)) int sample_format) { - debug(1,"pa start"); + // debug(1,"pa start"); uint32_t buffer_size_in_bytes = (uint32_t)2 * 2 * RATE * 0.1; // hard wired in here // debug(1, "pa_buffer size is %u bytes.", buffer_size_in_bytes); @@ -276,7 +276,7 @@ static void stop(void) { audio_umb = audio_lmb + audio_size; audio_occupancy = 0; - debug(1,"pa stop"); + // debug(1,"pa stop"); pa_stream_unref(stream); pa_stream_disconnect(stream); } From 2f73f1ac663e24658cf9a981396a98840892252d Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Fri, 21 Sep 2018 18:22:23 +0100 Subject: [PATCH 27/70] Revert previous change which was to unreference a stream prior to disconnection -- not needed. --- audio_pa.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/audio_pa.c b/audio_pa.c index 59207003..b46054d4 100644 --- a/audio_pa.c +++ b/audio_pa.c @@ -138,7 +138,6 @@ static int init(__attribute__((unused)) int argc, __attribute__((unused)) char * } static void deinit(void) { - // debug(1, "pa deinit start"); pa_threaded_mainloop_stop(mainloop); pa_threaded_mainloop_free(mainloop); // debug(1, "pa deinit done"); @@ -147,7 +146,6 @@ static void deinit(void) { static void start(__attribute__((unused)) int sample_rate, __attribute__((unused)) int sample_format) { - // debug(1,"pa start"); uint32_t buffer_size_in_bytes = (uint32_t)2 * 2 * RATE * 0.1; // hard wired in here // debug(1, "pa_buffer size is %u bytes.", buffer_size_in_bytes); @@ -277,7 +275,6 @@ static void stop(void) { audio_occupancy = 0; // debug(1,"pa stop"); - pa_stream_unref(stream); pa_stream_disconnect(stream); } From 1121d6a0e4c323ca723cca94b49d535f26a925a2 Mon Sep 17 00:00:00 2001 From: gregs007 Date: Wed, 3 Oct 2018 12:03:35 -0400 Subject: [PATCH 28/70] Update INSTALL.md Just a quick note that this modification of config.txt isn't needed in newer versions of Raspbian. --- INSTALL.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/INSTALL.md b/INSTALL.md index 57d0438d..f506b2ce 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -19,6 +19,8 @@ Do the usual update and upgrade: Check the file `/boot/config.txt` and, if it's not there already, add the following line: ``` audio_pwm_mode=2 + +(Note that this isn't needed in the most recent versions of Raspbian as it will enable this driver mode by default) ``` ### Turn Off WiFi Power Management From f619a658ca4b836e3f0ad53110108b813ab04fe3 Mon Sep 17 00:00:00 2001 From: Robert Lange Date: Sat, 6 Oct 2018 17:46:11 +0200 Subject: [PATCH 29/70] normalize whitespaces in scripts/shairport-sync.conf --- scripts/shairport-sync.conf | 88 ++++++++++++++++++------------------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/scripts/shairport-sync.conf b/scripts/shairport-sync.conf index 2f7f1378..b3880603 100644 --- a/scripts/shairport-sync.conf +++ b/scripts/shairport-sync.conf @@ -29,9 +29,9 @@ general = // volume_control_profile = "standard" ; // use this advanced setting to specify how the airplay volume is transferred to the mixer volume. // "standard" makes the volume change more quickly at lower volumes and slower at higher volumes. // "flat" makes the volume change at the same rate at all volumes. -// run_this_when_volume_is_set = "/full/path/to/application/and/args"; // Run the specified application whenever the volume control is set or changed. -// The desired AirPlay volume is appended to the end of the command line – leave a space if you want it treated as an extra argument. -// AirPlay volume goes from 0 to -30 and -144 means "mute". +// run_this_when_volume_is_set = "/full/path/to/application/and/args"; // Run the specified application whenever the volume control is set or changed. +// The desired AirPlay volume is appended to the end of the command line – leave a space if you want it treated as an extra argument. +// AirPlay volume goes from 0 to -30 and -144 means "mute". // regtype = "_raop._tcp"; // Use this advanced setting to set the service type and transport to be advertised by Zeroconf/Bonjour. Default is "_raop._tcp". // playback_mode = "stereo"; // This can be "stereo", "mono", "reverse stereo", "both left" or "both right". Default is "stereo". @@ -39,17 +39,17 @@ general = // the original Shairport decoder by David Hammerton or the Apple Lossless Audio Codec (ALAC) decoder written by Apple. // interface = "name"; // Use this advanced setting to specify the interface on which Shairport Sync should provide its service. Leave it commented out to get the default, which is to select the interface(s) automatically. -// audio_backend_latency_offset_in_seconds = 0.0; // Set this offset to compensate for a fixed delay in the audio back end. E.g. if the output device delays by 100 ms, set this to -0.1. -// audio_backend_buffer_desired_length_in_seconds = 0.15; // If set too small, buffer underflow occurs on low-powered machines. Too long and the response time to volume changes becomes annoying. Default is 0.15 seconds in the alsa backend, 0.35 seconds in the pa backend and 1.0 seconds otherwise. -// audio_backend_silent_lead_in_time = 2.0; // This optional advanced setting, from 0.0 and 4.0 seconds, sets the length of the period of silence that precedes the start of the audio. The default is the latency, usually 2.0 seconds. Values greater than the latency are ignored. Values that are too low will affect initial synchronisation. -// dbus_service_bus = "system"; // The Shairport Sync dbus interface, if selected at compilation, will appear -// as "org.gnome.ShairportSync" on the whichever bus you specify here: "system" (default) or "session". -// mpris_service_bus = "system"; // The Shairport Sync mpris interface, if selected at compilation, will appear -// as "org.gnome.ShairportSync" on the whichever bus you specify here: "system" (default) or "session". +// audio_backend_latency_offset_in_seconds = 0.0; // Set this offset to compensate for a fixed delay in the audio back end. E.g. if the output device delays by 100 ms, set this to -0.1. +// audio_backend_buffer_desired_length_in_seconds = 0.15; // If set too small, buffer underflow occurs on low-powered machines. Too long and the response time to volume changes becomes annoying. Default is 0.15 seconds in the alsa backend, 0.35 seconds in the pa backend and 1.0 seconds otherwise. +// audio_backend_silent_lead_in_time = 2.0; // This optional advanced setting, from 0.0 and 4.0 seconds, sets the length of the period of silence that precedes the start of the audio. The default is the latency, usually 2.0 seconds. Values greater than the latency are ignored. Values that are too low will affect initial synchronisation. +// dbus_service_bus = "system"; // The Shairport Sync dbus interface, if selected at compilation, will appear +// as "org.gnome.ShairportSync" on the whichever bus you specify here: "system" (default) or "session". +// mpris_service_bus = "system"; // The Shairport Sync mpris interface, if selected at compilation, will appear +// as "org.gnome.ShairportSync" on the whichever bus you specify here: "system" (default) or "session". }; // Advanced parameters for controlling how Shairport Sync runs a play session -sessioncontrol = +sessioncontrol = { // run_this_before_play_begins = "/full/path/to/application and args"; // make sure the application has executable permission. If it's a script, include the shebang (#!/bin/...) on the first line // run_this_after_play_ends = "/full/path/to/application and args"; // make sure the application has executable permission. If it's a script, include the shebang (#!/bin/...) on the first line @@ -63,72 +63,72 @@ sessioncontrol = // These are parameters for the "alsa" audio back end. alsa = { -// output_device = "default"; // the name of the alsa output device. Use "alsamixer" or "aplay" to find out the names of devices, mixers, etc. -// mixer_control_name = "PCM"; // the name of the mixer to use to adjust output volume. If not specified, volume in adjusted in software. -// mixer_device = "default"; // the mixer_device default is whatever the output_device is. Normally you wouldn't have to use this. -// output_rate = 44100; // can be 44100, 88200, 176400 or 352800, but the device must have the capability. -// output_format = "S16"; // can be "U8", "S8", "S16", "S24", "S24_3LE", "S24_3BE" or "S32", but the device must have the capability. Except where stated using (*LE or *BE), endianness matches that of the processor. -// disable_synchronization = "no"; // Set to "yes" to disable synchronization. Default is "no". -// period_size = ; // Use this optional advanced setting to set the alsa period size near to this value -// buffer_size = ; // Use this optional advanced setting to set the alsa buffer size near to this value -// use_mmap_if_available = "yes"; // Use this optional advanced setting to control whether MMAP-based output is used to communicate with the DAC. Default is "yes" -// use_hardware_mute_if_available = "no"; // Use this optional advanced setting to control whether the hardware in the DAC is used for muting. Default is "no", for compatibility with other audio players. +// output_device = "default"; // the name of the alsa output device. Use "alsamixer" or "aplay" to find out the names of devices, mixers, etc. +// mixer_control_name = "PCM"; // the name of the mixer to use to adjust output volume. If not specified, volume in adjusted in software. +// mixer_device = "default"; // the mixer_device default is whatever the output_device is. Normally you wouldn't have to use this. +// output_rate = 44100; // can be 44100, 88200, 176400 or 352800, but the device must have the capability. +// output_format = "S16"; // can be "U8", "S8", "S16", "S24", "S24_3LE", "S24_3BE" or "S32", but the device must have the capability. Except where stated using (*LE or *BE), endianness matches that of the processor. +// disable_synchronization = "no"; // Set to "yes" to disable synchronization. Default is "no". +// period_size = ; // Use this optional advanced setting to set the alsa period size near to this value +// buffer_size = ; // Use this optional advanced setting to set the alsa buffer size near to this value +// use_mmap_if_available = "yes"; // Use this optional advanced setting to control whether MMAP-based output is used to communicate with the DAC. Default is "yes" +// use_hardware_mute_if_available = "no"; // Use this optional advanced setting to control whether the hardware in the DAC is used for muting. Default is "no", for compatibility with other audio players. }; // Parameters for the "sndio" audio back end. All are optional. sndio = { -// device = "snd/0"; // optional setting to set the name of the output device. Default is the sndio system default. -// rate = 44100; // optional setting which can be 44100, 88200, 176400 or 352800, but the device must have the capability. Default is 44100. -// format = "S16"; // optional setting which can be "U8", "S8", "S16", "S24", "S24_3LE", "S24_3BE" or "S32", but the device must have the capability. Except where stated using (*LE or *BE), endianness matches that of the processor. -// round = ; // advanced optional setting to set the period size near to this value -// bufsz = ; // advanced optional setting to set the buffer size near to this value +// device = "snd/0"; // optional setting to set the name of the output device. Default is the sndio system default. +// rate = 44100; // optional setting which can be 44100, 88200, 176400 or 352800, but the device must have the capability. Default is 44100. +// format = "S16"; // optional setting which can be "U8", "S8", "S16", "S24", "S24_3LE", "S24_3BE" or "S32", but the device must have the capability. Except where stated using (*LE or *BE), endianness matches that of the processor. +// round = ; // advanced optional setting to set the period size near to this value +// bufsz = ; // advanced optional setting to set the buffer size near to this value }; // Parameters for the "pa" PulseAudio backend. pa = { -// application_name = "Shairport Sync"; //Set this to the name that should appear in the Sounds "Applications" tab when Shairport Sync is active. +// application_name = "Shairport Sync"; //Set this to the name that should appear in the Sounds "Applications" tab when Shairport Sync is active. }; // Parameters for the "pipe" audio back end, a back end that directs raw CD-style audio output to a pipe. No interpolation is done. pipe = { -// name = "/path/to/pipe"; // there is no default pipe name for the output +// name = "/path/to/pipe"; // there is no default pipe name for the output }; // These are no configuration file parameters for the "stdout" audio back end. No interpolation is done. // These are no configuration file parameters for the "ao" audio back end. No interpolation is done. -// Static latency settings are deprecated and the settings have been removed. +// Static latency settings are deprecated and the settings have been removed. dsp = { ////////////////////////////////////////// -// This convolution filter can be used to apply almost any correction to the audio signal, like frequency and phase correction. -// For example you could measure (with a good microphone and a sweep-sine) the frequency response of your speakers + room, -// and apply a correction to get a flat response curve. +// This convolution filter can be used to apply almost any correction to the audio signal, like frequency and phase correction. +// For example you could measure (with a good microphone and a sweep-sine) the frequency response of your speakers + room, +// and apply a correction to get a flat response curve. ////////////////////////////////////////// // -// convolution = "yes"; // Activate the convolution filter. -// convolution_ir_file = "impulse.wav"; // Impulse Response file to be convolved to the audio stream -// convolution_gain = -4.0; // Static gain applied to prevent clipping during the convolution process -// convolution_max_length = 44100; // Truncate the input file to this length in order to save CPU. +// convolution = "yes"; // Activate the convolution filter. +// convolution_ir_file = "impulse.wav"; // Impulse Response file to be convolved to the audio stream +// convolution_gain = -4.0; // Static gain applied to prevent clipping during the convolution process +// convolution_max_length = 44100; // Truncate the input file to this length in order to save CPU. ////////////////////////////////////////// -// This loudness filter is used to compensate for human ear non linearity. -// When the volume decreases, our ears loose more sentisitivity in the low range frequencies than in the mid range ones. -// This filter aims at compensating for this loss, applying a variable gain to low frequencies depending on the volume. -// More info can be found here: https://en.wikipedia.org/wiki/Equal-loudness_contour -// For this filter to work properly, you should disable (or set to a fix value) all other volume control and only let shairport-sync control your volume. -// The setting "loudness_reference_volume_db" should be set at the volume reported by shairport-sync when listening to music at a normal listening volume. +// This loudness filter is used to compensate for human ear non linearity. +// When the volume decreases, our ears loose more sentisitivity in the low range frequencies than in the mid range ones. +// This filter aims at compensating for this loss, applying a variable gain to low frequencies depending on the volume. +// More info can be found here: https://en.wikipedia.org/wiki/Equal-loudness_contour +// For this filter to work properly, you should disable (or set to a fix value) all other volume control and only let shairport-sync control your volume. +// The setting "loudness_reference_volume_db" should be set at the volume reported by shairport-sync when listening to music at a normal listening volume. ////////////////////////////////////////// // -// loudness = "yes"; // Activate the filter -// loudness_reference_volume_db = -20.0; // Above this level the filter will have no effect anymore. Below this level it will gradually boost the low frequencies. +// loudness = "yes"; // Activate the filter +// loudness_reference_volume_db = -20.0; // Above this level the filter will have no effect anymore. Below this level it will gradually boost the low frequencies. }; From 8ec8ac8a40ee80e913075cb963e420a3eb3260cd Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Wed, 10 Oct 2018 14:37:21 +0100 Subject: [PATCH 30/70] Update CAR INSTALL.md --- CAR INSTALL.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CAR INSTALL.md b/CAR INSTALL.md index d02f83fe..d1fffc2f 100644 --- a/CAR INSTALL.md +++ b/CAR INSTALL.md @@ -40,8 +40,8 @@ Close the file and carefully dismount and eject the two drives. Remove the SD ca ### Boot, Configure, Update The first thing to do on a Pi would be to use the `raspi-config` tool to expand the file system to use the entire card. It might be useful to change the `hostname` too. Next, do the usual update and upgrade: ``` -# apt-get update -# apt-get upgrade +# apt update +# apt upgrade # rpi-update ``` **Note:** If you are following this guide but are using a full-size Rapsberry Pi with the built-in DAC, then, at this time of writing (September 2018) it is a good idea to update the Pi's firmware using `rpi-update` because a [significant improvement](https://github.com/raspberrypi/firmware/commit/200c2f4dd54b2048b5dcb8661ea3f232beb7d81e) has been made to the [timing software](https://github.com/raspberrypi/firmware/issues/1026) of the built-in audio DAC's drivers. It should be incorporated in firmware from Raspbian 4.14.66-v7 onwards. From c2b2b335c45fe197b9b6787da156e7710867f253 Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Wed, 10 Oct 2018 14:38:20 +0100 Subject: [PATCH 31/70] Update INSTALL.md --- INSTALL.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index f506b2ce..8488f160 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -7,8 +7,8 @@ In the commands below, note the convention that a `#` prompt means you are in su ### Configure and Update Do the usual update and upgrade: ``` -# apt-get update -# apt-get upgrade +# apt update +# apt upgrade # rpi-update ``` **Note:** At this time of writing (September 2018), it is a good idea to update the Pi's firmware using `rpi-update` because a [significant improvement](https://github.com/raspberrypi/firmware/commit/200c2f4dd54b2048b5dcb8661ea3f232beb7d81e) has been made to the [timing software](https://github.com/raspberrypi/firmware/issues/1026) of the built-in audio DAC's drivers. It should be incorporated in firmware from Raspbian 4.14.66-v7 onwards. From aed05f90ddf3c0a4c34a5d603d5c17f041b66957 Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Wed, 10 Oct 2018 14:40:51 +0100 Subject: [PATCH 32/70] Update README.md --- README.md | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index e7b864d6..db8b3c0c 100644 --- a/README.md +++ b/README.md @@ -153,15 +153,15 @@ Many Linux distributions have Avahi and OpenSSL already in place, so normally it Debian, Ubuntu and Raspbian users can get the basics with: -- `# apt-get install build-essential git xmltoman` – these may already be installed. -- `# apt-get install autoconf automake libtool libdaemon-dev libpopt-dev libconfig-dev` -- `# apt-get install libasound2-dev` for the ALSA libraries -- `# apt-get install libpulse-dev` for the PulseAudio libraries -- `# apt-get install avahi-daemon libavahi-client-dev` if you want to use Avahi (recommended). -- `# apt-get install libssl-dev` if you want to use OpenSSL and libcrypto, or use mbed TLS otherwise. -- `# apt-get install libmbedtls-dev` if you want to use mbed TLS, or use OpenSSL/libcrypto otherwise. You can still use PolarSSL with `apt-get install libpolarssl-dev` if you want to use PolarSSL, but it is deprecated as it's not longer being supported. -- `# apt-get install libsoxr-dev` if you want support for libsoxr-based resampling. This library is in many recent distributions; if not, instructions for how to build it from source for Rasbpian/Debian Wheezy are available at [LIBSOXR.md](https://github.com/mikebrady/shairport-sync/blob/master/LIBSOXR.md). -- `# apt-get install libsndfile1-dev` if you want to use the convolution filter. +- `# apt install build-essential git xmltoman` – these may already be installed. +- `# apt install autoconf automake libtool libdaemon-dev libpopt-dev libconfig-dev` +- `# apt install libasound2-dev` for the ALSA libraries +- `# apt install libpulse-dev` for the PulseAudio libraries +- `# apt install avahi-daemon libavahi-client-dev` if you want to use Avahi (recommended). +- `# apt install libssl-dev` if you want to use OpenSSL and libcrypto, or use mbed TLS otherwise. +- `# apt install libmbedtls-dev` if you want to use mbed TLS, or use OpenSSL/libcrypto otherwise. You can still use PolarSSL with `apt install libpolarssl-dev` if you want to use PolarSSL, but it is deprecated as it's not longer being supported. +- `# apt install libsoxr-dev` if you want support for libsoxr-based resampling. This library is in many recent distributions; if not, instructions for how to build it from source for Rasbpian/Debian Wheezy are available at [LIBSOXR.md](https://github.com/mikebrady/shairport-sync/blob/master/LIBSOXR.md). +- `# apt install libsndfile1-dev` if you want to use the convolution filter. If you wish to include the Apple ALAC decoder, you need install it first – please refer to the [ALAC](https://github.com/mikebrady/alac) repository for more information. @@ -362,8 +362,8 @@ The Raspberry Pi Models A and B have a built-in audio DAC that is connected to t Do the usual update and upgrade: ``` -# apt-get update -# apt-get upgrade +# apt update +# apt upgrade ``` Update the Pi's firmware: ``` @@ -378,6 +378,8 @@ Separately, if you haven't done so already, consider using the `raspi-config` to To activate the updated audio driver referred to above, add the line: ``` audio_pwm_mode=2 + +(Note that this isn't needed in the most recent versions of Raspbian as it will enable this driver mode by default) ``` to `/boot/config.txt`. From 430e3c4cbb597621d17db0f6ae15f6ee1488e976 Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Wed, 10 Oct 2018 15:12:54 +0100 Subject: [PATCH 33/70] Update INSTALL.md --- INSTALL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/INSTALL.md b/INSTALL.md index 8488f160..3812c03c 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -51,7 +51,7 @@ Okay, now let's get the tools and sources for building and installing Shairport First, install the packages needed by Shairport Sync: ``` -# apt-get install build-essential git xmltoman autoconf automake libtool libdaemon-dev \ +# apt install build-essential git xmltoman autoconf automake libtool libdaemon-dev \ libpopt-dev libconfig-dev libasound2-dev avahi-daemon libavahi-client-dev libssl-dev ``` Next, download Shairport Sync, configure it, compile and install it: From 7d04f682fbbe4507ec5eadf78e2230947212d500 Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Wed, 10 Oct 2018 15:14:44 +0100 Subject: [PATCH 34/70] Update CAR INSTALL.md --- CAR INSTALL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CAR INSTALL.md b/CAR INSTALL.md index d1fffc2f..190aaacf 100644 --- a/CAR INSTALL.md +++ b/CAR INSTALL.md @@ -51,7 +51,7 @@ The first thing to do on a Pi would be to use the `raspi-config` tool to expand ### Shairport Sync First, install the packages needed by Shairport Sync: ``` -# apt-get install build-essential git xmltoman autoconf automake libtool libdaemon-dev libpopt-dev libconfig-dev libasound2-dev avahi-daemon libavahi-client-dev libssl-dev +# apt install build-essential git xmltoman autoconf automake libtool libdaemon-dev libpopt-dev libconfig-dev libasound2-dev avahi-daemon libavahi-client-dev libssl-dev ``` Next, download Shairport Sync, configure it, compile and install it: ``` From f84083b5fce1632dbee69514727935450886330c Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Wed, 10 Oct 2018 15:15:50 +0100 Subject: [PATCH 35/70] Update CAR INSTALL.md --- CAR INSTALL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CAR INSTALL.md b/CAR INSTALL.md index 190aaacf..15f4ab45 100644 --- a/CAR INSTALL.md +++ b/CAR INSTALL.md @@ -90,7 +90,7 @@ The `alsa` settings are specific to the Pimoroni PHAT -- it does not have a hard ### Extra Packages A number of packages to enable the Pi to work as a WiFi base station are needed: ``` -# apt-get install hostapd isc-dhcp-server +# apt install hostapd isc-dhcp-server ``` Disable both of these services from starting at boot time (this is because we will launch them sequentially later on): ``` From 13ca2a4fa391fe1933b661ffe9c3b01c2c8849d3 Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Wed, 10 Oct 2018 15:52:47 +0100 Subject: [PATCH 36/70] Update INSTALL.md --- INSTALL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/INSTALL.md b/INSTALL.md index 3812c03c..8f84cd85 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -16,7 +16,7 @@ Do the usual update and upgrade: (Separately, if you haven't done so already, consider using the `raspi-config` tool to expand the file system to use the entire card.) ### Activate the Improved Audio Driver -Check the file `/boot/config.txt` and, if it's not there already, add the following line: +Check the file `/boot/config.txt` and, if it's not there already, add the following line and reboot afterwards: ``` audio_pwm_mode=2 From 7f5f30209d227a87711030f3a234e440c3d7d478 Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Sun, 14 Oct 2018 10:15:23 +0100 Subject: [PATCH 37/70] Fix a parsing bug when calling the run_this_when_volume_is_set script/program. --- common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common.c b/common.c index 7709e36f..e6974bfc 100644 --- a/common.c +++ b/common.c @@ -565,7 +565,7 @@ void command_set_volume(double volume) { inform("Couldn't allocate memory for set_volume argument string"); } else { memset(command_buffer, 0, command_buffer_size); - snprintf(command_buffer, command_buffer_size, "%s%f", config.cmd_set_volume, volume); + snprintf(command_buffer, command_buffer_size, "%s %f", config.cmd_set_volume, volume); // debug(1,"command_buffer is \"%s\".",command_buffer); int argC; char **argV; From a7ee65cda0fe08f303ae56f0882658c090ff4b15 Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Sun, 14 Oct 2018 10:18:16 +0100 Subject: [PATCH 38/70] Allow for changed AirPlay latencies in iOS 12 and mac OS Mojave (AirPlay version 371 and onwards) --- rtp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtp.c b/rtp.c index 6a588b0b..a5db0aaa 100644 --- a/rtp.c +++ b/rtp.c @@ -300,7 +300,7 @@ void *rtp_control_receiver(void *arg) { uint16_t flags = nctohs(&packet[2]); int64_t la = sync_rtp_timestamp - rtp_timestamp_less_latency; // debug(3, "Latency derived just from the sync packet is %" PRId64 " frames.", la); - if ((flags == 7) || ((conn->AirPlayVersion > 0) && (conn->AirPlayVersion <= 353))) { + if ((flags == 7) || ((conn->AirPlayVersion > 0) && (conn->AirPlayVersion <= 353)) || ((conn->AirPlayVersion > 0) && (conn->AirPlayVersion >= 371))) { la += config.fixedLatencyOffset; // debug(3, "A fixed latency offset of %d frames has been added, giving a latency of // " From c7b1d4ba7ec2293f49a6b88d824774285dc8c501 Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Sun, 14 Oct 2018 10:20:00 +0100 Subject: [PATCH 39/70] Update latencies for iOS 12 / macOS Mojave and fix a bug calling the run_this_when_volume_is_set program/script. --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index ed9e1067..37f8a732 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.50]) -AC_INIT([shairport-sync], [3.2.1], [mikebrady@eircom.net]) +AC_INIT([shairport-sync], [3.2.2], [mikebrady@eircom.net]) AM_INIT_AUTOMAKE AC_CONFIG_SRCDIR([shairport.c]) AC_CONFIG_HEADERS([config.h]) From 24425308decb20bfc87a54e2a4444567df941019 Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Sun, 14 Oct 2018 10:24:03 +0100 Subject: [PATCH 40/70] Update RELEASENOTES.md --- RELEASENOTES.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index de6a5116..520bb1a7 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -1,3 +1,13 @@ +Version 3.2.2 +==== +Please see the [Release Notes for 3.2](https://github.com/mikebrady/shairport-sync/releases/tag/3.2). + +**Enhancement** +* Update latency calculations for iOS 12 / mac OS Mojave to retain synchronisation between AirPlay audio and video. + +**Bug Fix** +* Fixed a bug that prevented the `run_this_when_volume_is_set` script or program from running. + Version 3.2.1 ==== Please see the [Release Notes for 3.2](https://github.com/mikebrady/shairport-sync/releases/tag/3.2). From 91d8a4c29e36bc452619fd9a7908bb3ffb96d97e Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Sun, 14 Oct 2018 10:24:31 +0100 Subject: [PATCH 41/70] Update RELEASENOTES.md --- RELEASENOTES.md | 1 - 1 file changed, 1 deletion(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 520bb1a7..c0239143 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -10,7 +10,6 @@ Please see the [Release Notes for 3.2](https://github.com/mikebrady/shairport-sy Version 3.2.1 ==== -Please see the [Release Notes for 3.2](https://github.com/mikebrady/shairport-sync/releases/tag/3.2). **Bug Fix** * Fix a bug that was causing problems when `soxr` interpolation was chosen. Problems included instability during or after a play session and possibly an extremely slight click on very loud audio. Thanks are due to [hanaguro](https://github.com/hanaguro), [FnasBas](https://github.com/FnasBas), [priitohlo](https://github.com/priitohlo), [David Krmpotić](https://github.com/davidhq) and [artenverho](https://github.com/artenverho). From 5e0e33c4dc13cd63ab66555c7bcca7f15798d787 Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Sun, 14 Oct 2018 14:33:17 +0100 Subject: [PATCH 42/70] Update RELEASENOTES.md --- RELEASENOTES.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index c0239143..f7a45f27 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -3,10 +3,10 @@ Version 3.2.2 Please see the [Release Notes for 3.2](https://github.com/mikebrady/shairport-sync/releases/tag/3.2). **Enhancement** -* Update latency calculations for iOS 12 / mac OS Mojave to retain synchronisation between AirPlay audio and video. +* Adjust the latency calculation to accommodate changes in iOS 12 and AirPlay connections from macOS Mojave. Thanks to [artenverho](https://github.com/artenverho) who first reported the issue. **Bug Fix** -* Fixed a bug that prevented the `run_this_when_volume_is_set` script or program from running. +* Fixed a problem that prevented the `run_this_when_volume_is_set` script or program from running when the volume control is changed. Thanks to [shaven](https://github.com/shaven) for the report. Version 3.2.1 ==== @@ -16,7 +16,7 @@ Version 3.2.1 Version 3.2 ==== -Version 3.2 is equivalent to 3.2RC13. Please see the [Release Notes for 3.2](https://github.com/mikebrady/shairport-sync/releases/tag/3.2). +Version 3.2 is equivalent to 3.2RC13. Version 3.2RC13 ==== From c9b5df2114783abfa6567fa5a76b206989306fe2 Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Sun, 14 Oct 2018 14:35:43 +0100 Subject: [PATCH 43/70] Update shairport-sync.spec --- shairport-sync.spec | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/shairport-sync.spec b/shairport-sync.spec index cbd25fe1..9d4f83c7 100644 --- a/shairport-sync.spec +++ b/shairport-sync.spec @@ -1,5 +1,5 @@ Name: shairport-sync -Version: 3.2.1 +Version: 3.2.2 Release: 1%{?dist} Summary: AirTunes emulator. Multi-Room with Audio Synchronisation # MIT licensed except for tinysvcmdns under BSD, @@ -67,6 +67,8 @@ getent passwd %{name} &> /dev/null || useradd --system -c "%{name} User" \ %license LICENSES %changelog +* Sun Oct 14 2018 Mike Brady Date: Sun, 14 Oct 2018 14:45:36 +0100 Subject: [PATCH 44/70] Update RELEASENOTES.md --- RELEASENOTES.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index f7a45f27..c895cb7e 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -5,6 +5,8 @@ Please see the [Release Notes for 3.2](https://github.com/mikebrady/shairport-sy **Enhancement** * Adjust the latency calculation to accommodate changes in iOS 12 and AirPlay connections from macOS Mojave. Thanks to [artenverho](https://github.com/artenverho) who first reported the issue. +* Formatting of the settings file `shairport-sync.conf` has been fixed, thanks to the work of [roblan](https://github.com/roblan). + **Bug Fix** * Fixed a problem that prevented the `run_this_when_volume_is_set` script or program from running when the volume control is changed. Thanks to [shaven](https://github.com/shaven) for the report. From 6014a77d47e2866632c6d76241896a2b27f7adc4 Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Sun, 14 Oct 2018 14:46:11 +0100 Subject: [PATCH 45/70] Update RELEASENOTES.md --- RELEASENOTES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index c895cb7e..94cee6b8 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -3,7 +3,7 @@ Version 3.2.2 Please see the [Release Notes for 3.2](https://github.com/mikebrady/shairport-sync/releases/tag/3.2). **Enhancement** -* Adjust the latency calculation to accommodate changes in iOS 12 and AirPlay connections from macOS Mojave. Thanks to [artenverho](https://github.com/artenverho) who first reported the issue. +* Latency calculations have been updated to accommodate changes in iOS 12 and AirPlay connections from macOS Mojave. Thanks to [artenverho](https://github.com/artenverho) who first reported the issue. * Formatting of the settings file `shairport-sync.conf` has been fixed, thanks to the work of [roblan](https://github.com/roblan). From d34fdff849e9234da3ed06001c57780da3bd341d Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Thu, 18 Oct 2018 13:15:03 +0100 Subject: [PATCH 46/70] Update CONTRIBUTING.md --- CONTRIBUTING.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ab4d5442..9ae6b8e2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -10,7 +10,8 @@ Changes and additions in the development branch make their way eventually to the Issue Reports ---- -Issue reports are welcome, but before you report an issue, please have a look though the existing [issues](https://github.com/mikebrady/shairport-sync/issues), both open and closed, and check for hints in the [TROUBLESHOOTING](TROUBLESHOOTING.md) page. It would be great to give some details of the device and version of Linux or FreeBSD in use along with the version of Shairport Sync you are using (use `$ shairport-sync -V` to get this). Then, if possible, some diagnostic information from the log or logfile would be useful. +Issue reports are welcome, but before you report an issue, please check that your version of Shairport Sync is up to date. You'll find details of releases at [Shairport Sync Releases](https://github.com/mikebrady/shairport-sync/releases). +Then, please have a look though the existing [issues](https://github.com/mikebrady/shairport-sync/issues), both open and closed, and check for hints in the [TROUBLESHOOTING](TROUBLESHOOTING.md) page. It would be great to give some details of the device and version of Linux or FreeBSD in use along with version and build configuration of Shairport Sync you are using (use `$ shairport-sync -V` to get this). Then, if possible, some diagnostic information from the log or logfile would be useful. In general, a log verbosity of 2 is adequate (`-vv`, or the relevant entry in the configuration file), and it's usually helpful if statistics have been enabled (`--statistics` on the command line, or the relevant entry in the configuration file). From 4e32bfe0fdb8458e6cf9d09714fa24cd9e6fa858 Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Thu, 18 Oct 2018 13:15:53 +0100 Subject: [PATCH 47/70] Create ISSUES.md --- ISSUES.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 ISSUES.md diff --git a/ISSUES.md b/ISSUES.md new file mode 100644 index 00000000..1364553e --- /dev/null +++ b/ISSUES.md @@ -0,0 +1,15 @@ +Issue Reports +---- +Issue reports are welcome, but before you report an issue, please check that your version of Shairport Sync is up to date. You'll find details of releases at [Shairport Sync Releases](https://github.com/mikebrady/shairport-sync/releases). +Then, please have a look though the existing [issues](https://github.com/mikebrady/shairport-sync/issues), both open and closed, and check for hints in the [TROUBLESHOOTING](TROUBLESHOOTING.md) page. It would be great to give some details of the device and version of Linux or FreeBSD in use along with version and build configuration of Shairport Sync you are using (use `$ shairport-sync -V` to get this). Then, if possible, some diagnostic information from the log or logfile would be useful. + +In general, a log verbosity of 2 is adequate (`-vv`, or the relevant entry in the configuration file), and it's usually helpful if statistics have been enabled (`--statistics` on the command line, or the relevant entry in the configuration file). + +If you are pasting in code or a log file, format it as code by preceding it and following it with a line containing exactly three backquotes and nothing else ([see here](https://guides.github.com/features/mastering-markdown/) for more on formatting): + +\`\`\` +``` +code or log file entries +``` +\`\`\` + From a68d8ff9bdf75f3667dd9586c2a1d1ec19c214eb Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Sat, 3 Nov 2018 12:59:17 +0000 Subject: [PATCH 48/70] Update README.md --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index db8b3c0c..6ecdc908 100644 --- a/README.md +++ b/README.md @@ -323,7 +323,11 @@ general = // ... other general settings }; ``` -(Remember, anything preceded by `//` is a comment and will have no effect on the setting of Shairport Sync.) No backend is specified here, so it will default to the `alsa` backend if more than one back end has been compiled. To route the output to PulseAudio, add: +(Remember, anything preceded by `//` is a comment and will have no effect on the setting of Shairport Sync.) + +**Important:** You should *never* use an important password as the AirPlay password for a Shairport Sync player -- the password is stored in Shairport Sync's configuration file in plain text and is thus completely vulnerable. + +No backend is specified here, so it will default to the `alsa` backend if more than one back end has been compiled. To route the output to PulseAudio, add: ``` output_backend = "pa"; From 3717ef41fabc35c2188eb90a6c013ec412e57a95 Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Sat, 3 Nov 2018 13:01:49 +0000 Subject: [PATCH 49/70] Update INSTALL.md --- INSTALL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/INSTALL.md b/INSTALL.md index 8f84cd85..489e4666 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -89,6 +89,6 @@ Finally, either reboot the Pi or start the `shairport-sync` service: ``` # systemctl start shairport-sync ``` -The Shairport Sync AirPlay service should now appear on the network with a service name made from the Pi's hostname with the first letter capitalised, e.g. hostname `raspberrypi` gives a service name `Raspberrypi`. You can change the service name and set a password in the configuration file. +The Shairport Sync AirPlay service should now appear on the network with a service name made from the Pi's hostname with the first letter capitalised, e.g. hostname `raspberrypi` gives a service name `Raspberrypi`. You can change the service name and set a password in the configuration file. BTW, you should *never* use an important password as the AirPlay password for a Shairport Sync player – the password is stored in Shairport Sync's configuration file in plain text and is thus completely vulnerable. Connect and enjoy... From 3d21f89c780ae9601aaabd628af2b1c9ed1dcaa0 Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Sun, 11 Nov 2018 15:17:31 +0000 Subject: [PATCH 50/70] Update CAR INSTALL.md --- CAR INSTALL.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CAR INSTALL.md b/CAR INSTALL.md index 15f4ab45..6c2f12be 100644 --- a/CAR INSTALL.md +++ b/CAR INSTALL.md @@ -42,9 +42,8 @@ The first thing to do on a Pi would be to use the `raspi-config` tool to expand ``` # apt update # apt upgrade -# rpi-update ``` -**Note:** If you are following this guide but are using a full-size Rapsberry Pi with the built-in DAC, then, at this time of writing (September 2018) it is a good idea to update the Pi's firmware using `rpi-update` because a [significant improvement](https://github.com/raspberrypi/firmware/commit/200c2f4dd54b2048b5dcb8661ea3f232beb7d81e) has been made to the [timing software](https://github.com/raspberrypi/firmware/issues/1026) of the built-in audio DAC's drivers. It should be incorporated in firmware from Raspbian 4.14.66-v7 onwards. +**Note:** If you are following this guide but are using a full-size Rapsberry Pi with the built-in DAC, then it is a good idea to update to the Raspian release of October 2018 or later, as a number of improvements have been made to the built-in DAC. (Separately, if you haven't done so already, consider using the `raspi-config` tool to expand the file system to use the entire card.) From 299063daccb8ef1e8838a80128374c589289fed8 Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Sun, 11 Nov 2018 15:19:33 +0000 Subject: [PATCH 51/70] Update INSTALL.md --- INSTALL.md | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 489e4666..6cc444cf 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -9,20 +9,11 @@ Do the usual update and upgrade: ``` # apt update # apt upgrade -# rpi-update ``` -**Note:** At this time of writing (September 2018), it is a good idea to update the Pi's firmware using `rpi-update` because a [significant improvement](https://github.com/raspberrypi/firmware/commit/200c2f4dd54b2048b5dcb8661ea3f232beb7d81e) has been made to the [timing software](https://github.com/raspberrypi/firmware/issues/1026) of the built-in audio DAC's drivers. It should be incorporated in firmware from Raspbian 4.14.66-v7 onwards. +**Note:** If you are following this guide for the Raspberry Pi, it is a good idea to update to update to the Raspian release of October 2018 or later, as a number of improvements have been made to the built-in DAC. (Separately, if you haven't done so already, consider using the `raspi-config` tool to expand the file system to use the entire card.) -### Activate the Improved Audio Driver -Check the file `/boot/config.txt` and, if it's not there already, add the following line and reboot afterwards: -``` -audio_pwm_mode=2 - -(Note that this isn't needed in the most recent versions of Raspbian as it will enable this driver mode by default) -``` - ### Turn Off WiFi Power Management If you are using WiFi, you should turn off WiFi Power Management: ``` @@ -70,8 +61,7 @@ Now to configure Shairport Sync. Here are the important options for the Shairpor // Sample Configuration File for Shairport Sync on a Raspberry Pi using the built-in audio DAC general = { - // drift_tolerance_in_seconds = 0.010; // this is no longer necessary if you have updated the Pi's firmware using rpi-update (see above). - volume_range_db = 50; + volume_range_db = 60; }; alsa = From db1c2f59e893ac5fcd1dd85a9884e52b35a99ff0 Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Sun, 11 Nov 2018 15:19:56 +0000 Subject: [PATCH 52/70] Update INSTALL.md --- INSTALL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/INSTALL.md b/INSTALL.md index 6cc444cf..644f7ebe 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -10,7 +10,7 @@ Do the usual update and upgrade: # apt update # apt upgrade ``` -**Note:** If you are following this guide for the Raspberry Pi, it is a good idea to update to update to the Raspian release of October 2018 or later, as a number of improvements have been made to the built-in DAC. +**Note:** If you are following this guide for the Raspberry Pi, it is a good idea to update to the Raspian release of October 2018 or later, as a number of improvements have been made to the built-in DAC. (Separately, if you haven't done so already, consider using the `raspi-config` tool to expand the file system to use the entire card.) From 74c1fbd2c46dc325a05dce9795e85fd8bd357d6f Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Sun, 11 Nov 2018 15:25:05 +0000 Subject: [PATCH 53/70] Update README.md --- README.md | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 6ecdc908..0264463e 100644 --- a/README.md +++ b/README.md @@ -362,31 +362,15 @@ Note: Shairport Sync can take configuration settings from command line options. **Raspberry Pi** -The Raspberry Pi Models A and B have a built-in audio DAC that is connected to the device's headphone jack. To get the benefits of improvements in the Pi's software and firmware, you should update the Raspberry Pi as follows: +The Raspberry Pi Models A and B have a built-in audio DAC that is connected to the device's headphone jack. Apart from a loud click when used for the first time after power-up, it is now quite adequate for casual listening. + +To get the benefits of improvements in the Pi's software and firmware, you should update to the Raspian release of October 2018 or later, as a number of improvements have been made to the built-in DAC's firmware. Do the usual update and upgrade: ``` # apt update # apt upgrade ``` -Update the Pi's firmware: -``` -# rpi-update -``` -Recent (September 2018) improvements include: -* An updated audio driver has greatly improved the quality of the output – see [#525](https://github.com/mikebrady/shairport-sync/issues/525) for details. -* A [significant improvement](https://github.com/raspberrypi/firmware/commit/200c2f4dd54b2048b5dcb8661ea3f232beb7d81e) has been made to the [timing software](https://github.com/raspberrypi/firmware/issues/1026) of the built-in audio DAC's drivers. It should be incorporated in firmware from Raspbian 4.14.66-v7 onwards. - -Separately, if you haven't done so already, consider using the `raspi-config` tool to expand the file system to use the entire card. - -To activate the updated audio driver referred to above, add the line: -``` -audio_pwm_mode=2 - -(Note that this isn't needed in the most recent versions of Raspbian as it will enable this driver mode by default) -``` -to `/boot/config.txt`. - To make Shairport Sync output to the built-in audio DAC and use its hardware mixer, in the `alsa` section of the configuration file, set the output device and mixer as follows: ``` alsa = @@ -397,12 +381,10 @@ alsa = ``` (Remember to uncomment the lines by removing the `//` at the start of each.) When these changes have been made, reboot the machine. -Apart from a loud click when used for the first time after power-up, it is quite adequate for casual listening. A problem is that it declares itself to have a very large mixer volume control range – all the way from -102.38dB up to +4dB, a range of 106.38 dB. In reality, only the top 50 dB of it is in any way usable. To help get the most from the DAC, consider using the `volume_range_db` setting in the `general` group to instruct Shairport Sync to use the top of the DAC mixer's declared range. For example, if you set the `volume_range_db` figure to 50, the top 50 dB of the range will the used. With this setting on the Raspberry Pi, maximum volume will be +4dB and minimum volume will be -46dB, below which muting will occur. +A problem with the built-in DAC that it declares itself to have a very large mixer volume control range – all the way from -102.38dB up to +4dB, a range of 106.38 dB. In reality, only the top 60 dB of it is in any way usable. To help get the most from the DAC, consider using the `volume_range_db` setting in the `general` group to instruct Shairport Sync to use the top of the DAC mixer's declared range. For example, if you set the `volume_range_db` figure to 60, the top 60 dB of the range will the used. With this setting on the Raspberry Pi, maximum volume will be +4dB and minimum volume will be -56dB, below which muting will occur. From a user's point of view, the effect of using this setting is to move the minimum usable volume all the way down to the bottom of the user's volume control, rather than have the minimum usable volume concentrated very close to the maximum volume. -If you have not updated the Pi's firmware as discussed above, then another setting to consider is the `general` `drift_tolerance_in_seconds` setting: you should set it to a larger tolerance, say 10 milliseconds – `drift_tolerance_in_seconds=0.010;` – to reduce the amount of overcorrection that seems to occur when using the Raspberry Pi's built-in DAC. - *Command Line Arguments* As previously mentioned, you can use command line arguments to provide settings to Shairport Sync as before, though newer settings will only be available via the configuration file. For full information, please read the Shairport Sync `man` page, also available at http://htmlpreview.github.io/?https://github.com/mikebrady/shairport-sync/blob/master/man/shairport-sync.html. From 0d32d3cc6fa529bbae1398a4f58bdf03f8284c40 Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Sun, 11 Nov 2018 15:26:57 +0000 Subject: [PATCH 54/70] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0264463e..01e638f9 100644 --- a/README.md +++ b/README.md @@ -364,7 +364,7 @@ Note: Shairport Sync can take configuration settings from command line options. The Raspberry Pi Models A and B have a built-in audio DAC that is connected to the device's headphone jack. Apart from a loud click when used for the first time after power-up, it is now quite adequate for casual listening. -To get the benefits of improvements in the Pi's software and firmware, you should update to the Raspian release of October 2018 or later, as a number of improvements have been made to the built-in DAC's firmware. +To get the benefits of improvements in the Pi's software and firmware, you should update to the Raspian release of October 2018 or later, as a number of improvements have been made to the built-in DAC. Do the usual update and upgrade: ``` @@ -381,7 +381,7 @@ alsa = ``` (Remember to uncomment the lines by removing the `//` at the start of each.) When these changes have been made, reboot the machine. -A problem with the built-in DAC that it declares itself to have a very large mixer volume control range – all the way from -102.38dB up to +4dB, a range of 106.38 dB. In reality, only the top 60 dB of it is in any way usable. To help get the most from the DAC, consider using the `volume_range_db` setting in the `general` group to instruct Shairport Sync to use the top of the DAC mixer's declared range. For example, if you set the `volume_range_db` figure to 60, the top 60 dB of the range will the used. With this setting on the Raspberry Pi, maximum volume will be +4dB and minimum volume will be -56dB, below which muting will occur. +A problem with the built-in DAC that it declares itself to have a very large mixer volume control range – all the way from -102.38dB up to +4dB, a range of 106.38 dB. In reality, only the top 60 dB of it is in any way usable. To help get the most from it, consider using the `volume_range_db` setting in the `general` group to instruct Shairport Sync to use the top of the DAC mixer's declared range. For example, if you set the `volume_range_db` figure to 60, the top 60 dB of the range will the used. With this setting on the Raspberry Pi, maximum volume will be +4dB and minimum volume will be -56dB, below which muting will occur. From a user's point of view, the effect of using this setting is to move the minimum usable volume all the way down to the bottom of the user's volume control, rather than have the minimum usable volume concentrated very close to the maximum volume. From 44a8c200081e74c2f3ed2923e5bdf20fb66188e9 Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Sun, 11 Nov 2018 15:30:51 +0000 Subject: [PATCH 55/70] Update CAR INSTALL.md --- CAR INSTALL.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/CAR INSTALL.md b/CAR INSTALL.md index 6c2f12be..671695c9 100644 --- a/CAR INSTALL.md +++ b/CAR INSTALL.md @@ -43,9 +43,7 @@ The first thing to do on a Pi would be to use the `raspi-config` tool to expand # apt update # apt upgrade ``` -**Note:** If you are following this guide but are using a full-size Rapsberry Pi with the built-in DAC, then it is a good idea to update to the Raspian release of October 2018 or later, as a number of improvements have been made to the built-in DAC. - -(Separately, if you haven't done so already, consider using the `raspi-config` tool to expand the file system to use the entire card.) +**Note:** If you are following this guide but are using a full-size Rapsberry Pi with the built-in DAC, then it is a good idea to update to the Raspian release of October 2018 or later, as a number of changes have been made in the firmware that improve the built-in DAC. ### Shairport Sync First, install the packages needed by Shairport Sync: From 62b1f2ff9c31f3dcebddccc47766e0f84206ccd8 Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Sun, 11 Nov 2018 15:31:42 +0000 Subject: [PATCH 56/70] Update INSTALL.md --- INSTALL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/INSTALL.md b/INSTALL.md index 644f7ebe..22607aaf 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -10,7 +10,7 @@ Do the usual update and upgrade: # apt update # apt upgrade ``` -**Note:** If you are following this guide for the Raspberry Pi, it is a good idea to update to the Raspian release of October 2018 or later, as a number of improvements have been made to the built-in DAC. +**Note:** If you are following this guide but are using a full-size Rapsberry Pi with the built-in DAC, then it is a good idea to update to the Raspian release of October 2018 or later, as a number of changes have been made in the firmware that improve the built-in DAC. (Separately, if you haven't done so already, consider using the `raspi-config` tool to expand the file system to use the entire card.) From 11765c8277973eba4c1dd0c7b703ba881f1c305e Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Mon, 12 Nov 2018 14:46:33 +0000 Subject: [PATCH 57/70] Update INSTALL.md --- INSTALL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/INSTALL.md b/INSTALL.md index 22607aaf..a39b3f93 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -10,7 +10,7 @@ Do the usual update and upgrade: # apt update # apt upgrade ``` -**Note:** If you are following this guide but are using a full-size Rapsberry Pi with the built-in DAC, then it is a good idea to update to the Raspian release of October 2018 or later, as a number of changes have been made in the firmware that improve the built-in DAC. +**Note:** If you are following this guide on a Rapsberry Pi, the second step above will, in addition, automatically update to the most recent stable Rapsberry Pi firmware. (Separately, if you haven't done so already, consider using the `raspi-config` tool to expand the file system to use the entire card.) From 83a002c2a436df02541efbcb215a980d6655d97e Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Mon, 12 Nov 2018 21:20:23 +0000 Subject: [PATCH 58/70] Update INSTALL.md --- INSTALL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/INSTALL.md b/INSTALL.md index a39b3f93..441aee06 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -10,7 +10,7 @@ Do the usual update and upgrade: # apt update # apt upgrade ``` -**Note:** If you are following this guide on a Rapsberry Pi, the second step above will, in addition, automatically update to the most recent stable Rapsberry Pi firmware. +**Note:** The upgrade step above will automatically update to the most recent stable Rapsberry Pi firmware. (Separately, if you haven't done so already, consider using the `raspi-config` tool to expand the file system to use the entire card.) From 06d04582bb1425866a4d0241ca843a5382054e82 Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Sat, 24 Nov 2018 11:30:39 +0000 Subject: [PATCH 59/70] Update FREEBSD.md --- FREEBSD.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FREEBSD.md b/FREEBSD.md index 3449a5c4..82429808 100644 --- a/FREEBSD.md +++ b/FREEBSD.md @@ -60,7 +60,7 @@ Next, configure the build and compile it: ``` $ autoreconf -i -f -./configure --with-avahi --with-ssl=openssl --with-alsa --with-sndio --with-os=freebsd --with-freebsd-service +$ ./configure --with-avahi --with-ssl=openssl --with-alsa --with-sndio --with-os=freebsd --with-freebsd-service $ make ``` Omit `--with-alsa` if you don't want to include the ALSA back end. Omit the `--with-sndio` if you don't want the `sndio` back end. Omit the `--with-freebsd-service` if you don't want to install a FreeBSD startup script, runtime folder and user and group -- see below for more details. From 56f8145b795ac059d285cb6cec09f51c0e7bd517 Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Tue, 11 Dec 2018 20:45:27 +0000 Subject: [PATCH 60/70] Update INSTALL.md --- INSTALL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/INSTALL.md b/INSTALL.md index 441aee06..fc59cb4a 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -35,7 +35,7 @@ Remove it as follows: ``` Do this until no more copies of `shairport-sync` are found. -You should also remove the initialisation script files `/etc/systemd/system/shairport-sync.service` and `/etc/init.d/shairport-sync` if they exist – new ones will be installed in necessary. +You should also remove the initialisation script files `/etc/systemd/system/shairport-sync.service` and `/etc/init.d/shairport-sync` if they exist – new ones will be installed if necessary. ### Build and Install Okay, now let's get the tools and sources for building and installing Shairport Sync. From 83184a9efd95ce8d7e26b1ef813ece320d45f2da Mon Sep 17 00:00:00 2001 From: Alexander Mextner Date: Sat, 22 Dec 2018 21:19:02 +0300 Subject: [PATCH 61/70] INSTALL.md: which -a shairport-sync find all the copies --- INSTALL.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index fc59cb4a..15a1c646 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -24,9 +24,9 @@ WiFi Power Management will put the WiFi system in low-power mode when the WiFi s Reboot the Pi. ### Remove Old Copies and Old Startup Scripts -Before you begin building Shairport Sync, it's best to search for and remove any existing copies of the application, called `shairport-sync`. Use the command `$ which shairport-sync` to find them. For example, if `shairport-sync` has been installed previously, this might happen: +Before you begin building Shairport Sync, it's best to search for and remove any existing copies of the application, called `shairport-sync`. Use the command `$ which -a shairport-sync` to find them. For example, if `shairport-sync` has been installed previously, this might happen: ``` -$ which shairport-sync +$ which -a shairport-sync /usr/local/bin/shairport-sync ``` Remove it as follows: From 7be30cc4bc799a0fa76ca66fce2ac0822977441f Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Fri, 4 Jan 2019 21:08:19 +0000 Subject: [PATCH 62/70] Update TROUBLESHOOTING.md --- TROUBLESHOOTING.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/TROUBLESHOOTING.md b/TROUBLESHOOTING.md index 6d69a1fb..2847ae97 100644 --- a/TROUBLESHOOTING.md +++ b/TROUBLESHOOTING.md @@ -25,12 +25,12 @@ Shairport Sync is installed and running, but sometimes it disappears from the ne This can be caused by lots of things, but one of them is that the WiFi adapter may be set to run in a low-power or power-saving mode. If it's not busy, then after a while it goes into a low-power mode. This is bad as the device needs to be always connected to the network to provide the AirPlay service. You need to turn off power-saving mode. How you do this varies with platform and with WiFi adapter – internet search is your friend. Here, for instance, is the command for the C.H.I.P. from Next Thing Co, which has built in WiFi and Linux and has the `iw` command installed: ``` -iw dev wlan0 set power_save off +# iw dev wlan0 set power_save off ``` Here is the command sequence for a Raspberry Pi 3, which has built-in WiFi: ``` -sudo iwconfig wlan0 power off +# iwconfig wlan0 power off ``` Alternatively, (also for the Raspberry Pi), add the following line: ``` @@ -41,7 +41,7 @@ to the file `/etc/network/interfaces`. Here is another option, suggested by [davidhq](https://github.com/davidhq) in [#653](https://github.com/mikebrady/shairport-sync/issues/653#issuecomment-391100620): ``` -$ sudo nano /etc/network/if-up.d/off-power-manager +# nano /etc/network/if-up.d/off-power-manager ``` Type: @@ -51,7 +51,7 @@ Type: ``` Then: ``` -sudo chmod +x /etc/network/if-up.d/off-power-manager +# chmod +x /etc/network/if-up.d/off-power-manager ``` There are some more details in some the closed issues on this repository. From ca2f84e966ceeff08185208d7ce5f905adb1f9fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Can=20S=C3=BCrmeli?= Date: Wed, 6 Feb 2019 14:08:24 +0100 Subject: [PATCH 63/70] Extended the low-power mode problems section with instructions for additional Wi-Fi chips. --- TROUBLESHOOTING.md | 50 +++++++++++++++++++++++++++++++++++++--------- 1 file changed, 41 insertions(+), 9 deletions(-) diff --git a/TROUBLESHOOTING.md b/TROUBLESHOOTING.md index 6d69a1fb..ef61a4d7 100644 --- a/TROUBLESHOOTING.md +++ b/TROUBLESHOOTING.md @@ -10,28 +10,36 @@ In this brief document will be listed some problems and some solutions, some pro ### WiFi and Microwaves Microwaves can interfere with WiFi -- see [here](http://sciabc.us/F6Gaa) for example. -### WiFi adapter running in power-saving / low-power mode - +### WiFi adapter running in power-saving/low-power mode **Check Throughput** - - You can check WiFi throughput using, for example, https://thepi.io/how-to-use-your-raspberry-pi-to-monitor-broadband-speed/ +You can learn how to check your Wi-Fi's throughput by following this [tutorial](https://thepi.io/how-to-use-your-raspberry-pi-to-monitor-broadband-speed/) **Problem** - Shairport Sync is installed and running, but sometimes it disappears from the network, and sometimes it suffers from long dropouts. **Possible Cause** +This can be caused by lots of things, however, the most prominent cause is that the Wi-Fi adapter may be set to run in a low-power/power-saving mode; which after a certain period of time(usually a minute or so), if the adapter is not busy, the system will hold back the active use of the adapter. -This can be caused by lots of things, but one of them is that the WiFi adapter may be set to run in a low-power or power-saving mode. If it's not busy, then after a while it goes into a low-power mode. This is bad as the device needs to be always connected to the network to provide the AirPlay service. You need to turn off power-saving mode. How you do this varies with platform and with WiFi adapter – internet search is your friend. Here, for instance, is the command for the C.H.I.P. from Next Thing Co, which has built in WiFi and Linux and has the `iw` command installed: +This is an unintended scenario where Shairport requires the Wi-Fi adapter at all times to function properly. Hence you need to turn off the power saving/low-power mode. +How you do this varies with platform to platform or adapter to adapter and therefore internet search is your friend or some closed issues on this repo has some more knowledge for you as well. + +However, below are the instructions for the onboard Wi-Fi chip that comes with Raspberry Pi, another popular chip(Realtek RTL8188CUS), and, the chip 8192cu. + +Moreover, if you want an in-depth look at Raspberry Pi Wi-Fi adapters, [here](https://www.elinux.org/RPi_USB_Wi-Fi_Adapters) is a good primer. + +#### Onboard Wi-Fi Chip + +Here, for instance, is the command for the C.H.I.P. from Next Thing Co., which has built in WiFi and Linux and has the `iw` command installed: ``` iw dev wlan0 set power_save off ``` -Here is the command sequence for a Raspberry Pi 3, which has built-in WiFi: +Here is the command sequence for a Raspberry Pi 3, which has built-in WiFi: ``` sudo iwconfig wlan0 power off ``` + Alternatively, (also for the Raspberry Pi), add the following line: ``` wireless-power off @@ -39,7 +47,6 @@ wireless-power off to the file `/etc/network/interfaces`. Here is another option, suggested by [davidhq](https://github.com/davidhq) in [#653](https://github.com/mikebrady/shairport-sync/issues/653#issuecomment-391100620): - ``` $ sudo nano /etc/network/if-up.d/off-power-manager ``` @@ -49,12 +56,37 @@ Type: #!/bin/sh /sbin/iwconfig wlan0 power off ``` + Then: ``` sudo chmod +x /etc/network/if-up.d/off-power-manager ``` -There are some more details in some the closed issues on this repository. +#### Realtek RTL8188CUS + +The chip `Realtek RTL8188CUS` is a popular one used by many Wi-Fi adapters. To disable it's power-saving/low-power mode: + +- `sudo vim /etc/modprobe.d/r8188eu.conf`, +- paste the below content into the file, + - `options r8188eu rtw_power_mgnt=0 rtw_enusbss=0` +- `sudo reboot` + +**After the reboot**, the power-saving/low-power mode should be disabled. You can check it by the following command. In return, it should output `0`. + +`cat /sys/module/r8188eu/parameters/rtw_power_mgnt` + +#### 8192cu + +Another chip you may encounter is `8192cu`. The process is similar to `Realtek RTL8188CUS`; just a simple name change. + +- `sudo vim /etc/modprobe.d/8192cu.conf`, +- paste the below content into the file, + - `options 8192cu rtw_power_mgnt=0 rtw_enusbss=0` +- `sudo reboot` + +**After the reboot**, the power-saving/low-power mode should be disabled. You can check it by the following command. In return, it should output `0`. + +`cat /sys/module/8192cu/parameters/rtw_power_mgnt` ### Faulty WiFi For an example of what it can take to track down a bad WiFi situation – in this case, a faulty WiFi adapter – please look at [this report](https://github.com/mikebrady/shairport-sync/issues/689). From 5657f71291de4894e53d2599fb0fe0e79dcf976c Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Wed, 6 Feb 2019 17:04:34 +0000 Subject: [PATCH 64/70] Update TROUBLESHOOTING.md --- TROUBLESHOOTING.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/TROUBLESHOOTING.md b/TROUBLESHOOTING.md index 3e2e1f1d..0215c702 100644 --- a/TROUBLESHOOTING.md +++ b/TROUBLESHOOTING.md @@ -12,7 +12,7 @@ Microwaves can interfere with WiFi -- see [here](http://sciabc.us/F6Gaa) for exa ### WiFi adapter running in power-saving/low-power mode **Check Throughput** -You can learn how to check your Wi-Fi's throughput by following this [tutorial](https://thepi.io/how-to-use-your-raspberry-pi-to-monitor-broadband-speed/) +You can learn how to check your Wi-Fi's throughput by following this [tutorial](https://thepi.io/how-to-use-your-raspberry-pi-to-monitor-broadband-speed/). **Problem** Shairport Sync is installed and running, but sometimes it disappears from the network, and sometimes it suffers from long dropouts. @@ -64,7 +64,7 @@ Then: #### Realtek RTL8188CUS -The chip `Realtek RTL8188CUS` is a popular one used by many Wi-Fi adapters. To disable it's power-saving/low-power mode: +The chip `Realtek RTL8188CUS` is a popular one used by many Wi-Fi adapters. To disable its power-saving/low-power mode: - `sudo vim /etc/modprobe.d/r8188eu.conf`, - paste the below content into the file, @@ -77,14 +77,14 @@ The chip `Realtek RTL8188CUS` is a popular one used by many Wi-Fi adapters. To d #### 8192cu -Another chip you may encounter is `8192cu`. The process is similar to `Realtek RTL8188CUS`; just a simple name change. +Another chip you may encounter is `8192cu`. The process is similar to `Realtek RTL8188CUS` – just a simple name change. - `sudo vim /etc/modprobe.d/8192cu.conf`, - paste the below content into the file, - `options 8192cu rtw_power_mgnt=0 rtw_enusbss=0` - `sudo reboot` -**After the reboot**, the power-saving/low-power mode should be disabled. You can check it by the following command. In return, it should output `0`. +**After the reboot**, the power-saving/low-power mode should be disabled. You can check it by the following command. It should return the value `0`. `cat /sys/module/8192cu/parameters/rtw_power_mgnt` From 3d657707aabb13348e34a591b44d60cc6eac7a1c Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Thu, 14 Feb 2019 09:43:15 +0000 Subject: [PATCH 65/70] Update CYGWIN.md --- CYGWIN.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/CYGWIN.md b/CYGWIN.md index a177ead5..fde2d2f2 100644 --- a/CYGWIN.md +++ b/CYGWIN.md @@ -23,11 +23,16 @@ and enter valid DNS server addresses, e.g. `8.8.8.8`. * `wget` for convenience, * `flex` for compiling `libconfig` * `bison` for compiling `libconfig` + +Assuming the Cygwin setup program (`setup-x86_64.exe` in this case) is in your Downloads directory and the default directory is your home directory, the following command should work: +``` +.\Downloads\setup-x86_64.exe -P pkg-config,autoconf,automake,clang,libdaemon-devel,popt-devel,make,libao-devel,openssl-devel,libtool,git,wget,flex,bison +``` * Download, configure, compile and install `libconfig`: ``` $ git clone https://github.com/hyperrealm/libconfig.git -$ cd libconfig +$ ./make $ autoreconf -fi $ ./configure $ make @@ -36,7 +41,7 @@ $ cd .. ``` * Next, download, configure and compile Shairport Sync: ``` -$ git clone https://github.com/mikebrady/shairport-sync.git +$ cd $ cd shairport-sync $ autoreconf -fi $ PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure --with-ao --with-ssl=openssl --with-tinysvcmdns From 0026f2550737fdb148abcfcbe80131472b96c4fb Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Mon, 18 Feb 2019 12:51:22 +0000 Subject: [PATCH 66/70] Update CYGWIN.md --- CYGWIN.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CYGWIN.md b/CYGWIN.md index fde2d2f2..dc810d20 100644 --- a/CYGWIN.md +++ b/CYGWIN.md @@ -26,13 +26,15 @@ and enter valid DNS server addresses, e.g. `8.8.8.8`. Assuming the Cygwin setup program (`setup-x86_64.exe` in this case) is in your Downloads directory and the default directory is your home directory, the following command should work: ``` -.\Downloads\setup-x86_64.exe -P pkg-config,autoconf,automake,clang,libdaemon-devel,popt-devel,make,libao-devel,openssl-devel,libtool,git,wget,flex,bison +.\Downloads\setup-x86_64.exe -P pkg-config,autoconf,automake,clang, \ + libdaemon-devel,popt-devel,make,libao-devel,openssl-devel, \ + libtool,git,wget,flex,bison ``` * Download, configure, compile and install `libconfig`: ``` $ git clone https://github.com/hyperrealm/libconfig.git -$ ./make +$ cd libconfig $ autoreconf -fi $ ./configure $ make From 2d3ab8f742b115057a7b636dfee991eb04e7a104 Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Mon, 18 Feb 2019 13:30:13 +0000 Subject: [PATCH 67/70] Update CYGWIN.md --- CYGWIN.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CYGWIN.md b/CYGWIN.md index dc810d20..3cddfce6 100644 --- a/CYGWIN.md +++ b/CYGWIN.md @@ -43,7 +43,7 @@ $ cd .. ``` * Next, download, configure and compile Shairport Sync: ``` -$ cd +$ git clone https://github.com/mikebrady/shairport-sync.git $ cd shairport-sync $ autoreconf -fi $ PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure --with-ao --with-ssl=openssl --with-tinysvcmdns From 9adf8be3561d4e49c5ad1e9e0f34417db7550b44 Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Mon, 18 Feb 2019 19:53:18 +0000 Subject: [PATCH 68/70] Update CYGWIN.md --- CYGWIN.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/CYGWIN.md b/CYGWIN.md index 3cddfce6..c128388e 100644 --- a/CYGWIN.md +++ b/CYGWIN.md @@ -26,9 +26,7 @@ and enter valid DNS server addresses, e.g. `8.8.8.8`. Assuming the Cygwin setup program (`setup-x86_64.exe` in this case) is in your Downloads directory and the default directory is your home directory, the following command should work: ``` -.\Downloads\setup-x86_64.exe -P pkg-config,autoconf,automake,clang, \ - libdaemon-devel,popt-devel,make,libao-devel,openssl-devel, \ - libtool,git,wget,flex,bison +.\Downloads\setup-x86_64.exe -P pkg-config,autoconf,automake,clang,libdaemon-devel,popt-devel,make,libao-devel,openssl-devel,libtool,git,wget,flex,bison ``` * Download, configure, compile and install `libconfig`: From bac658b3c8fe03a366a7b86d8ba29b529d77096a Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Mon, 4 Mar 2019 13:21:24 +0000 Subject: [PATCH 69/70] Fix some MQTT issues and a silly error. --- common.h | 16 ++++++++++++++++ configure.ac | 4 ---- shairport.c | 2 +- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/common.h b/common.h index 70ca6219..9bc849e1 100644 --- a/common.h +++ b/common.h @@ -104,6 +104,22 @@ typedef struct { int metadata_sockport; size_t metadata_sockmsglength; int get_coverart; +#endif +#ifdef CONFIG_MQTT + int mqtt_enabled; + char *mqtt_hostname; + int mqtt_port; + char *mqtt_username; + char *mqtt_password; + char *mqtt_capath; + char *mqtt_cafile; + char *mqtt_certfile; + char *mqtt_keyfile; + char *mqtt_topic; + int mqtt_publish_raw; + int mqtt_publish_parsed; + int mqtt_publish_cover; + int mqtt_enable_remote; #endif uint8_t hw_addr[6]; int port; diff --git a/configure.ac b/configure.ac index 446f62df..9d03e798 100644 --- a/configure.ac +++ b/configure.ac @@ -2,11 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.50]) -<<<<<<< HEAD -AC_INIT([shairport-sync], [3.2.2], [mikebrady@eircom.net]) -======= AC_INIT([shairport-sync], [3.3rc0], [mikebrady@eircom.net]) ->>>>>>> development AM_INIT_AUTOMAKE AC_CONFIG_SRCDIR([shairport.c]) AC_CONFIG_HEADERS([config.h]) diff --git a/shairport.c b/shairport.c index f87e7725..ca23867c 100644 --- a/shairport.c +++ b/shairport.c @@ -1692,10 +1692,10 @@ int main(int argc, char **argv) { if (config.mqtt_enabled) { initialise_mqtt(); } +#endif activity_monitor_start(); ->>>>>>> development // daemon_log(LOG_INFO, "Successful Startup"); rtsp_listen_loop(); From 72a10506bd2f630f070150d27b9addfa39063afd Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Mon, 4 Mar 2019 13:56:58 +0000 Subject: [PATCH 70/70] Add in the MQTT includes --- Makefile.am | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile.am b/Makefile.am index 81db424a..e17bf39a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -93,6 +93,10 @@ if USE_METADATA_HUB shairport_sync_SOURCES += metadata_hub.c endif +if USE_MQTT +shairport_sync_SOURCES += mqtt.c +endif + if USE_DACP_CLIENT shairport_sync_SOURCES += dacp.c tinyhttp/chunk.c tinyhttp/header.c tinyhttp/http.c endif