public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: "Frédéric DALLEAU" <frederic.dalleau@palmsource.com>
To: BlueZ development <bluez-devel@lists.sourceforge.net>
Subject: [Bluez-devel] a2dpd patch
Date: Fri, 22 Sep 2006 18:45:15 +0200	[thread overview]
Message-ID: <4514131B.4030609@palmsource.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 128 bytes --]

Hi,

This is a small patch to correct the left sound only. It also integrate 
the underrun fix we talked about last day.

Fred.

[-- Attachment #2: patch_stereo_underrun --]
[-- Type: text/plain, Size: 3250 bytes --]

? .deps
? .libs
? Doxyfile
? Makefile
? Makefile.in
? a2play
? a2recv
? aclocal.m4
? autom4te.cache
? avrecv
? avsnd
? btsco
? btsco.kdevelop
? btsco.kdevelop.pcs
? btsco.kdevses
? btsco2
? compile
? config.guess
? config.h
? config.h.in
? config.log
? config.status
? config.sub
? configure
? depcomp
? install-sh
? libtool
? missing
? stamp-h1
? alsa-plugins/.deps
? alsa-plugins/.libs
? alsa-plugins/Makefile
? alsa-plugins/Makefile.in
? alsa-plugins/a2dp_ipc.lo
? alsa-plugins/a2dp_timer.lo
? alsa-plugins/a2dpd
? alsa-plugins/ctl_a2dpd.lo
? alsa-plugins/ctl_sco.lo
? alsa-plugins/libasound_module_ctl_a2dpd.la
? alsa-plugins/libasound_module_ctl_sco.la
? alsa-plugins/libasound_module_pcm_a2dp.la
? alsa-plugins/libasound_module_pcm_a2dpd.la
? alsa-plugins/libasound_module_pcm_sco.la
? alsa-plugins/pcm_a2dp.lo
? alsa-plugins/pcm_a2dpd.lo
? alsa-plugins/pcm_sco.lo
? avdtp/.deps
? avdtp/.libs
? avdtp/Makefile
? avdtp/Makefile.in
? avdtp/avtest
? sbc/.deps
? sbc/.libs
? sbc/Makefile
? sbc/Makefile.in
? sbc/rcplay
? sbc/sbcdec
? sbc/sbcenc
? sbc/sbcinfo
Index: alsa-plugins/a2dpd.c
===================================================================
RCS file: /cvsroot/bluetooth-alsa/btsco/alsa-plugins/a2dpd.c,v
retrieving revision 1.8
diff -u -r1.8 a2dpd.c
--- alsa-plugins/a2dpd.c	6 Sep 2006 02:59:43 -0000	1.8
+++ alsa-plugins/a2dpd.c	22 Sep 2006 15:47:45 -0000
@@ -580,9 +580,8 @@
 			pBuffer[j] = (((channel_1 & 0x0000FFFF) << 16) | (channel_2 & 0x0000FFFF));
 		} else {
 			//FIXME We have a reverse stereo I don't know why
-			// The following line corrects the problem but I miss the cause so
-			pBuffer[j] = (((channel_2&0x0000FFFF)<<16)|(channel_1&0x0000FFFF));
-			pBuffer[j] = ( (channel_1 & 0xFFFF0000) | (channel_2 & 0x0000FFFF) );
+			// The following line corrects the problem but I miss the cause so be aware
+			pBuffer[j] = (((channel_2 & 0x0000FFFF) << 16) | (channel_1 & 0x0000FFFF));
 		}
 	}
 	return pcm_buffer_filed_size;
Index: alsa-plugins/alsalib.c
===================================================================
RCS file: /cvsroot/bluetooth-alsa/btsco/alsa-plugins/alsalib.c,v
retrieving revision 1.1
diff -u -r1.1 alsalib.c
--- alsa-plugins/alsalib.c	7 Sep 2006 19:46:02 -0000	1.1
+++ alsa-plugins/alsalib.c	22 Sep 2006 15:47:45 -0000
@@ -70,7 +70,7 @@
 		err = snd_pcm_prepare(handle);
 		if (err < 0)
 			printf("Can't recovery from underrun, prepare failed: %s\n", snd_strerror(err));
-		return 0;
+		return err;
 	} else if (err == -ESTRPIPE) {
 		while ((err = snd_pcm_resume(handle)) == -EAGAIN)
 			sleep(1);	/* wait until the suspend flag is released */
@@ -79,7 +79,7 @@
 			if (err < 0)
 				printf("Can't recovery from suspend, prepare failed: %s\n", snd_strerror(err));
 		}
-		return 0;
+		return err;
 	}
 	return err;
 }
@@ -95,13 +95,13 @@
 		break;
 	case -EPIPE:
 		// To manage underrun, we will try to ignore
-		xrun_recovery(alsa->playback_handle, result);
-		//result = 0;
+		if(xrun_recovery(alsa->playback_handle, result) == 0)
+			result = 0;
 		DBG("EPIPE(%d)", result);
 		break;
 	case -ESTRPIPE:
-		xrun_recovery(alsa->playback_handle, result);
-		//result=0;
+		if(xrun_recovery(alsa->playback_handle, result) == 0)
+			result=0;
 		DBG("ESTRPIPE(%d)", result);
 		break;
 	}

[-- Attachment #3: Type: text/plain, Size: 348 bytes --]

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

[-- Attachment #4: Type: text/plain, Size: 164 bytes --]

_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

             reply	other threads:[~2006-09-22 16:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-22 16:45 Frédéric DALLEAU [this message]
2006-09-25 18:10 ` [Bluez-devel] a2dpd patch Brad Midgley
2006-09-26 16:25   ` Frédéric DALLEAU

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4514131B.4030609@palmsource.com \
    --to=frederic.dalleau@palmsource.com \
    --cc=bluez-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox