shankar90 / sipdroid

Automatically exported from code.google.com/p/sipdroid
GNU General Public License v3.0
0 stars 0 forks source link

Alternate Codec Support #49

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
If possible, it would be REALLY helpful if multiple codec support was
included as there are a couple codecs that would be much better for a phone
like this. Or even set a fallback codec, however that is not even close to
mattering...

The codecs that would be EPIC to see supported are:

ILBC - Internet Low Bitrate Codec (Good for edge, or low signal)
GSM  
G729
G711

Thanks!

Original issue reported on code.google.com by andrusjo...@gmail.com on 9 Jun 2009 at 7:12

GoogleCodeExporter commented 9 years ago
actually I can confirm that since the last SIPdroid release (1.4.6 beta) the 
g722 
codec is working fine both ways.

Original comment by maxims...@gmail.com on 20 Apr 2010 at 12:07

GoogleCodeExporter commented 9 years ago
achtubcvt, I would recommend you configure your router for NAT-PMP or UPnP 
instead of 
having to forward ports. This might resolve your audio problem. Have a look at 
this 
page: http://wiki.freeswitch.org/wiki/Auto_NAT

We also might want to move this discussion to the FreeSWITCH mailing list or 
irc 
channel if need be.

Original comment by carlos.t...@gmail.com on 20 Apr 2010 at 2:10

GoogleCodeExporter commented 9 years ago
Are the codec source code compiled using NDK available for download? If they 
are,
where can I find them? Thanks.

Original comment by ernieche...@gmail.com on 1 May 2010 at 6:47

GoogleCodeExporter commented 9 years ago
erniecheung,

in the svn source you can check out:
http://code.google.com/p/sipdroid/source/browse/#svn/trunk/jni

Original comment by carlos.t...@gmail.com on 2 May 2010 at 3:57

GoogleCodeExporter commented 9 years ago
I was really hoping sipdroid had support for iLBC codec. I can see the latest 
version
(1.4.7 beta) has support for a number of codecs, however most of them can't be 
used
by google voice + gizmo5 combination, or gv+g5+pbxes either.

Since now other codecs are being used, and iLBC is royalty free, is it possible 
to
implement it on sipdroid? Or is there some other limiting factor on Android?

Original comment by andre.vo...@gmail.com on 20 May 2010 at 6:43

GoogleCodeExporter commented 9 years ago
Is it possible to enable Speex Wideband and BV32 codecs also or the processor 
cannot handle the extra load?

Original comment by marcu...@gmail.com on 23 Jun 2010 at 3:24

GoogleCodeExporter commented 9 years ago
Lack of g729 support in Sipdroid is a showstopper for me.

freephoneline.ca only supports the g729 codec.

Outgoing calls only get silence, incoming calls fail with "ERROR: Codecs 
Incompatible' message.

Please this is a needed codec.

Original comment by ben...@gmail.com on 28 Jun 2010 at 6:11

GoogleCodeExporter commented 9 years ago
Csipsimple and linphone now both support ILBC.  Csipsimple also sounds really 
good and supports multiple simultaneous accounts.  Sipdroid needs to start 
releasing updates.

Original comment by kro...@gmail.com on 2 Jul 2010 at 12:39

GoogleCodeExporter commented 9 years ago
Issue 570 has been merged into this issue.

Original comment by pmerl...@googlemail.com on 28 Jul 2010 at 8:12

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I have a very good experience with the AMR codec that is officially supported 
by Android
http://developer.android.com/guide/appendix/media-formats.html
The experience comes from some nokia devices like (N95, E61...). There are some 
SIP providers (like Truphone) that do have amr support, note also that asterisk 
PBX can be patched to include amr codec. 
This codec works very well even over slower internet connection and probably 
can be easier to implement than some other codecs options mentioned above.

Original comment by dzi...@gmail.com on 12 Aug 2010 at 10:28

GoogleCodeExporter commented 9 years ago
Please Please I begging you to support G729 G729a G729b in SipDroid. Is a MUST.
Thanks

Original comment by ionut.ta...@gmail.com on 26 Aug 2010 at 12:41

GoogleCodeExporter commented 9 years ago
Plus 1, codec g729 would be of help.

Original comment by huibertd...@gmail.com on 29 Aug 2010 at 12:45

GoogleCodeExporter commented 9 years ago
Hi,

We want to integrate a wideband codec(16kHz sampling rate) with Sipdroid (Using 
NDK and JNI). 

We have tested the Sipdroid on the Emulator and using Asterisk Server. The 
Sipdroid works well (emulator environment) for alaw, ulaw, gsm and Speex. For 
G722 , though it is supported in Asterisk Sipdroid does not work.

Does Sipdroid in Emulator have any restriction on the Sampling rate? (i.e only 
8000 Hz sampling is supported ? ) This we want to know since we are trying to 
integrate a Wideband codec with Sipdroid. If there is restriction with 
Emulator, does on a hardware,Sipdroid work with any sampling rate?

Also since the codec which we are working on is not implemented on Asterisk 
server, will the channel be setup (atleast passthru)? Is there any way we can 
add new codecs to the Asterisk server

Any guidance in these issue is appreciated.

Original comment by pradeepi...@gmail.com on 2 Sep 2010 at 10:02

GoogleCodeExporter commented 9 years ago
I feel like the developers still dont understand the significance of what we 
are asking:
1) focus on implementing Addon system which allows delegating the codecs issue 
to a third party.

2) Add "profiles" please - so I can uninstall, reinstall, swap between 
different SIP accounts without having to redefine everything, and easily backup 
the settings file from the SDcard.

I will say again, number 1 is very important mostly due to G729 codec - not 
only its the wide SIP standard by literally every SIP provider I checked, but 
it enables COMPRESSION! the PCMA and PCMU are constant, 64kbit rates which will 
require me to upgrade to unlimited data plan - and suddenly SIP and VoIP is not 
so cheap...

Original comment by carmageddon on 16 Sep 2010 at 5:59

GoogleCodeExporter commented 9 years ago
please really need 729 codec would be awesome

Original comment by brent.kr...@live.co.za on 22 Sep 2010 at 6:39

GoogleCodeExporter commented 9 years ago
I second what carmageddon puts forward. Seriously, SIP on a cellphone is almost 
useless without a way to properly compress the data!

Original comment by andrusjo...@gmail.com on 22 Sep 2010 at 9:49

GoogleCodeExporter commented 9 years ago
The GSM codec is not working for me (and at least one other person)
http://code.google.com/p/sipdroid/issues/detail?id=592 -- since no one has 
responded to that issues, I hope it is okay to post it here again.

Original comment by sahal.ya...@gmail.com on 30 Sep 2010 at 4:05

GoogleCodeExporter commented 9 years ago
@sahal.yacoob I have posted an answer for 
http://code.google.com/p/sipdroid/issues/detail?id=592

Hope it helps you.

Original comment by plauriol...@gmail.com on 30 Sep 2010 at 4:29

GoogleCodeExporter commented 9 years ago
Unfortunately it did not.

Original comment by sahal.ya...@gmail.com on 30 Sep 2010 at 4:32

GoogleCodeExporter commented 9 years ago
Could someone from developers team comment on carmageddon (Comment 115)
I second that, we really need:
1. addons/plugins
2. profiles

I would pay for a G729 addon. It is a must.
Please answer

Original comment by tar...@gmail.com on 7 Oct 2010 at 8:02

GoogleCodeExporter commented 9 years ago
I am working on sipdroid 1.5.5 beta version open source,android 2.2,GNU make 
3.81and ADT 0.9.9.need g729 codec support.Recent I add ITU g729annexA but when 
i test it on my HTC wildfire device and get some noise from receiver Mobile 
device. i don't understand what is happening.But there is some warning buffer 
overflow

->i want to convert bitstreem data to RTP data after encoding by g729annexA(is 
it necessary for me?)Or what will i do?
->Please help me

payload for g729 is 18
annexb=no for SDP
Details on the attachment:

My g729_jni linker file is here:

#include <stdlib.h>
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <memory.h>
#include <ctype.h>
#include <jni.h>
#include <android/log.h>

extern "C" {
#include "g729/typedef.h"
#include "g729/basic_op.h"
#include "g729/ld8a.h"
}

Word16 bad_lsf;
/*Variable initialization for encoder*/
extern Word16 *new_speech;     /* Pointer to new speech data            */
Word16 prm[PRM_SIZE];          /* Analysis parameters.                  */

/*Variable initialization for decoder*/
Word16  synth_buf[L_FRAME+M], *synth; /* Synthesis                   */
Word16  parm[PRM_SIZE+1];             /* Synthesis parameters        */
Word16  Az_dec[MP1*2];                /* Decoded Az for post-filter  */
Word16  T2[2];                        /* Pitch lag for 2 subframes   */
/*Common variable*/
Word16  i;

#define LOG_TAG "g729" // text for log tag

#undef DEBUG_G729

