Return-Path: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----_=_NextPart_001_01C79981.3B9D380E" Date: Fri, 18 May 2007 21:17:53 +0200 Message-ID: References: <200705170207.52710.bluez-devel@huitl.de> <200705171521.38889.bluez-devel@huitl.de> <464C7616.9070900@nnytech.net> <464DCCC4.90300@nnytech.net> From: "Frederic Dalleau" To: , "BlueZ development" Subject: [Bluez-devel] RE : Frequent headset disconnects Reply-To: BlueZ development List-Id: BlueZ development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: bluez-devel-bounces@lists.sourceforge.net Errors-To: bluez-devel-bounces@lists.sourceforge.net This is a multi-part message in MIME format. ------_=_NextPart_001_01C79981.3B9D380E Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, I did some recent changes and there are things to solve. I don't have access to a linux computer right now.=20 In your case, enclosing the write call in a while loop may help. do { if ((written =3D write(a2dp->sk, a2dp->buf, a2dp->len)) !=3D = a2dp->len) { // Return the error result =3D written; } } while(written<0 && errno=3D=3DEAGAIN); Remove the DBG call. However, it may burn cpu time if you don't wait a little before = retrying. The best solution would be to find why the packet must be resent. Let us know if you get something. Frederic. -------- Message d'origine-------- De: bluez-devel-bounces@lists.sourceforge.net de la part de John Feig Date: ven. 18/05/2007 17:56 =C0: BlueZ development Objet : Re: [Bluez-devel] Frequent headset disconnects =20 Brad Midgley wrote: > *John > > * > > > I've been using the a2dpd app for a couple of weeks now, and > really like > it. I have a few issues though, with the main one being that after = a > couple of minutes of playback, my headphones (HT820) turn off > > > it looks like alsa_transfer_raw returns -1 once and then a2dpd closes=20 > the connection. Maybe we should be checking for an error state that=20 > indicates we can retry or maybe we should retry a few times = regardless. > > it could be the set turns off because of the way we terminate the=20 > connection. This is mostly Frederic's playground but I remember=20 > locking up headsets with a2play by accidentally sending data on the=20 > stream fd after we had signaled a stream close on the control fd. > > brad Brad, thank you for the reply. To try to understand this, you're saying=20 that when I get: a2dp_transfer_raw: Wrote -1 not 603 bytes (sbc.len=3D118) transfer_outgoing_packets: Error in transfer (transfer=3D-1) The issue could be that the headset is expecting a value of a certain=20 length, and since the value -1 is not that length, the headset doens't=20 like that, and shuts down? If this is the case, where should I look to=20 change that value, and what should it be changed to? I wouldn't mind=20 sending some dummy data and have it drop out for a second once in a=20 while, as long as I don't have to keep restarting the thing. At least it = would be a temporary fix. I found the IF block in a2dpd_output_a2dp.c: if (a2dp->sk > 0) { // Pause? // The value 0 have finally been tested ;) // However, we may safely simulate a failed write if (!a2dp->pause_writing) { // Send our data if ((written =3D write(a2dp->sk, a2dp->buf, a2dp->len)) !=3D = a2dp->len) { // Error while sending data DBG("Wrote %d not %d bytes (sbc.len=3D%d)", written, = a2dp->len, a2dp->sbc.len); // Return the error result =3D written; } ... That seems to be the only place that contains that string, that I could=20 find. I can't find out where the function "write" is defined either. I'll keep looking, and if you guys can give me some suggestions of=20 things to try and what I should be looking at, I will and let you all=20 know how it goes. Thanks again, John ------_=_NextPart_001_01C79981.3B9D380E Content-Type: application/ms-tnef; name="winmail.dat" Content-Transfer-Encoding: base64 eJ8+IjYTAQaQCAAEAAAAAAABAAEAAQeQBgAIAAAA5AQAAAAAAADoAAEIgAcAGAAAAElQTS5NaWNy b3NvZnQgTWFpbC5Ob3RlADEIAQ2ABAACAAAAAgACAAEEgAEAMAAAAFJFIDogW0JsdWV6LWRldmVs XSBGcmVxdWVudCBoZWFkc2V0IGRpc2Nvbm5lY3RzAC0RAQWAAwAOAAAA1wcFABIAFQARADUABQBV AQEggAMADgAAANcHBQASABUAEQA1AAUAVQEBCYABACEAAAA2MkVGQzA1NEQwRTQ4OTQzQUNEODAz MjREMjRGMkMwRgA4BwEDkAYAHBEAADkAAAADACYAAAAAAAMANgAAAAAAQAA5AA44nTuBmccBHgA9 AAEAAAABAAAAAAAAAAIBRwABAAAAOAAAAGM9VVM7YT0gO3A9QWNjZXNzLUNvbXBhbnk7bD1NUExF WDAxLTA3MDUxODE5MTc1M1otNDM2MzEAHgB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REFMTEVBVQAAAAAeADlAAQAAAAIAAAAuAAAAAwB2QP////8LACkAAAAA AAsAIwAAAAAAAwAGEG3vz6ADAAcQ5AgAAAMAEBAAAAAAAwAREAAAAAAeAAgQAQAAAGUAAABISSxJ RElEU09NRVJFQ0VOVENIQU5HRVNBTkRUSEVSRUFSRVRISU5HU1RPU09MVkVJRE9OVEhBVkVBQ0NF U1NUT0FMSU5VWENPTVBVVEVSUklHSFROT1dJTllPVVJDQVNFLEVOAAAAAAIBfwABAAAASAAAADxD RTUyMTZDMTBDODM5NDREOUZEMzdCNjVDRDMzRjM5NzBDRjRFMUBtcGxleDAxLm1wbC5hY2Nlc3Mt Y29tcGFueS5jb20+AJsg ------_=_NextPart_001_01C79981.3B9D380E Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ------_=_NextPart_001_01C79981.3B9D380E Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel ------_=_NextPart_001_01C79981.3B9D380E--