Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
New Contributor
GoldenHammer
Posts: 2
Registered: ‎04-20-2012
My Device: Blackberry Playbook
My Carrier: none
Accepted Solution

Need Help With OpenAL

We are having some trouble getting OpenAL to work on the Playbook. 

 

The first OpenAL call we make is:

 

          alcOpenDevice(0);

 

When we call alGetError() immediately afterwards, it returns AL_INVALID_OPERATION.

 

Although the subsequent alGetError call returns AL_INVALID_OPERATION, the call to alcOpenDevice actually does not return 0. The subsequent call to alcCreateContext also generates AL_INVALID_OPERATION but appears to succeed by return value. alcMakeContextCurrent does not generate any errors.

 

Note: If we call alGetError() prior to the call to alcOpenDevice(), it also returns AL_INVALID_OPERATION. The OAL documentation says it should return AL_NO_ERROR in this case. This may or may not be a clue.

 

Also note: We have tried calling 

 

alcOpenDevice(alcGetString(0, ALC_DEFAULT_DEVICE_SPECIFIER));

 

and 

 

alcOpenDevice(alcGetString(0, ALC_DEVICE_SPECIFIER));

 

Both of these calls yield the same result as alcOpenDevice(0);

 

More information, which might be irrelevant due to the earlier issues: alutLoadMemoryFromFile returns 0 under these circumstances but does not generate an error. alBufferData then generates AL_INVALID_ENUM or AL_INVALID_VALUE, presumably due to the data parameter being passed as 0.

 

Has anyone here succeeded at using OpenAL in a Blackberry app on the Playbook? What could we be doing wrong? Thanks in advance for any potential leads on this issue.

Please use plain text.
Developer
guru2000at
Posts: 101
Registered: ‎02-25-2011
My Device: Playbook, q5, z10
My Carrier: TM

Re: Need Help With OpenAL

I'm using openAL for one of our applications.

to init the device i use the following code snipet:

 

ALCcontext *context;
ALCdevice *device;



if (!alutInit(NULL, NULL)) {
	fprintf(stderr, "init alut error\n");
}
device = alcOpenDevice(NULL);
if (device == NULL) {
	fprintf(stderr, "device error\n");
}

//Create a context
context = alcCreateContext(device, NULL);

 

________________
mappau Dev Team
blackberry@mappau.com
twitter: mappau
Please use plain text.
New Contributor
GoldenHammer
Posts: 2
Registered: ‎04-20-2012
My Device: Blackberry Playbook
My Carrier: none

Re: Need Help With OpenAL

Thanks a lot! Adding the call to alutInit at the beginning fixed the problem.

Please use plain text.
Developer
useful
Posts: 26
Registered: ‎09-23-2012
My Device: Playbook, Z10LE
My Carrier: tnl

Re: Need Help With OpenAL

I have a problem.

I can't add to the project openAL library.

When I add writing to a file "common.mk" LIBS+=openal,

in the console I get the error No rule to make target `libopenal.a'.

I read about this problem hereand about the way of a solution here.

To me it didn't help.

Please use plain text.
Developer
useful
Posts: 26
Registered: ‎09-23-2012
My Device: Playbook, Z10LE
My Carrier: tnl

Re: Need Help With OpenAL

Still have the problem, but managed to get around it.
When creating a new project you need to "Build Style" to choose "Managed Build".
Then with the connection libraries openAL is not a problem.

Please use plain text.