// the header length of the RTP frame (must skip when en/decoding)
#define RTP_HDR_SIZE    12

#define BITSTREAM_SIZE  10

static int codec_open = 0;

static JavaVM *gJavaVM;
const char *kInterfacePath = "org/sipdroid/pjlib/g729";

extern "C"
JNIEXPORT jint JNICALL Java_org_sipdroid_codecs_G729_open
  (JNIEnv *env, jobject obj) {
    int ret;

    if (codec_open++ != 0)
        return (jint)0;

    /*--------------------------------------------------------------------------*
     * Initialization of the encoder.                                             *
     *--------------------------------------------------------------------------*/

    Init_Pre_Process();
    Init_Coder_ld8a();
    Set_zero(prm, PRM_SIZE);

    /*-----------------------------------------------------------------*
     *           Initialization of decoder                             *
     *-----------------------------------------------------------------*/

      for (i=0; i<M; i++) synth_buf[i] = 0;
      synth = synth_buf + M;

      bad_lsf = 0;          /* Initialize bad LSF indicator */
      Init_Decod_ld8a();
      Init_Post_Filter();
      Init_Post_Process();

    return (jint)0;
}

extern "C"
JNIEXPORT jint JNICALL Java_org_sipdroid_codecs_G729_encode
    (JNIEnv *env, jobject obj, jshortArray lin, jint offset, jbyteArray encoded, jint size) {

        Word16 serial[SERIAL_SIZE];    /* Output bitstream buffer               */
        jshort lin_input[L_FRAME];

        int i;

        int frsz=L_FRAME;
        unsigned int lin_pos = 0;

        if (!codec_open)
            return 0;

        for (i = 0; i < size; i+=frsz)
        {
            /*set lin pcm data into the lin_input array*/
            env->GetShortArrayRegion(lin, offset + i,frsz, lin_input);

            /*Return initialization for new_speech of input data*/
            memcpy(new_speech, (Word16 *)lin_input, sizeof(Word16)*L_FRAME);

            /*Preprocess start for new_speech data*/
            Pre_Process(new_speech, L_FRAME);

            Coder_ld8a(prm);

            prm2bits_ld8k( prm, serial);

            env->SetByteArrayRegion(encoded, RTP_HDR_SIZE+ lin_pos, BITSTREAM_SIZE, (jbyte *)serial);

            lin_pos += BITSTREAM_SIZE;
        }

    return (jint)lin_pos;
}

extern "C"
JNIEXPORT jint JNICALL Java_org_sipdroid_codecs_G729_decode
    (JNIEnv *env, jobject obj, jbyteArray encoded, jshortArray lin, jint size) {

        jbyte serial[SERIAL_SIZE];

        unsigned int lin_pos = L_FRAME;

        if (!codec_open)
            return 0;

            env->GetByteArrayRegion(encoded, RTP_HDR_SIZE, size, serial);

            bits2prm_ld8k((Word16 *)&serial[2], &parm[1]);

                parm[0] = 0;           /* No frame erasure */
                for (i=2; i < SERIAL_SIZE; i++)
                    if (serial[i] == 0 ) parm[0] = 1; 

                parm[4] = Check_Parity_Pitch(parm[3], parm[4]);

                Decod_ld8a(parm, synth, Az_dec, T2);

                Post_Filter(synth, Az_dec, T2);        /* Post-filter */

                Post_Process(synth, L_FRAME);

                env->SetShortArrayRegion(lin, 0, L_FRAME,synth);

        }
    return (jint)lin_pos;
}

extern "C"
JNIEXPORT void JNICALL Java_org_sipdroid_codecs_G729_close
    (JNIEnv *env, jobject obj) {

    if (--codec_open != 0)
        return;

}
->At first i think i add siphon g729a codec  for android.
->siphon codec support ARMV7 but HTC wildfire and emulator support ARMV5. 
->Then i choose ITU g729annexA for codec implementation.
->After encoding i get bit streem data but it is unpacked data for this reason 
i want to convert bitstreem data to RTP data
->how to convert Bitstreem data to RTP data and (is it necessary for me?)

Here attach the SDP logs after calling but receiver didnt receive the 
call(sdplogs1.png)and after receiving the call (sdplogs2.png).

Original comment by ocean.ra...@gmail.com on 9 Oct 2010 at 12:08

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks every one.At last i complete g729 codec for android sipdroid open source 
project.G729 codec development for sipdroid is possible.Thanks every one of 
android developer those people who help me to complete the sipdialer.i think i 
will get help from this forum later if i face any problem.last time i talk with 
from my HTC Wildfire device about 1 hour successful call.voice quality with 
g729 codec was very good for me.if any one face "can't hear the other person" 
problem then you just install the apk for your device (HTC wildfire) and after 
installed your sipdroid application just reboot your device i think problem 
will be solve.

**another time i tell that if i face any problem then i think i will get help 
from this forum**pray for me......    

Original comment by ocean.ra...@gmail.com on 18 Oct 2010 at 6:53

GoogleCodeExporter commented 9 years ago
Where do you keep your code?

Original comment by droidhac...@gmail.com on 18 Oct 2010 at 12:03

GoogleCodeExporter commented 9 years ago
Please can you add "codec 2" support it was released under gpl it has a very 
good compresion.

http://www.rowetel.com/blog/?page_id=452

Original comment by Daedalus...@gmail.com on 18 Oct 2010 at 10:48

GoogleCodeExporter commented 9 years ago
Hi! Daedalus2027

i download the source code from your given link.I think it is possible to 
implement.but i didn't build it for sipdroid.do you know the payload for "codec 
2"?.another thing do you know this source code support armv5?.      

Original comment by ocean.ra...@gmail.com on 19 Oct 2010 at 6:56

GoogleCodeExporter commented 9 years ago
Hi!droidhacker

which mobile device you use to develop g729 codec?.and also check it will 
support armv5 or armv7.

Original comment by ocean.ra...@gmail.com on 19 Oct 2010 at 7:00

GoogleCodeExporter commented 9 years ago
Without ARM optimization the G.729 implementation from ITU is unusable on 
embedded devices.
Off course, it will work on a 1GHz device but it will use at least 40% of the 
CPU which means that you won't be able to add any other stream to the session 
(e.g. Video).

To convert the ITU bitstream from/to RTP as per RFC 3551: 
http://code.google.com/p/doubango/source/browse/trunk/tinyDAV/src/codecs/g729/td
av_codec_g729.c
A work in progress source code of g729AB implementation for ARM devices (ARMv5 
and later): http://code.google.com/p/g729/

Original comment by boss...@yahoo.fr on 19 Oct 2010 at 7:28

GoogleCodeExporter commented 9 years ago
we dont care if its 40% or 50%.
We want it working even without the video :)
Though I think remaining 50% should be enough to power not overly compressed 
video.
Anyway who walks around with video calls? video calls are normally done at home 
or office on laptop, not when you are mobile.

If someone has a g729 working on the 1ghz snapdragon, I'll take it anyday as I 
am sure will 90% of the others here.
The rest can keep sucking with their older phones :)

Original comment by carmageddon on 19 Oct 2010 at 7:50

GoogleCodeExporter commented 9 years ago
@carmageddon

1. 40%-50% CPU usage means aggressive battery usage which means shorter life. I 
guess you don't want to change your phone each year because the battery is dead?

2. 40-50% for audio (even without video) means that the phone only have 50% of 
the CPU resources to run. Try to read your mails, fetch your contacts, .... and 
you will understand what I mean.

Original comment by boss...@yahoo.fr on 19 Oct 2010 at 8:13

GoogleCodeExporter commented 9 years ago
@boss:

1. Again I dont care - I will buy a new battery, it needs to be replaced anyway 
after 1-2 years. Why would I replace the whole phone? I am not iPhone user lol.

2. Again I dont care - while I am on a phone conversation, lol I cant speak and 
use the phone at the same time.. sure there is Bluetooth etc. But you forget, 
nobody forces you to use g729. who doesnt like the cpu costs, could set another 
codec.

Original comment by carmageddon on 19 Oct 2010 at 8:23

GoogleCodeExporter commented 9 years ago
@ocean.rabby.1971:
I do my work on HTC DREAM MSM7201A.
Oldie, but goodie.

Low in RAM, low in CPU, so if it works there, it'll work everywhere.

Original comment by droidhac...@gmail.com on 19 Oct 2010 at 11:40

GoogleCodeExporter commented 9 years ago
google nexus one support armv7.so you can easily implement g729 codec from 
siphon.please download source code from this link and build it for your 
sipdroid.
http://code.google.com/p/siphon/wiki/Codec_G729

Original comment by ocean.ra...@gmail.com on 19 Oct 2010 at 12:46

GoogleCodeExporter commented 9 years ago
MSM7201A as seen in the HTC Dream, HTC Magic, Motorola i1, Motorola Z6, HTC 
Hero,All ARMv7 chips support the Thumb-2 instruction set.But you know that 
emulator do not support armv7.

