Commit Graph
75 Commits
Author SHA1 Message Date
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 1488bf0a34 Remove a misleading comment. 2024-10-31 14:17:29 +00:00
Mike Brady b221e1322d in audio_jack.c, return the delay in terms of frames at Shairport Sync's output rate, not the Jack Audio server's internal rate. 2024-10-31 13:03:23 +00:00
Mike Brady b7d9c22de9 format adjustments 2023-09-11 16:01:38 +01:00
Michiel De Witte ef01dc541e Add missing format string argument 2023-06-20 11:10:54 +02: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
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 67e9b1b6cd partial move to using a nanosecond-based system timer. More to come. 2020-02-24 19:40:44 +00:00
Pieter De GendtandPieter De Gendt 32646f22e2 jack: Rename soxr "recipe" to "quality" and configurable buffer size 2019-12-23 09:10:08 +01:00
Pieter De GendtandPieter De Gendt 311909a2dd Fix input buffer while resampling 2019-12-03 12:17:42 +01:00
Pieter De GendtandPieter De Gendt 7285b1ee03 Jack output add soxr resampling 2019-12-03 10:02:22 +01:00
Chris Boot b9cf91b2bb More typo fixes across the tree
Previously I have made spelling changes as caught by Debian's lintian
tool, which has a short list of common misspellings that it tests for.
This time I decided to run codespell against the source and fix all the
obvious problems it came up with. It also uses a list of misspellings
but it's much larger than lintian's, but also has some false positives
so I went over the list by hand.

