Commit Graph
141 Commits
Author SHA1 Message Date
Mike Brady b0db1b228c Its 353 not 363. 2018-05-04 20:21:47 +01:00
Mike Brady 21e1e12c76 If it's an AirPlay user agent up to and including version 363 (iOS 11.1.2) use the old offset calculation by adding 11,205 frames to the offset. 2018-05-04 18:25:52 +01:00
Mike Brady 41241681e3 Make resend error backoff work better and set it to 0.5 seconds. Quieten some routine debug messages. 2018-04-23 13:09:44 +01:00
Mike Brady 3e72bb216e Send resend requests via control channel rather than the audio channel. This makes it compatilbe iwht AirAudio and confformant with the unofficial guide to the airplay protocol. Brown bag time. 2018-04-19 10:16:28 +01:00
Mike Brady 0738ddeac8 Make resend requests come from tyhe control socket rather than the audio socket. This makes it work with AirAudio and according to the unofficial standard. 2018-04-18 20:29:16 +01:00
Mike Brady ad48056686 Improvements in handling non-existent DACP server, slightly more informative debug messages. 3.2RC4. 2018-04-18 10:34:50 +01:00
Mike Brady ae94daf259 Add a little more detail to the resend requests 2018-04-17 21:08:29 +01:00
Mike Brady e002da6033 Fix a tiny typo. 2018-04-16 10:05:02 +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 70c72821c9 Add code to skip occasional outgoing and icoming timing and resnd packets to simulate a bad network. Quieten some debug messages. 2018-04-14 17:33:45 +01:00
Mike Brady deb9f4b86b Add logic to skip an occasional outbound timing requester or to discard an occasional incoming timing packet, all to simulate a poor network. 2018-04-14 16:07:13 +01:00
Mike Brady 49d5486df6 Keep timestamp info from the incoming audio packet 2018-04-14 13:56:44 +01:00
Mike Brady e76a636668 Fix serious and long-standing bugs in the control, audio and timing threads that could be responsible for low resilience on noisy and unrealiable networks. Add ability to simiulate UDP receive and send failures on timing, control and audio ports. Significantly improve resend requesting and handling. 2018-04-14 13:01:42 +01:00
Mike Brady d9c9009ff2 Add the ability to pseudo-randomly drop audio packets to simiulate a noisy network. 2018-04-13 09:58:05 +01:00
Mike Brady c40d1ad53c Change the order of port allocation in rtp setup. Change some debug weights. 2018-04-12 22:47:42 +01:00
Mike Brady 665a53a8b5 Allow sps to deal with duplicate RTSP messages like RECORD and SETUP. Add some diagnostics to the player. 2018-04-10 17:35:39 +01:00
Mike Brady 08a7d4ffb5 Use snprintf in place of sprintf. 2018-04-08 15:36:05 +01:00
Mike Brady d3e2cb5d92 Modify latency detection to use the second word of a sync packet to decide whether to add an extra delay or not. Use all sync packets, not just one with the exception flag. Use 1024 buffers -- a bit profligate, but hey. 2018-04-02 16:44:16 +01:00
Mike Brady 8bf83c149f Modify latency detection to use the second word of a sync packet to decide whether to add an extra delay or not. Use all sync packets, not just one with the exception flag. Use 1024 buffers -- a bit profligate, but hey. 2018-04-02 16:42:46 +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 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 a7d82ae823 Begin to avoid strict aliasing violations -- not finished yet. 2018-03-07 08:58:23 +00:00
Mike Brady 73bf006c12 Add lots of debug messages, begin to use correctly sized PRId64 and friends in sprintf commands, begin to remove some simple causes of warnings. 2018-03-06 08:50:34 +00:00
Mike Brady b1e4ac7d05 Quieten a few debug messages 2018-02-10 17:58:39 +00:00
Mike Brady f94d6a5d16 Only request a resend one time, after about a second. Stop making resend requests if there is a send-to error for 10 seconds. 2018-02-10 17:43:47 +00:00
Mike Brady 0a29b61238 Quieten some debug messages 2018-02-05 19:56:21 +00:00
Mike Brady a0bb2993df Add timing to debug messages, make timing sender wait interruptable eveyr 20 ms, thus making TEARDOWN faster. 2018-02-03 20:24:58 +00:00
Mike Brady 28a671b292 Ignore timing pings over 350 millisecond and emit a debug message. 2018-02-01 18:04:39 +00:00
Mike Brady c371aa59fd pretty print 2018-01-20 16:53:02 +00:00
Mike Brady 866c06240e Replace use of perror with strerror_l 2018-01-17 14:43:43 +00:00
Mike Brady e0aa75a80c pretty-print after adding alsa volume-based mute capability 2018-01-13 20:15:27 +00:00
Mike Brady 3c08cedb78 Only allow sync packets after flush or resume to set latency and set an initial default latency. 2018-01-10 13:02:52 +00:00
Mike Brady 3e5dbe9e1a Move a play session's latency into the play session's data structure, duh. 2018-01-09 20:54:03 +00:00
Mike Brady 9cfc6c475b use max-latency and min-latency information in AirPlay ANNOUNCE packets, remove different latency settings except one fixed one 2018-01-09 17:54:24 +00:00
Mike Brady 6af24f7c1f Begin to add support for a central metadata bundle or respository. Lots more to do. 2017-12-26 20:28:14 +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 86f76ad6ce Improve the sync between AirPlay and movies like YouTube. Not sure we understand the negotiation for syncing. 2017-12-10 22:26:19 +00:00
Mike Brady 455d93485d Quieten a warning from clang on FreeBSD 2017-11-25 20:46:37 +00:00
Mike Brady 3198ec4265 Improve dbus and add some dacp services 2017-11-12 14:26:10 +01:00
Mike Brady 827fa5a5b0 Clean up rtp_send_client_command a little 2017-11-06 09:05:22 +00:00
Belbo b98e6a9ac0 Fixed race condition when stopping other threads with SIGUSR1
Many threads have a main loop that checks some exit variable in the loop condition. To stop a thread, another thread sets that exit variable, sends a SIGUSR1 to that thread to get it out of blocking calls like read(), write() or select(), and finally joins it.