Original comment by ocean.ra...@gmail.com on 20 Oct 2010 at 5:30

GoogleCodeExporter commented 9 years ago
why isn't there an implementation of a vbr codec like silk? why is speex 
limited to 13k? I've been having major call quality issues. I have a samsung 
vibrant, and my friend has a moto milestone. He's been using skype and has been 
very very happy. I don't understand why sipdroid is not up to par. 

Original comment by GoKarts...@gmail.com on 23 Nov 2010 at 12:01

GoogleCodeExporter commented 9 years ago
what happened to SILK? and why isn't speex VBR?

Original comment by GoKarts...@gmail.com on 23 Nov 2010 at 12:53

GoogleCodeExporter commented 9 years ago
Hi ocean.rabby.1971
How about G729? Do you have any plan to add G729 to sipdroid? We are all 
waiting.

Original comment by mayuqi...@gmail.com on 6 Dec 2010 at 10:07

GoogleCodeExporter commented 9 years ago
i need g723 codec support for sipdroid open source app.where i get the g723 
source code for sipdoid? any link or other information

Original comment by ocean.ra...@gmail.com on 12 Dec 2010 at 7:14

GoogleCodeExporter commented 9 years ago
Hi mayuqiang 

you need to try by using siphon g729 for armv7 supported android mobile.please 
u try this then inform me what happen.

Original comment by ocean.ra...@gmail.com on 12 Dec 2010 at 7:22

GoogleCodeExporter commented 9 years ago
Hi everyone

we want to implement g723.1 codec support for sipdroid community. We are 
working on Itu-g723.1 for sipdroid. g723.1 was dual rate codec 6.3 and 5.3. We 
are working on rate 6.3. After completion of build all source code from 
ITU-g723.1. we face one problem.

***one sided voice by using g723.1 codec for sipdroid***   

***sender hear the voice of other person but other person hear some noise.We 
already change in JAudioLauncher.java that was 

sample_rate=8000;
sample_size=1;
frame_size=240; //default:160
frame_rate=33.3;

but we have the same problem***

is g723.1 codec support possible for sipdroid? 
if anyone know how to solve this problem, please answer me. 

Original comment by ocean.ra...@gmail.com on 22 Dec 2010 at 6:47

GoogleCodeExporter commented 9 years ago
Hear i attach g729_jni.cpp file for sipdroid community.g729 codec support is 
possible for sipdroid community  

Original comment by ocean.ra...@gmail.com on 22 Dec 2010 at 7:24

Attachments:

GoogleCodeExporter commented 9 years ago
This is the perfect g729_jni.cpp file for sipdroid. Please see the attachment

Original comment by ocean.ra...@gmail.com on 22 Dec 2010 at 7:31

Attachments:

GoogleCodeExporter commented 9 years ago
hi ocean.rabby.1971 ,

if you are trying to include g723.1 codec then don't include the framesize 
there, let it be the default frame size

Original comment by ragualwa...@gmail.com on 30 Dec 2010 at 3:50

GoogleCodeExporter commented 9 years ago
if we use default frame size that was 160 then session destroy after 2 
second.and return to the dialer starting screen.
if frame size is 240 then session established and one sided voice is ok.

Original comment by ocean.ra...@gmail.com on 12 Jan 2011 at 9:26

GoogleCodeExporter commented 9 years ago
my testing program shows that iLBC on emulator does not work. It is too slow. 
Encoding 30ms PCM to iLBC30 packet needs  about 100ms. I am not sure whether 
FPU does matter and whether emulator has FPU support or not.

Original comment by yang.yue...@gmail.com on 31 Jan 2011 at 2:22

GoogleCodeExporter commented 9 years ago
yang.yue - did you try either finding an optimized iLBC30 code for ARMv5 
instruction set processors? or perhaps try and optimize the available code..

Original comment by carmageddon on 31 Jan 2011 at 6:24

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I also want to know how to add g729 codec support with sipdroid..what steps to 
b followed..
what to do with the above code.?
Please attach 
typedef.h"
basic_op.h"
ld8a.h"
g729a.h"  files.
And write here how to join this code to sipdroid.

Original comment by Arian.Sa...@gmail.com on 3 Feb 2011 at 2:04

GoogleCodeExporter commented 9 years ago
here a attach typedef.h file.you just add "APP_ABI := armeabi-v7a" into 
aplication.mk file.i think it works

Original comment by ocean.ra...@gmail.com on 4 Feb 2011 at 9:08

Attachments: