Commit Graph
290 Commits
Author SHA1 Message Date
Mike Brady 0cd8a2ce90 Remove more causes of warnings at -Wextra levels 2018-03-07 22:05:11 +00:00
Mike Brady cfd40af87e Remove a few more warning causes. 2018-03-07 19:27:45 +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 0b07e1eafd Quieten some more debug messages. 2018-02-21 18:49:24 +00:00
Mike Brady b05ced6658 Make the scan interval five seconds and quieten some more debug messages. 2018-02-21 18:38:13 +00:00
Mike Brady 64d36693d4 Add play/pause/stop MPRIS and quieten some debug messages 2018-02-21 18:30:32 +00:00
Mike Brady bef287d90a Disable playerstatus metadata updates, add facility to release track metadata, enable a lot of debug messages 2018-02-19 20:56:49 +00:00
Mike Brady 3a4e29c5c6 Tidy up dacp scanner -- stop scanning when audio source goes offline. 2018-02-18 16:29:09 +00:00
Mike Brady f2bcf7528c Check for missing packets only once, approximately 250 ms after they should have arrived. They may take a good half second to be resent. 2018-02-13 17:20:08 +00:00
Mike Brady 79e22b32ad Remove an incorrect debug message about dithering 2018-02-10 18:37:08 +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 283e4930e8 Add support for OpenBSD compilation 2018-02-09 21:11:39 +00:00
Mike Brady 0a29b61238 Quieten some debug messages 2018-02-05 19:56:21 +00:00
Mike Brady 370501117e Change snd_pcm_drain to snd_pcm_drop, remove the blocking and unblocking code, so a little formatting. 2018-02-05 14:19:33 +00:00
Mike Brady 5fca5428a6 Remove 100 mS delay fudge at the close of a player thread. Probably don't need it. Also not prior move or player_play to RECORD from SETUP, I think 2018-02-03 21:00:00 +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 ab6fef93e1 Improve resyncing when many frames have to be discarded. Should stop the "audio speeding up" effect. 2018-02-01 22:17:41 +00:00
Mike Brady f83b86ec23 Add the option to use a flat volume control profile. 2018-01-29 22:28:22 +00:00
Mike Brady c6aa6fd27d Add ability to diable resend request. Use a new "diagnostics" group in the configuration file and move log_verbosity and statistics to it. 2018-01-24 11:12:29 +00:00
Mike Brady 564ff638e6 Bracket metadata reception with prologs and epilogs, make metadat pipe and art directory writable by group and world 2018-01-23 11:13:19 +00:00
Mike Brady f67b63b9c4 Wait a little longer before looking for missing packets 2018-01-18 15:17:07 +00:00
Mike Brady 0d0c41d403 Further tune the delay before checking for resends on an original Pi B 2018-01-17 20:53:54 +00:00
Mike Brady a757aa1082 Delay asking for a resend to a little over half a second. 2018-01-17 18:51:24 +00:00
Mike Brady e0aa75a80c pretty-print after adding alsa volume-based mute capability 2018-01-13 20:15:27 +00:00
Mike Brady 3e2c3e837a Make player.c send information to the metadata store rather than initiating d-bus messages 2018-01-10 21:30:30 +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 065eada6b5 Separate out metadata hub, dacp client, mpris and dbus interfaces a bit. Probably not finished. 2018-01-09 15:56:06 +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 ea46a09aea More comprhensive saving and restoring of hardware and software level when a session is stopped and started. Does hardware as well as software. 2017-12-11 16:32:37 +00:00
Mike Brady 6089007bc4 Store the last software volume setting so that it can become the default when the next play sessions starts. This is important if a starting volume is not always given, a new phenomenon in iOS 11.2 and macOS 10.13.2 2017-12-09 20:14:39 +00:00
Mike Brady af50e91232 Intermediate 2017-12-02 16:21:46 +00:00
Mike Brady dc111c8d1d Send playing status as soon as the first packet is received 2017-11-20 11:45:49 +00:00
Mike Brady bafdd94e33 Clang-format 2017-11-19 21:41:11 +00:00
Mike Brady df7c48f0f3 Clean up naming of some files, get the 'stop' command working 2017-11-19 21:16:36 +00:00
Mike Brady 74f41a1769 Reorganise D-BUS interface code and introduce an MPRIS interface. 2017-11-19 16:08:39 +00:00
Mike Brady d4eae76f33 dbus-related files taken from directories and renamed 2017-11-12 15:45:29 +01:00
Mike Brady f5248a20e1 Change the names of some of the files. 2017-11-12 14:49:53 +01:00
Mike Brady 3198ec4265 Improve dbus and add some dacp services 2017-11-12 14:26:10 +01: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
Belbo 39e122a4ff Fixed dangling pointer to random state array
The C library function initstate(), at least in macOS El Capitan, not only sets the state array given to it as the second argument, but also accesses the state array given to it in a previous call! (I don't know why, or if that behaviour is correct, but macOS seems to do that anyhow).
Therefore, we cannot pass a local variable to it. As soon as the player thread stops, it will be a dangling pointer, and when a new player thread is started afterwards, initstate() will dereference that dangling pointer with unforeseeable consequences.
2017-10-31 23:19:22 +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 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
Mike Brady 1e07e1e0ef Add very very experimental and exploratory systembus dbus support -- subject to change or removal 2017-09-10 13:19:56 +01:00
Mike Brady 3001f39bc5 3.1.2 pretty-print using clang-format 2017-09-07 12:02:00 +01:00
Mike Brady f283f95dcb Fix an issue where it would terminate if it could not allocate an excessively large buffer. 2017-08-28 21:33:29 +01:00
Mike Brady ef507a0e70 Improve debug messages 2017-08-28 12:14:05 +01:00