The command I used to do check the source was:
git ls-tree -rz --name-only HEAD | xargs -0 codespell -L minimise,errorstring
2019-07-27 00:05:38 -03:00
Mike Brady c8b0be30b4 find . \( -name \*.cpp -or -name \*.h -or -name \*.c \) -exec clang-format -i -style='{BasedOnStyle: llvm, IndentWidth: 2, ColumnLimit: 100}' '{}' \; 2019-06-19 19:06:54 +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
Jörn Nettingsmeier e59da78348 Fix segfault due to missing null check... 2019-02-16 21:26:32 +00:00
Jörn Nettingsmeier b361ad84fc NOP. Reformat code consistently, improve comments. 2019-02-16 19:57:28 +00:00
Jörn Nettingsmeier 31bbd743a5 Use appropriate warn/inform/debug levels. 2019-02-16 19:01:37 +00:00
Jörn Nettingsmeier 97370d8bce Actually implement auto-connection, and document it. 2019-02-16 18:45:51 +00:00
Jörn Nettingsmeier 4f39e0d830 Move away from hardcoded channels. Centralizes information, simplifies the code, and might be helpful for future surround support. 2019-02-16 16:09:29 +00:00
Jörn Nettingsmeier 28ea6972af Add dummy option jack_autoconnect_option. 2019-02-16 15:33:29 +00:00
Jörn Nettingsmeier 5c1769f87c Partly revert c00199d664, some 0 are actually longs. It's late :( 2019-02-16 02:28:59 +00:00
Jörn Nettingsmeier 3a4deb38a2 Declare all file-global variables as static, remove unused thread pointer. 2019-02-16 02:26:36 +00:00
Jörn Nettingsmeier 90f24c62df Add myself to (C)omplain-to tag :-D 2019-02-16 02:20:21 +00:00
Jörn Nettingsmeier c00199d664 Always use NULL instead of 0 for pointers for clarity. 2019-02-16 02:15:35 +00:00
Jörn Nettingsmeier 95246dcd84 Use more conservative JACK client name (a simple token without whitespace). 2019-02-16 02:05:05 +00:00
Jörn Nettingsmeier 4751a4e1bc Move jack base latency computation out of delay() into graph() to save cycles. 2019-02-16 02:03:15 +00:00
Jörn Nettingsmeier bda8b99cda Add graph reorder callback, this is where we now compute the output latencies. 2019-02-16 01:53:49 +00:00
Jörn Nettingsmeier f1ba07ff2b Make callback names simpler and more consistent. Always use &callback in setter functions to make the function pointer explicit, even though it's not syntactically necessary. 2019-02-16 01:02:30 +00:00
Jörn Nettingsmeier 0009fcddf6 Revert "Remove client_mutex, since JACK opening and closing is now single-threaded."
That was a bit too optimistic, I guess. Must understand more about the rest of shairport-sync.
Fixes spurious segfault on program termination with CTRL-C that does not happen in gdb :)
This reverts commit 8e46c727d5.
2019-02-16 00:53:04 +00:00
Jörn Nettingsmeier 55797c8387 Remove unused headers. <getopt.h> will come back once we implement command line parsing, the others may well be gone for good. 2019-02-15 23:51:11 +00:00
Jörn Nettingsmeier 8e46c727d5 Remove client_mutex, since JACK opening and closing is now single-threaded. 2019-02-15 23:45:12 +00:00
Jörn Nettingsmeier 2826756938 Remove global client_is_open flag, always execute former conditional statements. We know we're open. 2019-02-15 23:43:00 +00:00
Jörn Nettingsmeier 753cc07777 Remove optional is_running() API call, since it doesn't do anything useful.
We are either already running along just fine, or we are throughly dead.
2019-02-15 23:39:53 +00:00
Jörn Nettingsmeier 1906bfd727 Remove indirections open_if_needed() and close(), can now be integrated into API calls init and deinit. 2019-02-15 23:38:01 +00:00
Jörn Nettingsmeier ec68c677e0 Remove jack_stop() function pointer from API struct, since it does nothing. Checked, no segfault on program termination. 2019-02-15 23:17:50 +00:00
Jörn Nettingsmeier 8c5e85c87c Remove audio_client_disconnect option. This is not good behaviour for a JACK client, and adds nothing. 2019-02-15 23:14:31 +00:00
Jörn Nettingsmeier edd699dfbc Remove auto_client_open_interval option, always open JACK connection immediately or fail.
Remove client creation thread and wrapper function.
2019-02-15 23:08:04 +00:00
Jörn Nettingsmeier 63b3381a27 Fail early and fail deadly (AFAIK there is no fallback to another audio backend, so any severe JACK issue should be fatal). 2019-02-15 22:59:31 +00:00
Jörn Nettingsmeier adefcc698c remove unused globals 2019-02-15 19:34:23 +00:00
Jörn Nettingsmeier 0b589cbe6d Remove option to configure port names. This is very unusual for a JACK client, nothing is gained by offering this, and it might confuse users. 2019-02-15 19:29:24 +00:00
Jörn Nettingsmeier 89a8add7af NOP: move external API functions to the end, ordered by struct audio_output 2019-02-15 18:57:15 +00:00
Jörn Nettingsmeier 91a8553a02 Declare all JACK callbacks static (they are accessed via function pointers only). 2019-02-15 18:43:51 +00:00
Jörn Nettingsmeier 9520e89183 Declare all functions static that are not callbacks and not in audio_jack API struct.
If there are any calls from the outside I haven't thought of, that should make them fail.
2019-02-15 18:39:20 +00:00
Jörn Nettingsmeier d7c7365bb1 comment out some debug statements not relevant to users 2019-02-15 18:31:23 +00:00
Jörn Nettingsmeier a3201ff290 Declare deinterleaving function static, it's nobody else's business. 2019-02-15 18:22:33 +00:00
Jörn Nettingsmeier ec13a2bb3a Do not query the JACK port latency on every process() call. It can only ever change when the graph is reordered. 2019-02-15 18:19:44 +00:00
Jörn Nettingsmeier aefd7cdb33 remove more dead code and obsolete comments 2019-02-15 18:09:36 +00:00
Jörn Nettingsmeier 120e95fc66 Add parentheses around macro to avoid breakage with stronger-binding operators. 2019-02-15 18:06:36 +00:00