Android audio device

LO
Lars Olsson
Fri, Oct 28, 2016 11:23 PM

Hi,

What is the recommended audio device for Android to use with PJSIP?
JNI or OpenSL?

I can read in the getting started guide that there might be some shutdown
issues with OpenSL? Linked to a Kitkat issue.

Running on latest TRUNK I have multiple sound issues using JNI on some old
low budget devices LG running.  One will not record anything from the mic
(4.4.2) and on the other device (4.0.3) I get a periodic "tick" sound.
I will dig deeper into if I can find any specific reason for this. On other
devices, JNI driver works mostly fine.

Running with OpenSL audio device, I get working audio on both struggling
devices.

Which audio device are people using?
Any known drawbacks to use either option?
Safe to use OpenSL?

Cheers,
Lasse

Hi, What is the recommended audio device for Android to use with PJSIP? JNI or OpenSL? I can read in the getting started guide that there might be some shutdown issues with OpenSL? Linked to a Kitkat issue. Running on latest TRUNK I have multiple sound issues using JNI on some old low budget devices LG running. One will not record anything from the mic (4.4.2) and on the other device (4.0.3) I get a periodic "tick" sound. I will dig deeper into if I can find any specific reason for this. On other devices, JNI driver works mostly fine. Running with OpenSL audio device, I get working audio on both struggling devices. Which audio device are people using? Any known drawbacks to use either option? Safe to use OpenSL? Cheers, Lasse
JL
JOHAN LANTZ
Mon, Oct 31, 2016 10:33 AM

Hej Lasse

I experienced the Open-SLES issue a couple of years ago. Basically some devices froze when shutting down the sound card. I would assume it is long since fixed but we keep using the JNI driver anyway. If I recall correctly I also did some latency measurements and could not notice a difference. I also recall some devices having issues using other sound card frequencies than 16kHZ.

One thing to keep in mind is that at least in the past, the OpenSL-ES driver did not have any audio processing such as echo cancellation or noise reduction. This you get automatically when using the Java API: https://developer.android.com/reference/android/media/MediaRecorder.AudioSource.html#VOICE_COMMUNICATION

Nowadays pjsip has integrated the webrtc ec so it might be less of an issue but it might be worth taking into account.

I have honestly not spent much time on this since 2013 so some comments might be a bit dated but given the longtail of Android some it it probably still valid. If anyone has more recent comments it would be interesting to know.

Johan

From: pjsip on behalf of Lars Olsson
Reply-To: pjsip list
Date: Saturday, 29 October 2016 at 01:23
To: "pjsip@lists.pjsip.orgmailto:pjsip@lists.pjsip.org"
Subject: [pjsip] Android audio device

Hi,

What is the recommended audio device for Android to use with PJSIP?
JNI or OpenSL?

I can read in the getting started guide that there might be some shutdown issues with OpenSL? Linked to a Kitkat issue.

Running on latest TRUNK I have multiple sound issues using JNI on some old low budget devices LG running.  One will not record anything from the mic (4.4.2) and on the other device (4.0.3) I get a periodic "tick" sound.
I will dig deeper into if I can find any specific reason for this. On other devices, JNI driver works mostly fine.

Running with OpenSL audio device, I get working audio on both struggling devices.

Which audio device are people using?
Any known drawbacks to use either option?
Safe to use OpenSL?

Cheers,
Lasse

Hej Lasse I experienced the Open-SLES issue a couple of years ago. Basically some devices froze when shutting down the sound card. I would assume it is long since fixed but we keep using the JNI driver anyway. If I recall correctly I also did some latency measurements and could not notice a difference. I also recall some devices having issues using other sound card frequencies than 16kHZ. One thing to keep in mind is that at least in the past, the OpenSL-ES driver did not have any audio processing such as echo cancellation or noise reduction. This you get automatically when using the Java API: https://developer.android.com/reference/android/media/MediaRecorder.AudioSource.html#VOICE_COMMUNICATION Nowadays pjsip has integrated the webrtc ec so it might be less of an issue but it might be worth taking into account. I have honestly not spent much time on this since 2013 so some comments might be a bit dated but given the longtail of Android some it it probably still valid. If anyone has more recent comments it would be interesting to know. Johan From: pjsip on behalf of Lars Olsson Reply-To: pjsip list Date: Saturday, 29 October 2016 at 01:23 To: "pjsip@lists.pjsip.org<mailto:pjsip@lists.pjsip.org>" Subject: [pjsip] Android audio device Hi, What is the recommended audio device for Android to use with PJSIP? JNI or OpenSL? I can read in the getting started guide that there might be some shutdown issues with OpenSL? Linked to a Kitkat issue. Running on latest TRUNK I have multiple sound issues using JNI on some old low budget devices LG running. One will not record anything from the mic (4.4.2) and on the other device (4.0.3) I get a periodic "tick" sound. I will dig deeper into if I can find any specific reason for this. On other devices, JNI driver works mostly fine. Running with OpenSL audio device, I get working audio on both struggling devices. Which audio device are people using? Any known drawbacks to use either option? Safe to use OpenSL? Cheers, Lasse