ThaMe90
ThaMe90

Reputation: 4296

Error when trying to record Audio with OpenSL ES

I get an error when I run my application which utilizes the OpenSL ES API for Android. When I run the application, I get the following error:

05-23 16:18:19.355: ERROR/AudioHardwareALSA(84): ALSALib device/samsung/GT-I9000/alsa-lib/src/pcm/pcm.c:7244:(snd_pcm_recover) overrun occured.

However, I haven't been able to find the cause. Maybe that this debug message has something to do with it?

05-23 16:18:19.339: DEBUG/dalvikvm(1409): JIT unchain all for threadid=11

I suspect that the first is caused by the second. But how can I prevent this then? I also see several GC_EXPLICIT and GC_CONCURRENT debug messages in my logs.

Anyway, I use OpenSL ES to record and play audio data. The data is sent and/or received over WiFi via the Java layer. But for this to go fluently, I don't want the GC to come and interfere... Is there any way to prevent the VM to limit the use of the GC?


Edit

I have found out that the JIT unchain all for threadid=11 isn't the issue. I have run the application on a new, clean phone, and the error doesn't show at first, but the DEBUG message still shows. It has no influence on the performance then. However, after several days, the error starts to show up, and I get little hick-ups in my Audio data.

I've tried increasing the number of buffers allocated to my recorder, which is now 4, but this doesn't help aswell. I've looked through the source code of pcm.c, but that doesn't help me any further with the issue. Does anybody have an idea about this issue?

Upvotes: 2

Views: 2068

Answers (1)

ThaMe90
ThaMe90

Reputation: 4296

It seems I had another issue running which caused this problem. It seems I had another Thread consuming to much cycles due to a bad code clause. This caused the Thread to skip most of the code and effectively do nothing. As the Thread became busy with waiting, the Audio got suppressed and I got the errors mentioned above.

Upvotes: 1

Related Questions