Commit Graph
85 Commits
Author SHA1 Message Date
Mike Brady 3cbc4b1899 Fix the incorrect signalling of the DACP port to the DACP monitor, send 'dapo' port info as text and send a token of "0" when the port becomes inaccessible. 2026-05-09 17:44:37 +01:00
Mike Brady 0e4bb2a8ff Quieten a compiler warning on Ubuntu 26.04. 2026-05-05 12:02:51 +01:00
Mike Brady 11052b7896 Lot of changes here.
1. check_classic_mac_basic.yml — update to latest macOS-latest
2. docker-on-push-tag-or-pr — dependant updates
3. FFTConvolver — fix a compilation warning when the DEBUG flag is turned off
4. Reorganise some source files — e.g. move most of the metadata stuff into a subdirectory
5. Remove unused special-purpose AirPlay 2 RC event handler.
6. Reorganise source files and source code relating to the standard event handler.
7. Check configuration settings a little more carefully to offer more meaningful diagnostics.
8. Add password to AirPlay 2 and reorganise initialisation to set AirPlay 2 flags accordingly.  Also, remove redundant airplay_pin.
9. Remove redundant debug facility definitions from common.h
10. Make it possible to omit all the dacp stuff from a build.
11. Make it possible to omit metadata multicast from a build.
12. Add AP2-native metadata by setting bit 50 of features to true.
13. Improve stability when pre-empting an existing play session.
14. Fix a few compiler warnings in the pair_ap library.
15. Ensure that the audio format is known before starting synchronisation.
16. Improve handle_configure to set/clear a new config setting. Doesn’t seem to do anything…
17. Experimentally turn off bit 46 of AirPlay 2 features — seems to stop failing pair-verify attempts.
2026-04-26 10:23:18 +01:00
Rudi HeitbaumandGitHub ecc30968e7 fix handling of missing const type qualifier
For ISO C23, the function strrchr that return pointers into their input arrays now have definitions as macros that return a pointer to a const-qualified type when the input argument is a pointer to a const-qualified type.

Update to const type for variable, as returned string is only used in comparisons which const can be used
2026-02-14 15:12:07 +11:00
Mike Brady b405c0b896 Version 5.0 Major Release.
New Features:
Multi-Channel and High-Resolution Audio Support
48,000 frames per second ("48k") operation.
48k lossless stereo support.
5.1 and 7.1 surround sound support.
Multi-channel and multi-rate operation on ALSA, PipeWire, PulseAudio, FreeBSD, stdout and Unix pipe output backends.
Automatic Audio Format Selection
Flexible and controllable output format selection.
Automatic rate, sample format, and channel count selection.
Full FFmpeg Integration
Support for transcoding.
Advanced resampling capabilities.
New audio format support.
Enhanced Resampling
New vernier resampling and interpolation method optimized for low-power CPUs.
Better performance on resource-constrained devices.

Convolution and Loudness Enhancements:
Convolution system is now multithreaded and works on stereo and multichannel audio at 48k and 44.1k.
Multiple impulse response (IR) files can now be provided via convolution_ir_files setting.
New convolution_thread_pool_size setting for multithreaded processing (defaults to 1).
Loudness processing now works with stereo and multichannel audio at 48k and 44.1k.
Updated to the most recent HiFi-LoFi FFT convolver.

MQTT Enhancements:
Added new publish_retain boolean option. When enabled, published MQTT messages have the retain flag set, so the MQTT broker stores the last message per topic and new subscribers receive the most recent value immediately. Thanks to lululombard for PR #2142.

D-Bus Enhancements:
Added new dbus_default_message_bus command-line argument (can be system or session) to set the default message bus for both D-Bus native service and MPRIS service.

Performance Improvements:
Enhanced compatibility with AirPlay 2 AutoMix and Smart Tracklists resulting in less unexplained track skipping.
Better operation on low-power devices down to Raspberry Pi B.
Improved efficiency on embedded systems.
Enhanced timestamp handling for better synchronization.
Improved sync error calculation.
Rebuilt buffered audio processor for cleaner handling of immediate and deferred flush requests.

Docker Enhancements:
Reduced Docker image sizes with slimmed-down FFmpeg library.
Removed dhclient from Docker images for smaller footprint.

