Bug 9050 - Crash on calling AudioSesstion.InterruptionType
Summary: Crash on calling AudioSesstion.InterruptionType
Status: RESOLVED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: 6.1.x
Hardware: Other Other
: --- normal
Target Milestone: Untriaged
Assignee: Marek Safar
URL:
Depends on:
Blocks:
 
Reported: 2012-12-19 10:52 UTC by Alexander
Modified: 2013-03-11 08:36 UTC (History)
4 users (show)

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

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:
Status:
RESOLVED FIXED

Description Alexander 2012-12-19 10:52:33 UTC
My stream radio player crashes on calling AudioSesstion.InterruptionType



    AudioSession.Initialize();
    AudioSession.Category = AudioSessionCategory.MediaPlayback;
    AudioSession.SetActive(true);
    AudioSession.Interrupted += OnInterrupted;


    void OnInterrupted(object sender, EventArgs e)
    {
        if (AudioSession.InterruptionType == AudioSessionInterruptionType.ShouldResume)
            // ...
    }



After minimizing my app and opening music player it crashes with such an error:

    [AudioSessionException: UnhandledExceptions] Handle(ex) MonoTouch.AudioToolbox.AudioSessionException: The audio session property is not supported
Comment 1 Sebastien Pouliot 2012-12-19 12:54:28 UTC
Please provide all the versions information of your system. You can get them from "MonoDevelop" menu, "About MonoDevelop" item, "Version Information" tab. Click on the "Copy Version Information" button and paste this into this bug report.

Also provide the iOS version used on your device(s).
Comment 2 Alexander 2012-12-24 04:33:05 UTC
MonoDevelop 3.0.5
Installation UUID: ee7dbcdf-5ad3-4078-b2cf-7f358daccd94
Runtime:
	Mono 2.10.9 (tarball)
	GTK 2.24.10
	GTK# (2.12.0.0)
	Package version: 210090011
Mono for Android: Not Installed

Apple Developer Tools:
	 Xcode 4.5 (1839)
	 Build 4G182
Monotouch: 6.0.6
Build information:
	Release ID: 30005000
	Git revision: e159cf083bd327933166819d94245298898d6e3d
	Build date: 2012-10-24 16:43:06+0000
	Xamarin addins: eea2ed91ae8dd242b281d5ec8f6c2fbc63b4cd3d
Operating System:
	Mac OS X 10.7.5
	Darwin Edgars-Mac-mini.local 11.4.2 Darwin Kernel Version 11.4.2
	    Thu Aug 23 16:25:48 PDT 2012
	    root:xnu-1699.32.7~1/RELEASE_X86_64 x86_64


iOS version is 6.0.1 (10A523)
Comment 3 Alexander 2012-12-24 07:31:38 UTC
On 5.1.1 the same error:



