Commit Graph
292 Commits
Author SHA1 Message Date
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
Mike Brady f771774519 Compiles under gcc-10 with -fno-common 2020-02-13 17:37:41 +00:00
Mike Brady aeb46892e0 correct frame size entry for S24 format 2019-11-09 09:35:04 +00:00
Mike Brady 1b4c9b1783 quieten a debug message 2019-09-10 13:10:49 +01:00
Mike Brady e8a92d3c3b ensure alsa mixer is initialised before trying to set volume. Normalise the 'pvol' volume mesasages to the hardware devices' maximum volume when using combined hardware and software attenuation. 2019-09-10 13:03:54 +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 a8faacd3fc Expose some of the settings used in the disable_standby_mode.
Specifically, firstly, the disable_standby_mode_silence_threshold, which is the
amount of audio in the output device's hardware buffer. It should normally
be close to the value givein in the audio_backend_buffer_desired_length_in_seconds
setting. If it drops to this value, silence is added to the buffer to prevent
the output device from becoming idle.

Secondly, the disable_standby_mode_silence_scan_interval is the time between checks
of the output device's hardware buffer.

The code for generating frames of possibly-dithered silence has been simplified.
2019-06-20 10:45:27 +01: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 BradyandGitHub 1ca9226242 Update audio_alsa.c 2019-06-17 22:25:47 +01:00
Mike Brady 7013b0cc3d refine the selection of precision timing to be allowed only if the device is a real hardware device 2019-06-17 19:43:23 +01:00
Mike Brady 9199bf24dd fix the detection of the availability of precision timing information -- actuall, renable it 2019-06-17 10:38:20 +01:00
Mike Brady a46c761aa6 make snd_pcm_recover silent when the debug level is 0, not the other way around, duh. 2019-06-17 10:04:23 +01:00
Mike Brady 65abca2562 change the threshold for turning off disable standby mode to more than 40 underruns in the first 100 writes. 2019-06-17 09:47:56 +01:00
Mike Brady cd9982c43b if disable_standby_mode is enabled, disable if if more than 20 underruns occur for 50 silence buffers at the start. 2019-06-17 09:39:04 +01:00
Mike Brady dbea82c212 restore full code for checking for precise timing but stop making it necessary for disable standby mode. 2019-06-17 07:54:04 +01:00
Jörg KrauseandGitHub 854942df92 Debug requested period size value 2019-06-04 20:47:43 +02:00
Mike Brady 3ca3408255 Fix error message for invalid standby mode choice 2019-06-04 15:32:10 +01:00
Mike Brady 4bafe1c982 quieten a compilation warning 2019-06-03 10:03:54 +01:00
Mike Brady 76ad4e6a73 enable specification of specific formats and/or speeds to turn off automatic format/speed selection, fixing a bug. Clarify some of the warnings. Fix a few typos in the configuration file sample. 2019-05-29 16:00:47 +01:00
Mike Brady d9168f4aa7 remove a strncpy truncation warning
update a timing setting in the settings file
list the alsa hardware devices in the -h message
2019-05-17 10:43:54 +01:00
Mike Brady f13f22d857 Fix stupid auto format error. 2019-05-07 12:22:23 +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 1d32976d07 Improve support for bigendian devices. Add support for S16_LE, S16_BE, S24_LE, S24_BE, S32_LE and S32_BE formats. Make the default S16_LE. Allow precision timing only on alsa devices with names beginning with "hw:". Use snd_pcm_hw_params_is_monotonic() to see if clock is monotonic. 2019-05-01 11:01:15 +01:00
Mike Brady 449a9be55e make Shairport Sync die for some other serious alsa device errors 2019-04-09 22:37:59 +01:00
Mike Brady 84eecaf722 use abort() to exit after a "die" call and fix the logic of opening the alsa device -- success was causing it to die, duh. 2019-04-09 22:26:26 +01:00
Mike Brady d3072ae827 Give error if alsa output device can't be found. 2019-04-09 11:35:46 +01:00
Mike Brady 986f2fb4bd hook up the alsa "use_precision_timing" option and update the sample conf file. 2019-04-09 11:06:52 +01:00
Mike Brady aac57c9cdc add standard timing -- more compatible -- and precision timing -- more precise. Add option reader but it's not connected up yet. 2019-04-09 10:23:23 +01:00
Mike Brady 5d005e211a Dirty Hack #11 -- avoid using pcm_get_status 2019-04-08 21:55:18 +01:00
Mike Brady 06e9f370c2 Dirty Hack #10 -- add a snd_pcm_prepare call 2019-04-08 21:45:59 +01:00
Mike Brady 3d73e8153d Dirty Hack #9 2019-04-08 21:28:56 +01:00
Mike Brady 60c2bf27f6 Dirty Hack #8 2019-04-08 21:14:46 +01:00
Mike Brady 1f45b8c006 allow calculation of nominal source frame rates even when the connection is error prone. 2019-04-02 15:37:38 +01:00
Mike Brady ac51c10116 Add back the flag to control the logging of the note, duh. 2019-04-02 14:45:51 +01:00
Mike Brady 98c8d04e03 slight changes to messages 2019-04-02 14:23:35 +01:00
Mike Brady 5e143fe691 relate initial silence buffer size to the ilent leadin time available 2019-04-02 12:52:36 +01:00
Mike Brady 539dea7d3d Some messages made a bit more useful 2019-04-02 12:28:01 +01:00
Mike Brady c687dadd14 change how the initials size of the silence sent to the dac is calculated, to make it pretty large 2019-04-02 12:24:02 +01:00
Mike Brady d883575916 Add tentative raw PCM input facility. Clean up some messages. 2019-03-27 11:44:58 +00:00
Mike Brady 1244bc49ba Add check to see if precision delay is available -- if not, disable the disable_standby feature. 2019-03-27 10:01:20 +00:00
Mike Brady f10fb93e83 Only ask for delay if device is running or draining. 2019-03-26 12:36:51 +00:00
Mike Brady ecee220b80 Detect when the ALSA device can not provide update timings, which seems to be if the output device is actually a virtual device. 2019-03-26 06:51:19 +00:00
Mike Brady 178af21dab Make soxr, metadata and apple_alac defaults if support for them is included in the build configuration. 2019-03-08 21:19:48 +00:00
Mike Brady a3736837d3 set default for disable standby to 'never' 2019-02-28 21:51:11 +00:00
Mike Brady 41b584bd43 bring the active state timeout to 1 second and tidy up a few debug messages. 2019-02-28 14:48:41 +00:00
Mike Brady 042d940415 Remove the AUTO bit-depth setting. It's a hack and needs more consideration. 2019-02-28 14:21:05 +00:00
Mike Brady 20967812ad Fix a bug in the activity_monitor software that could lock up a player thread so that it couln't be cancelled. If a player was cancelled while performing an activity script, the activity_monitor_mutex would remain locked. 2019-02-26 15:23:11 +00:00
Mike Brady 2758312679 use CLOCK_REALTIME instead of CLOCK_MONOTONIC is the alsa library is older than 1.0.28. 2019-02-17 14:26:14 +00:00
Mike Brady a8038c15c9 remove some diagnostics and add in a comment -- using CLOCK_REALTIME with alsa libraries before 1.0.28 2019-02-17 14:00:10 +00:00