Commit Graph
208 Commits
Author SHA1 Message Date
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 4613ee6bcb Make buffer size threashold 100 ms instead of 50 ms. Remove some surplus snd_pcm_prepare calls. 2019-01-07 16:00:58 +00:00
Mike Brady 0e37f7e78d Only look for snd_pcm_status_get_driver_htstamp is alsa version 1.1 or later... 2019-01-04 21:52:36 +00:00
Mike Brady 6b42abab72 Use driver htstamp rather than regular one. Use untimed_delay so that a regualr delay sets the standoff timer for silence. 2019-01-04 20:57:18 +00:00
Mike Brady 48043a81cc Move stall threshold calculation to init from start, duh. 2019-01-04 18:17:30 +00:00
Mike Brady 80f15e1f57 clang format 2019-01-04 17:26:55 +00:00
Mike Brady 9552b278b7 remove some debugging code from delay(). 2019-01-04 17:26:00 +00:00
Mike Brady 7496364aaa continue to change delay() and play() to reflect use of snd_pcm_recover _after_ a XRUN has occurred -- fix rate calculations etc. 2019-01-04 17:20:15 +00:00
Mike Brady 459dd51a31 Use snd_pcm_recover only _after_ an XRUN or suspend has happened. Don't use it to remove one -- it doesn't work. 2019-01-04 13:50:14 +00:00
Mike Brady 8e5733e6ae Check before using snd_pcm_prepare in delay() 2019-01-04 11:29:18 +00:00
Mike Brady 41c8c8b9a1 Strengthen the ability to recover from an XRUN by putting in a call to snd_pcm_prepare first. 2019-01-03 10:19:44 +00:00
Mike Brady 15729ebcd4 Fix trivial error in a debug message. 2019-01-02 22:40:48 +00:00
Mike Brady 8d8b8c05f6 new play(), delay(), delay_prep_and_status() routines in place and working, but with the old stuff taken out. 2019-01-02 19:54:12 +00:00
Mike Brady 59d26918f6 new play(), delay(), delay_prep_and_status() routines in place and working, but with the old stuff still around. 2019-01-02 19:49:15 +00:00
Mike Brady 6f8b35d121 Try out a new alsa delay routine. Could be very buggy! 2019-01-02 14:43:25 +00:00
Mike Brady fe857037de If output is stalled, don't write any more frames to the output device. 2018-12-31 17:46:05 +00:00
Mike Brady fc08572631 Modify my_snd_pcm_delay but don't test it yet! 2018-12-29 09:34:10 +00:00
Mike Brady 919c5fe8b8 Add some diagnostics around the state of the DAC during delays. 2018-12-28 10:35:13 +00:00
Mike Brady ad6c721d5a Format 2018-12-27 14:04:31 +00:00
Mike Brady 1828545602 Account for duration of samples to be played and use the untimed_play when calculating silence-filling backoff period. 2018-12-27 14:01:32 +00:00
Mike Brady 284cb9d3fb Return genuine error codes where available in actual_open_alsa_device. 2018-12-26 10:41:20 +00:00
Mike Brady 70cd4fe81f Further adjustments to the silence thread -- make the sleep time 30 ms, thus if the queue goes below 60 ms of samples, silence will be inserted unless an audio write occurred within the last 30 ms. 2018-12-17 17:11:46 +00:00
Mike Brady 2830cdf712 adjust minimum interval between last audio write and writing silence. 2018-12-17 16:50:36 +00:00
Mike Brady a96d28c4e5 Need to use an untimed play for the silence buffer filler. 2018-12-17 16:44:19 +00:00
Mike Brady cb17fb263a Don't send silence into the alsa device within the scanner's sleep time of the last legitimate write to it. This is to stop the scanner inserting silent frames while the player is flushing fames. 2018-12-17 16:31:03 +00:00
Mike Brady 57e9619e5b Don't add dither if volume control is set to max. 2018-12-17 13:14:40 +00:00
Mike Brady 14e867a66b use dither if using software mixer (i.e. no hardware mixer and not ignoring the volume control) -- fix a mistake in accounting for the ignore_volume_control setting. 2018-12-17 11:30:23 +00:00
Mike Brady 4ba0947ddb Move the keep_dac_busy in to a configuration setting. Always start the keep_dac_busy thread and check if the keep_dac_busy is set. Don't dither is ignore volume control is set. 2018-12-15 15:36:44 +00:00
Mike Brady 7708ee3cdf Bring in the "disable_standby_mode" feature on alsa to stop some DACs making popping noises. Fix dither generation. 2018-12-14 15:28:32 +00:00
Mike Brady 4046c0e73d Fix dither, add dither to silences during lead-in, interpolatied frames and keeping out of standby, only if the output device doesn't use a mixer. Check configuration at initialisation. 2018-12-14 15:07:00 +00:00
Mike Brady 5dd9fbc4fb Don't drop the audio during a flush -- it creates a clunk. 2018-12-13 16:59:18 +00:00
Mike Brady 7cc434e989 Experimentally, add the ability to prevent the DAC making popping noises by feeding it with silence instead of allowing it to stop. 2018-12-13 14:47:52 +00:00
Mike Brady dad5e28208 Stay with the standard delay call for the present time. 2018-12-11 16:25:53 +00:00
Mike Brady 45ce909214 Tidy up some debug messages and warnings, remove old diagnostic codes and settings. 2018-12-11 10:56:36 +00:00
Mike Brady 9d5ff22f2d Connect up the stall response to the external command calling -- add a single argument to the unfixable error call. 2018-12-10 22:28:52 +00:00
Mike Brady 079db2eba8 Set stall threshold to 200 ms. 2018-12-10 12:38:48 +00:00
Mike Brady 46a13dce40 Add stall detection to the alsa subsystem. 2018-12-10 10:50:08 +00:00
Mike Brady ea11547095 add delay to debug output. 2018-12-09 08:58:47 +00:00
Mike Brady 7c42050847 Get timings of play / flush / delay calls. 2018-12-09 08:45:10 +00:00
Mike Brady df61f80607 Time opening of the device 2018-12-08 22:30:34 +00:00
Mike Brady e5452e5172 Make the idle timeout on the RTSP link the same as the overall timeout -- 30 seconds is a bit short. Add checks to the alsa interface timing -- 15 ms to write a packet of frames, 1 ms to ask for the delay. 2018-12-08 14:12:33 +00:00
Mike Brady 50700b46a5 Add timing to writing to the DAC 2018-12-08 12:58:01 +00:00
Mike Brady 53c17276db Continue to use the ordinary snd_pcm_delay call. 2018-12-06 15:39:19 +00:00
Mike Brady 277d401d24 Ensure watchdog always starts with the starting time of the thread. Add watchdog bark count. On the third bark, execute an unfixable error script if present. 2018-12-04 17:25:15 +00:00
Mike Brady 9ddef563ad Shorten the delays to 100 ms 2018-12-04 08:56:29 +00:00
Mike Brady 60315b63c9 Try to ensure that any alsa command sequences are uncancellable. Leave a little time afterwards where possible. 2018-12-03 17:00:12 +00:00
Mike Brady e49707e051 Ensure no pthread cancellation can occur during an ALSA-related call. 2018-12-03 12:44:57 +00:00
Mike Brady 2737222b0b Fix a non-initialisation of parameters if no h/w mixer used. Add a few diagnostics, tidy up initial diagnostic message, add verbosity level and whether mixer used. 2018-12-01 16:52:23 +00:00
Mike Brady 22f3e3e318 Move watchdog to cover connection from start, not just from start of play. Start investigating UDP port allocation. Tidy up handling or RTSP write errors -- remove the pselect code from before a write. 2018-11-28 17:18:03 +00:00
Mike Brady b7ee743a0e Quieten a few debug messages. 2018-11-27 17:44:45 +00:00