linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Bluez-devel] A2DP: signaling channel never closed
@ 2006-07-26 22:55 Sebastien Henrio
  2006-07-27  0:43 ` Brad Midgley
  0 siblings, 1 reply; 4+ messages in thread
From: Sebastien Henrio @ 2006-07-26 22:55 UTC (permalink / raw)
  To: bluez-devel

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

Hi all,

I found a bad behaviour in alsa-plugin: signaling channel is never
closed. So if remote device doesn't close it (and It's recommended to
keep it opened), alsa plugin will open a new signaling channel for
each connection, until remote device isnot able to accept any new
L2CAP connection.

to reproduce the bug, you must have a device that doesn't close the
signaling channel and then simply press STOP and PLAY several times on
XMMS using alsa plugin....

So I just close signaling channel before doing a free of a2dp
structure. another fix can be to use the signaling channel for next
connection

In this patch I also add the parsing of sbc parameters (bitpool, sub
band and block len).

I think it's important to merge signaling patch in CVS.

adding the ability to configure the codec is of course less important.


I found also another bug and I don't know how to solve it.  When you
use XMMS with alsa output plugin (or other apps like amarok...) when I
do a brutal disconnection of the SNK after several seconds xmms (or
amarok) uses 100% of my cpu I have some idea but I don't know how to
fiw it

Best regards
Sebastien

[-- Attachment #2: patch --]
[-- Type: application/octet-stream, Size: 1916 bytes --]

Index: pcm_a2dp.c
===================================================================
RCS file: /cvsroot/bluetooth-alsa/btsco/alsa-plugins/pcm_a2dp.c,v
retrieving revision 1.13
diff -r1.13 pcm_a2dp.c
977,979d976
< 	a2dp->sbc.subbands = 8; // safe default
< 	a2dp->sbc.blocks = 16; // safe default
< 	a2dp->sbc.bitpool = 32; // recommended value 53, safe default is 32
1212a1210,1212
> 	if (a2dp->control_sk > fileno(stderr))
> 		close(a2dp->control_sk);
> 
1345a1346,1347
> 	long bitpool = -1,subbnd = -1, blklen = -1;
> 
1380a1383,1410
> 		if (!strcmp(id, "sbc_bitpool")) {
> 			if ((err = snd_config_get_integer(n, &bitpool )) < 0 &&
> 					( bitpool < 0 || 254 < bitpool))  {
>                                 SNDERR("The field for bitpool must be an unsigned integer");
>                                 return err;
>                         }
> 			continue;
> 		}
> 
> 		if (!strcmp(id, "sbc_blklen")) {
> 			if ((err = snd_config_get_integer(n, &blklen)) < 0 &&
> 					( blklen != 4 && blklen != 8 && blklen != 12 && blklen != 16)) {
> 				SNDERR("The field for blocklen must be either 4, 8, 12 or 16");
> 				return err;
> 			}
> 			continue;
> 		}
> 
> 		if (!strcmp(id, "sbc_subband")) {
> 			if ((err = snd_config_get_integer(n, &subbnd)) < 0 &&
> 				 ( subbnd != 4 && subbnd != 8)) {
> 				SNDERR("The field for subband must be either 4 or 8");
> 				return err;
> 			}
> 			continue;
> 		}
> 
> 
1428a1459,1477
> 	a2dp->sbc.subbands = 8; // safe default
> 	a2dp->sbc.blocks = 16; // safe default
> 	a2dp->sbc.bitpool = 32; // recommended value 53, safe default is 32
> 
> 	if (bitpool != -1){
> 		DBG("sbc : bitpool %d" , (int)bitpool);
> 		a2dp->sbc.bitpool = (int)bitpool;
> 	}
> 
> 	if (blklen != -1){
> 		DBG("sbc : subbands %d" , (int)subbnd);
> 		a2dp->sbc.subbands = (int)subbnd;
> 	}
> 
> 	if (blklen != -1){
> 		DBG("sbc : blklen %d" , (int)blklen);
> 		a2dp->sbc.blocks = (int)blklen;
> 	}
> 

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-07-28 22:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-26 22:55 [Bluez-devel] A2DP: signaling channel never closed Sebastien Henrio
2006-07-27  0:43 ` Brad Midgley
2006-07-28 13:25   ` Sebastien Henrio
2006-07-28 22:05     ` Brad Midgley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).