2008-07-23 22:31:30

by keith preston

[permalink] [raw]
Subject: [PATCH] bluez a2dp alsa fix

There is a small bug in pcm_bluetooth.c. Typically in an alsa write
call you return the number of samples(frames) that you have processed.
However in this case where we don't have a full block to encode in
SBC, we return basically return (incoming_buffer_size) %
(SBC_Encode_Block_size). This is correct in the case where
(incoming_buffer_size) < (SBC_Encode_Block_size), however is wrong
when (incoming_buffer_size) > (SBC_Encode_Block_size), because this
statement ignores previously processed blocks. This is a small one
line fix. Patch is attached. Also I don't know if anyone is
actively working on this, but this section of code is rather
inefficent. The memcopy is only needed when partial blocks are found
and there are way too many repeated calculations inside the for loop.
I guess a patch for that will come another day though.

Keith Preston


Attachments:
(No filename) (869.00 B)
return-correct-number-of-frames.patch (495.00 B)
Download all attachments

2008-07-24 19:34:27

by keith preston

[permalink] [raw]
Subject: Re: [PATCH] bluez a2dp alsa fix

Sorry I'll forward it on. Someone should probably change this page:
http://www.bluez.org/development/lists/

To list all of the mailing lists.

Keith Preston


On Thu, Jul 24, 2008 at 2:29 PM, Brad Midgley <[email protected]> wrote:
> Keith
>
> I may be wrong but I thought this list was for kernel issues.
> bluez-devel might be better for userland.
>
> I guess we have a similar problem in bluetooth_hsp_write. I can't make
> the commit... when we're on git then everything will be good again.
>
> On Wed, Jul 23, 2008 at 4:31 PM, keith preston <[email protected]> wrote:
>> However in this case where we don't have a full block to encode in
>> SBC, we return basically return (incoming_buffer_size) %
>> (SBC_Encode_Block_size). This is correct in the case where
>> (incoming_buffer_size) < (SBC_Encode_Block_size), however is wrong
>> when (incoming_buffer_size) > (SBC_Encode_Block_size), because this
>> statement ignores previously processed blocks.
>
> --
> Brad
>

2008-07-24 19:29:03

by Brad Midgley

[permalink] [raw]
Subject: Re: [PATCH] bluez a2dp alsa fix

Keith

I may be wrong but I thought this list was for kernel issues.
bluez-devel might be better for userland.

I guess we have a similar problem in bluetooth_hsp_write. I can't make
the commit... when we're on git then everything will be good again.

On Wed, Jul 23, 2008 at 4:31 PM, keith preston <[email protected]> wrote:
> However in this case where we don't have a full block to encode in
> SBC, we return basically return (incoming_buffer_size) %
> (SBC_Encode_Block_size). This is correct in the case where
> (incoming_buffer_size) < (SBC_Encode_Block_size), however is wrong
> when (incoming_buffer_size) > (SBC_Encode_Block_size), because this
> statement ignores previously processed blocks.

--
Brad