Re: [Bluez-devel] Big patch to a2dpd

Frédéric DALLEAU
2006-09-06T09:33:02Z

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

Hi,

> Lea
>
>
>> Yes. I prefer modifying alsa_transfer_raw(), which makes the framework logic consistent. How do you think about it?
>>
>
> I'm not familiar with this new stuff, but it seems that the return
> values were commented out for some reason and maybe forgotten. If
> Frederic has no problems with the change to alsa_transfer_raw, I'll do
> it that way.
>

Hi Brad and Lea,
No it's not forgotten : what I wanted is to restart audio on errors. I
had some failures when trying to recover : when pausing a stream in
xmms, an underrun occurs as the alsa device is not closed.
However, I didn't investigate the xrun_recovery return value.
Lea's patch is interesting but it miss something : the xrun_recovery
will ALWAYS return 0 if fed with EPIPE or ESIGPIPE, whether the recovery
succeed or not.
The cleanest is to keep Lea's patch but remove the two "return 0;" calls
in order to "return err;" at the end of the func.

The modification to a2dpd.c should not be done.

See the following :

static int xrun_recovery(snd_pcm_t * handle, int err)
{
if (err == -EPIPE) { /* under-run */
err = snd_pcm_prepare(handle);
if (err < 0)
printf("Can't recovery from underrun, prepare failed: %s\n",
snd_strerror(err));
return 0; // ------------------------ Remove this line to return err at
the end of the func
} else if (err == -ESTRPIPE) {
while ((err = snd_pcm_resume(handle)) == -EAGAIN)
sleep(1); /* wait until the suspend flag is released */
if (err < 0) {
err = snd_pcm_prepare(handle);
if (err < 0)
printf("Can't recovery from suspend, prepare failed: %s\n",
snd_strerror(err));
}
return 0;// ------------------------ Remove this line to return err at
the end of the func
}
return err;
}

[-- Attachment #2: Type: text/plain, Size: 373 bytes --]

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

[-- Attachment #3: Type: text/plain, Size: 164 bytes --]