jitsi / jitsi-android

Jitsi for Android is an Android port of the Jitsi project: The most feature-rich communicator with support for encrypted audio/video, chat and presence over SIP and XMPP
Apache License 2.0
414 stars 259 forks source link

Bad audio quality #14

Open jitsi-jenkins opened 9 years ago

jitsi-jenkins commented 9 years ago

Sometimes audio quality is poor on Android, but it happens always when proximity sensor turns off the screen during call. Udating Opus to the latest version might give slight improvemnt as well as trying to build it with floats disabled. Increasing priority of audio encoding thread may also help which was abandoned at some point - not sure when and why, maybe by mistake.

(Issue migrated from https://trac.jitsi.org/ticket/1237)

jitsi-jenkins commented 9 years ago

It seems that the CPU is being put into sleep state when the screen is turned off using WakeLock. Holding partial wake lock before turning off the screen does not help here. Maybe other method for turning off the screen should be used here like for example full screen black dialog which blocks user input. Thread priorities are being set properly on both audio renderer and capture threads.

jitsi-jenkins commented 9 years ago

Full screen dialog seems to work pretty well. It's faster and results in simplier code. Waiting for user feedback before closing the issue(it has been tested on Galaxy S3 only).

jitsi-jenkins commented 9 years ago

Opus was updated to 2.1 and built without the floats. Reducing encoder complexity level to 5 gives significant quality improvement.

jitsi-jenkins commented 9 years ago

On many devices Opus seems to be too slow which results in bad audio quality hence it should not always be used as a default codec. We should provide some sort of benchmark test and based on device performance we can adjust default codec settings. This should provide better "out of the box" user experience. Simple codecs performance tests were done on Nexus 7 tablet. Results show that we can try to divide them into 3 groups: high, medium and low cpu usage. High cpu usage: Opus: 25%-33% - encoder complexity set to 10(max) silk/24000: 22%-33% silk/16000: 22%-33% silk/8000: 22%-33% speex/32000: 18%--33% Medium cpu usage: speex/16000: 13%-26% speex/8000: 13%-26% GSM: 13%-23% G722: 11%-23% iLBC: 13%-22% Low cpu usage: PCMA: 4%-11% PCMU: 3%-11%

jitsi-jenkins commented 9 years ago

Which version of libopus was used for the above results? According to these test results[1], there is a huge difference between versions prior to 1.1 and 1.1 at complexity 10. The original discussion at the opus mailing list is here[2]. It is my understanding that the quality at complexity 6 with libopus 1.1 should be comparable to the quality with complexity 10 and older versions of libopus. [1] https://docs.google.com/spreadsheet/ccc?key=0AmUOhhaYBtrKdEJaUGFmZkxzaUE0VVdZRUtJRU16bnc&usp=sharing [2] http://lists.xiph.org/pipermail/opus/2013-December/002470.html

jitsi-jenkins commented 9 years ago

Maybe this is also be related to jitsi/libjitsi#41?