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
Developer
bb10H36
Posts: 57
Registered: ‎11-12-2013
My Device: Z10

Wave file not playing (no sound) using OpenAl when multimedia AudioRecorder is running in a thread

My app plays a wave file and starts a thread to either perform an audio recording or a video recording at the same time.

On my Z10 (10.1)  everything works correctly.

But on my dev alpha C-Q10 (10.2.0.341) the wave file is not played, at least there is no sound from speaker. The file is played ok during video recording.

The wave file is played with OpenAL and I use multimedia/AudioRecorder in a QThread.

Following it in debug the program executes as expected except there are no errors returned from AL and no sound from the speaker.

Build SDK 10.1.0.1020 for both Q10 and Z10.

My question, "Is there a known incompatibility in 10.2 that would cause this error?" and "I guess how can I zero in on the cause?"

BlackBerry Development Advisor
RSperanza
Posts: 142
Registered: ‎03-08-2012
My Device: Z10

Re: Wave file not playing (no sound) using OpenAl when multimedia AudioRecorder is running in a thread

Hi.

 

I would retry your app on the latest posted 10.2 SDK OS build.  It is newer than the bundle you are testing with.  Your issue may be due to a bug that has been fixed since.  Reply back with the results.

Developer
bb10H36
Posts: 57
Registered: ‎11-12-2013
My Device: Z10

Re: Wave file not playing (no sound) using OpenAl when multimedia AudioRecorder is running in a thread

It is actually worse. I upgraded both Q10 10.2 version to latest and reinstalled 10.2 sdk (again, 10.2 sdk doesn't work consistently especially for debugging so I go back to 10.1 to get my work done).

 

Now, sound does not play while either audio or video thread is recording. Tried putting the playing in its' own thread but makes no difference.

 

One change is that sound plays, stops when video starts recording, then starts again when recording is stopped. which didn't happen before, although I suspect it was always that way. I just haven't finished all the small details of adding the new thread.

 

My concern is "what else will not work in 10.2?".

 

And, because Dev alpha C is not  a full implementation is it the device, the OS installed on the device, or the full 10.2 OS that is causing the conflict.

BlackBerry Development Advisor
RSperanza
Posts: 142
Registered: ‎03-08-2012
My Device: Z10

Re: Wave file not playing (no sound) using OpenAl when multimedia AudioRecorder is running in a thread

The Dev Alpha C has the same hardware as one of the Q10 production models so there should be no difference in the way it behaves versus a production Q10. 

 

To understand the behaviour better, I will have to recreate what you are doing in your code in my own sample app.  It may take a few days for me to schedule the time to do this.

 

In the meantime, I do have a question about what you are recording.  Are you intending to mix ambient audio with what you are playing via OpenAL or do you want to replace the ambient audio with what OpenAL is playing? 

 

Developer
bb10H36
Posts: 57
Registered: ‎11-12-2013
My Device: Z10

Re: Wave file not playing (no sound) using OpenAl when multimedia AudioRecorder is running in a thread

I want to hear both (spearker output and microphone input) together on playback.

 

I just went back and tested new version with the new thread for openAL on Z10, and it still works there although seemed better without "my" thread (I don't know what AL is doing).

Developer
bb10H36
Posts: 57
Registered: ‎11-12-2013
My Device: Z10

Re: Wave file not playing (no sound) using OpenAl when multimedia AudioRecorder is running in a thread

Also, I started with the soundmanager app to play the wave files.

BlackBerry Development Advisor
RSperanza
Posts: 142
Registered: ‎03-08-2012
My Device: Z10

Re: Wave file not playing (no sound) using OpenAl when multimedia AudioRecorder is running in a thread

OpenAL was ported over primarily for native apps like games where the 3D capability of the library is widely used by game developers.  There is always a possibility that it is not optimized to play nice with other code accessing the audio drivers at the same time. 

 

Please report back the results of switching over to using a different playback method and if that doesn't help, I will try to help out with other suggestions.

Developer
bb10H36
Posts: 57
Registered: ‎11-12-2013
My Device: Z10

Re: Wave file not playing (no sound) using OpenAl when multimedia AudioRecorder is running in a thread

Like what? Everything else I have looked at is only half documented and no guarantee that the performance wiil be there after all the effort. BB wants creative apps but the tools to create them aren't there or don't work as documented.

 

Show me  the sound manager example using PCM or ?

BlackBerry Development Advisor
RSperanza
Posts: 142
Registered: ‎03-08-2012
My Device: Z10

Re: Wave file not playing (no sound) using OpenAl when multimedia AudioRecorder is running in a thread

Sorry, perhaps I misunderstood.  I thought you were already trying to change your code to use something else.

 

As I said originally, I don't mind trying to recreate the current scenario (OpenAL + AudioRecorder) with my own sample app to help diagnose the issue, especially if it may be due to a system issue that will need to be fixed.  I suspect that I cannot get enough time to work on it consistently to complete a sample app until early next week at best.

Retired
s_rashid
Posts: 127
Registered: ‎02-27-2012
My Device: Bold

Re: Wave file not playing (no sound) using OpenAl when multimedia AudioRecorder is running in a thread


Hi @bb10H36,

Yes, there has been some changes for the default behaviour from 10.1 to 10.2. By default, the audio recording will mute the other playback channel(s); this is mainly to ensure that the recording is not hampered by the noises coming from other apps. However, I believe you could change this through the *setAudioManagerHandle* function:
https://developer.blackberry.com/native/reference/cascades/bb__multimedia__audiorecorder.html#functi...

Note that this would require you to deal with the C API directly for audio manager handle. I will try to post info here when I get the chance but let us know if you get anywhere with this.

Cheers,
Rashid

 

Application Development Consultant | Developer Relations

BlackBerry
@surashid