Skip to contentSkip to conversation

a2dpd patch

Bluez-devel Frédéric DALLEAU 2 participants 3 messages Sep 22, 2006 – Sep 26, 2006 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

Hi,

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

Fred.

? .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

a2dpd.c +2 -3
diff -u -r1.8 a2dpd.c
@@ -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

alsalib.c +6 -6
diff -u -r1.1 alsalib.c
@@ -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;
 	}

-------------------------------------------------------------------------
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

_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#1 lore raw

Fr=E9d=E9ric

Quoted 2 lines

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

merged

Brad

-------------------------------------------------------------------------
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=3Djoin.php&p=3Dsourceforge&CID=3DDE=
VDEV
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#2 lore raw

Hi Brad,

Brad Midgley a =E9crit :

Quoted 10 lines

Fr=E9d=E9ric

=

Quoted 3 lines

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

    =

merged
=

Thank you,
Bluetooth UPF will take place in malta next month, do you plan to go there?

Fr=E9d=E9ric.

-------------------------------------------------------------------------
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=3Djoin.php&p=3Dsourceforge&CID=3DDE=
VDEV
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel