diff --git a/.gitignore b/.gitignore index b78d32b7..276d276e 100644 --- a/.gitignore +++ b/.gitignore @@ -27,6 +27,9 @@ man/Makefile.in scripts/shairport-sync.service scripts/shairport-sync shairport-sync.core +gitversion.h +plist_xml_strings.* + #Some dbus files that are automatically generated /org.gnome.ShairportSync.service diff --git a/BUILDFORAP1.md b/BUILDFORAP1.md index 6941e564..847346ba 100644 --- a/BUILDFORAP1.md +++ b/BUILDFORAP1.md @@ -17,7 +17,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 computer. @@ -33,8 +33,8 @@ Remove it as follows: ``` Do this until no more copies of `shairport-sync` are found. -### Remove Old Startup Scripts -You should also remove the startup script files `/etc/systemd/system/shairport-sync.service` and `/etc/init.d/shairport-sync` if they exist – new ones will be installed in necessary. +### Remove Old Startup and Service Scripts +You should also remove the startup script and service definition files `/etc/systemd/system/shairport-sync.service`, `/lib/systemd/system/shairport-sync.service`, `/etc/init.d/shairport-sync`, `/etc/dbus-1/system.d/shairport-sync-dbus.conf` and `/etc/dbus-1/system.d/shairport-sync-mpris.conf` if they exist – new ones will be installed if necessary. ### Reboot after Cleaning Up If you removed any installations of Shairport Sync or any of its startup script files in the last two steps, you should reboot. diff --git a/CAR INSTALL.md b/CAR INSTALL.md index 8fb2294b..dcf78cba 100644 --- a/CAR INSTALL.md +++ b/CAR INSTALL.md @@ -14,7 +14,7 @@ Note that Android devices can not, so far, do this trick of using the two networ ## Example -In this example, a Raspberry Pi Zero W and a Pimoroni PHAT DAC are used. This combination has been tested for well over a year. Please note that some of the details of setting up networks are specific to the version of Linux used -- Raspbian Stretch. +In this example, a Raspberry Pi Zero W and a Pimoroni PHAT DAC are used. This combination has been tested for over two years. Please note that some of the details of setting up networks are specific to the version of Linux used -- Raspbian Stretch or later. ### Prepare the initial SD Image * Download the latest version of Raspbian Lite -- Stretch Lite of 2018-03-13 at the time of writing -- and install it onto an SD Card. @@ -193,6 +193,24 @@ denyinterfaces wlan0 ``` From this point on, at least on the Raspberry Pi, if you reboot the machine, it will not reconnect to your network – instead, it will act as the WiFi base station you have configured with `hostapd` and `isc-dhcp-server`. +### Optimise startup time -- Raspberry Pi Specific + +This is applicable to a Raspberry Pi only. Some of it may be applicable to other systems, but it has not been tested on them. There are quite a few services that are not necessary for this setup. Disabling them can increase startup time. Running these commands disables them: + +```` +sudo systemctl disable systemd-timesyncd.service +sudo systemctl disable keyboard-setup.service +sudo systemctl disable triggerhappy.service +sudo systemctl disable dhcpcd.service +sudo systemctl disable wpa_supplicant.service +sudo systemctl disable dphys-swapfile.service +sudo systemctl disable networking.service +```` + +### Read-only mode -- Raspberry Pi Specific + +Run `sudo raspi-config` and then choose `Performance Options` > `Overlay Filesystem` and choose to enable the overlay filesystem, and to set the boot partition to be write-protected. + ### Ready Install the Raspberry Pi in your car. It should be powered from a source that is switched off when you leave the car, otherwise the slight current drain will eventually flatten the car's battery. diff --git a/FEDORA.md b/FEDORA.md index cf8cbc50..f105ddbe 100644 --- a/FEDORA.md +++ b/FEDORA.md @@ -1,23 +1,27 @@ Fedora Installation Guide [Needs updating for Airplay 2] ----- - +Update everything... +``` +# yum update +``` Install the toolchain and pre-requisites, if necessary: ``` # yum install make automake gcc gcc-c++ kernel-devel -# yum install alsa-lib-devel autoconf automake avahi-devel libconfig-devel libdaemon-devel openssl-devel popt-devel soxr-devel +# yum install alsa-lib-devel autoconf automake avahi-devel libconfig-devel \ + libdaemon-devel openssl-devel popt-devel soxr-devel rpmbuild ``` -Download the tarball from the "releases" tab on github or use `wget` and then use `rpmbuild`. This example is for version 2.6: +Download the tarball from the "releases" tab on github or use `wget` and then use `rpmbuild`. Alternatively, download a tarball of the `master` branch, as in this example: ``` -$ wget -O shairport-sync-2.6.tar.gz https://github.com/mikebrady/shairport-sync/archive/2.6.tar.gz -$ rpmbuild -ta shairport-sync-2.6.tar.gz +$ wget -O shairport-sync-master.tar.gz https://github.com/mikebrady/shairport-sync/archive/master.tar.gz +$ rpmbuild -ta shairport-sync-master.tar.gz ``` The `-ta` means "build all from this tarball". The RPM will be built in a directory and will have a pathname like, for example, `~/rpmbuild/RPMS/i686/shairport-sync-2.6-1.fc22.i686.rpm` You should then install it with (for this example): ``` -# rpm -i ~/rpmbuild/RPMS/i686/shairport-sync-2.6-1.fc22.i686.rpm +$ sudo rpm -i ~/rpmbuild/RPMS/i686/shairport-sync-2.6-1.fc22.i686.rpm ``` -You may have to manually create the directory `/var/shairport-sync` for the installation to succeed. Having edited the configuration file `/etc/shairport-sync.conf` as appropriate (see ("Configuring Shairport Sync")[https://github.com/mikebrady/shairport-sync/blob/master/README.md#configuring-shairport-sync]), enable and start the service with: +You may have to manually create the directory `/var/shairport-sync` beforehand for the installation to succeed. Having edited the configuration file `/etc/shairport-sync.conf` as appropriate (see [Configuring Shairport Sync](https://github.com/mikebrady/shairport-sync/blob/master/README.md#configuring-shairport-sync)), enable and start the service with: ``` # systemctl enable shairport-sync.service # systemctl start shairport-sync.service diff --git a/OPENBSD.md b/OPENBSD.md index 6b18f979..c046390d 100644 --- a/OPENBSD.md +++ b/OPENBSD.md @@ -1,16 +1,24 @@ Shairport Sync on OpenBSD [AirPlay 2 Not Supported] ---- -This is an initial note about installing Shairport Sync on OpenBSD. Shairport Sync compiles and runs natively on OpenBSD using the `sndio` back end. +This is a note about installing Shairport Sync on OpenBSD. Shairport Sync compiles and runs natively on OpenBSD using the `sndio` back end. For general information on `sndio` please follow [this link](http://www.sndio.org). Unlike FreeBSD, it seems that OpenBSD does not use the directory `/usr/local/etc` as a system configuration directory ("`sysconfdir`") but follows the same practice as Linux in using `/etc` as the default `sysconfdir`. General ---- -This build was done on a default build of `OpenBSD 6.2 GENERIC.MP#134 amd64`. Following [this guide](https://www.openbsd.org/faq/faq15.html), `/etc/installurl` was created with the contents: +This build was done on a default build of `OpenBSD 6.6 GENERIC.MP#5 amd64`. Following [this guide](https://www.openbsd.org/faq/faq15.html), `/etc/installurl` was created with the to refer to the standard repository: ``` https://ftp.openbsd.org/pub/OpenBSD ``` -Next, although it may not always be necessary, [update the packages](https://unix.stackexchange.com/questions/23579/how-to-apply-updates-on-openbsd-netbsd-and-freebsd). +You might have a [closer or faster](https://www.openbsd.org/ftp.html) repository to use instead. + +Next, although it may not always be necessary, apply any outstanding system updates and [update the packages](https://unix.stackexchange.com/questions/23579/how-to-apply-updates-on-openbsd-netbsd-and-freebsd). + +First, update the system: +``` +# syspatch +``` +Now update the packages: ``` # pkg_add -Uu ``` @@ -31,10 +39,10 @@ Install the following packages (e.g. using `pkg_add` in superuser mode) needed t ``` # pkg_add autoconf automake popt libconfig git ``` -Add the relevant shell variable definitions for Autoconf and Automake -- they could be placed in the user's `.profile` file to be automatically executed at login: +Note the versions of `autoconf` and `automake` you choose (`2.69` and `1.16` at the time of writing) and add them as shell variable definitions for -- they could be placed in the user's `.profile` file to be automatically executed at login: ``` export AUTOCONF_VERSION=2.69 -export AUTOMAKE_VERSION=1.15 +export AUTOMAKE_VERSION=1.16 ``` Now, download Shairport Sync from GitHub: ``` @@ -44,7 +52,8 @@ $ cd shairport-sync Next, configure and compile shairport-sync: ``` $ autoreconf -fi -$ ./configure --sysconfdir=/etc --with-avahi --with-ssl=openssl --with-libdaemon --with-sndio --with-os=openbsd +$ ./configure --sysconfdir=/etc --with-avahi --with-ssl=openssl --with-libdaemon \ + --with-sndio --with-os=openbsd $ make ``` The application is called `shairport-sync`. Check that it's running correctly by executing the following command: @@ -53,11 +62,11 @@ $ ./shairport-sync -V ``` This will execute the application and it will return its version information and terminate, for example: ``` -3.2-libdaemon-OpenSSL-Avahi-sndio-sysconfdir:/etc +3.3.6-libdaemon-OpenSSL-Avahi-sndio-sysconfdir:/etc ``` There is no make install yet -- you're on your own. Using the `sndio` backend ---- -The `sndio` back end does not have a hardware volume control facility. +The `sndio` back end does not yet have a hardware volume control facility. You should set the volume to maximum before use, using, for example, the `mixerctl` command. diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 973433a5..e86b136f 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -1,5 +1,69 @@ Please see the [Release Notes for 3.3](https://github.com/mikebrady/shairport-sync/releases/tag/3.3). +Version 3.3.8 +==== +**Enhancements** +* Documentation for the MQTT interface. Many thanks to [minix1234](https://github.com/minix1234)! + +**Bug Fixes** +* Fix a bug in the `alsa` back end. In the interval between checking that the alsa device handle was non-`NULL` and actually using it, the handle could be set to `NULL`. The interval between check and usage is now protected. +* Fix a bug in the `alsa` precision timing code. Thanks to [durwin99](https://github.com/durwin99), [Nicolas Da Mutten](https://github.com/cleverer), [mistakenideas](https://github.com/mistakenideas), [Ben Willmore](https://github.com/ben-willmore) and [giggywithit](https://github.com/giggywithit) for the [report](https://github.com/mikebrady/shairport-sync/issues/1158). +* Fix a bug that caused Shairport Sync to hang, but not actually crash, if an `on-...` script failed. +* Fix a crash that occurred if metadata support is enabled during compilation but turned off in the configuration file. Thanks to [Tim Curtis](https://github.com/moodeaudio) for the report. +* Fix a crash that occurred playing from AirPower on Android. Thanks to [Ircama](https://github.com/Ircama) for the report. +* Fix the configure.ac file so that `--without-` configuration options are not interpreted as `--with-` options instead! Thanks to [David Racine](https://github.com/bassdr) for the report. + +Version 3.3.7 +==== +**Docker Integration** +* Docker Hub integration. From now on, prebuilt Docker images should be available on the Docker Hub at https://hub.docker.com/r/mikebrady/shairport-sync. + +**New Feature** +* For the PulseAudio backend `pa`, added a new `server` entry to the `pa` section of the configuration file, allowing you to specify a connection to a remote or a local system PulseAudio instance instead of letting PulseAudio choose. Thanks to [Guillaume Revaillot](https://github.com/grevaillot) for this new feature. + +**Pesky Changes** +* The underlying timing system has been moved from 64-bit fixed-point time representation (like NTP) to a 64-bit unsigned nanoseconds representation. This should make precisely no difference to the functionality of Shairport Sync but the transition might inadvertently have introduced bugs. Problem reports gratefully received. + +**Bug Fixes** +* Fixed a number of bugs that prevented Shairport Sync from terminating cleanly in response to the `MPRIS` interface's `Quit()` command. Thanks to [João Gabriel](https://github.com/jgabriel98) for reporting this issue. +* Related to the above, the code used to terminate the application after a fatal error has been cleaned up. It now uses the correct `exit()` call rather than the rather hacky `abort()` call, returning the value of the constant `EXIT_FAILURE` (typically `1`) to the caller . +* Fixed a bug whereby the start and end of active mode tokens `abeg` and `aend` where not generated or published -- `pend` tokens were being generated instead. Thanks to [minix1234](https://github.com/minix1234) for the bug report and [fix](https://github.com/mikebrady/shairport-sync/pull/1023). +* Fixed a bug calculating the instantaneous synchronisation error. This bug could occasionally cause Shairport Sync to lose synchronisation and maybe even to mute for a few seconds before resynchronising. It was caused doing modulo arithmetic incorrectly and it's been there for a while. +* Removed a bug which would affect initial synchronisation if a `FLUSH` command was received from the player at an inopportune time. +* Added code to do calculations involving the `audio_backend_latency_offset_in_seconds` and `audio_backend_silent_lead_in_time` settings correctly. Many thanks to [Tucker Kern](https://github.com/mill1000) for discovering a number of bugs associated with this and for [proposing a solution](https://github.com/mikebrady/shairport-sync/pull/1001). This prompted a closer investigation and a number of further improvements were made, and a few "hostages to fortune" removed. +* The DACP ID looks like a 64-bit number expressed in hexadecimal. It is normally quoted with leading zeroes removed, but in the `_dacp._tcp` service string, leading zeros are not removed from the DACP ID. The bug fix removes those leading zeroes. Thanks to [julianc1969](https://github.com/juliandc1969) for tracking down this bug so tenaciously! +* Make the first output backend in the list of backends the default and make its name the default `output_name`. +* Fix a flaw in resyncing -- a flush is set up but not triggered. +* Ensure metadata and cover art are enabled if metadata support is included at compilation. +* Set convolution defaults even if no configuration file is found. +* Handle the `active_remote_id` token as a string rather than an unsigned 32-bit number -- it seems ROON uses a longer character sequence. + +**Enhancements** +* Added the strings `-alac` and `-jack` to the the version string returned by the `-V` command line option if Apple ALAC decoder support and Jack Audio support are included respectively. +* Cleaned up and simplified the code that handles `FLUSH` requests coming from the player. (Debug messages are still a little verbose.) +* Improved timing estimation. Shairport Sync has been using linear least-squares regression to estimate timing drift between the (remote) source clock and the local clock. This technique is now extended to provide an estimate of the remote-to-local clock difference itself. (The remote-to-local clock difference is used to remap the timing of audio frames from the remote device's clock to the local clock.) + + Timing drift estimates are now saved when a sessions ends, keyed to the client IP number. When a new session starts from that IP number, the stored estimate is used until a new estimate can be generated from the new session. + + In practice, the timing techniques in use up to now have been very accurate, but this should result in slightly smoother rates of correction. +* Tidied up the creation and initial opening of pipes. Suppress repeated pipe-opening error messages. +* Tidied up warnings and fatal error messages when log verbosity is zero. +* Cleaned up the code that provides a silent lead-in to play on a back end without synchronisation, e.g. a pipe or `stdout`. +* Added in commented-out code to check the timeliness of the release of audio to a back end without synchronisation, e.g. a pipe or `stdout`. TL;DR – so long as the back end does not block, frames will be released to it not more than one packet (352 frames) late. +* Logs and statistics can now be directed to the system log (default), `stdout`, `stderr` or to a file or pipe of your choice using a new setting, `log_output_to` in the `diagnostics` section of the configuration file. This is very useful when the system log is disabled or diverted. +* Audio data from the `pipe` back end and metadata from the metadata pipe are now written using standard blocking `write` commands rather than a slightly complex non-blocking write function. Pipes are now opened in non-blocking mode and changed to blocking mode when successfully opened. +* Add a default name for the pipe backend: `/tmp/shairport-sync-audio`. +* Separate threads are now used for each metadata subsystem. Until now, all metadata was processed on a single thread. This included writing to the metadata pipe and the multicast stream and supplying metadata for the `mqtt` interface and for the `dbus` and `MPRIS` interfaces. Unfortunately, that meant that a problem with any one of these subsystems could propagate into the others. Now they all run on separate threads. If one thread blocks, it will not interfere with the other subsystems. +* Cleaned up and improved the code to synchronise the first frame of audio. This should result in more accurate and reliable initial synchronisation, usually to under a millisecond, and often to within 20 or 30 microseconds. Syncronisation should improve even when the silent lead-in time is as short as 0.3 seconds or when the `audio_backend_latency_offset_in_seconds` is as much as -1.7 seconds, i.e. when only 0.3 seconds of latency are left when the latency would normally be 2.0 seconds. +* Cleaned up some confused uses of modulo arithmetic. +* Cleaned up the allocation of memory for gathering running statistics – the heap is now used instead of the stack. +* Cleaned up the display of statistics for backends that do not implement active synchronisation, e.g. the `pipe` and `STDOUT` back ends. +* Cleaned up the `audio_backend_silent_lead_in_time` setting by adding an `"auto"` setting. +* Improved synchronisation accuracy with short silence lead-ins. +* While a player is active, the DACP port number to which to send remote commands should be broadcast over ZEROCONF/Bonjour. However, if that information is not available, Shairport Sync will now check for it every two seconds. +* The timing software in the `sndio` backend does some extra sanity checking on certain time estimates, it may help a little when running on virtual machines. +* Open metadata and audio pipes with 666 permissions to allow them to be shared by other applications. + Version 3.3.6 ==== **New Features** diff --git a/REPORTING ISSUES.md b/REPORTING ISSUES.md index 5c502091..ce0db535 100644 --- a/REPORTING ISSUES.md +++ b/REPORTING ISSUES.md @@ -2,21 +2,21 @@ Reporting Issues and Making Pull Requests ==== -Pull Requests ----- -If you would like to contribute to the development of Shairport Sync, please make you changes to the `development` branch and make a pull request. - -Changes and additions in the development branch make their way eventually to the `master` branch. - 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 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 +``` +Then, if possible, some diagnostic information from the log or logfile would be useful. If your system uses `systemd`, as most recent Linuxes do, try using: ``` $ sudo systemctl status shairport-sync ``` -You might get something lke this: +You might get something like this: ``` ● shairport-sync.service - Shairport Sync - AirPlay Audio Receiver Loaded: loaded (/lib/systemd/system/shairport-sync.service; disabled; vendor preset: enabled) @@ -41,3 +41,10 @@ code or log file entries ``` \`\`\` +Pull Requests +---- +If you would like to contribute to the development of Shairport Sync, please make you changes to the `development` branch and make a pull request. + +Changes and additions in the development branch make their way eventually to the `master` branch. + + diff --git a/TROUBLESHOOTING.md b/TROUBLESHOOTING.md index fd500e60..66665c25 100644 --- a/TROUBLESHOOTING.md +++ b/TROUBLESHOOTING.md @@ -4,9 +4,9 @@ The installation and setup of Shairport Sync is straightforward on recent Linux In this brief document will be listed some problems and some solutions, some provided by other users. -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). - +1. Before starting, ensure that your software is up-to-date. This document always refers to the most recent version of Shairport Sync -- see [here](https://github.com/mikebrady/shairport-sync/releases) for information about the most recent release. +2. If you have set `interpolation` in the `general` section of the configuration file to to `soxr`, comment it out or set it to `auto` or `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). +3. Ensure the volume setting of your output device is set to some reasonable value and ensure it is not muted. For ALSA devices, the `alsamixer` command-line tool is very good for this. For other sound systems, please consult the relevant documentation. ### WiFi adapter running in power-saving / low-power mode @@ -54,6 +54,10 @@ sudo chmod +x /etc/network/if-up.d/off-power-manager There are some more details in some the closed issues on this repository. +### VPNs + +To see the AirPlay service Shairport Sync provides, your devices must be on the same subnet as Shairport Sync. If, say, a device such as an iPhone is on a VPN and Shairport Sync is not, or vice-versa, then even though the devices might be physically on the same network, they are effectively on separate networks due to the VPN and the AirPlay service will not be accessible to the device. So, when you are troubleshooting, look out for VPN issues. + ### 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). @@ -67,7 +71,7 @@ You can play from other devices but not from your Windows PC. Allow network discovery. This setting creates a private type network and enables Windows to access the ports and protocols necessary to use Shairport Sync. -### UFW firewall blocking connections on Raspbian (Raspberry Pi) +### UFW firewall blocking ports (commonly includes Raspberry Pi) **Problem** @@ -87,7 +91,7 @@ You have installed Shairport Sync successfully, the daemon is running, you can s **Solution** -You have to allow connections to your Pi from remote devices. To do so, after re-enabling UFW (see last step of the previous section), enter the following commands in shell: +You have to allow connections to your Shairport Sync device from remote devices. To do so, after re-enabling UFW (see last step of the previous section), enter the following commands in shell: ``` sudo ufw allow from 192.168.1.1/16 to any port 3689 proto tcp diff --git a/UNINSTALLING.md b/UNINSTALLING.md deleted file mode 100644 index 33689814..00000000 --- a/UNINSTALLING.md +++ /dev/null @@ -1,21 +0,0 @@ - - -Uninstalling Shairport Sync -==== -This is under construction. - - - - - diff --git a/UPDATING.md b/UPDATING.md index 73e18fb0..cbfdc635 100644 --- a/UPDATING.md +++ b/UPDATING.md @@ -1,13 +1,17 @@ ### Updating Shairport Sync [Needs updating for Airplay 2] -This guide is for updating an installation of Shairport Sync. If you installed Shairport Sync from a package, most of these instructions don't apply – please go to the section at the end called "Post Update Tasks" +This guide is for building and updating an installation of Shairport Sync. + +If you updated Shairport Sync from a package, most of these instructions don't apply – please go to the section at the end called "Post Update Tasks". If you wish to build an installation of Shairport Sync to replace an installation that came from a package, instructions don't apply either – instead, please follow the guide at [INSTALL.md](https://github.com/mikebrady/shairport-sync/blob/master/INSTALL.md). To do an update, you basically have to go through the whole process of building Shairport Sync again, but a few steps are shorter because you've done them before; you won't have to reinstall the build tools or libraries needed, and you won't have to define the user and group or reconfigure the settings in the configuration file. But before you begin, you should update and upgrade any packages. -Here is the sequence for Raspbian Stretch, which is based on Debian Stretch. The same commands work for Ubuntu, and maybe more. Here, a non-`root` user with `sudo` privileges is assumed. +Note that in this guide, a `$` prefix means you should be in the normal user mode; a `#` prefix means you should be in the superuser or root mode. + +Here is the sequence for Raspberry Pi OS (Buster), which is based on Debian Buster. The same commands work for Ubuntu, and maybe more. Here, a non-`root` user with `sudo` privileges is assumed. ``` $ sudo apt-get update @@ -15,7 +19,26 @@ $ sudo apt-get upgrade ``` Next, stop playing music to your device. -Now, to update and install Shairport Sync, if you still have the directory in which you previously built Shairport Sync, it will contain the repository you originally downloaded. Navigate your way to it and 'pull' the changes from GitHub: +### Remove Old Copies +It's a good idea 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 +/usr/local/bin/shairport-sync +``` +Remove it as follows: +``` +# rm /usr/local/bin/shairport-sync +``` +Do this until no more copies of `shairport-sync` are found. This is especially important if you are building Shairport Sync over an old version that was installed from packages, as the built application will be installed in a different directory to the packaged installation. + +### Remove Old Startup and Service Scripts +You should also remove the startup script and service definition files `/etc/systemd/system/shairport-sync.service`, `/lib/systemd/system/shairport-sync.service`, `/etc/init.d/shairport-sync`, `/etc/dbus-1/system.d/shairport-sync-dbus.conf` and `/etc/dbus-1/system.d/shairport-sync-mpris.conf` if they exist – new ones will be installed if necessary. As with the previous section, this is especially important if you are building Shairport Sync over an old version that was installed from packages, as the scripts for the built application may be different to those of the packaged version. If they are left in place, bad things can happen. + +### Reboot after Cleaning Up +If you removed any installations of Shairport Sync or any of its startup script files in the last two steps, you should reboot. + +### Building the Updated Shairport Sync +Now, to build, update and install Shairport Sync, if you still have the directory in which you previously built Shairport Sync, it will contain the repository you originally downloaded. Navigate your way to it and 'pull' the changes from GitHub: ``` $ git pull diff --git a/audio_alsa.c b/audio_alsa.c index ed4f3c88..4aa6ee9b 100644 --- a/audio_alsa.c +++ b/audio_alsa.c @@ -1,7 +1,7 @@ /* * libalsa output driver. This file is part of Shairport. * Copyright (c) Muffinman, Skaman 2013 - * Copyright (c) Mike Brady 2014 -- 2019 + * Copyright (c) Mike Brady 2014 -- 2021 * All rights reserved. * * Permission is hereby granted, free of charge, to any person diff --git a/shairport-sync.spec b/shairport-sync.spec index 215b303c..ed0c3d49 100644 --- a/shairport-sync.spec +++ b/shairport-sync.spec @@ -1,5 +1,5 @@ Name: shairport-sync -Version: 3.3.7 +Version: 3.3.8 Release: 1%{?dist} Summary: AirTunes emulator. Multi-Room with Audio Synchronisation # MIT licensed except for tinysvcmdns under BSD, @@ -66,29 +66,31 @@ getent passwd %{name} &> /dev/null || useradd --system -c "%{name} User" \ %license LICENSES %changelog -* Tue Nov 1 2020 Mike Brady 3.3.8 +- Bug fixes and enhancements. +* Tue Nov 1 2020 Mike Brady <4265913+mikebrady@users.noreply.github.com> 3.3.7 - Jack resampling, bug fixes and additions to the pipe and stdout backends, to metadata and to the D-Bus and MPRIS interfaces. -* Thu Feb 20 2020 Mike Brady 3.3.6 - Jack resampling, bug fixes and additions to the D-Bus and MPRIS interfaces. -* Wed Nov 13 2019 Mike Brady 3.3.5 - Bug fixes and additions to the D-Bus interface. -* Mon Oct 28 2019 Mike Brady 3.3.4 - Bug fixes and minor enhancements. -* Fri Jul 26 2019 Mike Brady 3.3.2 - Minor bug fixes. -* Wed Jun 05 2019 Mike Brady 3.3.1 - Bug fixes. -* Fri May 24 2019 Mike Brady 3.3 - Audio enhancements, stability improvements, MQTT and Jack Audio interfaces. -* Sun Oct 14 2018 Mike Brady 3.2.2 - Compatibility with iOS 12 and mac OS Mojave AirPlay latencies. Minor bug fix. -* Fri Jul 13 2018 Mike Brady 3.2.1 - Stability improvements when soxr interpolation is chosen. -* Mon Jul 09 2018 Mike Brady 3.2 - New D-Bus and MPRIS Interfaces, Bug Fixes and Enhancements. -* Thu Dec 21 2017 Mike Brady 3.1.7 +* Thu Dec 21 2017 Mike Brady <4265913+mikebrady@users.noreply.github.com> 3.1.7 - Bug fix for unexpectedly resuming play at full volume from iOS 11.2 and macOS 10.3.2. -* Mon Dec 11 2017 Mike Brady 3.1.5 +* Mon Dec 11 2017 Mike Brady <4265913+mikebrady@users.noreply.github.com> 3.1.5 - Bug fixes and better compatibility with iOS 11.2 and mac OS 10.13.2. - Better AirPlay synchronisation. * Wed Sep 13 2017 Bill Peck 3.1.2-1 @@ -115,27 +117,27 @@ getent passwd %{name} &> /dev/null || useradd --system -c "%{name} User" \ - new optional loudness and convolution filters - improvements in non-synchronised backends - enhancements, stability improvements and bug fixes -* Fri Feb 24 2017 Mike Brady 2.8.6 +* Fri Feb 24 2017 Mike Brady <4265913+mikebrady@users.noreply.github.com> 2.8.6 - Many changes including 8- 16- 24- and 32-bit output -* Fri Oct 21 2016 Mike Brady 2.8.6 +* Fri Oct 21 2016 Mike Brady <4265913+mikebrady@users.noreply.github.com> 2.8.6 - Advertise self as ShairportSync rather than AirPort device 2.8.6 -* Sun Sep 25 2016 Mike Brady 2.8.5 +* Sun Sep 25 2016 Mike Brady <4265913+mikebrady@users.noreply.github.com> 2.8.5 - Bug fixes and small enhancements 2.8.5 -* Sat May 28 2016 Mike Brady 2.8.4 +* Sat May 28 2016 Mike Brady <4265913+mikebrady@users.noreply.github.com> 2.8.4 - Bug fixes and a few small enhancements 2.8.4 -* Fri Apr 15 2016 Mike Brady 2.8.2 +* Fri Apr 15 2016 Mike Brady <4265913+mikebrady@users.noreply.github.com> 2.8.2 - Stability improvements, bug fixes and a few special-purpose settings 2.8.2 -* Wed Mar 02 2016 Mike Brady 2.8.1 +* Wed Mar 02 2016 Mike Brady <4265913+mikebrady@users.noreply.github.com> 2.8.1 - Stability improvements and important bug fixes 2.8.1 -* Sat Jan 30 2016 Mike Brady 2.8.0 +* Sat Jan 30 2016 Mike Brady <4265913+mikebrady@users.noreply.github.com> 2.8.0 - Enhancements and bug fixes 2.8.0 -* Sun Oct 18 2015 Mike Brady 2.6 +* Sun Oct 18 2015 Mike Brady <4265913+mikebrady@users.noreply.github.com> 2.6 - Important enhancements and bug fixes 2.6 -* Thu Aug 27 2015 Mike Brady 2.4.1 +* Thu Aug 27 2015 Mike Brady <4265913+mikebrady@users.noreply.github.com> 2.4.1 - Minor bug fixes 2.4.1 -* Thu Aug 27 2015 Mike Brady 2.4 +* Thu Aug 27 2015 Mike Brady <4265913+mikebrady@users.noreply.github.com> 2.4 - Prepare for stable release 2.4 -* Wed Aug 26 2015 Mike Brady 2.3.13.1-1 +* Wed Aug 26 2015 Mike Brady <4265913+mikebrady@users.noreply.github.com> 2.3.13.1-1 - Harmonise release numbers * Fri Jul 24 2015 Bill Peck 2.3.7-1 - Initial spec file diff --git a/tinysvcmdns.c b/tinysvcmdns.c index 9e605e07..55e82ad2 100644 --- a/tinysvcmdns.c +++ b/tinysvcmdns.c @@ -735,7 +735,8 @@ static size_t mdns_parse_rr(uint8_t *pkt_buf, size_t pkt_len, size_t off, struct if (name == NULL) goto err; - // parse the MDNS RR section p += label_len(pkt_buf, pkt_len, off); + // parse the MDNS RR section + p += label_len(pkt_buf, pkt_len, off); rr->name = name; rr->type = mdns_read_u16(p);