Post

Replies

Boosts

Views

Activity

MusicKit tvOS — Some personal library songs fail with Error Code 6, while others play successfully
Hi everyone, I’m developing a native Apple TV application using MusicKit for Swift. The app provides a custom interface for browsing and playing the user’s personal Apple Music library. The application was working correctly for several months, but recently certain songs from the user’s personal library have stopped playing. I’ve been investigating this issue extensively and have reproduced it in a completely separate, minimal tvOS test application. The issue I retrieve songs using MusicLibraryRequest() and play them using ApplicationMusicPlayer. Some songs play successfully, while others consistently fail during playback preparation with: `MPMusicPlayerControllerErrorDomain Code=6 "Prepare to play failed"` The underlying errors include : NSCocoaErrorDomain Code=4099 Example of a failing song Michael Jackson — Bad (2012 Remaster) Library song ID: i.ldDOAp0UrAa62J Successfully retrieved using MusicLibraryRequest() Fails when queued with ApplicationMusicPlayer Also fails with SystemMusicPlayer Example of a working song Harry Nilsson — Everybody’s Talkin’ (1971 Mix) Library song ID: i.WmYQp9PcdZ4Y0E Retrieved using the exact same MusicLibraryRequest() Successfully plays using ApplicationMusicPlayer Both songs have library identifiers beginning with i.. What I’ve tested ApplicationMusicPlayer with prepareToPlay() followed by play(). SystemMusicPlayer with the same library song. Direct play() without explicitly calling prepareToPlay(). Retrieving songs directly using MusicLibraryRequest(), rather than accessing them through albums. A completely separate minimal tvOS application. An older version of my application’s code, recompiled using the current Xcode version. The issue persists across these tests. Interestingly, the corresponding Apple Music catalog song plays successfully when retrieved through MusicCatalogSearchRequest. However, replacing library songs with catalog equivalents is not an acceptable solution because the application needs to support users’ actual personal libraries, including imported music. Important observation The exact same failing song plays correctly on the same Apple TV and Apple Music account in: The official Apple Music application. Sleeve, another third-party Apple TV music player. This suggests that the song itself is playable and that another third-party application can successfully initiate playback. Environment Platform: tvOS Device: Physical Apple TV Framework: MusicKit for Swift Apple Music authorization: Granted MusicKit App Service: Enabled Signing: Automatic, using a paid Apple Developer account Question Is there a known issue with resolving or playing certain personal library songs through MusicKit on tvOS? Are there additional playback parameters, library synchronization requirements, or recommended queue configurations that could explain why some MusicLibraryRequest() items fail while others work? Has anyone encountered a similar issue or found a workaround that preserves playback of the user’s actual library items? Any guidance would be greatly appreciated. Thank you!
2
0
361
14h
MusicKit tvOS — Some personal library songs fail with Error Code 6, while others play successfully
Hi everyone, I’m developing a native Apple TV application using MusicKit for Swift. The app provides a custom interface for browsing and playing the user’s personal Apple Music library. The application was working correctly for several months, but recently certain songs from the user’s personal library have stopped playing. I’ve been investigating this issue extensively and have reproduced it in a completely separate, minimal tvOS test application. The issue I retrieve songs using MusicLibraryRequest() and play them using ApplicationMusicPlayer. Some songs play successfully, while others consistently fail during playback preparation with: `MPMusicPlayerControllerErrorDomain Code=6 "Prepare to play failed"` The underlying errors include : NSCocoaErrorDomain Code=4099 Example of a failing song Michael Jackson — Bad (2012 Remaster) Library song ID: i.ldDOAp0UrAa62J Successfully retrieved using MusicLibraryRequest() Fails when queued with ApplicationMusicPlayer Also fails with SystemMusicPlayer Example of a working song Harry Nilsson — Everybody’s Talkin’ (1971 Mix) Library song ID: i.WmYQp9PcdZ4Y0E Retrieved using the exact same MusicLibraryRequest() Successfully plays using ApplicationMusicPlayer Both songs have library identifiers beginning with i.. What I’ve tested ApplicationMusicPlayer with prepareToPlay() followed by play(). SystemMusicPlayer with the same library song. Direct play() without explicitly calling prepareToPlay(). Retrieving songs directly using MusicLibraryRequest(), rather than accessing them through albums. A completely separate minimal tvOS application. An older version of my application’s code, recompiled using the current Xcode version. The issue persists across these tests. Interestingly, the corresponding Apple Music catalog song plays successfully when retrieved through MusicCatalogSearchRequest. However, replacing library songs with catalog equivalents is not an acceptable solution because the application needs to support users’ actual personal libraries, including imported music. Important observation The exact same failing song plays correctly on the same Apple TV and Apple Music account in: The official Apple Music application. Sleeve, another third-party Apple TV music player. This suggests that the song itself is playable and that another third-party application can successfully initiate playback. Environment Platform: tvOS Device: Physical Apple TV Framework: MusicKit for Swift Apple Music authorization: Granted MusicKit App Service: Enabled Signing: Automatic, using a paid Apple Developer account Question Is there a known issue with resolving or playing certain personal library songs through MusicKit on tvOS? Are there additional playback parameters, library synchronization requirements, or recommended queue configurations that could explain why some MusicLibraryRequest() items fail while others work? Has anyone encountered a similar issue or found a workaround that preserves playback of the user’s actual library items? Any guidance would be greatly appreciated. Thank you!
Replies
2
Boosts
0
Views
361
Activity
14h