Comments (15)
I dumped at the receiving end a sample of audio that baresip android sent using opus codec:
https://box.tutpro.com/tmp/dump-2018-05-11-15-57-52-enc.wav
As you can hear, the first second or so is OK and after that the trouble starts.
from baresip-android.
I also tried with speex codec and again voice quality was fine. So it is only opus that has the issue.
from baresip-android.
We should first try to establish if the problem is in the audio driver
or in the opus codec.
The auloop module will create a local audio loop where the recorded input
is just played out, and no audio codecs are involved. Can you please test
the /auloop
command on your device with the sample rates listed in auloop.c:
static const struct {
uint32_t srate;
uint32_t ch;
} configv[] = {
{ 8000, 1},
{16000, 1},
{32000, 1},
{44100, 1},
{48000, 1},
{ 8000, 2},
{16000, 2},
{32000, 2},
{44100, 2},
{48000, 2},
};
Regarding the building of libopus, does it matter which Android NDK was used ?
Perhaps also try to compile it with fixed point, by adding this:
--enable-fixed-point compile without floating point (for machines without
a fast enough FPU)
Alfred
from baresip-android.
from baresip-android.
from baresip-android.
from baresip-android.
from baresip-android.
from baresip-android.
from baresip-android.
I did a test using the aufile
module as audio input, reading from a WAV file,
excluding errors in the opensles driver.
NDK: r16b
API: 21
Device: Samsung J5
Opus: version 1.2.1
The result is good audio, no crackling.
The Baresip output is here:
shell@j5xnlte:/data/local/tmp $ ./baresip
baresip v0.5.9 Copyright (C) 2010 - 2018 Alfred E. Heggestad et al.
Local network address: IPv4=:10.0.0.104
aucodec: opus/48000/2
auplay: opensles
ausrc: opensles
ausrc: aubridge
auplay: aubridge
ausrc: aufile
medianat: stun
medianat: turn
medianat: ice
Populated 1 account
Populated 2 contacts
Populated 1 audio codec
Populated 0 audio filters
Populated 0 video codecs
Populated 0 video filters
baresip is ready.
[email protected]: {0/UDP/v4} 200 OK (callflow v0.1.0 (arm6/linux)) [1 binding]
All 1 useragent registered successfully! (14 ms)
answering call from sip:[email protected] with 200
audio: Set audio decoder: opus 48000Hz 2ch
audio: player started with sample format S16LE
audio: Set audio encoder: opus 48000Hz 2ch
aufile: loading input file 'lr.wav'
aufile: lr.wav: 48000 Hz, 2 channels
aufile: audio ptime=20 sampc=1920 aubuf=[192000:3840000]
aufile: end of file
aufile: loaded 7442240 bytes
audio: source started with sample format S16LE
audio tx pipeline: aufile ---> opus
audio rx pipeline: opensles <--- opus
stream: incoming rtp for 'audio' established, receiving from 10.0.0.109:11546
[email protected]: Call established: sip:[email protected]
aufile: end of file34/31320 (bit/s)
aufile: player thread exited
sip:[email protected]: Call with sip:[email protected] terminated (duration: 39 secs)
audio Transmit: Receive:
packets: 1951 1888
avg. bitrate: 32.2 31.5 (kbit/s)
errors: 0 0
pkt.report: 1754 1694
lost: 0 15
jitter: 2.3 3.6 (ms)
Quit
ua: stop all (forced=0)
Stopping 1 useragent..
from baresip-android.
from baresip-android.
it is possible that the opus encoder is using too much CPU. if this happens
the whole audio input will be blocked, leading to lost PCM samples inside Baresip.
couple of more things to try:
-
After running a call for >10 seconds press
A
to see the audio debug
(pay attention to transmit aubuf and overruns/underruns) -
Test again with aufile module and run Baresip with -v, using this commit:
- Try
audio_txmode thread
from baresip-android.
from baresip-android.
from baresip-android.
Opus audio quality is good when the lib is built using android-ndk-r16b instead of the ndk bundled in Android Studio.
from baresip-android.
Related Issues (20)
- OPUS build needs quotes HOT 4
- is there means to turn on echo cancellation? HOT 5
- crash in audio.c HOT 2
- checking how to run the C preprocessor... /lib/cpp HOT 2
- Makefile did not work in arm64, x86 and x86_64. HOT 1
- armv8-a build guidelines for Android platform HOT 1
- Could not build
- getting compilation error android-ndk-17
- How to correct errors in studio 3.4
- Registration issue in android pie
- Android unregister
- arm-linux-androideabi-gcc no longer part of the ndk HOT 3
- App crashes immediately after start HOT 3
- Connect sip over websocket
- No audio in DND mode HOT 1
- Notification for unregistered usage. HOT 3
- How to publish Call Custom SIP Progress after ringing
- advertised GSM codec not selectable in app (F-Droid)
- minimal bandwidth codecs missing in android version (f-droid)
- Invalid authentication password on use of %
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from baresip-android.