Git Product home page Git Product logo

Comments (15)

juha-h avatar juha-h commented on July 20, 2024

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.

juha-h avatar juha-h commented on July 20, 2024

I also tried with speex codec and again voice quality was fine. So it is only opus that has the issue.

from baresip-android.

alfredh avatar alfredh commented on July 20, 2024

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.

juha-h avatar juha-h commented on July 20, 2024

from baresip-android.

juha-h avatar juha-h commented on July 20, 2024

from baresip-android.

juha-h avatar juha-h commented on July 20, 2024

from baresip-android.

juha-h avatar juha-h commented on July 20, 2024

from baresip-android.

juha-h avatar juha-h commented on July 20, 2024

from baresip-android.

juha-h avatar juha-h commented on July 20, 2024

from baresip-android.

alfredh avatar alfredh commented on July 20, 2024

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.

juha-h avatar juha-h commented on July 20, 2024

from baresip-android.

alfredh avatar alfredh commented on July 20, 2024

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:

baresip/baresip@ce3d2ae

  • Try audio_txmode thread

from baresip-android.

juha-h avatar juha-h commented on July 20, 2024

from baresip-android.

juha-h avatar juha-h commented on July 20, 2024

from baresip-android.

juha-h avatar juha-h commented on July 20, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.