Linux bluetooth development
 help / color / mirror / Atom feed
From: Jonathan Paisley <jp-www@dcs.gla.ac.uk>
To: bluez-devel@lists.sourceforge.net
Subject: [Bluez-devel] Re: Re: Bluetooth headset with Bluetooth usb dongle status.
Date: Sun, 20 Jul 2003 15:33:10 +0100	[thread overview]
Message-ID: <pan.2003.07.20.14.33.03.324941@dcs.gla.ac.uk> (raw)
In-Reply-To: 3F17FD1A.9050003@superbug.demon.co.uk

On Fri, 18 Jul 2003 14:58:50 +0100, James Courtier-Dutton wrote:

>>>The playback problem is a scheduling problem. The "hci_usb_tx_complete"
>>>function uses the scheduler to kick off the next transmission, but the
>>>scheduler is too slow, and the correct method to use is getting the
>>>"hci_usb_tx_complete" function to retrieve the next packet to send from
>>>a ring buffer, and send it immeadiately during the"hci_usb_tx_complete"

I think this happens anyway:

	hci_usb_tx_complete() calls
	hci_usb_tx_wakeup() which calls
	hci_usb_tx_process() which calls
	hci_usb_send_isoc() which calls
	__tx_submit() which calls
	usb_submit_urb()

Thus, if there is a new packet queued when the old one completes, the new
one will be sent immediately.

I have managed to get playback and recording (with the PC acting as a
headset for my phone) to work well. I've made the following changes which
are included in the patch at the end:

	(1) submit two rx urbs (same as your proposed patch, but done at caller)
	(2) allow two pending isoc urbs instead of one
	(3) only use the 9 byte (single voice channel) isoc endpoint

Please let me know if you're able to reproduce this at your end.

Thanks.

diff -ur --exclude='.*' drivers/bluetooth.orig/hci_usb.c drivers/bluetooth/hci_usb.c
--- drivers/bluetooth.orig/hci_usb.c	2003-07-20 15:25:49.000000000 +0100
+++ drivers/bluetooth/hci_usb.c	2003-07-20 15:19:20.000000000 +0100
@@ -302,6 +302,7 @@
 
 #ifdef CONFIG_BLUEZ_USB_SCO
 		if (husb->isoc_iface)
+		    for (i = 0; i < HCI_MAX_ISOC_RX; i++)
 			hci_usb_isoc_rx_submit(husb);
 #endif
 	} else {
@@ -522,7 +523,7 @@
 #ifdef CONFIG_BLUEZ_USB_SCO
 		/* Process SCO queue */
 		q = __transmit_q(husb, HCI_SCODATA_PKT);
-		if (!atomic_read(__pending_tx(husb, HCI_SCODATA_PKT)) &&
+		if (atomic_read(__pending_tx(husb, HCI_SCODATA_PKT)) < HCI_MAX_ISOC_TX &&
 				(skb = skb_dequeue(q))) {
 			if (hci_usb_send_isoc(husb, skb) < 0)
 				skb_queue_head(q, skb);
@@ -830,7 +831,7 @@
 
 #ifdef CONFIG_BLUEZ_USB_SCO
 				case USB_ENDPOINT_XFER_ISOC:
-					if (ep->wMaxPacketSize < size)
+					if (ep->wMaxPacketSize != 9)
 						break;
 					size = ep->wMaxPacketSize;
 
Only in drivers/bluetooth: hci_usb.c.orig
diff -ur --exclude='.*' drivers/bluetooth.orig/hci_usb.h drivers/bluetooth/hci_usb.h
--- drivers/bluetooth.orig/hci_usb.h	2003-07-20 15:25:49.000000000 +0100
+++ drivers/bluetooth/hci_usb.h	2003-07-20 14:20:43.000000000 +0100
@@ -41,6 +41,9 @@
 #define HCI_MAX_BULK_TX     	4
 #define HCI_MAX_BULK_RX     	1
 
+#define HCI_MAX_ISOC_RX     	2
+#define HCI_MAX_ISOC_TX     	2
+
 #define HCI_MAX_ISOC_FRAMES     10
 
 struct _urb_queue {



-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
same time. Free trial click here: http://www.vmware.com/wl/offer/345/0
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

  reply	other threads:[~2003-07-20 14:33 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E19a5DI-0002jL-00@sc8-sf-list2.sourceforge.net>
     [not found] ` <3F1752C5.5020701@dsto.defence.gov.au>
2003-07-18 12:15   ` [Bluez-devel] Re: Bluetooth headset with Bluetooth usb dongle status James Courtier-Dutton
2003-07-18 13:04     ` Marcel Holtmann
2003-07-18 13:58       ` James Courtier-Dutton
2003-07-20 14:33         ` Jonathan Paisley [this message]
2003-07-22  0:23           ` [Bluez-devel] " Max Krasnyansky
2003-07-22  1:10             ` James Courtier-Dutton
2003-07-22 17:46               ` Max Krasnyansky
2003-07-22 17:56                 ` jp-www
2003-07-22 13:35             ` jp-www
2003-07-22  0:18         ` [Bluez-devel] " Max Krasnyansky
2003-07-21 23:53       ` Max Krasnyansky
2003-07-21 23:49     ` Max Krasnyansky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=pan.2003.07.20.14.33.03.324941@dcs.gla.ac.uk \
    --to=jp-www@dcs.gla.ac.uk \
    --cc=bluez-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox