Repository navigation
feat(player): sync Philips Hue lights to the picture on tvOS - #374
Merged
Merged
Conversation
The lamps of a Hue entertainment area follow the picture beside them at about 50 Hz over HueStream v2 (DTLS 1.2 PSK), with intensity from Subtle to Intense in the player menu. In multiview they follow the tile with the sound. Before streaming, Lume saves each light's state and puts it back on stop, and at the next launch if a crash left a snapshot. - Frames come from KSPlayer, AetherEngine (native and software paths) and LumeEngine (VideoSampleTap); AVPlayer and VLC are unsupported. - Pairing, area choice, a sensitivity notice and a Test Lights button live in Settings › Philips Hue. Lume Pro, tvOS only. - Keys stay in the Keychain; bridge, area and keys never reach logs. - Shares a Bonjour browser with recording-server discovery. Needs bilipp/LumeEngine feat/frame-sample-tap.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Philips Hue light sync on Apple TV, without a Sync Box. Each lamp in the chosen Hue entertainment area takes the colour of the picture beside it, about 50 times a second, changing on cuts. Intensity is set from the player menu (Off, Subtle, Moderate, High, Intense). In multiview the lamps follow the tile with the sound. When playback stops, the lamps go back to how they were.
Implementation
Lume/Services/Hue/: pairing over CLIP v2 HTTPS (bridge's self-signed cert viaHueTrustDelegate), entertainment-area selection, and HueStream v2 over DTLS 1.2 PSK from a 20 ms tick, driven byHueSyncController.shared.HueFrameSource): KSPlayer (MEPlayer pixel buffer,HuePlayerItemTapfor KSAVPlayer), AetherEngine (native path via the same tap; software path, which interlaced live channels take, viaLumeAetherSession.displayedSoftwareFrame()), LumeEngine (PlayerSession.videoSamples). AVPlayer and VLC report unsupported.HueSourceRouterpicks the multiview tile with the sound.hue.restoreSnapshot) before start and each light's whole captured state is sent back on stop or at the next launch after a crash. Streamed colours never reach the CLIP light resources, so restore never diffs against what the bridge reports.BonjourServiceBrowseris shared with recording-server discovery.Decisions
PremiumFeature.hueSync).hue.*UserDefaults, excluded fromDebugLogExporter. No keys, bridge id/IP or area ids in logs or exports.Info.plistentries apply on all platforms. Also included, outside Hue: theRecordingServerDiscoveryrefactor onto the shared browser and aPerfLumeCloudFeedfix.Testing
Platforms
Related
feat/frame-sample-tap(VideoSampleTap); merge that first, since../LumeEngineon main won't compileLumeEngineHueFrameSource.