There was a race condition though: if the signal arrived after the loop condition was checked but before the blocking system function was entered, the target thread essentially ignored the signal, made the blocking call anyway, and could get stuck forever there.

The only way around this race condition is to block SIGUSR1 in the destination thread during the critical time interval. This requires that the blocking system call and the call to unblock SIGUSR1 be an atomic unit. There is only one system call that makes this possible: pselect(), which takes a signal mask to replace the current signal mask with, but only while pselect() runs. Other functions like read(), recv(), write() and sendto() may only be called if we can be sure that they don't block. For this purpose, the file descriptors must be set to non-blocking mode and we must prepend the call to them with a call to pselect() to block until the socket becomes readable/writable.
2017-11-01 20:46:05 +01:00
Mike Brady 6467803858 Adjust the debug level of buffers exhausted and network condition messages. 2017-10-22 11:20:21 +02:00
Mike Brady 415b3f4ba9 Generalise volumeup to any command. 2017-10-15 13:08:21 +01:00
Mike Brady b3a90f9d6d Make the volumeup command work with IPv6 -- use the scope_id 2017-10-13 22:16:50 +01:00
Mike Brady ce06d45033 Hook up "volumeup" remote control command -- doesn't work on ipv6, it seems 2017-10-09 22:14:34 +01:00
Mike Brady 1e0d0944c0 Tidy up configure.ac and drop old pulseaudio back end 2017-10-09 09:38:35 +01:00
Mike Brady d343a851c0 Some spring cleaning using clang-format 2017-10-05 17:48:24 +01:00
Mike Brady 139c18bf3e Add avahi code to look for the rmeote control information for the client and get the port number from it. 2017-10-05 17:39:32 +01:00