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
the connection. Maybe we should be checking for an error state that
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
connection. This is mostly Frederic's playground but I remember locking
up headsets with a2play by accidentally sending data on the 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
that when I get:
a2dp_transfer_raw: Wrote -1 not 603 bytes (sbc.len=118)
transfer_outgoing_packets: Error in transfer (transfer=-1)
The issue could be that the headset is expecting a value of a certain
length, and since the value -1 is not that length, the headset doens't
like that, and shuts down? If this is the case, where should I look to
change that value, and what should it be changed to? I wouldn't mind
sending some dummy data and have it drop out for a second once in a
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 = write(a2dp->sk, a2dp->buf,
a2dp->len)) != a2dp->len) {
// Error while sending data
DBG("Wrote %d not %d bytes (sbc.len=%d)", written,
a2dp->len, a2dp->sbc.len);
// Return the error
result = written;
}
...
That seems to be the only place that contains that string, that I could
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
things to try and what I should be looking at, I will and let you all
know how it goes.
Thanks again,
John