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
yaiba24
Posts: 31
Registered: ‎07-25-2013
My Device: Q10
Accepted Solution

OpenAL alcCaptureOpenDevice crashes on Blackberry Q10

Q10 firmware: 10.1.0.4285

I'm trying to use OpenAL to capture sound, but on Q10 I've got problem that cannot open capture device. Open capture device on simulator (v10_1_X.1483) is OK though (I haven't tested actual sound capturing yet).

Below is my code snippet for that.

 

qDebug() << "Available capture devices:";
devices = alcGetString(NULL, ALC_CAPTURE_DEVICE_SPECIFIER);
ptr = devices;
while (*ptr) {
	qDebug() << "**	[" << ptr << "]";
	ptr += strlen(ptr) + 1;
}

// Open the capture device
qDebug() << "Opening capture device:";
const ALchar *deviceName;
ptr = devices;
while (*ptr) {
	qDebug() << "** Opening device [" << ptr << "]";
	captureDev = alcCaptureOpenDevice(ptr, 8000, AL_FORMAT_MONO8, 800);
	if (captureDev == NULL) {
		qDebug() << "** Unable to open capture device: [" << ptr << "]";
	} else {
		deviceName = ptr;
		qDebug() << "** Opened device [" << deviceName << "]";
		break;
	}
	ptr += strlen(ptr) + 1;
}

 Output result:

Available capture devices: 
**	[ ASOUND Default ] 
**	[ MSM, MSM PCM 0 (CARD=0,DEV=1) ] 
Opening capture device: 
** Opening device [ ASOUND Default ] 
** Unable to open capture device: [ ASOUND Default ] 
** Opening device [ MSM, MSM PCM 0 (CARD=0,DEV=1) ] 
AL lib: asound_open_capture: Could not open capture device 'default': No such file or directory

Process 75899061 (BBTestSound) terminated SIGSEGV code=1 fltno=11 ip=78658774(/base/usr/lib/libOpenAL.so.1@StopThread+0x57f) mapaddr=00018774. ref=00000018

 Please help.

Thanks,

 

Developer
yaiba24
Posts: 31
Registered: ‎07-25-2013
My Device: Q10

Re: OpenAL alcCaptureOpenDevice crashes on Blackberry Q10

Hello there, please help with this. I'm stuck at this step..
BlackBerry Development Advisor
smcveigh
Posts: 668
Registered: ‎11-29-2011
My Device: developer

Re: OpenAL alcCaptureOpenDevice crashes on Blackberry Q10

do you have the record_audio permission in your bar-descriptor.xml file?

Developer
yaiba24
Posts: 31
Registered: ‎07-25-2013
My Device: Q10

Re: OpenAL alcCaptureOpenDevice crashes on Blackberry Q10

That solves my question! Thank you.