public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [Bluez-devel] error in headset capture, patch included
@ 2008-01-09  0:28 Pavel Semerad
  2008-01-09  3:03 ` Johan Hedberg
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Pavel Semerad @ 2008-01-09  0:28 UTC (permalink / raw)
  To: bluez-devel


Helo,

I have found error in function bluetooth_hsp_read. frame_size is
correctly set only when data->count is zero. When data->count is
nonzero, frame_size is 0 and condition
'if ((data->count + size * frame_size) <= data->link_mtu)'
is always true and frames_to_write is set incorrectly (1000 instead
max 24 in my case). This results in capture not working for headset,
cycling in endless loop.

Following patch sets frame_size before check to data->count and
'arecord -D bluetooth -f S16_LE' now works.

Pavel Semerad



--- ./audio/pcm_bluetooth.c.capture     2007-12-08 20:04:40.000000000
+0100
+++ ./audio/pcm_bluetooth.c     2008-01-09 01:12:02.000000000 +0100
@ -786,11 +786,11 @@ static snd_pcm_sframes_t bluetooth_hsp_r
        DBG("areas->step=%u areas->first=%u offset=%lu size=%lu
io->nonblock=%u",
                        areas->step, areas->first, offset, size,
io->nonblock);
 
+       frame_size = areas->step / 8;
+
        if (data->count > 0)
                goto proceed;
 
-       frame_size = areas->step / 8;
-
        nrecv = recv(data->stream.fd, data->buffer, data->link_mtu,
                        MSG_WAITALL | (io->nonblock ? MSG_DONTWAIT :
0));
 

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-01-10 15:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-09  0:28 [Bluez-devel] error in headset capture, patch included Pavel Semerad
2008-01-09  3:03 ` Johan Hedberg
2008-01-09 10:37 ` [Bluez-devel] [PATCH] HFP - Rejecting a call Alok
2008-01-10 15:24 ` [Bluez-devel] [PATCH][HFP] - default device as hfp Alok
2008-01-10 15:36 ` [Bluez-devel] [PATCH][HFP] - Setting the inband Ringtone Alok

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox