AirPlay allows users to wirelessly stream content from their iOS device or Mac to devices and accessories compatible with AirPlay.

Posts under AirPlay tag

102 Posts

Post

Replies

Boosts

Views

Activity

Help with crash in framework code - freeing completion blocks?
Hello. I have a mysterious crash that I can't reproduce. The stack traces never have any of my code in them. Here is what I know about the crashes: It doesn't seem to be at all device-specific, but newer devices are far more commonly seen than older devices. It only happens on iOS 14 and up It might possibly be related to airplay (I work on a video player app), because every crash report also has either a thread labeled com.apple.coremedia.displaymirroringobserver or a thread labeled AVAudioSession Notify Thread Here is the stack trace: language Crashed: com.apple.main-thread  EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000020 0 libobjc.A.dylib 0x1bfa07de0 objc_release + 16 1 libsystem_blocks.dylib 0x1f315d784 _Block_release + 188 2 UIKitCore 0x1ae37bf14 -[_UIAfterCACommitBlock run] + 76 3 UIKitCore 0x1adee1984 _runAfterCACommitDeferredBlocks + 296 4 UIKitCore 0x1aded0eb4 _cleanUpAfterCAFlushAndRunDeferredBlocks + 200 5 UIKitCore 0x1adf02484 _afterCACommitHandler + 76 6 CoreFoundation 0x1ab5e687c __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32 7 CoreFoundation 0x1ab5e0f50 __CFRunLoopDoObservers + 604 8 CoreFoundation 0x1ab5e1498 __CFRunLoopRun + 960 9 CoreFoundation 0x1ab5e0ba0 CFRunLoopRunSpecific + 572 10 GraphicsServices 0x1c2346598 GSEventRunModal + 160 11 UIKitCore 0x1aded22f4 -[UIApplication _run] + 1052 12 UIKitCore 0x1aded7874 UIApplicationMain + 164 13 SpectrumTV 0x1029874d0 main + 29 (SettingsAboutAnalyticsReporter.swift:29) 14 libdyld.dylib 0x1ab2bf568 start + 4 This seems to indicate that we are doing something wrong with a Core Animation completion block. When the OS tries to free the completion blocks, it crashes. But, that still leaves me with a huge search surface area, so I was hoping that by posting here, someone (perhaps someone with knowledge of the code in question) could point me at specifically what causes the above framework code to run. The other option is that someone is corrupting the heap, which is too horrifying to contemplate. 😱
5
0
4.6k
Oct ’21
Calling replaceCurrentItem(with:) method not working after an error occurs on AirPlay
Hello, My problem is quite complex, so I am going to describe it in detail below. I am developing a playback app that makes use of HLS streaming. One of the requirements I have to meet is that my app should react to HTTP response headers. As there is no API to get these information, I applied the solution described in the latest comment right here: HTTP Response Header from AVPlayer – I am using a proxy server to extract the headers from the response. The problem happens when a user wants to stream video on an external device via AirPlay. Since the proxy server runs only on a mobile device, any HTTP request fails on the external device due to an incorrect URL (e.g http://127.0.0.1:58244/theRestOfUrl/playlist.m3u8). In this case, I detect when the AirPlay connection is initiated (via the Notification Center mechanism), and then change AVPlayerItem by calling the replaceCurrentItem(with:) method. The new item contains a correct URL, without the proxy server address added. Everything works fine on AirPlay 2, but unfortunately not on older AirPlay – the player on the external device displays an activity indicator for a moment and after a while the connection is being interrupted. As a workaround, I tried to set nil on AVPlayer and create a new instance of it, but this does not work either. I can attach the sample project if needed. Best regards, Tomasz
1
0
1.7k
Oct ’21
Help with crash in framework code - freeing completion blocks?
Hello. I have a mysterious crash that I can't reproduce. The stack traces never have any of my code in them. Here is what I know about the crashes: It doesn't seem to be at all device-specific, but newer devices are far more commonly seen than older devices. It only happens on iOS 14 and up It might possibly be related to airplay (I work on a video player app), because every crash report also has either a thread labeled com.apple.coremedia.displaymirroringobserver or a thread labeled AVAudioSession Notify Thread Here is the stack trace: language Crashed: com.apple.main-thread  EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000020 0 libobjc.A.dylib 0x1bfa07de0 objc_release + 16 1 libsystem_blocks.dylib 0x1f315d784 _Block_release + 188 2 UIKitCore 0x1ae37bf14 -[_UIAfterCACommitBlock run] + 76 3 UIKitCore 0x1adee1984 _runAfterCACommitDeferredBlocks + 296 4 UIKitCore 0x1aded0eb4 _cleanUpAfterCAFlushAndRunDeferredBlocks + 200 5 UIKitCore 0x1adf02484 _afterCACommitHandler + 76 6 CoreFoundation 0x1ab5e687c __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32 7 CoreFoundation 0x1ab5e0f50 __CFRunLoopDoObservers + 604 8 CoreFoundation 0x1ab5e1498 __CFRunLoopRun + 960 9 CoreFoundation 0x1ab5e0ba0 CFRunLoopRunSpecific + 572 10 GraphicsServices 0x1c2346598 GSEventRunModal + 160 11 UIKitCore 0x1aded22f4 -[UIApplication _run] + 1052 12 UIKitCore 0x1aded7874 UIApplicationMain + 164 13 SpectrumTV 0x1029874d0 main + 29 (SettingsAboutAnalyticsReporter.swift:29) 14 libdyld.dylib 0x1ab2bf568 start + 4 This seems to indicate that we are doing something wrong with a Core Animation completion block. When the OS tries to free the completion blocks, it crashes. But, that still leaves me with a huge search surface area, so I was hoping that by posting here, someone (perhaps someone with knowledge of the code in question) could point me at specifically what causes the above framework code to run. The other option is that someone is corrupting the heap, which is too horrifying to contemplate. 😱
Replies
5
Boosts
0
Views
4.6k
Activity
Oct ’21
Calling replaceCurrentItem(with:) method not working after an error occurs on AirPlay
Hello, My problem is quite complex, so I am going to describe it in detail below. I am developing a playback app that makes use of HLS streaming. One of the requirements I have to meet is that my app should react to HTTP response headers. As there is no API to get these information, I applied the solution described in the latest comment right here: HTTP Response Header from AVPlayer – I am using a proxy server to extract the headers from the response. The problem happens when a user wants to stream video on an external device via AirPlay. Since the proxy server runs only on a mobile device, any HTTP request fails on the external device due to an incorrect URL (e.g http://127.0.0.1:58244/theRestOfUrl/playlist.m3u8). In this case, I detect when the AirPlay connection is initiated (via the Notification Center mechanism), and then change AVPlayerItem by calling the replaceCurrentItem(with:) method. The new item contains a correct URL, without the proxy server address added. Everything works fine on AirPlay 2, but unfortunately not on older AirPlay – the player on the external device displays an activity indicator for a moment and after a while the connection is being interrupted. As a workaround, I tried to set nil on AVPlayer and create a new instance of it, but this does not work either. I can attach the sample project if needed. Best regards, Tomasz
Replies
1
Boosts
0
Views
1.7k
Activity
Oct ’21