Commit Graph
61 Commits
Author SHA1 Message Date
Mike Brady f30dd7aee6 Enhancements
Enable the AirPlay 2 build to operate an optional classic-AirPlay-only service or to gracefully degrade to classic AirPlay, as follows:
  1. Add a new command-line option '-—service-type=<type>' and an equivalent configuration entry 'service_type = "<type>"' in the 'general' section of the configuration file,
     where <type> can be "auto", "classic" or "airplay2":
      1. "auto" (default) means that the service will be AirPlay 2 if NQPTP is running. If NQPTP is not running, classic AirPlay service will be provided instead, and in that case,
      "(Classic)" will be appended to the default AirPlay service name visible to AirPlay clients like Apple Music, for example "RaspberryPi3B (Classic)".
      2. "classic" means the service will be classic AirPlay (aka AirPlay 1).
      3. "airplay2" means the service will be the modern AirPlay 2. In this case, as distinct from "auto", if NQPTP is not running, Shairport Sync will log an error and terminate.
  2. In the systemd service file, NQPTP is now a "Want" rather than a "Require". If it's present, then it will be launched before Shairport Sync. If it's absent, Shairport Sync will launch anyway.
  3. Improve the delivery of input format changes and emit 'sdsc' metadata when changes occur.
  4. Emit new format information in the log if statistics is enabled.

Docker Changes
  1. Support for linux/arm/v6 has been dropped, as Docker is no longer supported.
  2. NQPTP is not started in the AirPlay 2 Docker image if '--service-type=classic' or '--service-type=airplay1' is in the command line options at the end of the docker run command.
     The purpose is to ensure that ports 319 and 320 are left alone when the AirPlay 2 image is set to provide Classic service only.
     Note that setting the configuration file 'service_type' to 'classic' will not prevent NQPTP from starting up -- you must use the command line option.
  3. A new "dev" target has been added. It is a large image containing the custom-built FFmpeg library, NQPTP, Avahi and D-Bus along with the Shairport Sync source and
     all necessary development tools. When started, Avahi, D-Bus and NQPTP are all installed and running. The bash shell has also been added and is entered.

Stability Improvements
  Reorganise session preemption to fully terminate the existing session before starting a new one.
  Don't delay closing the event port to wait for it to be closed at the client end.
  Add a safe_socket_close() function to ensure sockets are fully closed. Use -1 to designate closed rather than 0, to prevent attempts to reclose sockets, causing mayhem.
  Re-order FFmpeg decommissioning during teardown.
2026-05-18 09:57:12 +01:00
Mike Brady 68b6d4dfb7 Fix missing configuration mapping parameter in PulseAudio backend initialisation. 2026-04-27 12:46:13 +01:00
Mike Brady 16b6534ad3 further changes to remove compilation warnings on 32-bit builds 2025-12-31 19:02:16 +00:00
Mike Brady 691d71f356 More fixes due to tightening the checks on debug/die/inform/warn varadic arguments. 2025-12-30 16:56:30 +00:00
Vladimir c97efa1248 audio_pa.c: pa_delay, return "No latency data yet" on PA_ERR_NODATA 2025-12-20 21:21:13 +01:00
Mike Brady e05448aecc Check for configuration strings that are given but turn out to be empty, issue a warning and ignore them. 2025-04-14 10:40:26 +01:00
Mike Brady 60143518c2 This squashed commit comprises a long series of improvements, bug fixes, optimizations, and new feature additions:
- 48,000 frames per second operation,
 - 48k lossless stereo, 5.1 and 7.1 surround sound
 - Multichannel and multi rate operation on ALSA, PipeWire, PulseAudio, FreeBSD, stdout and unix pipe output backends.

Automatic, flexible and controllable output format (rate, sample format and channel count) selection.

Full FFmpeg integration to support transcoding, resampling, and new audio formats.

Better operation on lower powered devices down to e.g. Raspberry Pi B.

Reduced Docker image sizes with a slimmed-down FFmpeg library.

