From c603b6ee35314fb9130fef9b26433b61876afd0a Mon Sep 17 00:00:00 2001 From: frankw Date: Wed, 14 May 2008 07:05:22 +0000 Subject: [PATCH] gsm compression bad sound quality due to problems with optimization. asterisk patches to include when using gsm with vicidial. git-svn-id: svn://192.168.202.10@861 3d104415-ff17-0410-8863-d5cf3c621b8a --- agc_2-X/trunk/extras/1.2-gsm-gcc4.2.patch | 18 +++++++++++ agc_2-X/trunk/extras/1.4_gsm_gcc4.2.patch | 18 +++++++++++ .../trunk/extras/experimental_gsm_asm.patch | 31 +++++++++++++++++++ 3 files changed, 67 insertions(+) create mode 100644 agc_2-X/trunk/extras/1.2-gsm-gcc4.2.patch create mode 100644 agc_2-X/trunk/extras/1.4_gsm_gcc4.2.patch create mode 100644 agc_2-X/trunk/extras/experimental_gsm_asm.patch diff --git a/agc_2-X/trunk/extras/1.2-gsm-gcc4.2.patch b/agc_2-X/trunk/extras/1.2-gsm-gcc4.2.patch new file mode 100644 index 00000000..b7203076 --- /dev/null +++ b/agc_2-X/trunk/extras/1.2-gsm-gcc4.2.patch @@ -0,0 +1,18 @@ +diff -Naur asterisk-1.2.26.orig/codecs/gsm/Makefile asterisk-1.2.26/codecs/gsm/Makefile +--- asterisk-1.2.26.orig/codecs/gsm/Makefile 2006-07-24 13:05:56.000000000 -0400 ++++ asterisk-1.2.26/codecs/gsm/Makefile 2008-01-15 13:21:38.000000000 -0500 +@@ -37,6 +37,14 @@ + ######### ppro's, etc, as well as the AMD K6 and K7. The compile will + ######### probably require gcc. + ++# Due to the gsm codec beeing broken when compiled with gcc version 4.2 ++# and optimization higher than -O2 we are checking for that version and ++# set the optimization to -O2 in this case. ++ ++ifeq ($(shell gcc -v 2>&1 | grep "gcc version" | cut -c 13-16 ),4.2.) ++OPTIMIZE=-O2 ++endif ++ + ifneq (${OSARCH},Darwin) + ifneq (${OSARCH},SunOS) + ifneq (${PROC},x86_64) diff --git a/agc_2-X/trunk/extras/1.4_gsm_gcc4.2.patch b/agc_2-X/trunk/extras/1.4_gsm_gcc4.2.patch new file mode 100644 index 00000000..c227439e --- /dev/null +++ b/agc_2-X/trunk/extras/1.4_gsm_gcc4.2.patch @@ -0,0 +1,18 @@ +diff -Naur asterisk-1.4.17.orig/codecs/gsm/Makefile asterisk-1.4.17/codecs/gsm/Makefile +--- asterisk-1.4.17.orig/codecs/gsm/Makefile 2007-02-16 19:31:42.000000000 -0500 ++++ asterisk-1.4.17/codecs/gsm/Makefile 2008-01-15 13:23:37.000000000 -0500 +@@ -37,6 +37,14 @@ + ######### ppro's, etc, as well as the AMD K6 and K7. The compile will + ######### probably require gcc. + ++# Due to the gsm codec beeing broken when compiled with gcc version 4.2 ++# and optimization higher than -O2 we are checking for that version and ++# set the optimization to -O2 in this case. ++ ++ifeq ($(shell gcc -v 2>&1 | grep "gcc version" | cut -c 13-16 ),4.2.) ++OPTIMIZE=-O2 ++endif ++ + ifeq (, $(findstring $(OSARCH) , Darwin SunOS )) + ifeq (, $(findstring $(PROC) , x86_64 amd64 ultrasparc sparc64 arm armv5b armeb ppc powerpc ppc64 ia64 s390 bfin mipsel )) + ifeq (, $(findstring $(shell uname -m) , ppc ppc64 alpha armv4l s390 )) diff --git a/agc_2-X/trunk/extras/experimental_gsm_asm.patch b/agc_2-X/trunk/extras/experimental_gsm_asm.patch new file mode 100644 index 00000000..69a86aa4 --- /dev/null +++ b/agc_2-X/trunk/extras/experimental_gsm_asm.patch @@ -0,0 +1,31 @@ +Index: codecs/gsm/inc/private.h +=================================================================== +--- codecs/gsm/inc/private.h (revision 109711) ++++ codecs/gsm/inc/private.h (working copy) +@@ -105,7 +105,7 @@ + __asm__ __volatile__( + + "addl %2,%0; jno 0f; movl $0x7fffffff,%0; adcl $0,%0; 0:" +- : "=r" (a) ++ : "=&r" (a) + : "0" (a), "ir" (b) + : "cc" + ); +@@ -116,7 +116,7 @@ + { + __asm__ __volatile__( + "addw %2,%0; jno 0f; movw $0x7fff,%0; adcw $0,%0; 0:" +- : "=r" (a) ++ : "=&r" (a) + : "0" (a), "ir" (b) + : "cc" + ); +@@ -127,7 +127,7 @@ + { + __asm__ __volatile__( + "subw %2,%0; jno 0f; movw $0x7fff,%0; adcw $0,%0; 0:" +- : "=r" (a) ++ : "=&r" (a) + : "0" (a), "ir" (b) + : "cc" + );