Bug Fixes:
Fixed MQTT warning on service startup: "Could not establish a mqtt connection". The startup script now correctly states that the mosquitto service is required. Thanks to Hugo Villeneuve for PR #2137.
Fixed compatibility with mbedtls library version 3.4+ (present on recent Linux versions). Thanks to Christian Beier for finding and fixing the bug.
Fixed PulseAudio backend so that PA_ERR_NODATA returns "No latency data yet". Thanks to Vladimir Shakov for the report and fix.
Ensured old flush requests are deleted when a new play session starts. Thanks to saujanyashah for the report.
Fixed format warnings on 64-bit and 32-bit systems
Removed compilation warnings on 32-bit builds
Improved argument checking for debug(), inform(), warn() and die() functions
Fixed "daemon" typos throughout codebase. Thanks to Chris Boot for PR #1981.
Added warning if a convolution impulse response file cannot be read due to bad path or permissions

Build System Improvements:
Unified service file with variable substitution for Avahi support, making it easier to add future service dependencies. Thanks to Hugo Villeneuve.
Network interface selection now only considers interfaces that are up, running and not loopback interfaces. Thanks to Carl Johnson for the suggestion.
Configuration File Changes and Deprecations

New settings: convolution_ir_files (replaces convolution_ir_file), convolution_enabled (replaces convolution), convolution_max_length_in_seconds (replaces convolution_max_length), loudness_enabled (replaces loudness).
New convolution_thread_pool_size setting (defaults to 1).
Deprecated settings: convolution_ir_file, convolution, convolution_max_length, loudness.
Corresponding D-Bus methods and properties have been updated.

Deprecation Notice:
The Jack Audio and soundio backends are deprecated and will be removed in a future release. Consider using the updated PipeWire backend instead.

Documentation Updates
Updated BUILD.md with latest build instructions.
Updated AIRPLAY2.md with feature information.
Enhanced convolution and loudness documentation.

Maintenance:
Fixed FFmpeg deprecation warnings.
Bumped actions/checkout from 6.0.1 to 6.0.2.
Bumped docker/login-action from 3.6.0 to 3.7.0.
Bumped docker/build-push-action from 6.13.0 to 6.15.0.
Bumped docker/setup-qemu-action from 3.4.0 to 3.6.0.
Bumped docker/setup-buildx-action from 3.9.0 to 3.10.0.
2026-02-13 15:17:40 +00:00
Mike Brady 04e3f89130 Very very rarely, the avahi client becomes disconnected.
This usually means there are problems in the system as a whole rahter than with Shairport Sync.

However, Shairport Sync was not cleaning up properly before deleting the now-disconnected avahi client and
creating a new one in an attempt to reconnect. That caused Shairport Sync to crash even if the new avahi client
was created successfully.

So this commit has code to delete the avahi group and broswer callback before deleting the disconnected avahi client.
2023-09-27 10:36:28 +01: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 23d86d0a60 ensure avahi threaded poll lock is unlocked when the program is terminated. 2022-05-23 16:09:27 +01:00
Mike Brady a382ac6672 Clang Format 2022-03-14 11:56:43 +11:00
Mike Brady 4322f67fe2 Exit with a message in the log if the name to be used for the service is already in use. 2022-01-02 10:06:36 +00:00
Mike Brady 7258a45bea Fix a few more memory leaks 2021-12-07 19:58:00 +00:00
Mike Brady 7fde77c45d lock the avahi thread before modifying the strings 2021-09-01 16:39:32 +01:00
Mike Brady 4090b2d8fb Avoid repreatedly asking Avahi to monitor for the same DACP-ID. Quieten some debug messages. 2021-07-22 13:23:57 +01:00
Mike Brady 2e4156d39f Add the ability to update the ap1 and ap2 strings dynamically 2021-07-19 17:16:37 +01:00
Mike Brady a109b587ec Flush seems to be working properly and reliably. Some audio glitches removed too by dropping the first two AAC blocks of any passage. Crude. Flush diagnostic linked list stuff left in place. 2021-05-30 11:17:06 +01:00
Mike Brady e1034e1131 Advertise the _raop._tcp service as well as the _airplay._tcp service. Use a real MAC as the basis for the device ID. 2021-05-24 12:07:05 +01:00
Mike Brady 3a02b79a62 Update the mdns stuff to work with a string, update audio_alsa rtp.c, rtsp.c and shairport.c to build and work in AirPlay 1 but with AirPlay 2 code in place. Some of it is #defined out. 2021-04-30 09:29:30 +01:00
Mike Brady df7d6df0ad Change a slightly misleading comment 2020-07-08 21:21:42 +01:00
Mike Brady 282871eaba Remove leading zeroes from an incoming DACP ID in another place 2020-07-08 10:20:15 +01:00
Mike Brady 4e1f74db87 Quieten some debug messages. 2020-06-21 13:16:08 +01:00
Mike Brady 54d761ff7d Clean up some of the wording and layout of the configuration file
Clean up and improve the way lead-in sillence is used to give a more accurate sync time to the first packet of audio.
Allow very good sync to occur with 0.3 seconds of lead-in silence.
Improve the use of the buffer offset.
Format some other files.
2020-05-18 16:55:09 +01:00
Mike Brady eef6bbf983 Remove leading zeroes from the DACP ID provided by mDNS 2020-03-26 17:03:53 +00:00
Mike Brady cf70c12392 avoid a compilation warning when the dacp stuff isn't needed 2019-09-04 09:37:48 +01:00
Mike Brady 4d6f5b4844 Remove second avahi threaded poll, remove service client. 2019-09-03 10:47:10 +01:00
Mike Brady e454572dc7 Further debug tidy-ups and update the configuration file. 2018-12-11 11:26:39 +00:00
Mike Brady 72079adaf4 Initial shot at tidying up the avahi monitoring for DACP Id port information to make it survive abnormal temrination of play sessions. 2018-12-08 21:55:49 +00:00
Mike Brady 69642bb7de Partly clean up use of automake, autoconfig and compiler flags. Works but still not consistent. 2018-09-09 14:12:20 +01:00
Mike Brady 5f750ba9b7 Fix a few memory leaks. 2018-07-22 16:12:52 +01:00
Mike Brady f1d4503431 Try to add proper cancellation code to all threads -- not complete, buggy. 2018-07-20 13:50:38 +01:00
Mike Brady d3b79b965d Make more of the code amenable to pthread cancel 2018-07-14 19:34:31 +01:00
Mike Brady c2e3fa5aa7 Move ab_mutex, flow control CV and flush mutex initialisation and teardown out of the player thread. Thus remove need for player theread lock. Format some of the surce files. 2018-07-14 13:38:29 +01:00
Mike Brady 7e0f6acb55 Tidy up some avahi code and some player code, but bug not fixed 2018-07-11 20:49:31 +01:00
Mike Brady de18096762 add some debug messages to avahi code returns 2018-06-19 17:18:57 +01:00
Mike Brady d805ce914e Make some essentially cosmetic changes to return memory when the program exits. The program never exits, but it's good for valgrind. 2018-05-11 10:56:16 +01:00
Mike Brady ed0ce06e82 Fix a few tiny typos and rationalise some debug message levels. 2018-04-16 10:00:22 +01:00
Mike Brady 08a7d4ffb5 Use snprintf in place of sprintf. 2018-04-08 15:36:05 +01:00
Mike Brady 07b7e64a48 Fix some of the advanced remote code 2018-04-01 13:54:41 +01:00
Mike Brady 32c7a535a1 Make scanning for DACP port part of the dacp handler. Only emit 'clip' and 'svip' for a play connection, suppress 'pfls' until 'pffr' has been emitted 2018-03-31 17:34:59 +01:00
Mike Brady d692fab9e4 Clean up native dbus interface files and associated changes to existing files. 2018-03-20 16:31:59 +00:00
Mike Brady c02e53ea80 Add server status -- i.e. can we still send commands to the DACP server. Hook it up as "Server" property in basic remote control. 2018-03-19 16:53:58 +00:00
Mike Brady 8991f3420c Remove many causes of warnings at the -Wextra level 2018-03-07 20:48:21 +00:00
Mike Brady c36a7822a3 Tidy up using clang-format 2018-03-07 14:35:25 +00:00
Mike Brady 07e46565ca Eliminate almost all warnings from -Wall 2018-03-07 14:29:14 +00:00
Mike Brady b05ced6658 Make the scan interval five seconds and quieten some more debug messages. 2018-02-21 18:38:13 +00:00
Mike Brady 3208b0c1ab Quieten some debug messages 2018-02-19 20:54:13 +00:00
Mike Brady 20a453d96e Quieten some avahi messages. 2018-02-18 18:31:17 +00:00
Mike Brady 3a4e29c5c6 Tidy up dacp scanner -- stop scanning when audio source goes offline. 2018-02-18 16:29:09 +00:00
Mike Brady 065eada6b5 Separate out metadata hub, dacp client, mpris and dbus interfaces a bit. Probably not finished. 2018-01-09 15:56:06 +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 26efce2141 Fix segmentation fault bug when a client's DACP status is withdrawn. Not enough testing... 2017-12-13 23:46:11 +00:00