Dec 24 15:37:56 TI-iPod-Touch-4th-Gen-Maria-Smirnova UIKitApplication:com.touchin.cityfm[0x6e1b][1073] <Notice>: [ERROR] FATAL UNHANDLED EXCEPTION: MonoTouch.AudioToolbox.AudioSessionException: The audio session property is not supported
Dec 24 15:37:56 TI-iPod-Touch-4th-Gen-Maria-Smirnova UIKitApplication:com.touchin.cityfm[0x6e1b][1073] <Notice>:   at MonoTouch.AudioToolbox.AudioSession.GetInt (AudioSessionProperty property) [0x00000] in <filename unknown>:0
Dec 24 15:37:56 TI-iPod-Touch-4th-Gen-Maria-Smirnova UIKitApplication:com.touchin.cityfm[0x6e1b][1073] <Notice>:   at MonoTouch.AudioToolbox.AudioSession.get_InterruptionType () [0x00000] in <filename unknown>:0
Dec 24 15:37:56 TI-iPod-Touch-4th-Gen-Maria-Smirnova UIKitApplication:com.touchin.cityfm[0x6e1b][1073] <Notice>:   at Touchin.CityFM.Logic.Player.OnInterrupted (System.Object sender, System.EventArgs e) [0x00000] in <filename unknown>:0
Dec 24 15:37:56 TI-iPod-Touch-4th-Gen-Maria-Smirnova UIKitApplication:com.touchin.cityfm[0x6e1b][1073] <Notice>:   at MonoTouch.AudioToolbox.AudioSession.Interruption (IntPtr userData, UInt32 state) [0x00000] in <filename unknown>:0
Dec 24 15:37:56 TI-iPod-Touch-4th-Gen-Maria-Smirnova UIKitApplication:com.touchin.cityfm[0x6e1b][1073] <Notice>:   at (wrapper native-to-managed) MonoTouch.AudioToolbox.AudioSession:Interruption (intptr,uint)
Dec 24 15:37:56 TI-iPod-Touch-4th-Gen-Maria-Smirnova UIKitApplication:com.touchin.cityfm[0x6e1b][1073] <Notice>:   at MonoTouch.UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00000] in <filename unknown>:0
Dec 24 15:37:56 TI-iPod-Touch-4th-Gen-Maria-Smirnova UIKitApplication:com.touchin.cityfm[0x6e1b][1073] <Notice>:   at Touchin.CityFM.App.Application.Main (System.String[] args) [0x00000] in <filename unknown>:0
Dec 24 15:37:56 TI-iPod-Touch-4th-Gen-Maria-Smirnova UIKitApplication:com.touchin.cityfm[0x6e1b][1073] <Notice>: Stacktrace:
Dec 24 15:37:56 TI-iPod-Touch-4th-Gen-Maria-Smirnova UIKitApplication:com.touchin.cityfm[0x6e1b][1073] <Notice>: Native stacktrace:
Dec 24 15:37:56 TI-iPod-Touch-4th-Gen-Maria-Smirnova UIKitApplication:com.touchin.cityfm[0x6e1b][1073] <Notice>: 0   iPhone                              0x00549275 iPhone + 5538421
Dec 24 15:37:56 TI-iPod-Touch-4th-Gen-Maria-Smirnova UIKitApplication:com.touchin.cityfm[0x6e1b][1073] <Notice>: 1   iPhone                              0x0057b985 iPhone + 5745029
Dec 24 15:37:56 TI-iPod-Touch-4th-Gen-Maria-Smirnova UIKitApplication:com.touchin.cityfm[0x6e1b][1073] <Notice>: 2   libsystem_c.dylib                   0x30a967ed _sigtramp + 48
Dec 24 15:37:56 TI-iPod-Touch-4th-Gen-Maria-Smirnova UIKitApplication:com.touchin.cityfm[0x6e1b][1073] <Notice>: 3   libsystem_c.dylib                   0x30a8c20f pthread_kill + 54
Dec 24 15:37:56 TI-iPod-Touch-4th-Gen-Maria-Smirnova UIKitApplication:com.touchin.cityfm[0x6e1b][1073] <Notice>: 4   libsystem_c.dylib                   0x30a8529f abort + 94
Dec 24 15:37:56 TI-iPod-Touch-4th-Gen-Maria-Smirnova UIKitApplication:com.touchin.cityfm[0x6e1b][1073] <Notice>: 5   iPhone                              0x0051f0c3 iPhone + 5365955
Dec 24 15:37:56 TI-iPod-Touch-4th-Gen-Maria-Smirnova UIKitApplication:com.touchin.cityfm[0x6e1b][1073] <Notice>: 6   iPhone                              0x00503895 iPhone + 5253269
Dec 24 15:37:56 TI-iPod-Touch-4th-Gen-Maria-Smirnova UIKitApplication:com.touchin.cityfm[0x6e1b][1073] <Notice>: 7   iPhone                              0x00548f4b iPhone + 5537611
Dec 24 15:37:56 TI-iPod-Touch-4th-Gen-Maria-Smirnova UIKitApplication:com.touchin.cityfm[0x6e1b][1073] <Notice>: 8   iPhone                              0x00549019 iPhone + 5537817
Dec 24 15:37:56 TI-iPod-Touch-4th-Gen-Maria-Smirnova UIKitApplication:com.touchin.cityfm[0x6e1b][1073] <Notice>: 9   iPhone                              0x0057ac41 iPhone + 5741633
Dec 24 15:37:56 TI-iPod-Touch-4th-Gen-Maria-Smirnova UIKitApplication:com.touchin.cityfm[0x6e1b][1073] <Notice>: 10  iPhone                              0x002f15a8 iPhone + 3081640
Dec 24 15:37:56 TI-iPod-Touch-4th-Gen-Maria-Smirnova UIKitApplication:com.touchin.cityfm[0x6e1b][1073] <Notice>: 11  iPhone                              0x00118fac iPhone + 1146796
Dec 24 15:37:56 TI-iPod-Touch-4th-Gen-Maria-Smirnova UIKitApplication:com.touchin.cityfm[0x6e1b][1073] <Notice>: 12  iPhone                              0x004b8618 iPhone + 4945432
Dec 24 15:37:56 TI-iPod-Touch-4th-Gen-Maria-Smirnova UIKitApplication:com.touchin.cityfm[0x6e1b][1073] <Notice>: 13  iPhone                              0x00118dd0 iPhone + 1146320
Dec 24 15:37:56 TI-iPod-Touch-4th-Gen-Maria-Smirnova UIKitApplication:com.touchin.cityfm[0x6e1b][1073] <Notice>: 14  iPhone                              0x00157ccc iPhone + 1404108
Dec 24 15:37:56 TI-iPod-Touch-4th-Gen-Maria-Smirnova UIKitApplication:com.touchin.cityfm[0x6e1b][1073] <Notice>: 15  AudioToolbox                        0x336dd251 SSServer_AudioSessionInterruptionListenerMessage + 40
Dec 24 15:37:56 TI-iPod-Touch-4th-Gen-Maria-Smirnova UIKitApplication:com.touchin.cityfm[0x6e1b][1073] <Notice>: 16  AudioToolbox                        0x33684d33 _XAudioSessionInterruptionListenerMessage + 62
Dec 24 15:37:56 TI-iPod-Touch-4th-Gen-Maria-Smirnova UIKitApplication:com.touchin.cityfm[0x6e1b][1073] <Notice>: 17  AudioToolbox                        0x33619ce3 mshMIGPerform + 374
Dec 24 15:37:56 TI-iPod-Touch-4th-Gen-Maria-Smirnova UIKitApplication:com.touchin.cityfm[0x6e1b][1073] <Notice>: 18  CoreFoundation                      0x32185523 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 38
Dec 24 15:37:56 TI-iPod-Touch-4th-Gen-Maria-Smirnova UIKitApplication:com.touchin.cityfm[0x6e1b][1073] <Notice>: 19  CoreFoundation                      0x321854c5 __CFRunLoopDoSource1 + 140
Dec 24 15:37:56 TI-iPod-Touch-4th-Gen-Maria-Smirnova UIKitApplication:com.touchin.cityfm[0x6e1b][1073] <Notice>: 20  CoreFoundation                      0x32184313 __CFRunLoopRun + 1370
Dec 24 15:37:56 TI-iPod-Touch-4th-Gen-Maria-Smirnova UIKitApplication:com.touchin.cityfm[0x6e1b][1073] <Notice>: 21  CoreFoundation                      0x321074a5 CFRunLoopRunSpecific + 300
Dec 24 15:37:56 TI-iPod-Touch-4th-Gen-Maria-Smirnova UIKitApplication:com.touchin.cityfm[0x6e1b][1073] <Notice>: 22  CoreFoundation                      0x3210736d CFRunLoopRunInMode + 104
Dec 24 15:37:56 TI-iPod-Touch-4th-Gen-Maria-Smirnova UIKitApplication:com.touchin.cityfm[0x6e1b][1073] <Notice>: 23  GraphicsServices                    0x3125e439 GSEventRunModal + 136
Dec 24 15:37:56 TI-iPod-Touch-4th-Gen-Maria-Smirnova UIKitApplication:com.touchin.cityfm[0x6e1b][1073] <Notice>: 24  UIKit                               0x31c06cd5 UIApplicationMain + 1080
Dec 24 15:37:56 TI-iPod-Touch-4th-Gen-Maria-Smirnova UIKitApplication:com.touchin.cityfm[0x6e1b][1073] <Notice>: 25  iPhone                              0x00157aa0 iPhone + 1403552
Dec 24 15:37:56 TI-iPod-Touch-4th-Gen-Maria-Smirnova UIKitApplication:com.touchin.cityfm[0x6e1b][1073] <Notice>: 26  iPhone 0x004cbc30 iPhone + 5024816
Dec 24 15:37:56 TI-iPod-Touch-4th-Gen-Maria-Smirnova UIKitApplication:com.touchin.cityfm[0x6e1b][1073] <Notice>: 27  iPhone                              0x002bd20c iPhone + 2867724
Dec 24 15:37:56 TI-iPod-Touch-4th-Gen-Maria-Smirnova UIKitApplication:com.touchin.cityfm[0x6e1b][1073] <Notice>: 28  iPhone                              0x00505dcb iPhone + 5262795
Dec 24 15:37:56 TI-iPod-Touch-4th-Gen-Maria-Smirnova UIKitApplication:com.touchin.cityfm[0x6e1b][1073] <Notice>: 29  iPhone                              0x00571853 iPhone + 5703763
Dec 24 15:37:56 TI-iPod-Touch-4th-Gen-Maria-Smirnova UIKitApplication:com.touchin.cityfm[0x6e1b][1073] <Notice>: 30  iPhone                              0x0057457f iPhone + 5715327
Dec 24 15:37:56 TI-iPod-Touch-4th-Gen-Maria-Smirnova UIKitApplication:com.touchin.cityfm[0x6e1b][1073] <Notice>: 31  iPhone                              0x00577ea3 iPhone + 5729955
Dec 24 15:37:56 TI-iPod-Touch-4th-Gen-Maria-Smirnova UIKitApplication:com.touchin.cityfm[0x6e1b][1073] <Notice>: 32  iPhone                              0x0051c50f iPhone + 5354767
Dec 24 15:37:56 TI-iPod-Touch-4th-Gen-Maria-Smirnova UIKitApplication:com.touchin.cityfm[0x6e1b][1073] <Notice>: 33  iPhone                              0x005c3240 iPhone + 6038080
Dec 24 15:37:56 TI-iPod-Touch-4th-Gen-Maria-Smirnova UIKitApplication:com.touchin.cityfm[0x6e1b][1073] <Notice>: 34  iPhone                              0x00002118 iPhone + 4376
Dec 24 15:37:56 TI-iPod-Touch-4th-Gen-Maria-Smirnova UIKitApplication:com.touchin.cityfm[0x6e1b][1073] <Notice>: =================================================================
Dec 24 15:37:56 TI-iPod-Touch-4th-Gen-Maria-Smirnova UIKitApplication:com.touchin.cityfm[0x6e1b][1073] <Notice>: Got a SIGABRT while executing native code. This usually indicates
Dec 24 15:37:56 TI-iPod-Touch-4th-Gen-Maria-Smirnova UIKitApplication:com.touchin.cityfm[0x6e1b][1073] <Notice>: a fatal error in the mono runtime or one of the native libraries
Dec 24 15:37:56 TI-iPod-Touch-4th-Gen-Maria-Smirnova UIKitApplication:com.touchin.cityfm[0x6e1b][1073] <Notice>: used by your application.
Dec 24 15:37:56 TI-iPod-Touch-4th-Gen-Maria-Smirnova UIKitApplication:com.touchin.cityfm[0x6e1b][1073] <Notice>: =================================================================
Comment 4 Marek Safar 2013-01-29 11:04:14 UTC
Fixed in master
Comment 5 Marek Safar 2013-01-29 11:04:14 UTC
Fixed in master
Comment 6 Matthijs Koopman 2013-03-11 08:36:37 UTC
This issue still occurs, when using

AudioSession.Resumed += this.AudioSessionResumed;
private void AudioSessionResumed(object sender, EventArgs e)
{
    try
    {                
        if (AudioSession.InterruptionType == AudioSessionInterruptionType.ShouldResume)
        {
            this.Play();
        }
    }
    catch (Exception ex)
    {
        Log.Warning(ex.Message); //The exception will be caught here...
    }
}

I'm using:

Xamarin Studio
Version 4.0.1 (build 9)
Installation UUID: aeb8f0e1-6115-42aa-aece-52050bf40cf8
Runtime:
	Mono 2.10.11 (mono-2-10/2baeee2)
	GTK 2.24.14
	GTK# (2.12.0.0)
	Package version: 210110000

Xamarin.Android
Not Installed

Apple Developer Tools
Xcode 4.6 (2066)
Build 4H127

Xamarin.Mac
Xamarin.Mac: Not Installed

Xamarin.iOS
Version: 6.2.0.65 (Enterprise Edition)

Build Information
Git revision: Release ID: 400010009
4d204dd3370ed4de8ae6194b08208bcf11129eca
Build date: 2013-03-05 17:24:34+0000
Xamarin addins: 181e75e43f263f1c0783b9f7e32234cac6850998

Operating System
Mac OS X 10.8.2