Enhanced timestamp handling for better synchronization.

Improved the sync error calculation.

A new "vernier" resampling and interpolation method for low-power CPUs.

Bug fixes and minor enhancements.

Note -- there are many breaking changes from previous versions of Shairport Sync!
2025-02-23 13:31:17 +00:00
Mike Brady d166477eb9 Quieten a benign compiler warning 2024-12-05 09:55:08 +00:00
Ambrose Li 998776e496 minor typo 2024-05-14 04:44:58 -04:00
Ambrose Li 47f893ba2a use constant RATE for clarity 2024-05-14 04:25:10 -04:00
Mike Brady 420fe4ca7e Remove code that was double-deallocating settings strings. 2023-10-06 10:50:30 +01:00
Mike Brady 3db689f9e8 Deallocate settings strings on exit. 2023-10-05 09:39:22 +01:00
Mike Brady afdf0d8632 Stability improvements -- take more care when the fifi is full, fix a logical error in the use of the buffer mutex. 2023-10-01 09:28:41 +01:00
Mike Brady d1294c335e stop linker errors if built alongside audio_pa 2023-09-30 17:25:42 +01:00
Mike Brady 786481d855 mutex lock was protecting the wrong variable, duh. 2023-09-30 15:41:40 +01:00
Mike Brady b3af03ebc0 fix a warning of discarding a const property 2023-06-10 15:36:40 +01:00
Mike Brady 66ca645002 Check the pulseaudio stream whenever the pa backend is called. Warnings are issued for apparent problems. 2023-01-18 12:52:11 +00:00
Mike Brady b35d470c77 tidy up a few small things. 2023-01-13 20:46:54 +00:00
Mike Brady a16933bbc1 Stop using the pa_stream_is_suspended, but check writing errors more carefully. 2023-01-13 20:41:27 +00:00
Mike Brady 0ac1c0d8b5 Check to see if the stream is suspended when accessing it or sending data. 2023-01-13 18:06:34 +00:00
Mike Brady c2e4ab29f1 Quieten some debug messages 2023-01-13 15:19:46 +00:00
Mike Brady 99ca92998e Gremlin fix and comment tidy-up 2023-01-13 15:08:51 +00:00
Mike Brady 20dca3c542 Clean up the PulseAudio backend to open a stream once only. 2023-01-13 14:33:30 +00:00
Mike Brady e8b8c6edb7 Clang cleanup 2022-11-18 18:14:50 +00:00
Mike Brady 60e913dd6e In the PulseAudio backend, Whenever a play or latency request is made, open the stream if it is closed. 2022-11-16 10:02:00 +00:00
Mike Brady fd880056fb Squashed commit of the following:
Add three parameters to the backend play() function call -- (1) a flag indicating whether the samples are timed or not. If timed, (2) the timestamp and (3) the local time at which the first frame should be heard.
    Update missing pipewire library message.
    Makefile.am fix.
    Update the SHM version and fix the SHM name so that it works with FreeBSD.
    Remove redundant (?) AC_HEADER_STDC check.
    Fix compilation and installation under FreeBSD -- changes to allow building in a separate directory broke the FreeBSD build process.
    Add AC_CHECK_LIB for gcrypt in case PKG_CHECK_MODULES fails to find it.
    Find gcrypt using pkg-config
    Add code to detect when the RTSP channel goes idle for a period, and use it to reset clocks and timings, etc. so that SPS resumes correctly where the source has gone to sleep while playing a realtime stream and has subsequently woken up.
    Don't exit if a UDP Clock Control packet is empty. Also check minimum packet size.
    Remove some very experimental code which may cause memory and port leaks.
    Strip file path from the filename used in debug messages, information messages, warnings and fatal error messages.
    BB fix to Makefile.am -- overwriting the DBUS stuff with MPRIS definitions, duh.
    Fix some problems building on FreeBSD and tidy up the use of the "sed" editor.
    Fix some problems building on picore.
    Fix an uninitialised variable
    start using the "nqptp" SMI
