* [PATCH] bluez a2dp alsa fix
@ 2008-07-23 22:31 keith preston
2008-07-24 19:29 ` Brad Midgley
0 siblings, 1 reply; 3+ messages in thread
From: keith preston @ 2008-07-23 22:31 UTC (permalink / raw)
To: linux-bluetooth
[-- Attachment #1: Type: text/plain, Size: 869 bytes --]
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
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: return-correct-number-of-frames.patch --]
[-- Type: text/x-patch; name=return-correct-number-of-frames.patch, Size: 495 bytes --]
diff -Naur bluez-utils-3.36.orig/audio/pcm_bluetooth.c bluez-utils-3.36/audio/pcm_bluetooth.c
--- bluez-utils-3.36.orig/audio/pcm_bluetooth.c 2008-07-23 17:13:13.000000000 -0500
+++ bluez-utils-3.36/audio/pcm_bluetooth.c 2008-07-23 17:13:56.000000000 -0500
@@ -1032,7 +1032,7 @@
/* Remember we have some frames in the pipe now */
data->count += frames_to_read * frame_size;
if (data->count != a2dp->codesize) {
- ret = frames_to_read;
+ ret += frames_to_read;
goto done;
}
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] bluez a2dp alsa fix
2008-07-23 22:31 [PATCH] bluez a2dp alsa fix keith preston
@ 2008-07-24 19:29 ` Brad Midgley
2008-07-24 19:34 ` keith preston
0 siblings, 1 reply; 3+ messages in thread
From: Brad Midgley @ 2008-07-24 19:29 UTC (permalink / raw)
To: keith preston; +Cc: linux-bluetooth
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 <keithpre@gmail.com> 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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] bluez a2dp alsa fix
2008-07-24 19:29 ` Brad Midgley
@ 2008-07-24 19:34 ` keith preston
0 siblings, 0 replies; 3+ messages in thread
From: keith preston @ 2008-07-24 19:34 UTC (permalink / raw)
To: Brad Midgley; +Cc: linux-bluetooth
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 <bmidgley@gmail.com> 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 <keithpre@gmail.com> 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
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-07-24 19:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-23 22:31 [PATCH] bluez a2dp alsa fix keith preston
2008-07-24 19:29 ` Brad Midgley
2008-07-24 19:34 ` keith preston
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox