Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AudioBuffer / AudioBufferList Missing Constructors #158

Closed
rdamiano opened this issue Jun 9, 2017 · 15 comments
Closed

AudioBuffer / AudioBufferList Missing Constructors #158

rdamiano opened this issue Jun 9, 2017 · 15 comments

Comments

@rdamiano
Copy link

rdamiano commented Jun 9, 2017

This was something fixed late in development of OLD RoboVM, after going closed-source.

After the fix, this code in OLD RoboVM worked perfectly:

AudioBuffer audioBuffer = new AudioBuffer();
AudioBufferList fillBufferList = new AudioBufferList(new AudioBuffer[] { audioBuffer });

In MobiDevelop's RoboVM, this is no longer possible since AudioBuffer / AudioBufferFillList have no valid constructors:

AudioBuffer audioBuffer = AudioBuffer.AudioBufferPtr.malloc(AudioBuffer.class); // this is probably completely wrong, I was trying things
AudioBufferList fillBufferList = new AudioBufferList();
fillBufferList.setBuffers(new AudioBuffer[] { audioBuffer } ); // this argument should be in the constructor, like the Objective-C counterpart

This ^ code doesn't work at all and crashes.

I actually brought this up in support back when RoboVM was officially under development, and it was fixed quickly by the developers in a nightly so I assume this is a simple fix? (Please forgive my ignorance this stuff goes over my head a bit.)

This is for an app made back when RoboVM started, and I've since been working with OLD RoboVM but really want to update to MobiDevelop's version, this is so far the only obstacle.

dkimitsa added a commit to dkimitsa/robovm that referenced this issue Jun 12, 2017
@dkimitsa
Copy link
Contributor

#160

@rdamiano
Copy link
Author

rdamiano commented Jun 12, 2017

Oh cheers @dkimitsa that seemed simple enough, thanks.

I realize I now need to wait for the pull request/commit/build etc so I just want to bring up the fact that the AudioBufferList second constructor is also missing (https://developer.apple.com/documentation/coreaudio/audiobufferlist). I bring this up because I'd hate to wait for the next build and then have it still not working.

I feel like the RoboVM AudioBufferList.setBuffers() function has a problem due to something not being initialized or set properly, I'm trying to remember what was said back when the original RoboVM team addressed this and added the constructor I use in the OP.

I could very well be wrong but I figure better safe than sorry rather than waiting and seeing it is indeed broken, if you don't mind tossing that constructor into another pull request? Appreciate it.

@dkimitsa
Copy link
Contributor

I see the issue now, will take a look tomorrow

@dkimitsa
Copy link
Contributor

@rdamiano #163

@rdamiano
Copy link
Author

@dkimitsa Thanks a lot really appreciate your help with this stuff!

florianf pushed a commit that referenced this issue Jun 13, 2017
* fix #158, added AudioBuffer missing constructor

* fix 158: modified the list same way as rdamiano mentioned
@florianf
Copy link
Collaborator

Merged the PR.

@rdamiano
Copy link
Author

@dkimitsa @florianf Cool thanks a lot guys this was the only thing holding me up for moving to MobiDevelop's RoboVM. If I can be a nuisance one last time when do you think the next snapshot build will happen so I can compile with these merged changes?

@dkimitsa
Copy link
Contributor

you can build RoboVM yourself for now it is quite easy

@rdamiano
Copy link
Author

rdamiano commented Jun 15, 2017

@dkimitsa huh you're right, that was easy, it did take a long time though lol

Sorry to keep coming back with questions, but all seems good, and it compiles (the changes you've applied in this PR are visible too). But regardless if I deploy or compile a release build, the process fails right after the step:

"Copying [AdHoc/Development] provisioning profile..."

No idea why, I haven't touched the profiles and they were just working a day ago when using the latest snapshot as well as old-RoboVM. You have any ideas? Maybe related to Xcode?

Edit: I can deploy a random project from Xcode (version 8.0).

@dkimitsa
Copy link
Contributor

@rdamiano is there any other output in robovm tab besides ""Copying [AdHoc/Development] provisioning profile..." ?

@rdamiano
Copy link
Author

@dkimitsa Nothing useful that I can tell, it's just going through the normal process and then fails. Here's a screenshot.

screenshot 2017-06-16 08 08 56

@dkimitsa
Copy link
Contributor

could you please also check Idea log as there will be a little bit more about NullPointerException

@rdamiano
Copy link
Author

@dkimitsa Okay didn't know about the logs, here's I believe the relevant output:

!ENTRY org.robovm.eclipse 4 0 2017-06-16 08:08:11.431
!MESSAGE Packaging failed. Check the RoboVM console for more information.
!STACK 0
java.lang.RuntimeException: java.lang.NullPointerException
	at org.robovm.compiler.target.ios.IOSTarget.getOrCreateEntitlementsPList(IOSTarget.java:495)
	at org.robovm.compiler.target.ios.IOSTarget.prepareInstall(IOSTarget.java:354)
	at org.robovm.compiler.target.ios.IOSTarget.archive(IOSTarget.java:560)
	at org.robovm.compiler.AppCompiler.archive(AppCompiler.java:803)
	at org.robovm.eclipse.internal.actions.CreateIPAAction$1$1.doCompile(CreateIPAAction.java:127)
	at org.robovm.eclipse.internal.AppCompilerThread.run(AppCompilerThread.java:66)
Caused by: java.lang.NullPointerException
	at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1792)
	at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1769)
	at org.apache.commons.io.IOUtils.copy(IOUtils.java:1744)
	at org.apache.commons.io.IOUtils.toByteArray(IOUtils.java:462)
	at org.robovm.compiler.target.ios.IOSTarget.getOrCreateEntitlementsPList(IOSTarget.java:477)
	... 5 more

@dkimitsa
Copy link
Contributor

it was broken by one of commits, check #168 i've created
meanwhile please add Entitlement.list to your project (and robovm.xml) is compiling against device. Simulator shall be not affected

@rdamiano
Copy link
Author

@dkimitsa Yep that did it, alright cool thanks again for all the help looks like I'm up and running now ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants