I've found that the interface between the BackgroundAudioPlayer (BAP) and foreground applications is quite possibly the most ill-conceived piece of "engineering" in the Windows Phone 7.x SDK. IsolatedStorage doesn't really work for me because my app could download many files and only play a few at a time in a "play list". Should I temporarily copy those files to a "special" location in IsolatedStorage just so the agent can read the playlist from there? At 10 to 20MB a pop, I don't think so. Also, if I want to use the background transfer service -- which works pretty well, btw -- to incrementally add files to the playlist, how would I go about telling the agent to go load up more tracks as they are downloaded? Short of settling on some convention to get the tracks created in the right order, it can't be done.
Tried to use static members on the agent to add tracks to a playlist (as they suggest in the docs), and...umm...yeah, that is just a non-starter.
What I have settled for now is to manage the playlist in the foreground app and feed tracks one by one to the BAP based on the user's actions. Problem is that this doesn't work with the BAP controls shown on the lock screen. Nor does it seem to handle the TrackEnded event consistently. I am within a hair's breadth of just using the MediaElement and forgo background audio all together.
I hope whoever invented this farce of an API is not involved in future versions of WP.