Frederic Dalleau wrote: > Hi, > I did some recent changes and there are things to solve. > I don't have access to a linux computer right now. > In your case, enclosing the write call in a while loop may help. > > do { > if ((written = write(a2dp->sk, a2dp->buf, a2dp->len)) != > a2dp->len) { > // Return the error > result = written; > } > } while(written<0 && errno==EAGAIN); > > 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. > Ok, I plugged that loop into the code and it seemed to be better at first, but the disconnects continue. See attachment. (Attachment contains output during failure, loops many times, probably only the first couple are of importance). As you can see from the line (errno=112:Host is down), the headphones are disconnected at this point, and I actually have to turn my headphones back on. I should mention that I also use my bluetooth connection, simultaneously, with my phone for internet access, and the a2dpd seems to get upset whenever I try to grab data from the net. I figured that my bluetooth chip should be able to handle this, as I thought that the point of bluetooth was to be able to connect up to 7 devices to a single chip, and the one I have (integrated into my laptop) says that it is v2.0+EDR, which I figured would be plenty of bandwidth. I gave the ppp connection a baud rate of 115200, and set the bitpool at 53 (had to hardcode, but that's another topic of discussion) which is i think a baud rate of 763200. Now, when I had the bitpool set at 33, or 475200 baud, the behavior was the same, and the headphones would get kicked off frequently. So, I wonder, based on Brad's comment, if the "transfer=-1" is what causes the shutoff of my headphones. And, if that's the case, where should I go to change the value being written, and what should that value be? If I change the "-1" to some junk data, will that collect on the client side, and cause issues there, or could the headphone crashes be because of collected junk data? Let me know what you guys think. And thanks for the help so far. -John