Fairplay protected content black screen when using Lightning Digital AV Adapter

Hi Guys,


We have recently encountered a problem not being able to play Faiyplay protected contents when our IOS application is used on an IPAD connected to a TV through Lightning Digital AV Adapter. The external display just shows a black screen while on the application it says "Paying through Airplay". We couldn't check the logs since we cannot connect the device to a MAC with xcode while the adapter is connected.


So far what we have tried are the following:


1. Set player.usesExternalPlaybackWhileExternalScreenIsActive = TRUE on the application as it was stated in the Fairplay Programming Guide.

2. Set the HDCP enforcement to type = 0 in the CKC message (40791AC78BD5C571). Before it was set to "NOT REQUIRED" (EF72894CA7895B78).

3. Remove the HDCP TTLV completely from the CKC message.


But none of these worked. The problem remains the same. The screen is black as if the device refuses to play the fairplay protected content when the adapter is connected.


Things that wre worth noting are:


1. We receive SPC message on the CKC server from the device even though the screen is black.

2. We tried playing the content on a MAC (connected to hdmi) + Safari using EME and the streams worked alright. We also tried from the IPAD to send the stream through Airplay directly to an Apple TV device and it also worked. So it doesnt seemed to be a problem with the stream, nor the CKC message, nor the HDCP TTLV.

3. We also tried to play contents from iTunes using the same IPAD + same Lightning Digital AV Adapter + Same Television and the streams worked correctly, so we doubt that it could be a problem with the device and it's HDCP support.


Is there anything else we should investigate to get to the bottom of this issue? We must have done something wrong inside the application that might be causing the issue. Could you guys give us some more pointers to where to look?


Regards,

Replies

Hi,


I am dealing with basically the same issue. Were you able to figure out what was causing the black screen?


Thanks,

Steve

Hi,


we're dealing with the same issue. In our case the audio is playing fine but the screen is blacked out. As far as we know, the issue is only reproducible on iOS 10.3.3, a device with iOS 9.3.5 works fine.


We noticed that, even though the cable is attached and the device screen is mirrored on the external screen, the "Streaming indicator" in the SPC payload fails to report that the content will be sent to an Apple digital AV adapter , e.g.


TLLVBlockStreamingIndicator{tag=TLLVTag[abb0256a31843974 (StreamingIndicator)], lengthBlock=144, lengthValue=8, value=c0d08ccafd3da8d5, isAirPlay=false, isAVAdapter=false}


Moreover, the 'value' field in there is always different and it's never one of the two values reported by the FPS guide (i.e. 0xabb0256a31843974, 0x5f9c8132b59f2fde)


Is this the source of the issue?


Thanks.

Anyone from Apple Fairplay support who might be able to clarify this? Seems like this issue is very common.

Hi steve.gray, hfghgfhfgh



Were you guys able to work around this issue? I honestly did everything I could changing parameters in the CKC response but ithe problem is still there.

Please post a bug report number for an existing bug report about this issue, or file a new bug report using our bug reporting system <https://developer.apple.com/bug-reporting/> and post its bug number to this forum.

Hi 3ZS,


We just filed a bug report. Here is the report number.


34408732


We have also attached a sample code to reproduce the issue.


Regards,

Hi 3ZS,


Was there any findings with the bug report that we have submitted 2 weeks ago?


There seems to be no activity in the logs of the bug report.


Regards,

Make sure usesExternalPlaybackWhileExternalScreenIsActive and allowsExternalPlayback are set up properly before the addition of the PlayItem to the playback queue, otherwise this may happen. Let me know the results of your testing.

Hi 3ZS,


We have updated the code in the bug tracker, to reflect the changes you recommend (setting the properties before replacing the AVPlayerItem in the player), but playback still does not work.


Device detects the external playback mode while the player is in full screen (i.e. the "Playing on TV" message appears), but the TV is green. If the player is minimized, playback just freezes and AVPlayerViewController shows a hanging spinner.


May be there is something else that we are doing wrong. Could you check the code?


Thank you for your help.

The green screen means your content key or iV is wrong for the content. First use the idenity key type as described in the Debuging FPS technote linked to below to make sure your content key is correct for the content (pulls the KSM out of the equation), then make sure the KSM is providing the right key. Second, log the content key/IV at the key server that is being provided to the client to make sure it matches what will play if you use the identity key type.


Debuging FairPlay Streaming

https://developer.apple.com/library/content/technotes/tn2454/_index.html

Hi 3ZS,



The tests listed in the link you have provided seems to be more inclined to problems of not being able to play the encrypted content on the device. Although our application failed to play the content on external displays using the "Lightning Digital AV Adapter", it plays perfectly on the device when the cable is disconnected. I think this should already rule out any problems that might have been caused by incorrect authoring of the content or incorrect response of the KSM server.


But even though, just to double check, we tried to perform all the test descibed in the link and the result are, as expected, all correct. Is there anything else we can try?


Below are the summary of the tests:

TEST 1. Using Identity key type.

below is the sample generated m3u8 file (The key URI is masked intentionally)

#EXTM3U
#EXT-X-VERSION:5
#EXT-X-TARGETDURATION:8
#EXT-X-MEDIA-SEQUENCE:2353
#EXT-X-KEY:METHOD=SAMPLE-AES,URI="http://XXXXXXXXXX.***/Fairplay/motogp.bin",IV=0x46657243617253616d3231336436335f,KEYFORMAT="identity"
#EXTINF:6.0,
media-uyexbl0iw_b7000000_2353.ts
#EXTINF:6.0,
media-uyexbl0iw_b7000000_2354.ts
#EXTINF:6.0,
media-uyexbl0iw_b7000000_2355.ts

Result: Content Plays on the application with and without connecting the Lightning Digital AV Adapter


TEST 2: Verifying the CKC response of the KSM server with the development credentials and SPC which came with the SDK.

Result: verify_ckc did not display any error when. The KSM server were configured to use the development certificate and DASK key = d87ce7a26081de2e8eb8acef3a6dc179


Info: SPC and CKC R1 key values match.
Info: CKC decryption and parsing was successful.


TEST 3: Verifying certificate used in app and private key used by the KSM server

Results: Certificate and private key matched (Middle 8 bytes masked for security)

Certificate used in the app

openssl x509 -noout -modulus -in fairplay.der -inform der | openssl md5
e37c1155XXXXXXXXXXXXXXXXa27e57e7

Private Key of server

openssl rsa -noout -modulus -in privatekey_clear.pem | openssl md5
e37c1155XXXXXXXXXXXXXXXXa27e57e7

TEST3: Verify that your Application certificate is encoded using the X.509 standard with distinguished encoding rules (DER)

Result: Application certificate is correct

Certificate:    Data:        Version: 3 (0x2)        Serial Number: 6095616854686433927 (0x5497fb3bbe780287)    Signature Algorithm: sha1WithRSAEncryption        Issuer: C=US, O=Apple Inc., OU=Apple Certification Authority, CN=Apple Key Services Certification Authority


Regards,

Hi 3ZS,


Any feed back?


Regards,


Ferdinand

Yep,


Please attach a built ipa to the bug report you filed that will allow SW engineering to reproduce the issue.

Hi,


How can we allow them to install it? We would need the UDIDs for the provisioning profiles.


Thank you.

Hello Yep,


Don't worry about that. The SW engineering group can run your application and they are very interested in getting a copy of it.