2022-09-12 15:19:52 +01:00
Mike Brady cd9da86fc3 Add a 'stats' function to the audio back ends to replace the 'rate_info' function. Zero all except the alsa back end. 2021-11-20 13:59:16 +00:00
Guillaume Revaillot aacc4e802b Allow to specify pulseaudio server instead of using default one.
Add "server" entry to pa config section, allowing to connect to a remote or a local system
pulseaudio instance instead of letting pulseaudio choose.
2020-03-27 09:39:11 +01:00
Mike Brady 83c0405d03 Add automatic bit depth and speed selection for alsa devices. Set rate and format to "auto" by default. Always look for the greatest bit depth, but the lowest multiple of 44,100.
Improve support for big-endian CPUs by adding support for explicit -endian formats, i.e. S16_LE, S16_BE, S24_LE, S24_BE, S32_LE, S32_BE.

For the "disable_standby_mode" setting, change "while_active" to "auto".
2019-05-07 10:19:04 +01:00
Mike Brady 89340f20c9 3.3 release candidate 0 2019-03-04 12:38:20 +00:00
Mike Brady 552218ab6e Clean up audio help texts, add in the volume_range_hw_priority setting. 2019-02-05 11:26:54 +00:00
Mike Brady aa5698fce2 Remove the preflight call - don't seem to need it. 2019-01-27 15:53:36 +00:00
Mike Brady caf06c5aba Add the idea of a preflight message to tell the backend that frames will be coming... 2019-01-07 17:34:50 +00:00
Mike Brady 80f15e1f57 clang format 2019-01-04 17:26:55 +00:00
Mike Brady 5e38fcd50f Add default values for the interpolation threshold 2019-01-04 17:06:21 +00:00
Mike Brady e0a4e5cde8 Format tidy-up 2018-10-21 17:10:23 +01:00
Mike Brady 2f73f1ac66 Revert previous change which was to unreference a stream prior to disconnection -- not needed. 2018-09-21 18:22:23 +01:00
Mike Brady ae97af4ad1 Revert previous change which was to unreference a stream prior to disconnection -- not needed. 2018-09-21 18:18:32 +01:00
Mike Brady 0dce052535 Remove debug messages from pa start and pa stop 2018-09-21 17:45:13 +01:00
Mike Brady c57d25652e Unreference the pa stream when finished with it, so that it the sink can go idle. 2018-09-21 17:41:50 +01:00
Mike Brady 52af6c6c9a Unreference the pa stream when finished with it, so that it the sink can go idle. 2018-09-21 17:36:49 +01:00
Maciej Wilczynski 947a0ca291 Add PA sink configuration option 2018-09-15 20:49:11 +02:00
Mike Brady 8cabb16f25 Initial very rough attempt at a jackaudio backend. 2018-08-31 12:39:18 +01:00
Mike Brady ea20840d6c Make the play function return a status (ignored for the present). Clean up audio_alsa by removing all the die calls and placing the alsa_mutex calls in pthread cleanup routines. 2018-07-29 13:45:42 +01:00
Mike Brady 8f76c853ed clean up audio_pa definition of play 2018-05-14 10:01:15 +01:00
Mike Brady 0cd8a2ce90 Remove more causes of warnings at -Wextra levels 2018-03-07 22:05:11 +00:00
Mike Brady 07e46565ca Eliminate almost all warnings from -Wall 2018-03-07 14:29:14 +00:00
Mike Brady 1637a79dd6 Add tinyhttp code for sending and reading responses. Clean up some dacp routines. Most new and modified rooutines untested. 2017-12-18 18:50:01 +00:00
Mike Brady 8ab46494fa Make some additions to audio_pa to emit erro messages before it dies 2017-12-06 20:59:36 +00:00
Mike Brady d46172e2eb Don't disable PulseAudio autospawn 2017-10-30 10:45:38 +01:00