Bug 16605 - AVAudioPlayer does not continue playing in background even when registered as audio app
Summary: AVAudioPlayer does not continue playing in background even when registered as...
Alias: None
Product: iOS
Classification: Xamarin
Component: XI runtime ()
Version: 7.0.4.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2013-12-04 15:21 UTC by Joshua Barker
Modified: 2013-12-06 05:21 UTC (History)
3 users (show)

Is this bug a regression?: ---
Last known good build:

Bare-bones solution containing example of described bug (14.13 KB, application/zip)
2013-12-04 15:21 UTC, Joshua Barker

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Joshua Barker 2013-12-04 15:21:32 UTC
Created attachment 5605 [details]
Bare-bones solution containing example of described bug

This was working in iOS 6.x, but ever since the upgrade to XCode 5 / Xamarin 7.x, this is broken. I've tried every possible permutation I can think of to get this to work, but without success.  I'm attaching a repro solution highlighting the described problem.

This occurs both on the Simulator and when deployed to a device.

Follow these steps to reproduce:

1. Verify "Enable Background Modes - Audio and AirPlay" is selected under the "Background Modes" section in Info.plist
2. Build & Run the application (either via the Simulator or on a device)
3. Press the 'Play' button
4. Observe that you can hear an audible, repeating "click" sound
5. Press the Home button (or Command+Shift+H for Simulator) to move the app to the background
6. Observe that the click sound stops repeating, even though the application is registered as an Audio app
7. Bring the app back to the foreground
8. Observe that the repeating click sound continues where it left off.
Comment 1 Rolf Bjarne Kvinge [MSFT] 2013-12-05 19:43:14 UTC
I can reproduce this in the iOS7 simulator, but not on my iOS 7 device (iPad Air).

OTOH I can also reproduce the issue with other Objective-C samples in the simulator, so this does not look like it's a problem with Xamarin.iOS.

Can you confirm if your able to use background audio in the simulator using Objective-C apps?
Comment 2 Joshua Barker 2013-12-05 23:55:06 UTC
Not sure, but this appears to now be partially fixed in the 4.2.2 (build 2)  update.  Prior to the update I could not get this to run in either the simulator or my device.  Since the update I can now get it to run in the background on my device, but not in the background on the simulator.
Comment 3 Rolf Bjarne Kvinge [MSFT] 2013-12-06 05:21:03 UTC
Yes, that matches what I see with Xcode projects too.

It looks like it's an issue that was fixed on device with iOS 7.0.3: http://stackoverflow.com/a/19544418/183422 - and it'll probably be fixed in the simulator as well in a future Xcode update.

So I'm closing this since it is not a Xamarin bug.