Commit Graph
3298 Commits
Author SHA1 Message Date
Mike Brady 8f20e5808b clang format 2019-01-10 16:12:57 +00:00
Mike Brady 1c40176468 CLean up timings, clean up DACP interface network timings and error behaviours. 2019-01-10 16:11:56 +00:00
Mike Brady 8e72574a57 Add some diagnostics, shorten timeouts and set so_linger of zero whenever a write or read error occurs. 2019-01-10 16:10:53 +00:00
Mike Brady 9f8b8a25c9 add actual waiting time for a failing timed mutex. 2019-01-10 16:09:52 +00:00
Mike Brady c958d506b1 reduce thresholds towards a buffer time of 0.2 seconds rather than the 0.25 seconds before. 2019-01-09 14:15:05 +00:00
Mike Brady 2a9d46afed backend silence threshold should be 0.060 not 0.6! 2019-01-09 10:10:04 +00:00
Mike Brady 34d6d89707 Don't use full flush to purge frames after an overrun -- flush will reset the buffers as well. Fix a potential bug if a flush actually occurs. 2019-01-09 10:09:29 +00:00
Mike Brady e9623faa44 Go for a 0.250 second buffer length. 2019-01-08 17:28:38 +00:00
Mike Brady 56f4b124bd Adjust thresholds and timings to suit pi zero. 2019-01-08 13:06:46 +00:00
Mike Brady 2e3be271fd Preflight all audio material playing (not lead-in silences though...) 2019-01-08 13:01:22 +00:00
Mike Brady c3668b3fc0 INcrease the delay between reading chunks of the RTSP message, may it less likely to overwhelm the CPU. 2019-01-08 13:00:00 +00:00
Mike Brady 1b3d64ce85 Quieten a debug message. 2019-01-08 12:59:04 +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 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 67a19bf3c9 Make the wait time less than the packet interval time to enable SPS to catch up if it gets behind. 2019-01-07 15:59: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 43a2813b8c Extensive changes to alsa delay() and play() -- recover from XRUN _after_ sending frames; doesn't work otherwise. Update soxr buffer threshold code. Improve missing libsoxr message. Fix syntax of progress metadata. Stop dropping YouTube metadata -- the indication it was invalid is unsafe. 2019-01-04 17:30:56 +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 3434761517 Add code for calculating and recognising the interpolation threshold. 2019-01-04 17:10:57 +00:00
Mike Brady 7b97ea4019 Add code for calculating and recognising the interpolation threshold. 2019-01-04 17:10:26 +00:00
Mike Brady 01dbf625fe Add the interpolation threshold setting. 2019-01-04 17:09:37 +00:00
Mike Brady db0e718c12 Add code for getting and setting the interpolation threshold. 2019-01-04 17:07:21 +00:00
Mike Brady 5e38fcd50f Add default values for the interpolation threshold 2019-01-04 17:06:21 +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 4610d0870d Raise the soxr minimum buffer size to something sensible and multiply it by the output ratio 2019-01-04 13:48:56 +00:00
Mike Brady 4f9730e3b2 Give a nice message if the soxr library isn't installed. 2019-01-04 13:47:44 +00:00
Mike Brady 8e5733e6ae Check before using snd_pcm_prepare in delay() 2019-01-04 11:29:18 +00:00
Mike Brady c35fb69e33 Fix parsing error with progress 'prgr' metadata 2019-01-03 10:48:54 +00:00
Mike Brady f5707d4f18 Stop dropping metadata with a zero id -- it's not infallible way of determining if the metadata is invalid. 2019-01-03 10:48:09 +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 b973619d66 Using new delay() and play() functions. 2019-01-02 22:42:48 +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 b4505593b2 If output is stalled, don't write any more frames to the output device. 2018-12-31 17:46:31 +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 59b3abd965 quieten some dacp debug messages 2018-12-27 14:36:29 +00:00
Mike Brady fbb381133e Fix some memory leaks, improve silence filling backoff time calculation, alwasy add a NUL to an RTSP message. 2018-12-27 14:05:48 +00:00
Mike Brady ad6c721d5a Format 2018-12-27 14:04:31 +00:00
Mike Brady 668f78062e Fix a few memory leaks by deleting responses even when the reply is somehow illegal. 2018-12-27 14:02:19 +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 6e5f84d2a0 Always leave space for, and put a NULL at the end of an RTSP packet. 2018-12-27 13:59:20 +00:00
Mike Brady 10985a0bec Bug fix: close a socket even if it doesn't successfully connect. Enhance some debug messages. 2018-12-26 10:42:52 +00:00