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
Highlighted
Contributor
Posts: 16
Registered: ‎01-08-2013
My Device: Developer
My Carrier: N/A
Accepted Solution

Dev Alpha C audio cuts out using OpenAL

[ Edited ]

Hello,

 

I am having some problems with the audio on my Dev Alpha C device and I was wondering if anyone else has either had similar problems or might be able to suggest a solution.

 

The Problem

When running our game on a Dev Alpha C device, after a short period the sound effects cut out. After this no sound effects are played again, apart from very occasional short snippets of sounds, like the device is trying to play them but quickly getting cut off again.

 

The weird thing is that the same code works fine on the Dev Alpha A.

 

Implementation

The sound effects are implemented using OpenAL and OpenALUT.  Our music is played back using the Multimedia Renderer (and works fine).  I have checked for any error messages coming from OpenAL but it is not reporting any.

 

Our OpenAL setup is quite simple, and is basically the following (note that I have cut out the error handling form all my code samples for reasons of brevity):

 

if(alutInitWithoutContext(NULL, NULL))
{
    device = alcOpenDevice(NULL);
    if(device != NULL)
    {
        context = alcCreateContext(device, 0);
        if(context != NULL)
        {
            alcMakeContextCurrent(context);
            alGenBuffers(MAX_SOUND_BUFFERS, buffers);
            alGenSources(MAX_SOUND_CHANNELS, sources);
        }
    }
}

 Sounds are then loaded using:

 

void *data=alutLoadMemoryFromFile(filepath.c_str(), &format, &size, &freq);
alBufferData(buffers[bufferIndex], format, data, size, freq);

 (There's some setup of the sounds initialising different parameters that I haven't posted because I don't think that is where the error is but I can add it if it might be relevant).

 

Finally sounds are played using

 

alSourcePlay(sourceNum);

 

I am using SDK 10.1.0.1020 and the Dev Alpha C device is on firmware 10.1.0.138.  

 

If anyone has any suggestions they would be most welcome!

Regular Contributor
Posts: 51
Registered: ‎06-29-2011
My Device: Z10 Limited Edition
My Carrier: Ukraine GSM

Re: Dev Alpha C audio cuts out using OpenAL

I have the same problem. Sound effects just stop playing after some time. Sometimes audio reappears, but then dissapears again. I tested my program on Mac and Windows, as well as on Z10, everything is ok, but Dev Alpha C has some problems.

Contributor
Posts: 16
Registered: ‎01-08-2013
My Device: Developer
My Carrier: N/A

Re: Dev Alpha C audio cuts out using OpenAL

Thanks for the response, interesting to hear someone else is having the same problem. As I mentioned in my original post, our app also works fine on the Dev Alpha/Z10 using the exact same code. The same basic code also works on OSX, iOS and Android, albeit with minor initialisation changes.

Retired
Posts: 74
Registered: ‎07-22-2008
My Device: BlackBerry Z10
My Carrier: N/A

Re: Dev Alpha C audio cuts out using OpenAL

There is a known issue with the audio driver crashing on some of the 10.1 builds and what you are experience could be a result of that.   When the audio cuts out, are you able to fix it by restarting the app?

Thanks,
Pratik Sapra
Gaming & Apps Consultant
Developer Relations
@pratiksapra
Contributor
Posts: 16
Registered: ‎01-08-2013
My Device: Developer
My Carrier: N/A

Re: Dev Alpha C audio cuts out using OpenAL

Would the audio driver crashing affect music playing through the multimedia renderer or does that use a separate driver?  As I mentioned in my original post the music plays fine through the MMR, I don't know if this helps to identify the problem at all.

 

Regarding whether the problem is resolved on restarting the app, unfortunately I can't say because we also have a problem where the app doesn't terminate properly, and the only way to re-run the app is to restart the device itself each time. Previously I'd assumed this was a separate problem to the audio issues but I guess there's a chance the two could be related?

Regular Contributor
Posts: 51
Registered: ‎06-29-2011
My Device: Z10 Limited Edition
My Carrier: Ukraine GSM

Re: Dev Alpha C audio cuts out using OpenAL

On my Dev Alpha C the applicatin doesn't exit properly, and you can't run it again (the icon is semi-transparent). It also can not be deleted, so the only way to continue development is to reboot the device. This is annoying.

Contributor
Posts: 16
Registered: ‎01-08-2013
My Device: Developer
My Carrier: N/A

Re: Dev Alpha C audio cuts out using OpenAL

Yes, that is the exact same problem we have with our app. I gather it is related to the app not terminating properly but I haven't been able to find anything our app is doing wrong in this regard.
Regular Contributor
Posts: 51
Registered: ‎06-29-2011
My Device: Z10 Limited Edition
My Carrier: Ukraine GSM

Re: Dev Alpha C audio cuts out using OpenAL

This is off topic, but I have another sound problem on Dev Alpha C. In cascades I create MediaPlayer object, set source to url stream, and it fails to play:

 

MediaPlayer::prepare: Error attaching input source. url="http://fr2.ah.fm:443", error=UnsupportedMediaType

 Neither MP3 nor AAC is supported. Why? It works great on Dev Alpha A

Contributor
Posts: 16
Registered: ‎01-08-2013
My Device: Developer
My Carrier: N/A

Re: Dev Alpha C audio cuts out using OpenAL

Regarding the original problem, a new firmware has been released that appears to fix the problem. You can find it here: https://developer.blackberry.com/blackberry10devalpha/devalpha_update.html.  I have tested it on our Dev Alpha C and it seems to work fine - I am still testing so will update if I encounter any problems but it seems okay so far.

 

@beemaster - You might want to consider posting that issue as a separate topic, as there's a good chance people won't find it inside this thread.  For what it's worth we are using MP3s in our game just fine, although we are not using Cascades and are using the Multimedia renderer to play it, so that might account for the differences.

Regular Contributor
Posts: 51
Registered: ‎06-29-2011
My Device: Z10 Limited Edition
My Carrier: Ukraine GSM

Re: Dev Alpha C audio cuts out using OpenAL

@eggshapedfred, already found related thread, thanks!