Explore the integration of media technologies within your app. Discuss working with audio, video, camera, and other media functionalities.

All subtopics
Posts under Media Technologies topic

Post

Replies

Boosts

Views

Activity

AVPlayer does not switch up from SDR to HDR (Dolby Vision) variants during HLS ABR playback
Hello, I am developing a custom player SDK based on AVPlayer that supports HLS and LL-HLS playback on iOS. I have a question about AVPlayer's variant selection behavior with respect to the VIDEO-RANGE attribute. Setup Our multivariant playlist contains a ladder where the dynamic range differs per rung. Simplified example: #EXT-X-STREAM-INF:BANDWIDTH=1200000,RESOLUTION=854x480,CODECS="hvc1.2.4.L93.B0",VIDEO-RANGE=SDR,FRAME-RATE=30.000 sdr_480p.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=3500000,RESOLUTION=1280x720,CODECS="dvh1.05.03",VIDEO-RANGE=PQ,FRAME-RATE=30.000 hdr_720p.m3u8 The lower rung(s) are SDR only, and HDR (Dolby Vision, VIDEO-RANGE=PQ) variants exist only at the higher rungs. There is no PQ variant at the low end and no SDR variant at the high end. Observed behavior On HDR-capable devices (AVPlayer.eligibleForHDRPlayback == true), playback starts on the SDR 480p variant and then never switches up to the HDR 720p variant, even when network throughput is clearly sufficient (verified via AVPlayerItemAccessLog.observedBitrate and variant switch events). ABR up-switching works as expected when all rungs share the same VIDEO-RANGE. Questions Is it expected behavior that AVPlayer confines ABR switching to variants of a single VIDEO-RANGE for the duration of an AVPlayerItem, i.e., it will not cross SDR <-> PQ/HLG boundaries at runtime? If so, is the VIDEO-RANGE group selected once at playback start based on display capability and the initially chosen variant, with all other ranges excluded from the eligible set? The HLS Authoring Specification for Apple devices requires parallel SDR ladders for backward compatibility (sections 1.24 / 6.16), which implies each VIDEO-RANGE should form a complete, self-contained ladder. Is a mixed-range ladder like the one above considered a non-conformant authoring pattern, and is completing the PQ ladder down to the lowest rungs the correct fix? Are there any public APIs that influence video-range selection for streaming playback (beyond eligibleForHDRPlayback, which is read-only)? I understand the ABR switching logic itself is not documented, but confirmation of the VIDEO-RANGE grouping behavior would help us author our ladders correctly. Thank you.
1
0
35
3h
Apple Music API - What am I missing?
So I'm digging through the Apple Music API trying to implement it into a music app. I feel like I have to be missing a huge piece of the puzzle. Did Apple really miss something this big?Let's take Apple Curators for instance, catalog/{storefront}/apple-curators/{id} Where do I get the list of all available Apple Curators? Same can be said for stations, artists, curators and activities. catalog/{storefront}/search looked promising for a second, until you realize you're required to supply a search term.At first glance, Top Chart Genres catalog/{storefront}/genres looked promising. Returns a full list of available Genres, but you then take one of those items and hit catalog/{storefront}/genres/{id} with it and you end up with the same exact json. Huh? Shouldn't that return me a list of albums and songs from that genre or at the very least, a link to get that information?Thus far the only thing that seems to return anything useful is /me/recent/played and /me/recommendations. /me/history/heavy-rotation is returning an empty data set, but I assume that's due to my lack of use of Apple Music (signed up a few weeks ago).Someone, please, tell me what I'm missing here. Is the API this lacking in functionality?
7
0
2.9k
6h
Why does retrieving the `PixelBuffer` of only one eye improve performance significantly on 2020 Mac mini?
Hi all! I'm maintaining a 3D video player, it's great to see we've developed MV-HEVC packed with great features that media industry love to use. This player uses macOS AV frameworks to decode MV-HEVC and plays time-interleaving signal on capable devices, such as DLP-Link projectors, 3D vision glasses syncing devices, etc. Previously, the player output was flickering, unstable when playing MV-HEVC, and I thought it was due to M1 didn't have hardware decoder for it, or 4K Dolby Vision decoding was too demanding for my Mac, but out of luck, I tried retrieving only 1 eye for each frame output during the DisplayLink call, and the flickering is gone. At least that's what I've seen with a 100Hz screen while testing. Why is the performance improvement so significant? And is there other ways I can improve the performance, and perhaps the energy consumption? The link to the change I've committed
0
0
83
3d
AVRoutePickerView's presented route list is automatically dismissed when CXProvider reports the call as connected (`reportOutgoingCall(with:connectedAt:)`)
Hi, I want my user to be able to change their audio output device while calling someone, even before the call is established. But I've run into an issue combining CallKit and AVRoutePickerView. On iOS 26 (Xcode 26.5, tested on iPhone 13 Mini): when my AVRoutePickerView's route list is presented while my call is still connecting (not yet established), the presented list is automatically dismissed the moment the app reports the call as connected via CXProvider.reportOutgoingCall(with:connectedAt:). That doesn't seem natural to me — it should stay open, since the user is actively interacting with unrelated system UI at that moment. This happens even when nothing about the AVAudioSession itself changes: no category change, no route change, no didActivate/didDeactivate callback fires around that time. The dismissal is caused by the CallKit "connected" state transition itself, but I don't know why, or whether it's intentional. Steps to reproduce (sample project below): Tap "Start Fake Call". Within 5 seconds, tap the small route picker button and leave its list open. Wait — at t+5s the app reports the call connected via reportOutgoingCall(connectedAt:), and the list closes itself right after. Is this normal? And is there an official, CallKit-sanctioned way to report a call's connected state without this side effect — some way to keep the route picker stable across that transition? The two workarounds I've found both have real downsides: Calling reportOutgoingCall(connectedAt:) at the very start of the call, before the callee has actually answered , but then CallKit no longer reflects the real call state (Recents/duration would include ringing time, and calls that are never answered would still show as "connected"). Disabling audio device selection entirely until the call is established... works, but hurts the user experience, since users may want to switch output before the call connects. Here's the minimal reproduction: import CallKit import SwiftUI struct ContentView: View { @StateObject private var demo = CallKitDemo() var body: some View { VStack(spacing: 24) { Text(demo.statusText) .font(.system(.body, design: .monospaced)) .multilineTextAlignment(.center) Button("Start Fake Call") { demo.startFakeCall() } .disabled(demo.isCallInProgress) RoutePickerView() .frame(width: 60, height: 60) } .padding() } } private struct RoutePickerView: UIViewRepresentable { func makeUIView(context: Context) -> AVRoutePickerView { let picker = AVRoutePickerView() picker.delegate = context.coordinator return picker } func updateUIView(_ uiView: AVRoutePickerView, context: Context) {} func makeCoordinator() -> Coordinator { Coordinator() } final class Coordinator: NSObject, AVRoutePickerViewDelegate { func routePickerViewWillBeginPresentingRoutes(_ routePickerView: AVRoutePickerView) { print("[REPRO]", Date(), "picker WILL present routes") } func routePickerViewDidEndPresentingRoutes(_ routePickerView: AVRoutePickerView) { print("[REPRO]", Date(), "picker DID end presenting routes <- dismissed here") } } } @MainActor final class CallKitDemo: NSObject, ObservableObject { @Published var statusText = "Idle" @Published var isCallInProgress = false private let provider: CXProvider = { let configuration = CXProviderConfiguration() configuration.supportsVideo = false configuration.maximumCallGroups = 1 configuration.maximumCallsPerCallGroup = 1 configuration.supportedHandleTypes = [.generic] return CXProvider(configuration: configuration) }() private let callController = CXCallController() private var currentCallUUID: UUID? override init() { super.init() provider.setDelegate(self, queue: nil) } func startFakeCall() { let uuid = UUID() currentCallUUID = uuid isCallInProgress = true statusText = "Requesting CXStartCallAction..." let handle = CXHandle(type: .generic, value: "repro-call") let startAction = CXStartCallAction(call: uuid, handle: handle) callController.request(CXTransaction(action: startAction)) { error in if let error { print("[REPRO]", Date(), "CXStartCallAction request failed:", error) } } DispatchQueue.main.asyncAfter(deadline: .now() + 5) { [weak self] in guard let self, currentCallUUID == uuid else { return } print("[REPRO]", Date(), "reportOutgoingCall(connectedAt:)") statusText = "Reported connected at t+5s" provider.reportOutgoingCall(with: uuid, connectedAt: Date()) } DispatchQueue.main.asyncAfter(deadline: .now() + 8) { [weak self] in guard let self, currentCallUUID == uuid else { return } callController.request(CXTransaction(action: CXEndCallAction(call: uuid))) { _ in } currentCallUUID = nil isCallInProgress = false statusText = "Call ended" } } } extension CallKitDemo: CXProviderDelegate { func providerDidReset(_ provider: CXProvider) {} func provider(_ provider: CXProvider, perform action: CXStartCallAction) { action.fulfill() } func provider(_ provider: CXProvider, perform action: CXEndCallAction) { action.fulfill() } func provider(_ provider: CXProvider, didActivate audioSession: AVAudioSession) { print("[REPRO]", Date(), "didActivate") } func provider(_ provider: CXProvider, didDeactivate audioSession: AVAudioSession) { print("[REPRO]", Date(), "didDeactivate") } } Thanks for your help !
1
0
101
4d
AVPlayerController. Internal constraints conflicts on tvOS.
I’m getting Auto Layout constraint conflict warnings related to AVPlayerController in my tvOS project. This issue can be reproduced in an empty tvOS project either by simply using an AVPlayerViewController as a initial view controller or by presenting it. tvOS 26.2 Simple empty project with only one controller: import UIKit import AVKit class PlayerViewController: AVPlayerViewController { override func viewDidLoad() { super.viewDidLoad() } } After presenting that view controller, the following Auto Layout constraint conflict warnings appear in the console: Unable to simultaneously satisfy constraints. Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. ( "<NSLayoutConstraint:0x60000212f5c0 UIStackView:0x103222520.width >= 217 (active)>", "<NSLayoutConstraint:0x60000212f610 H:|-(>=95)-[UIStackView:0x103222520] (active, names: '|':UIView:0x103216630 )>", "<NSLayoutConstraint:0x60000212f660 UIStackView:0x103222520.trailing == UIView:0x103216630.trailing - 95 (active)>", "<NSLayoutConstraint:0x60000212f7a0 H:|-(0)-[UIView:0x103216630] (active, names: '|':_AVFocusContainerView:0x10333aea0 )>", "<NSLayoutConstraint:0x60000212f7f0 UIView:0x103216630.trailing == _AVFocusContainerView:0x10333aea0.trailing (active)>", "<NSLayoutConstraint:0x6000021309b0 '_UITemporaryLayoutWidth' _AVFocusContainerView:0x10333aea0.width == 0 (active)>" ) Will attempt to recover by breaking constraint <NSLayoutConstraint:0x60000212f5c0 UIStackView:0x103222520.width >= 217 (active)> Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger. The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful. How can I fix this issue? Thanks.
2
0
93
4d
Ventura Hack for FireWire Core Audio Support on Supported MacBook Pro and others...
Hi all,  Apple dropping on-going development for FireWire devices that were supported with the Core Audio driver standard is a catastrophe for a lot of struggling musicians who need to both keep up to date on security updates that come with new OS releases, and continue to utilise their hard earned investments in very expensive and still pristine audio devices that have been reduced to e-waste by Apple's seemingly tone-deaf ignorance in the cries for on-going support.  I have one of said audio devices, and I'd like to keep using it while keeping my 2019 Intel Mac Book Pro up to date with the latest security updates and OS features.  Probably not the first time you gurus have had someone make the logical leap leading to a request for something like this, but I was wondering if it might be somehow possible of shoe-horning the code used in previous versions of Mac OS that allowed the Mac to speak with the audio features of such devices to run inside the Ventura version of the OS.  Would it possible? Would it involve a lot of work? I don't think I'd be the only person willing to pay for a third party application or utility that restored this functionality. There has to be 100's of thousands of people who would be happy to spare some cash to stop their multi-thousand dollar investment in gear to be so thoughtlessly resigned to the scrap heap.  Any comments or layman-friendly explanations as to why this couldn’t happen would be gratefully received!  Thanks,  em
65
10
38k
4d
MusicKit JS: clarification on 3.3.6(D) for a shared listening web app
Hi, I'm an individual developer in Japan planning a web app with MusicKit JS, and I'd like to confirm my reading of the Apple Developer Program License Agreement, section 3.3.6(D) (MusicKit), before I start building. The design A "host" picks a song. Other people in the same room hear that same song. Every user plays it on their own device, through their own Apple Music subscription, in their own MusicKit JS instance. My server never receives, stores, caches, transcodes, or transmits any audio. My server only relays control metadata: a song identifier and an approximate playback position, so each client can start near the same point. Each user explicitly taps to start playback in their own browser. Standard play / pause / skip controls are available to every user. Apple Music playback is free for everyone in the app. No paywall, no ads, and no requirement to hand over personal information in order to listen. My questions 3.3.6(D) says "MusicKit Content cannot be synchronized with any other content." I read this as referring to synchronization with other media (for example, using a song as a soundtrack for video or images), and not as prohibiting multiple users independently playing the same song at roughly the same time through their own subscriptions. Is that reading correct? 3.3.6(D) says I must not "require payment for or indirectly monetize access to the Apple Music service." If Apple Music playback stays entirely free for all users, and I separately charge hosts for features unrelated to playback (for example audience analytics, custom branding for their room page, and scheduling tools), would that count as indirect monetization of access to the Apple Music service? 3.3.6(D) says "users must initiate playback." If a user taps play once and a queue then continues to the next track automatically (ordinary continuous playback), is that acceptable? Or does the user need to tap for each track individually when the host changes the selection? I'd like to build this correctly from the start, so any guidance is appreciated. If these are better directed to another channel, a pointer would be very welcome. Thanks, Sho
0
0
52
4d
Core Media errors should be better described and documented
Errors related to media playback, whether received from AVPlayer directly or read from an AVPlayerItem access log, usually lack information about the root cause of a playback issue. Most errors we receive in the CoreMediaErrorDomain are namely associated with undocumented error codes and non-explicit error messages. Here are a few examples: Error Domain=CoreMediaErrorDomain Code=-12927 "(null)" Error Domain=CoreMediaErrorDomain Code=-16012 "(null)" Error Domain=CoreMediaErrorDomain Code=-12685 "The operation couldn’t be completed." Error Domain=CoreMediaErrorDomain Code=-12648 "The operation couldn’t be completed." It would be helpful that Core Media: Provides a public constant for the CoreMediaErrorDomain. Provides public constants for the error codes within this domain. Ensures each error is associated with a meaningful human-readable description. If not possible having at least a documented list of error codes (as is done in the FairPlay programming guide PDF, for example) would allow us to better classify errors and understand playback errors experienced by our users. I opened a FB17673165 feedback with this suggestion as well. Thanks in advance for considering this improvement request.
3
0
111
6d
MusicKit – Significant Gap Between Tracks
We’ve worked extensively on beatsinspace.net/mixes, where authenticated users with an Apple Music subscription can listen to full Beats in Space mixes through MusicKit JS on the web. https://www.beatsinspace.net/mixes Each mix is published as an Apple Music album, with the tracks acting as chapters within one continuous DJ mix. However, there is a noticeable gap between every track when listening through the website. The same mixes play seamlessly in the native Apple Music app. We’ve tested this across Chrome and Safari, as well as in a standalone prototype, and the issue appears to happen specifically with MusicKit JS playback. Do we know why this is happening and whether there is a supported way to prevent it? Would deeply appreciate any pointers here. Thank you!
0
0
61
6d
How should live latency be measured and maintained with AVPlayer (HLS / LL-HLS)?
We keep live playback at a consistent distance from the live edge using small playback rate adjustments, with a target range based on recommendedTimeOffsetFromLive. Since the live edge is not exposed by AVPlayer, we currently fall back to seekableTimeRanges.end as our best approximation. What should be treated as the live edge, and how should the current live latency be measured? Is rate adjustment the appropriate way to hold a target latency? While playing above 1.0x, the playhead can reach the seekable end, at which point AVPlayerItemDidPlayToEndTime fires and halts the live stream. How can we guard against ? Does any of this differ between regular HLS and LL-HLS? A clear statement of the intended contract here would resolve a lot of uncertainty. Thanks in advance.
2
0
244
6d
_MPRemoteCommandEventDispatch crashes on iOS 26.x devices.
I'm seeing crashes in _MPRemoteCommandEventDispatch on iOS 26.x devices in 3 apps. According to Bugsnag logs they are: NSInternalInconsistencyException: event dispatch <_MPRemoteCommandEventDispatch: <MPRemoteCommandEvent: 0x11c049500 commandID=THV0 command=<MPRemoteCommand: 0x109ad1ea0 type=Play (0) enabled=YES handlers=[0x109b6a310]> sourceID=(null) ([HostedRoutingSessionDataSource] handleControlSendingCommand<2W5E>)> state:201> deallocated without calling continuation I attached a log from Xcode organizer matching Bugsnag crash. mpr_remote_command_event.crash When I set the brakpoint on the -[_MPRemoteCommandEventDispatch dealloc] I can see it it's hit every time I tap play or pause on locked screen play button. Thread 0 Crashed: 0 libsystem_kernel.dylib 0x00000002370420cc __pthread_kill + 8 (:-1) 1 libsystem_pthread.dylib 0x00000001e975c810 pthread_kill + 268 (pthread.c:1721) 2 libsystem_c.dylib 0x0000000198f8ff64 abort + 124 (abort.c:122) 3 libc++abi.dylib 0x000000018a7cf808 __abort_message + 132 (abort_message.cpp:66) 4 libc++abi.dylib 0x000000018a7be484 demangling_terminate_handler() + 304 (cxa_default_handlers.cpp:76) 5 libobjc.A.dylib 0x000000018a6cff78 _objc_terminate() + 156 (objc-exception.mm:496) 6 xxxxxxxxxxxxxx 0x00000001003a7db8 CPPExceptionTerminate() + 416 (BSG_KSCrashSentry_CPPException.mm:156) 7 libc++abi.dylib 0x000000018a7cebdc std::__terminate(void (*)()) + 16 (cxa_handlers.cpp:59) 8 libc++abi.dylib 0x000000018a7ceb80 std::terminate() + 108 (cxa_handlers.cpp:88) 9 CoreFoundation 0x000000018d7341c4 __CFRunLoopPerCalloutARPEnd + 256 (CFRunLoop.c:769) 10 CoreFoundation 0x000000018d70bb5c __CFRunLoopRun + 1976 (CFRunLoop.c:3179) 11 CoreFoundation 0x000000018d70aa6c _CFRunLoopRunSpecificWithOptions + 532 (CFRunLoop.c:3462) 12 GraphicsServices 0x000000022e31c498 GSEventRunModal + 120 (GSEvent.c:2049) 13 UIKitCore 0x00000001930ceba4 -[UIApplication _run] + 792 (UIApplication.m:3902) 14 UIKitCore 0x0000000193077a78 UIApplicationMain + 336 (UIApplication.m:5577) 15 xxxxxxxxxxxxxx 0x00000001000c0134 main + 308 (main.swift:15) 16 dyld 0x000000018a722e28 start + 7116 (dyldMain.cpp:1477) Is the crash happening when the app is being terminated? Thank you!
8
3
1.7k
6d
`LockedCameraCaptureManager` practically unusable since iOS 26
Somewhere since iOS 26, the LockedCameraCapture framework gets in an unpredictable state after opening the main app from the LockedCamera extension using LockedCameraCaptureSession.openApplication(for userActivity:). (Feedback with sample code to reproduce: FB21966835) Opening the extension from the lock screen again doesn’t open the extension but puts the lock screen in a state as if it has. Content updated from LockedCameraCaptureManager.shared.sessionContentUpdates comes in inconsistently, usually needs the app to be opened again or the extension to be opened. This makes using this extension impossible for me as I use it to record video files that manually need to be imported when the app is launched (so not through PhotoKit). Does anybody have a suggestion to circumvent this issue or how to get this fixed?
1
1
566
1w
Issue setting a queue with library and non-library items at the same time (plus a couple more MusicKit issues)
As the summer continues, I have been diving deeper and deeper into MusicKit, largely with great results. A few issues have arisen that I've outlined here, feedbacks already filed and numbers included here. All of this happens on the lasted developer beta and latest Xcode beta. Thanks! FB10967343 - Setting the queue with library and non-library items at the same time doesn't work correctly In my app, I am working on a feature that lets a user shuffle songs from a collection of albums that may or may not be in their library. However, I’ve discovered an issue where the queue does not seem to work correctly when mixing these types. I’ve attempted to load ApplicationMusicPlayer by creating a Queue and to load applicationQueuePlayer using a MPMusicPlayerPlayParametersQueueDescriptor, but the same issue occurs each time. The queue is able to play songs from the same source, but if it’s been playing a library song and tries to move to a non-library song, the queue stops.  The first thing I do is pick random songs from each album, using a MusicLibraryRequest or a MusicCatalogResourceRequest as appropriate, then taking a randomElement() from the ensuing MusicItemCollection for the album.  I append each track to an array, which I then cast to MusicItemCollection so I’ve now got a MusicItemCollection consisting of the tracks I want. If I’m in MusicKit land, I simply set the queue as follows:  player.queue = ApplicationMusicPlayer.Queue(for: tracks) It takes a bit more doing in MediaPlayer, but in theory this should also work, right?    do {         let paramObjects = tracks.compactMap {             $0.playParameters         }         let params = try paramObjects.map({try JSONEncoder().encode($0)}) let dicts = try params.compactMap {               try JSONSerialization.jsonObject(with: $0, options: []) as? [String:Any]           }           let finalParams = dicts.compactMap {                 MPMusicPlayerPlayParameters(dictionary: $0)             } let descriptor = MPMusicPlayerPlayParametersQueueDescriptor(playParametersQueue: finalParams) mediaPlayer.setQueue(with: descriptor) } catch { print(error) } In either case, the following issue occurs: say that I end up with a queue made up of one library song, then one non-library song. The player will play just the first song, then it acts as if the queue has ended. Say that it has two non-library songs, then one library song. Just the two non-library songs play. Indeed, printing queue.entries shows just the number of items that were from the same source type. FB10967076 - Publishing changes from background thread error when inserting queue items When using the .insert method on ApplicationMusicPlayer.Queue on the last iOS 16 and Xcode betas, it returns a “Publishing changes from background thread” error even though the function I’m doing in is marked as a @MainActor and the stacktace indicates it was on the main thread. FB10967277 - song.with([.albums], preferredSource: .library) generates thousands of lines of EntityQueries in the console I’ve noticed that when using the preferredSource: .library when requesting additional properties on a library item creates ~6,000 of “EntityQuery” entries in the console, all in the span of a second. This doesn’t seem to be leading to any major performance issues, but it sure seems like something isn't right. let request = MusicLibraryRequest<Song>.init() do { let response = try await request.response() guard let song = response.items.first else { return } let songWithAlbums = try await song.with([.albums], preferredSource: .library) } catch { print(error) } generates the following output (except... 6,000 of them) 2022-07-31 13:02:07.729003-0400 MusicKitFutzing[9405:2192606] [EntityQuery] Finished fetching results in 0s 2022-07-31 13:02:07.729047-0400 MusicKitFutzing[9405:2192605] [EntityQuery] Finished executing query in 0.00100017s 2022-07-31 13:02:07.729202-0400 MusicKitFutzing[9405:2192611] [EntityQuery] Finished executing query in 0s 2022-07-31 13:02:07.729240-0400 MusicKitFutzing[9405:2192605] [EntityQuery] Finished fetching results in 0s
2
1
1.9k
1w
Can an iOS app analyze audio being played by another app?
Hello, I'm in the early planning stages of an iOS app and I'm trying to determine what's technically possible before designing around assumptions. Is it possible for a third-party iOS app, with the user's permission, to access or analyze audio that is being played by another app (for example Apple Podcasts, Spotify, Audible, or YouTube) in real time? Or is microphone input the only supported way for an app to analyze audio that is audible in the user's environment? I'm not asking about recording the screen or capturing video. I'm specifically trying to understand whether another app's audio output is ever available to third-party apps, or whether iOS intentionally isolates apps from each other's audio. If the answer depends on the audio source (for example Apple Podcasts versus Spotify versus audio coming through the microphone), I'd appreciate understanding those distinctions as well. Thank you.
0
0
127
1w
ShazamKit under the App Sandbox on macOS — sanctioned way to reach com.apple.shazamd? (error 202)
I'm building a music-recognition app for the Mac App Store that uses ShazamKit (SHSession / SHManagedSession) against the default Shazam catalog. In a sandboxed build, SHSession.match(_:) fails with: com.apple.ShazamKit error 202 — "The connection to service named com.apple.shazamd was invalidated" The root cause is a sandbox denial of the mach-lookup to the ShazamKit matching daemon: kernel (Sandbox): deny(1) mach-lookup com.apple.shazamd What I've established: Enabling the ShazamKit App Service on the App ID does not add com.apple.shazamd to the sandbox mach-lookup allow-list on macOS — the denial persists and matching returns error 202. The iOS entitlement com.apple.developer.shazamkit is rejected by the macOS validator at upload ("not supported on macOS"), so it isn't an option here. Adding com.apple.security.temporary-exception.mach-lookup.global-name = [com.apple.shazamd] to the app's entitlements removes the denial, and ShazamKit then matches correctly under the sandbox (verified end-to-end: real api.shazam.apple.com/v1/catalog/.../match requests complete and tracks are identified). Removing that exception reproduces error 202 on every probe. So the temporary-exception appears to be the only way to make ShazamKit's default-catalog matching work inside the macOS App Sandbox today. Questions: Is there a sanctioned, non-temporary-exception way to use ShazamKit default-catalog matching in a sandboxed macOS app (a proper entitlement, an App Service configuration, or a supported API usage)? If not, is the com.apple.shazamd mach-lookup temporary-exception the intended approach on macOS? My actual SHSession.match runs in a nested helper that inherits the app's sandbox (com.apple.security.inherit). Is it correct to place the exception on the main app (which the inherited helper then picks up), rather than on the helper itself? Environment: macOS 26.1, ShazamKit App Service enabled on the App ID, signed App Sandbox build installed via TestFlight (valid _MASReceipt present). Happy to share entitlement plists and a focused sample on request. Thanks!
5
0
327
1w
Extended Dynamic Range support
My app currently supports display and editing of RAW files in HDR mode (Extended Dynamic Range). I came across 2 issues: In HDR mode, if I am using the default boostAmount = 1.0, then some of the highlight colors will shift. Like a clear blue sky becomes a light gray / light purple sky. I've to set boostAmount = 0.0 to avoid this problem. Is this a bug or is there a way to keep the Apple colors and not having this issue? The Shadow and highlight filter does not appear to work correctly in HDR mode, I've it hooked up in the linearSpaceFilter. Would be nice if you guys can introduce a spatial aware shadow & highlight filter.
1
0
245
1w
Apple Music API - Heavy Rotation Endpoint Broken?
The endpoint: https://api.music.apple.com/v1/me/history/heavy-rotation seems to just be returning an empty data array. Is this a bug, or is the endpoint not supported anymore? I would like to display a user's recent listening history for my app, is there another way to do this?
Replies
4
Boosts
1
Views
929
Activity
1h
AVPlayer does not switch up from SDR to HDR (Dolby Vision) variants during HLS ABR playback
Hello, I am developing a custom player SDK based on AVPlayer that supports HLS and LL-HLS playback on iOS. I have a question about AVPlayer's variant selection behavior with respect to the VIDEO-RANGE attribute. Setup Our multivariant playlist contains a ladder where the dynamic range differs per rung. Simplified example: #EXT-X-STREAM-INF:BANDWIDTH=1200000,RESOLUTION=854x480,CODECS="hvc1.2.4.L93.B0",VIDEO-RANGE=SDR,FRAME-RATE=30.000 sdr_480p.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=3500000,RESOLUTION=1280x720,CODECS="dvh1.05.03",VIDEO-RANGE=PQ,FRAME-RATE=30.000 hdr_720p.m3u8 The lower rung(s) are SDR only, and HDR (Dolby Vision, VIDEO-RANGE=PQ) variants exist only at the higher rungs. There is no PQ variant at the low end and no SDR variant at the high end. Observed behavior On HDR-capable devices (AVPlayer.eligibleForHDRPlayback == true), playback starts on the SDR 480p variant and then never switches up to the HDR 720p variant, even when network throughput is clearly sufficient (verified via AVPlayerItemAccessLog.observedBitrate and variant switch events). ABR up-switching works as expected when all rungs share the same VIDEO-RANGE. Questions Is it expected behavior that AVPlayer confines ABR switching to variants of a single VIDEO-RANGE for the duration of an AVPlayerItem, i.e., it will not cross SDR <-> PQ/HLG boundaries at runtime? If so, is the VIDEO-RANGE group selected once at playback start based on display capability and the initially chosen variant, with all other ranges excluded from the eligible set? The HLS Authoring Specification for Apple devices requires parallel SDR ladders for backward compatibility (sections 1.24 / 6.16), which implies each VIDEO-RANGE should form a complete, self-contained ladder. Is a mixed-range ladder like the one above considered a non-conformant authoring pattern, and is completing the PQ ladder down to the lowest rungs the correct fix? Are there any public APIs that influence video-range selection for streaming playback (beyond eligibleForHDRPlayback, which is read-only)? I understand the ABR switching logic itself is not documented, but confirmation of the VIDEO-RANGE grouping behavior would help us author our ladders correctly. Thank you.
Replies
1
Boosts
0
Views
35
Activity
3h
Apple Music API - What am I missing?
So I'm digging through the Apple Music API trying to implement it into a music app. I feel like I have to be missing a huge piece of the puzzle. Did Apple really miss something this big?Let's take Apple Curators for instance, catalog/{storefront}/apple-curators/{id} Where do I get the list of all available Apple Curators? Same can be said for stations, artists, curators and activities. catalog/{storefront}/search looked promising for a second, until you realize you're required to supply a search term.At first glance, Top Chart Genres catalog/{storefront}/genres looked promising. Returns a full list of available Genres, but you then take one of those items and hit catalog/{storefront}/genres/{id} with it and you end up with the same exact json. Huh? Shouldn't that return me a list of albums and songs from that genre or at the very least, a link to get that information?Thus far the only thing that seems to return anything useful is /me/recent/played and /me/recommendations. /me/history/heavy-rotation is returning an empty data set, but I assume that's due to my lack of use of Apple Music (signed up a few weeks ago).Someone, please, tell me what I'm missing here. Is the API this lacking in functionality?
Replies
7
Boosts
0
Views
2.9k
Activity
6h
PHAsset Additional Properties
Following Metadata should be accessible from PHAsset Object: Title, caption, Keywords. Write now they are available in the SQLite Photo Library, but thats is not a clean solution.
Replies
2
Boosts
4
Views
658
Activity
3d
Why does retrieving the `PixelBuffer` of only one eye improve performance significantly on 2020 Mac mini?
Hi all! I'm maintaining a 3D video player, it's great to see we've developed MV-HEVC packed with great features that media industry love to use. This player uses macOS AV frameworks to decode MV-HEVC and plays time-interleaving signal on capable devices, such as DLP-Link projectors, 3D vision glasses syncing devices, etc. Previously, the player output was flickering, unstable when playing MV-HEVC, and I thought it was due to M1 didn't have hardware decoder for it, or 4K Dolby Vision decoding was too demanding for my Mac, but out of luck, I tried retrieving only 1 eye for each frame output during the DisplayLink call, and the flickering is gone. At least that's what I've seen with a 100Hz screen while testing. Why is the performance improvement so significant? And is there other ways I can improve the performance, and perhaps the energy consumption? The link to the change I've committed
Replies
0
Boosts
0
Views
83
Activity
3d
AVRoutePickerView's presented route list is automatically dismissed when CXProvider reports the call as connected (`reportOutgoingCall(with:connectedAt:)`)
Hi, I want my user to be able to change their audio output device while calling someone, even before the call is established. But I've run into an issue combining CallKit and AVRoutePickerView. On iOS 26 (Xcode 26.5, tested on iPhone 13 Mini): when my AVRoutePickerView's route list is presented while my call is still connecting (not yet established), the presented list is automatically dismissed the moment the app reports the call as connected via CXProvider.reportOutgoingCall(with:connectedAt:). That doesn't seem natural to me — it should stay open, since the user is actively interacting with unrelated system UI at that moment. This happens even when nothing about the AVAudioSession itself changes: no category change, no route change, no didActivate/didDeactivate callback fires around that time. The dismissal is caused by the CallKit "connected" state transition itself, but I don't know why, or whether it's intentional. Steps to reproduce (sample project below): Tap "Start Fake Call". Within 5 seconds, tap the small route picker button and leave its list open. Wait — at t+5s the app reports the call connected via reportOutgoingCall(connectedAt:), and the list closes itself right after. Is this normal? And is there an official, CallKit-sanctioned way to report a call's connected state without this side effect — some way to keep the route picker stable across that transition? The two workarounds I've found both have real downsides: Calling reportOutgoingCall(connectedAt:) at the very start of the call, before the callee has actually answered , but then CallKit no longer reflects the real call state (Recents/duration would include ringing time, and calls that are never answered would still show as "connected"). Disabling audio device selection entirely until the call is established... works, but hurts the user experience, since users may want to switch output before the call connects. Here's the minimal reproduction: import CallKit import SwiftUI struct ContentView: View { @StateObject private var demo = CallKitDemo() var body: some View { VStack(spacing: 24) { Text(demo.statusText) .font(.system(.body, design: .monospaced)) .multilineTextAlignment(.center) Button("Start Fake Call") { demo.startFakeCall() } .disabled(demo.isCallInProgress) RoutePickerView() .frame(width: 60, height: 60) } .padding() } } private struct RoutePickerView: UIViewRepresentable { func makeUIView(context: Context) -> AVRoutePickerView { let picker = AVRoutePickerView() picker.delegate = context.coordinator return picker } func updateUIView(_ uiView: AVRoutePickerView, context: Context) {} func makeCoordinator() -> Coordinator { Coordinator() } final class Coordinator: NSObject, AVRoutePickerViewDelegate { func routePickerViewWillBeginPresentingRoutes(_ routePickerView: AVRoutePickerView) { print("[REPRO]", Date(), "picker WILL present routes") } func routePickerViewDidEndPresentingRoutes(_ routePickerView: AVRoutePickerView) { print("[REPRO]", Date(), "picker DID end presenting routes <- dismissed here") } } } @MainActor final class CallKitDemo: NSObject, ObservableObject { @Published var statusText = "Idle" @Published var isCallInProgress = false private let provider: CXProvider = { let configuration = CXProviderConfiguration() configuration.supportsVideo = false configuration.maximumCallGroups = 1 configuration.maximumCallsPerCallGroup = 1 configuration.supportedHandleTypes = [.generic] return CXProvider(configuration: configuration) }() private let callController = CXCallController() private var currentCallUUID: UUID? override init() { super.init() provider.setDelegate(self, queue: nil) } func startFakeCall() { let uuid = UUID() currentCallUUID = uuid isCallInProgress = true statusText = "Requesting CXStartCallAction..." let handle = CXHandle(type: .generic, value: "repro-call") let startAction = CXStartCallAction(call: uuid, handle: handle) callController.request(CXTransaction(action: startAction)) { error in if let error { print("[REPRO]", Date(), "CXStartCallAction request failed:", error) } } DispatchQueue.main.asyncAfter(deadline: .now() + 5) { [weak self] in guard let self, currentCallUUID == uuid else { return } print("[REPRO]", Date(), "reportOutgoingCall(connectedAt:)") statusText = "Reported connected at t+5s" provider.reportOutgoingCall(with: uuid, connectedAt: Date()) } DispatchQueue.main.asyncAfter(deadline: .now() + 8) { [weak self] in guard let self, currentCallUUID == uuid else { return } callController.request(CXTransaction(action: CXEndCallAction(call: uuid))) { _ in } currentCallUUID = nil isCallInProgress = false statusText = "Call ended" } } } extension CallKitDemo: CXProviderDelegate { func providerDidReset(_ provider: CXProvider) {} func provider(_ provider: CXProvider, perform action: CXStartCallAction) { action.fulfill() } func provider(_ provider: CXProvider, perform action: CXEndCallAction) { action.fulfill() } func provider(_ provider: CXProvider, didActivate audioSession: AVAudioSession) { print("[REPRO]", Date(), "didActivate") } func provider(_ provider: CXProvider, didDeactivate audioSession: AVAudioSession) { print("[REPRO]", Date(), "didDeactivate") } } Thanks for your help !
Replies
1
Boosts
0
Views
101
Activity
4d
AVPlayerController. Internal constraints conflicts on tvOS.
I’m getting Auto Layout constraint conflict warnings related to AVPlayerController in my tvOS project. This issue can be reproduced in an empty tvOS project either by simply using an AVPlayerViewController as a initial view controller or by presenting it. tvOS 26.2 Simple empty project with only one controller: import UIKit import AVKit class PlayerViewController: AVPlayerViewController { override func viewDidLoad() { super.viewDidLoad() } } After presenting that view controller, the following Auto Layout constraint conflict warnings appear in the console: Unable to simultaneously satisfy constraints. Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. ( "<NSLayoutConstraint:0x60000212f5c0 UIStackView:0x103222520.width >= 217 (active)>", "<NSLayoutConstraint:0x60000212f610 H:|-(>=95)-[UIStackView:0x103222520] (active, names: '|':UIView:0x103216630 )>", "<NSLayoutConstraint:0x60000212f660 UIStackView:0x103222520.trailing == UIView:0x103216630.trailing - 95 (active)>", "<NSLayoutConstraint:0x60000212f7a0 H:|-(0)-[UIView:0x103216630] (active, names: '|':_AVFocusContainerView:0x10333aea0 )>", "<NSLayoutConstraint:0x60000212f7f0 UIView:0x103216630.trailing == _AVFocusContainerView:0x10333aea0.trailing (active)>", "<NSLayoutConstraint:0x6000021309b0 '_UITemporaryLayoutWidth' _AVFocusContainerView:0x10333aea0.width == 0 (active)>" ) Will attempt to recover by breaking constraint <NSLayoutConstraint:0x60000212f5c0 UIStackView:0x103222520.width >= 217 (active)> Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger. The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful. How can I fix this issue? Thanks.
Replies
2
Boosts
0
Views
93
Activity
4d
Ventura Hack for FireWire Core Audio Support on Supported MacBook Pro and others...
Hi all,  Apple dropping on-going development for FireWire devices that were supported with the Core Audio driver standard is a catastrophe for a lot of struggling musicians who need to both keep up to date on security updates that come with new OS releases, and continue to utilise their hard earned investments in very expensive and still pristine audio devices that have been reduced to e-waste by Apple's seemingly tone-deaf ignorance in the cries for on-going support.  I have one of said audio devices, and I'd like to keep using it while keeping my 2019 Intel Mac Book Pro up to date with the latest security updates and OS features.  Probably not the first time you gurus have had someone make the logical leap leading to a request for something like this, but I was wondering if it might be somehow possible of shoe-horning the code used in previous versions of Mac OS that allowed the Mac to speak with the audio features of such devices to run inside the Ventura version of the OS.  Would it possible? Would it involve a lot of work? I don't think I'd be the only person willing to pay for a third party application or utility that restored this functionality. There has to be 100's of thousands of people who would be happy to spare some cash to stop their multi-thousand dollar investment in gear to be so thoughtlessly resigned to the scrap heap.  Any comments or layman-friendly explanations as to why this couldn’t happen would be gratefully received!  Thanks,  em
Replies
65
Boosts
10
Views
38k
Activity
4d
MusicKit JS: clarification on 3.3.6(D) for a shared listening web app
Hi, I'm an individual developer in Japan planning a web app with MusicKit JS, and I'd like to confirm my reading of the Apple Developer Program License Agreement, section 3.3.6(D) (MusicKit), before I start building. The design A "host" picks a song. Other people in the same room hear that same song. Every user plays it on their own device, through their own Apple Music subscription, in their own MusicKit JS instance. My server never receives, stores, caches, transcodes, or transmits any audio. My server only relays control metadata: a song identifier and an approximate playback position, so each client can start near the same point. Each user explicitly taps to start playback in their own browser. Standard play / pause / skip controls are available to every user. Apple Music playback is free for everyone in the app. No paywall, no ads, and no requirement to hand over personal information in order to listen. My questions 3.3.6(D) says "MusicKit Content cannot be synchronized with any other content." I read this as referring to synchronization with other media (for example, using a song as a soundtrack for video or images), and not as prohibiting multiple users independently playing the same song at roughly the same time through their own subscriptions. Is that reading correct? 3.3.6(D) says I must not "require payment for or indirectly monetize access to the Apple Music service." If Apple Music playback stays entirely free for all users, and I separately charge hosts for features unrelated to playback (for example audience analytics, custom branding for their room page, and scheduling tools), would that count as indirect monetization of access to the Apple Music service? 3.3.6(D) says "users must initiate playback." If a user taps play once and a queue then continues to the next track automatically (ordinary continuous playback), is that acceptable? Or does the user need to tap for each track individually when the host changes the selection? I'd like to build this correctly from the start, so any guidance is appreciated. If these are better directed to another channel, a pointer would be very welcome. Thanks, Sho
Replies
0
Boosts
0
Views
52
Activity
4d
Core Media errors should be better described and documented
Errors related to media playback, whether received from AVPlayer directly or read from an AVPlayerItem access log, usually lack information about the root cause of a playback issue. Most errors we receive in the CoreMediaErrorDomain are namely associated with undocumented error codes and non-explicit error messages. Here are a few examples: Error Domain=CoreMediaErrorDomain Code=-12927 "(null)" Error Domain=CoreMediaErrorDomain Code=-16012 "(null)" Error Domain=CoreMediaErrorDomain Code=-12685 "The operation couldn’t be completed." Error Domain=CoreMediaErrorDomain Code=-12648 "The operation couldn’t be completed." It would be helpful that Core Media: Provides a public constant for the CoreMediaErrorDomain. Provides public constants for the error codes within this domain. Ensures each error is associated with a meaningful human-readable description. If not possible having at least a documented list of error codes (as is done in the FairPlay programming guide PDF, for example) would allow us to better classify errors and understand playback errors experienced by our users. I opened a FB17673165 feedback with this suggestion as well. Thanks in advance for considering this improvement request.
Replies
3
Boosts
0
Views
111
Activity
6d
MusicKit – Significant Gap Between Tracks
We’ve worked extensively on beatsinspace.net/mixes, where authenticated users with an Apple Music subscription can listen to full Beats in Space mixes through MusicKit JS on the web. https://www.beatsinspace.net/mixes Each mix is published as an Apple Music album, with the tracks acting as chapters within one continuous DJ mix. However, there is a noticeable gap between every track when listening through the website. The same mixes play seamlessly in the native Apple Music app. We’ve tested this across Chrome and Safari, as well as in a standalone prototype, and the issue appears to happen specifically with MusicKit JS playback. Do we know why this is happening and whether there is a supported way to prevent it? Would deeply appreciate any pointers here. Thank you!
Replies
0
Boosts
0
Views
61
Activity
6d
How should live latency be measured and maintained with AVPlayer (HLS / LL-HLS)?
We keep live playback at a consistent distance from the live edge using small playback rate adjustments, with a target range based on recommendedTimeOffsetFromLive. Since the live edge is not exposed by AVPlayer, we currently fall back to seekableTimeRanges.end as our best approximation. What should be treated as the live edge, and how should the current live latency be measured? Is rate adjustment the appropriate way to hold a target latency? While playing above 1.0x, the playhead can reach the seekable end, at which point AVPlayerItemDidPlayToEndTime fires and halts the live stream. How can we guard against ? Does any of this differ between regular HLS and LL-HLS? A clear statement of the intended contract here would resolve a lot of uncertainty. Thanks in advance.
Replies
2
Boosts
0
Views
244
Activity
6d
_MPRemoteCommandEventDispatch crashes on iOS 26.x devices.
I'm seeing crashes in _MPRemoteCommandEventDispatch on iOS 26.x devices in 3 apps. According to Bugsnag logs they are: NSInternalInconsistencyException: event dispatch <_MPRemoteCommandEventDispatch: <MPRemoteCommandEvent: 0x11c049500 commandID=THV0 command=<MPRemoteCommand: 0x109ad1ea0 type=Play (0) enabled=YES handlers=[0x109b6a310]> sourceID=(null) ([HostedRoutingSessionDataSource] handleControlSendingCommand<2W5E>)> state:201> deallocated without calling continuation I attached a log from Xcode organizer matching Bugsnag crash. mpr_remote_command_event.crash When I set the brakpoint on the -[_MPRemoteCommandEventDispatch dealloc] I can see it it's hit every time I tap play or pause on locked screen play button. Thread 0 Crashed: 0 libsystem_kernel.dylib 0x00000002370420cc __pthread_kill + 8 (:-1) 1 libsystem_pthread.dylib 0x00000001e975c810 pthread_kill + 268 (pthread.c:1721) 2 libsystem_c.dylib 0x0000000198f8ff64 abort + 124 (abort.c:122) 3 libc++abi.dylib 0x000000018a7cf808 __abort_message + 132 (abort_message.cpp:66) 4 libc++abi.dylib 0x000000018a7be484 demangling_terminate_handler() + 304 (cxa_default_handlers.cpp:76) 5 libobjc.A.dylib 0x000000018a6cff78 _objc_terminate() + 156 (objc-exception.mm:496) 6 xxxxxxxxxxxxxx 0x00000001003a7db8 CPPExceptionTerminate() + 416 (BSG_KSCrashSentry_CPPException.mm:156) 7 libc++abi.dylib 0x000000018a7cebdc std::__terminate(void (*)()) + 16 (cxa_handlers.cpp:59) 8 libc++abi.dylib 0x000000018a7ceb80 std::terminate() + 108 (cxa_handlers.cpp:88) 9 CoreFoundation 0x000000018d7341c4 __CFRunLoopPerCalloutARPEnd + 256 (CFRunLoop.c:769) 10 CoreFoundation 0x000000018d70bb5c __CFRunLoopRun + 1976 (CFRunLoop.c:3179) 11 CoreFoundation 0x000000018d70aa6c _CFRunLoopRunSpecificWithOptions + 532 (CFRunLoop.c:3462) 12 GraphicsServices 0x000000022e31c498 GSEventRunModal + 120 (GSEvent.c:2049) 13 UIKitCore 0x00000001930ceba4 -[UIApplication _run] + 792 (UIApplication.m:3902) 14 UIKitCore 0x0000000193077a78 UIApplicationMain + 336 (UIApplication.m:5577) 15 xxxxxxxxxxxxxx 0x00000001000c0134 main + 308 (main.swift:15) 16 dyld 0x000000018a722e28 start + 7116 (dyldMain.cpp:1477) Is the crash happening when the app is being terminated? Thank you!
Replies
8
Boosts
3
Views
1.7k
Activity
6d
How to import photos into Device Hub photos app (beta 3)
In the old simulator you were able to simply drag a photo or video from your desktop into the photos app within the simulator in order to use it for testing. That doesn't seem to be working yet in Device Hub. Is there a workaround or are we just waiting on this to be fixed?
Replies
1
Boosts
0
Views
107
Activity
1w
iOS27 Callkit's didActivateAudioSession not being called sometimes
I have not seen any issues with didActivateAudioSession not getting called by iOS in many many years with many thousands of devices. However with iOS27 beta code I have seen a few times that when making an outgoing call it never gets called. All subsequent outgoing calls fail until I dismiss and relaunch the App.
Replies
11
Boosts
0
Views
310
Activity
1w
`LockedCameraCaptureManager` practically unusable since iOS 26
Somewhere since iOS 26, the LockedCameraCapture framework gets in an unpredictable state after opening the main app from the LockedCamera extension using LockedCameraCaptureSession.openApplication(for userActivity:). (Feedback with sample code to reproduce: FB21966835) Opening the extension from the lock screen again doesn’t open the extension but puts the lock screen in a state as if it has. Content updated from LockedCameraCaptureManager.shared.sessionContentUpdates comes in inconsistently, usually needs the app to be opened again or the extension to be opened. This makes using this extension impossible for me as I use it to record video files that manually need to be imported when the app is launched (so not through PhotoKit). Does anybody have a suggestion to circumvent this issue or how to get this fixed?
Replies
1
Boosts
1
Views
566
Activity
1w
Issue setting a queue with library and non-library items at the same time (plus a couple more MusicKit issues)
As the summer continues, I have been diving deeper and deeper into MusicKit, largely with great results. A few issues have arisen that I've outlined here, feedbacks already filed and numbers included here. All of this happens on the lasted developer beta and latest Xcode beta. Thanks! FB10967343 - Setting the queue with library and non-library items at the same time doesn't work correctly In my app, I am working on a feature that lets a user shuffle songs from a collection of albums that may or may not be in their library. However, I’ve discovered an issue where the queue does not seem to work correctly when mixing these types. I’ve attempted to load ApplicationMusicPlayer by creating a Queue and to load applicationQueuePlayer using a MPMusicPlayerPlayParametersQueueDescriptor, but the same issue occurs each time. The queue is able to play songs from the same source, but if it’s been playing a library song and tries to move to a non-library song, the queue stops.  The first thing I do is pick random songs from each album, using a MusicLibraryRequest or a MusicCatalogResourceRequest as appropriate, then taking a randomElement() from the ensuing MusicItemCollection for the album.  I append each track to an array, which I then cast to MusicItemCollection so I’ve now got a MusicItemCollection consisting of the tracks I want. If I’m in MusicKit land, I simply set the queue as follows:  player.queue = ApplicationMusicPlayer.Queue(for: tracks) It takes a bit more doing in MediaPlayer, but in theory this should also work, right?    do {         let paramObjects = tracks.compactMap {             $0.playParameters         }         let params = try paramObjects.map({try JSONEncoder().encode($0)}) let dicts = try params.compactMap {               try JSONSerialization.jsonObject(with: $0, options: []) as? [String:Any]           }           let finalParams = dicts.compactMap {                 MPMusicPlayerPlayParameters(dictionary: $0)             } let descriptor = MPMusicPlayerPlayParametersQueueDescriptor(playParametersQueue: finalParams) mediaPlayer.setQueue(with: descriptor) } catch { print(error) } In either case, the following issue occurs: say that I end up with a queue made up of one library song, then one non-library song. The player will play just the first song, then it acts as if the queue has ended. Say that it has two non-library songs, then one library song. Just the two non-library songs play. Indeed, printing queue.entries shows just the number of items that were from the same source type. FB10967076 - Publishing changes from background thread error when inserting queue items When using the .insert method on ApplicationMusicPlayer.Queue on the last iOS 16 and Xcode betas, it returns a “Publishing changes from background thread” error even though the function I’m doing in is marked as a @MainActor and the stacktace indicates it was on the main thread. FB10967277 - song.with([.albums], preferredSource: .library) generates thousands of lines of EntityQueries in the console I’ve noticed that when using the preferredSource: .library when requesting additional properties on a library item creates ~6,000 of “EntityQuery” entries in the console, all in the span of a second. This doesn’t seem to be leading to any major performance issues, but it sure seems like something isn't right. let request = MusicLibraryRequest<Song>.init() do { let response = try await request.response() guard let song = response.items.first else { return } let songWithAlbums = try await song.with([.albums], preferredSource: .library) } catch { print(error) } generates the following output (except... 6,000 of them) 2022-07-31 13:02:07.729003-0400 MusicKitFutzing[9405:2192606] [EntityQuery] Finished fetching results in 0s 2022-07-31 13:02:07.729047-0400 MusicKitFutzing[9405:2192605] [EntityQuery] Finished executing query in 0.00100017s 2022-07-31 13:02:07.729202-0400 MusicKitFutzing[9405:2192611] [EntityQuery] Finished executing query in 0s 2022-07-31 13:02:07.729240-0400 MusicKitFutzing[9405:2192605] [EntityQuery] Finished fetching results in 0s
Replies
2
Boosts
1
Views
1.9k
Activity
1w
Can an iOS app analyze audio being played by another app?
Hello, I'm in the early planning stages of an iOS app and I'm trying to determine what's technically possible before designing around assumptions. Is it possible for a third-party iOS app, with the user's permission, to access or analyze audio that is being played by another app (for example Apple Podcasts, Spotify, Audible, or YouTube) in real time? Or is microphone input the only supported way for an app to analyze audio that is audible in the user's environment? I'm not asking about recording the screen or capturing video. I'm specifically trying to understand whether another app's audio output is ever available to third-party apps, or whether iOS intentionally isolates apps from each other's audio. If the answer depends on the audio source (for example Apple Podcasts versus Spotify versus audio coming through the microphone), I'd appreciate understanding those distinctions as well. Thank you.
Replies
0
Boosts
0
Views
127
Activity
1w
ShazamKit under the App Sandbox on macOS — sanctioned way to reach com.apple.shazamd? (error 202)
I'm building a music-recognition app for the Mac App Store that uses ShazamKit (SHSession / SHManagedSession) against the default Shazam catalog. In a sandboxed build, SHSession.match(_:) fails with: com.apple.ShazamKit error 202 — "The connection to service named com.apple.shazamd was invalidated" The root cause is a sandbox denial of the mach-lookup to the ShazamKit matching daemon: kernel (Sandbox): deny(1) mach-lookup com.apple.shazamd What I've established: Enabling the ShazamKit App Service on the App ID does not add com.apple.shazamd to the sandbox mach-lookup allow-list on macOS — the denial persists and matching returns error 202. The iOS entitlement com.apple.developer.shazamkit is rejected by the macOS validator at upload ("not supported on macOS"), so it isn't an option here. Adding com.apple.security.temporary-exception.mach-lookup.global-name = [com.apple.shazamd] to the app's entitlements removes the denial, and ShazamKit then matches correctly under the sandbox (verified end-to-end: real api.shazam.apple.com/v1/catalog/.../match requests complete and tracks are identified). Removing that exception reproduces error 202 on every probe. So the temporary-exception appears to be the only way to make ShazamKit's default-catalog matching work inside the macOS App Sandbox today. Questions: Is there a sanctioned, non-temporary-exception way to use ShazamKit default-catalog matching in a sandboxed macOS app (a proper entitlement, an App Service configuration, or a supported API usage)? If not, is the com.apple.shazamd mach-lookup temporary-exception the intended approach on macOS? My actual SHSession.match runs in a nested helper that inherits the app's sandbox (com.apple.security.inherit). Is it correct to place the exception on the main app (which the inherited helper then picks up), rather than on the helper itself? Environment: macOS 26.1, ShazamKit App Service enabled on the App ID, signed App Sandbox build installed via TestFlight (valid _MASReceipt present). Happy to share entitlement plists and a focused sample on request. Thanks!
Replies
5
Boosts
0
Views
327
Activity
1w
Extended Dynamic Range support
My app currently supports display and editing of RAW files in HDR mode (Extended Dynamic Range). I came across 2 issues: In HDR mode, if I am using the default boostAmount = 1.0, then some of the highlight colors will shift. Like a clear blue sky becomes a light gray / light purple sky. I've to set boostAmount = 0.0 to avoid this problem. Is this a bug or is there a way to keep the Apple colors and not having this issue? The Shadow and highlight filter does not appear to work correctly in HDR mode, I've it hooked up in the linearSpaceFilter. Would be nice if you guys can introduce a spatial aware shadow & highlight filter.
Replies
1
Boosts
0
Views
245
Activity
1w