Commit Graph
525 Commits
Author SHA1 Message Date
Mike Brady 29ca32256d Ensure that the PTP clock is restarted on seconds and subsequent plays on the same connection. 2023-02-22 13:01:29 +00:00
Mike Brady 551734b398 Treat a keepalive timeout the same as if the client had closed the connection. Total timeout is 35 + 5 * 5 = 60(?) seconds. 2023-02-13 08:34:55 +00:00
Mike Brady 65c6975ea6 Remove some race conditions between Shairport Sync ('SPS') opening a TCP connection and the client checking that it's open. If SPS is slow for some reason (e.g. slow CPU), the client could find that the connection hasn't been opened and may then terminate the session. The fix is to ensure the TCP connections are open for reading before telling the client about them. 2023-02-12 20:14:07 +00:00
Mike Brady 6eb70eee70 Add modifications for V9 of the nqptp interface. 2023-01-19 14:32:32 +00:00
Mike Brady 17c39797c6 Quieten some debug messages. 2023-01-19 13:04:43 +00:00
Mike Brady 72f1554cbb Continuing to check the high-volume limiter. Add configuration file settings for default and threshold volume settings and timeout. Include in diagnostics, set tentative defaults. 2023-01-19 12:44:26 +00:00
Mike Brady 8201903a4e Add code to try to save your ears by handling a situation where the player volume was set very high some time ago and you have forgotten.
In that situation currenctly, when you play something, it will come out at the last volume set on the device, which will be that very high volume.
This could happen, for example, the morning after a loud party :).

The new code works as follows: If nothing has been played for a period, say a few hours, and the volume is higher than a threshold, new connections that ask
for the current volume setting will be offered the default (low) volume rather than the current (very high) one.
Most players, including the HomePod mini, iOS and iPadOS use this to set their initial volume.
The Mac Music app retains its own setting, and the Mac System Sounds preference sometimes seems to take its setting from the Music app,
but at least you can see the settings they will apply.

Existing connections are unaffected, so this facility should be unobtrusive.
2023-01-18 10:41:50 +00:00
Mike Brady 76387f8291 Be more careful checking for ENODEV conditions in audio_alsa.c. Still a few places where it is not done... 2022-12-31 17:16:02 +00:00
Mike Brady f4c9c0bcd8 Move unfixable_error_reported flag from conn to config. 2022-12-30 18:49:10 +00:00
Mike Brady cb097034b6 BB 2022-11-30 17:05:37 +00:00
Mike Brady ebf5fefb55 Make the keepalive stuff compile under macOS. 2022-11-30 17:01:06 +00:00
Mike Brady 5f3f238b48 Make the keepalive stuff compile under FreeBSD 2022-11-30 16:53:38 +00:00
Mike Brady e353201376 Add code to close the play session if the client connection drops for a minute. Uses the TCP keepalive facility. 2022-11-30 16:25:03 +00:00
Mike Brady e8b8c6edb7 Clang cleanup 2022-11-18 18:14:50 +00:00
Mike Brady 03d291f464 Second attempt. Modify the generation of the 12-digit classic AirPlay service name prefix so that it depends on the service name as well as the hardware address. 2022-11-17 10:31:51 +00:00
Mike Brady 3e4b67e97d Add two new metadata items -- the player's service name, e.g. "Den Speakers" and the name of the current client, if any, e.g. "Joe's iPhone". 2022-11-07 11:33:05 +00:00
Mike Brady 085bf128fe Fix a long-standing bug which didn't close the socket used for the RTSP connection, so potentially exhausting the sockets available. 2022-11-03 15:04:32 +00:00
Mike Brady 3d106c4687 add descriptioon of the new metadata codes. 2022-10-18 12:17:22 +01:00
Mike Brady 04e28ee12b Stop using the flush and data resumption as proxies for pause and resume. Add (true) pause and resume to buffered audio streams. 2022-10-18 12:13:07 +01:00
Mike Brady 1046a076c4 Change how a missing session key is dealt with: instead of dropping the AirPlay connection, simply skip the audio. Hopefully this will be less disruptive for users. 2022-10-16 22:15:26 +01:00
Mike Brady 7004c81a28 Check for the existence of a session key when starting to play AP2, and drop the connection if not. 2022-10-15 13:31:32 +01:00
Mike Brady 7dcad08398 Fix two memory leaks. 2022-10-07 16:17:57 +01:00
Mike Brady 06c69c69f3 When a buffered stream is paused or stopped, try to close the output device immediately. This will succeed if disable_standby mode is off. 2022-10-05 12:41:54 +01:00
Mike Brady ca3e75f988 Updates made in the branch. 2022-10-05 09:46:41 +01:00
Mike Brady f96fa2f793 Only call the volume hook once for each volume event even when the dbus interface is included. 2022-10-03 17:56:18 +01:00
Mike Brady 98744211a7 Disable the timer on the RTSP link. OwnTone doesn't supply regular traffic here. 2022-10-01 15:32:53 +01:00
Mike Brady c269e815e6 Add name of client when we can get it in AP2 2022-09-29 16:39:01 +01:00
Mike Brady a980192a00 Fix a silly classic AirPlay build issue. 2022-09-22 17:33:23 +01:00
Mike Brady a6e02449fb Increase the RTSP idle timeout to ten seconds, and confine its operation to realtime and classic AirPlay only.: 2022-09-22 16:25:57 +01:00
Mike Brady 4951b8a7d4 It seems the RTSP link can go idle occasionally, so don't do anything drastic until it comes back, i.e. don't kill everything when it goes idle. 2022-09-16 20:00:17 +01:00
Mike Brady 8dfebea222 Make the RTSP idle checker a bit more resilient -- wait for the full timeout even if interrupted. Also signal to NQPTP when to stop listening and when to start w.r.t. idle and when a session stop. 2022-09-15 14:09:33 +01:00
Mike Brady 114c39d8a9 Add a few debug messages to watch the RTSP connection. 2022-09-13 09:34:42 +01:00
Mike Brady fd880056fb Squashed commit of the following:
Add three parameters to the backend play() function call -- (1) a flag indicating whether the samples are timed or not. If timed, (2) the timestamp and (3) the local time at which the first frame should be heard.
    Update missing pipewire library message.
    Makefile.am fix.
    Update the SHM version and fix the SHM name so that it works with FreeBSD.
    Remove redundant (?) AC_HEADER_STDC check.
    Fix compilation and installation under FreeBSD -- changes to allow building in a separate directory broke the FreeBSD build process.
    Add AC_CHECK_LIB for gcrypt in case PKG_CHECK_MODULES fails to find it.
    Find gcrypt using pkg-config
    Add code to detect when the RTSP channel goes idle for a period, and use it to reset clocks and timings, etc. so that SPS resumes correctly where the source has gone to sleep while playing a realtime stream and has subsequently woken up.
    Don't exit if a UDP Clock Control packet is empty. Also check minimum packet size.
    Remove some very experimental code which may cause memory and port leaks.
    Strip file path from the filename used in debug messages, information messages, warnings and fatal error messages.
    BB fix to Makefile.am -- overwriting the DBUS stuff with MPRIS definitions, duh.
    Fix some problems building on FreeBSD and tidy up the use of the "sed" editor.
    Fix some problems building on picore.
    Fix an uninitialised variable
    start using the "nqptp" SMI
