Skip to content

Crash when setFramesPerCallback(#frames) is used for input stream #778

@katyo

Description

@katyo

Android Version(s): 9
Android Device(s): several
Oboe Version: latest

Short Description

I develop an app which operates with constantly sized buffer of frames. So I set the number of frames per callback with builder.setFramesPerCallback(256) but the aaudio backend crashes in this case.

Steps To Reproduce

Set the number of frames per callback using builder.setFramesPerCallback(N_of_frames).

Expected behavior

Normal operating.

Actual behavior

SIGABRT with:

F/AudioStreamRecord(26563): maybeConvertDeviceData() conversion size 512 too large for buffer 256
F/libc    (26563): Fatal signal 6 (SIGABRT), code -6 (SI_TKILL) in tid 26636 (AudioRecord), pid 26563
<...>
backtrace:
    #00 pc 0000000000021afc  /system/lib64/libc.so (abort+124)
    #01 pc 00000000000080f8  /system/lib64/liblog.so (__android_log_assert+296)
    #02 pc 0000000000031b94  /system/lib64/libaaudio.so (aaudio::AudioStreamRecord::maybeConvertDeviceData(void const*, int)+236)
    #03 pc 000000000002e30c  /system/lib64/libaaudio.so (aaudio::AudioStreamLegacy::callDataCallbackFrames(unsigned char*, int)+260)
    #04 pc 00000000000371a4  /system/lib64/libaaudio.so (FixedBlockWriter::processVariableBlock(unsigned char*, int)+220)
    #05 pc 000000000002e928  /system/lib64/libaaudio.so (aaudio::AudioStreamLegacy::processCallbackCommon(int, void*)+696)
    #06 pc 000000000005ab04  /system/lib64/libaudioclient.so (android::AudioRecord::processAudioBuffer()+1396)
    #07 pc 000000000005a27c  /system/lib64/libaudioclient.so (android::AudioRecord::AudioRecordThread::threadLoop()+252)
    #08 pc 000000000000fb78  /system/lib64/libutils.so (android::Thread::_threadLoop(void*)+280)
    #09 pc 000000000008429c  /system/lib64/libc.so (__pthread_start(void*)+36)
    #10 pc 00000000000233fc  /system/lib64/libc.so (__start_thread+68)

Additional context

Also I sets channels count to 1 (mono) if it matter.

Metadata

Metadata

Assignees

Labels

P1high prioritybug

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions