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;
}
And below is 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
Yaiba, you need to ask for permissions for recording audio at the bar-descriptor file. After that, you will be able to use the ASOUND Default.
Best regards,
Rodrigo Peixoto BlackBerry - Application Development Consultant