2022-09-12 15:19:52 +01:00
Mike Brady 05dfcdfd6a Merge other enhancements. 2022-08-09 14:18:53 +01:00
Mike Brady b81fb39a80 Add a new D-Bus method called "DropSession" to forcibly terminate the current play session. 2022-08-07 10:02:56 +01:00
Mike Brady f9aa7fb811 Simplifiy locking and unlocking the playing_conn and add dbus connection to changing the volume. 2022-08-06 19:19:08 +01:00
Mike Brady 7bc480b3fc Ensure player's IP is first in the perer list. Will be duplicated but that's okay. 2022-08-03 12:53:06 +01:00
Mike Brady f218a4d45e Improve a debug message. 2022-07-09 09:55:54 +01:00
Mike Brady d36decbd36 Rename and reorder some of the pairing definitions and structures. 2022-06-25 14:15:56 +01:00
Mike Brady f551274a2e Set the initial volume to 0.0 (full volume) if ignore_volume_control is selected. Add some code to explore remote_control. Still not even close to working. 2022-06-25 10:47:18 +01:00
Mike Brady fb151915ae Tidy up write encrypted. Explore some of the remote_control connections. Not working. 2022-06-23 09:40:30 +01:00
Mike Brady 82849e0dfe Return 501 instead of 404 for unimplemented GETs in AP2 mode. 2022-06-20 08:46:16 +01:00
Mike Brady 6c23d14cf3 Fix an odd bug that could arise while exiting the program, causing it to crash on exit. 2022-05-23 17:12:21 +01:00
Mike Brady aa9f9423c4 Quieten a debug message. 2022-05-17 17:32:24 +01:00
Mike Brady 3b4a21f002 Quieten some debug messages. Remove some redundant code. 2022-05-17 15:49:01 +01:00
Mike Brady 82ad05e828 reset anchor information when setanchorinfo stops play -- clock information is no longer valid. Store time of initial connection (this is when we can be sure the PTP clock has started). 2022-05-14 19:00:46 +10:00
Mike Brady f34a69fa32 Add two new metadata 'ssnc' codes: 'conn' for AirPlay 2 connect, sent before killing any current play session, and 'disc' for AirPlay 2 disconnect. Might be useful for amplifier switching, etc. 2022-03-22 18:53:01 +11:00
Mike Brady e87218893b Allow for a longer group ID string. Fixes an issue with playing from a HomePod mini on homeOS 15.4. 2022-03-15 12:31:37 +11:00
Mike Brady a382ac6672 Clang Format 2022-03-14 11:56:43 +11:00
Mike Brady 3d96f79ddc Quieten a few debug messages. 2022-03-11 17:03:49 +11:00