Bug 22049 - AudioUnit.SetInputCallback throws System.NulReferenceException
Summary: AudioUnit.SetInputCallback throws System.NulReferenceException
Status: RESOLVED FIXED
Alias: None
Product: Xamarin.Mac
Classification: Desktop
Component: Library (Xamarin.Mac.dll) ()
Version: 1.8.0
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: ---
Assignee: Chris Hamons
URL:
Depends on:
Blocks:
 
Reported: 2014-08-12 16:22 UTC by Jon Goldberger [MSFT]
Modified: 2014-12-05 13:24 UTC (History)
3 users (show)

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


Attachments
Test project (24.70 KB, application/zip)
2014-08-12 16:22 UTC, Jon Goldberger [MSFT]
Details


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 Jon Goldberger [MSFT] 2014-08-12 16:22:29 UTC
Created attachment 7668 [details]
Test project

To reproduce:

1. Open and run the attached Xamarin.Mac test project.
2. Press the Start AudioUnit button.
3. Watch the console output.

Expected result: The AudioUnit input callback will be set and the callback called resulting in "In Input Callback" being written to the console.
Actual result: System.NullReferenceException is thrown and caught and "Object reference not set to an instance of an object" is written to the console.

I have stepped through the code and do not see any object reference that is not set to an instance of an object. Try:

1. Placing a breakpoint on line 65, itsAudioUnit.Initialize ();
2. Run the app and press the button.
3. When the breakpoint is hit, hover over itsAudioUnit and theTesting on line 57 to see that these are set to objects.
4. Hover over InputCallback, AudioUnitOutputRender, and AudioUnitInputRender and see that these show "Unknown Identifier" even though they are defined.
5. Press continue to continue execution of app.
6. Note that AudioUnitOutputRender _is_ called, evidenced by the repeated console output "In Output Render," despite the Unknown Identifier message noted in step 4, so I don't think the Unknown Identifier is the issue for InputCallback and the subsequent NullReferenceException.
Comment 2 Jon Goldberger [MSFT] 2014-08-12 16:23:22 UTC
Version Info:
=== Xamarin Studio ===

Version 5.2 (build 386)
Installation UUID: ce05f8e5-c785-49a4-a46f-d5ea68836fee
Runtime:
Mono 3.6.0 ((no/f540f8a)
GTK+ 2.24.23 (Raleigh theme)

Package version: 306000039

=== Apple Developer Tools ===

Xcode 5.1.1 (5085)
Build 5B1008

=== Xamarin.iOS ===

Version: 7.2.6.28 (Starter Edition)
Hash: 606f31a
Branch: 
Build date: 2014-08-01 15:27:48-0400

=== Xamarin.Mac ===

Version: 1.8.1.6

=== Xamarin.Android ===

Version: 4.14.0 (Starter Edition)
Android SDK: /Users/sbrowning/Library/Developer/Xamarin/android-sdk-mac_x86
Supported Android versions:
2.1 (API level 7)
2.2 (API level 8)
2.3 (API level 10)
3.1 (API level 12)
4.0 (API level 14)
4.0.3 (API level 15)
4.4 (API level 19)
Java SDK: /usr
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)

=== Build Information ===

Release ID: 502000386
Git revision: e6a54dee5376e6e7a2d9982695b060fddc09e65d
Build date: 2014-08-04 14:03:28-04
Xamarin addins: 2b5a5c26ac2ee74c6e91a8d24ef44d0ca9cb74d0

=== Operating System ===

Mac OS X 10.9.4
Darwin shanemacbookpro.curse.us 13.3.0 Darwin Kernel Version 13.3.0
Tue Jun 3 21:27:35 PDT 2014
root:xnu-2422.110.17~1/RELEASE_X86_64 x86_64
Comment 3 Akhilesh kumar 2014-08-13 08:11:20 UTC
I have checked this issue and able to reproduce this. To reproduce this I have followed the steps given in bug description. Here is the screencast for the same. 

Screencast: http://www.screencast.com/t/L4B6ccN0


Environment Info:

===Xamarin Studio===
Version 5.2 (build 386)
Installation UUID: 011d70a5-dede-428b-ab04-ef451c2e539d
Runtime:
	Mono 3.8.0 ((no/1a2c721)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 308000004

Xamarin.Android
Version: 4.14.0 (Enterprise Edition)
Android SDK: /Users/MM/Desktop/android-sdk-macosx
	Supported Android versions:
		2.1   (API level 7)
		2.2   (API level 8)
		2.3   (API level 10)
		3.1   (API level 12)
		3.2   (API level 13)
		4.0   (API level 14)
		4.0.3 (API level 15)
		4.1   (API level 16)
		4.2   (API level 17)
		4.3   (API level 18)
		4.4   (API level 19)
Java SDK: /usr
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)

Apple Developer Tools
Xcode 5.1.1 (5085)
Build 5B1008

Xamarin.iOS
Version: 7.9.3.53 (Enterprise Edition)
Hash: bbf3ac6
Branch: 
Build date: 2014-08-12 14:15:21-0400

Xamarin.Mac
Version: 1.10.0.4 (Enterprise Edition)

Build Information
Release ID: 502000386
Git revision: e6a54dee5376e6e7a2d9982695b060fddc09e65d
Build date: 2014-08-04 14:03:28-04
Xamarin addins: 2b5a5c26ac2ee74c6e91a8d24ef44d0ca9cb74d0

Operating System
Mac OS X 10.9.2
Darwin MacMini.local 13.1.0 Darwin Kernel Version 13.1.0
    Thu Jan 16 19:40:37 PST 2014
    root:xnu-2422.90.20~2/RELEASE_X86_64 x86_64
Comment 4 Rolf Bjarne Kvinge [MSFT] 2014-09-11 17:53:42 UTC
Fixed.

maccore/master: d43d14db54f14cf9ee816cad094eee1cccc610bd
Comment 5 Rolf Bjarne Kvinge [MSFT] 2014-09-11 18:50:19 UTC
Chris, the fix from comment #4 should go into whatever maccore branch the Evolve (October) release is coming from (is that xammac-1.12.0-branch?)
Comment 6 Chris Hamons 2014-12-05 13:24:03 UTC
This fix got pulled into the latest master and alpha.