From owner-freebsd-bluetooth@FreeBSD.ORG Wed Apr 12 11:37:38 2006 Return-Path: X-Original-To: freebsd-bluetooth@freebsd.org Delivered-To: freebsd-bluetooth@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AC3FB16A416 for ; Wed, 12 Apr 2006 11:37:38 +0000 (UTC) (envelope-from plunky@rya-online.net) Received: from mail01.svc.cra.dublin.eircom.net (mail01.svc.cra.dublin.eircom.net [159.134.118.17]) by mx1.FreeBSD.org (Postfix) with SMTP id 176EC43D6E for ; Wed, 12 Apr 2006 11:37:27 +0000 (GMT) (envelope-from plunky@rya-online.net) Received: (qmail 7898 messnum 7065348 invoked from network[83.70.176.191/unknown]); 12 Apr 2006 11:37:25 -0000 Received: from unknown (HELO rya-online.net) (83.70.176.191) by mail01.svc.cra.dublin.eircom.net (qp 7898) with SMTP; 12 Apr 2006 11:37:25 -0000 Received: (nullmailer pid 4587 invoked by uid 1000); Wed, 12 Apr 2006 11:35:43 -0000 Date: Wed, 12 Apr 2006 12:35:42 +0100 (BST) To: Maksim Yevmenkin In-Reply-To: <44170EDA.5000406@savvis.net> References: <20060314181140.GB6870@lbl.pl> <44170EDA.5000406@savvis.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Message-Id: <1144841743.207833.9946.nullmailer@galant.ukfsn.org> From: Iain Hibbert Cc: freebsd-bluetooth@freebsd.org Subject: Re: headset/sco support in freebsd X-BeenThere: freebsd-bluetooth@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Using Bluetooth in FreeBSD environments List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Apr 2006 11:37:38 -0000 On Tue, 14 Mar 2006, Maksim Yevmenkin wrote: > i have not committed it yet. there is also a bluetooth sco sockets layer to > simplify programming api. Max, I am working on this now for NetBSD - I had it in mind to use SOCK_STREAM type with 'HCI' protocol for this but I notice that BlueZ have declared a BTPROTO_SCO and are using SOCK_SEQPACKET instead. My feeling is that I am going with SOCK_STREAM since its clearly a stream of data, do you have an opinion? iain From owner-freebsd-bluetooth@FreeBSD.ORG Wed Apr 12 17:34:42 2006 Return-Path: X-Original-To: freebsd-bluetooth@freebsd.org Delivered-To: freebsd-bluetooth@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C523616A404 for ; Wed, 12 Apr 2006 17:34:42 +0000 (UTC) (envelope-from maksim.yevmenkin@savvis.net) Received: from mailgate1b.savvis.net (mailgate1b.savvis.net [216.91.182.6]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5C08D43D46 for ; Wed, 12 Apr 2006 17:34:42 +0000 (GMT) (envelope-from maksim.yevmenkin@savvis.net) Received: from localhost (localhost.localdomain [127.0.0.1]) by mailgate1b.savvis.net (Postfix) with ESMTP id 957823BE6C; Wed, 12 Apr 2006 12:34:41 -0500 (CDT) Received: from mailgate1b.savvis.net ([127.0.0.1]) by localhost (mailgate1b.savvis.net [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 21009-01-8; Wed, 12 Apr 2006 12:34:41 -0500 (CDT) Received: from [10.254.186.111] (sntc04ep01.savvis.net [64.14.1.106]) by mailgate1b.savvis.net (Postfix) with ESMTP id 21C823BE60; Wed, 12 Apr 2006 12:34:41 -0500 (CDT) Message-ID: <443D3A30.2020109@savvis.net> Date: Wed, 12 Apr 2006 10:34:40 -0700 From: Maksim Yevmenkin User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050404) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Iain Hibbert References: <20060314181140.GB6870@lbl.pl> <44170EDA.5000406@savvis.net> <1144841743.207833.9946.nullmailer@galant.ukfsn.org> In-Reply-To: <1144841743.207833.9946.nullmailer@galant.ukfsn.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: amavisd-new at savvis.net Cc: freebsd-bluetooth@freebsd.org Subject: Re: headset/sco support in freebsd X-BeenThere: freebsd-bluetooth@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Using Bluetooth in FreeBSD environments List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Apr 2006 17:34:42 -0000 Iain, >> i have not committed it yet. there is also a bluetooth sco sockets >> layer to simplify programming api. > > Max, I am working on this now for NetBSD - I had it in mind to use > SOCK_STREAM type with 'HCI' protocol for this but I notice that BlueZ > have declared a BTPROTO_SCO and are using SOCK_SEQPACKET instead. > > My feeling is that I am going with SOCK_STREAM since its clearly a > stream of data, do you have an opinion? well, yes and no. "yes" because sco primary goal is to carry audio/video streams. "no" is because of bluetooth specific. SOCK_STREAM "... provides sequenced, reliable, two-way, connection-based byte streams ..." SOCK_DGRAM "... datagrams (connectionless, unreliable mesĀ­sages of a fixed maximum length) ..." SOCK_SEQPACKET "... provides a sequenced, reliable, two-way connection based data transmission path for datagrams of fixed maximum length; a consumer is required to read an entire packet with each read system call ..." please keep in mind that sco is not really a protocol. it is more of a transport. sco has fixed packet length. sco is not reliable. the way i understand it, sco packets cannot be re-ordered but can be dropped. imo, none of the SOCK_xxx types describes sco exactly. to me its either SOCK_DGRAM/SOCK_SEQPACKET (more preferred) or SOCK_STREAM (less preferred). in my code, i opted for SOCK_SEQPACKET (just like linux) to describe properties of sco "protocol/transport". i guess, it is up to the one who implements sco sockets to choose if SOCK_xxx type describes "protocol" properties or what "protocol" can be used for. in other words sco "protocol" has (some) SOCK_SEQPACKET properties vs. sco "protocol" is/can be used to transfer SOCK_STREAM type of data. thanks, max From owner-freebsd-bluetooth@FreeBSD.ORG Wed Apr 12 19:50:19 2006 Return-Path: X-Original-To: freebsd-bluetooth@freebsd.org Delivered-To: freebsd-bluetooth@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4C4BB16A405 for ; Wed, 12 Apr 2006 19:50:19 +0000 (UTC) (envelope-from plunky@rya-online.net) Received: from mail00.svc.cra.dublin.eircom.net (mail00.svc.cra.dublin.eircom.net [159.134.118.16]) by mx1.FreeBSD.org (Postfix) with SMTP id A1DE343D6B for ; Wed, 12 Apr 2006 19:50:17 +0000 (GMT) (envelope-from plunky@rya-online.net) Received: (qmail 47649 messnum 6390433 invoked from network[83.70.176.191/unknown]); 12 Apr 2006 19:50:16 -0000 Received: from unknown (HELO rya-online.net) (83.70.176.191) by mail00.svc.cra.dublin.eircom.net (qp 47649) with SMTP; 12 Apr 2006 19:50:16 -0000 Received: (nullmailer pid 4337 invoked by uid 1000); Wed, 12 Apr 2006 19:48:34 -0000 Date: Wed, 12 Apr 2006 20:48:33 +0100 (BST) To: Maksim Yevmenkin In-Reply-To: <443D3A30.2020109@savvis.net> References: <20060314181140.GB6870@lbl.pl> <44170EDA.5000406@savvis.net> <1144841743.207833.9946.nullmailer@galant.ukfsn.org> <443D3A30.2020109@savvis.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Message-Id: <1144871314.024068.10495.nullmailer@galant.ukfsn.org> From: Iain Hibbert Cc: freebsd-bluetooth@freebsd.org Subject: Re: headset/sco support in freebsd X-BeenThere: freebsd-bluetooth@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Using Bluetooth in FreeBSD environments List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Apr 2006 19:50:19 -0000 On Wed, 12 Apr 2006, Maksim Yevmenkin wrote: > imo, none of the SOCK_xxx types describes sco exactly. to me its either > SOCK_DGRAM/SOCK_SEQPACKET (more preferred) or SOCK_STREAM (less preferred). [..] > in other words sco "protocol" has (some) SOCK_SEQPACKET properties vs. sco > "protocol" is/can be used to transfer SOCK_STREAM type of data. Thats kind of what I thought too only I was leaning the other way until I saw what the other guys did. Well I am hoping that the sockets part of it will be mostly irrelevant since I am aiming to create a kernel audio device that can be set on top of the SCO code, and in fact after already working on L2CAP (SEQPACKET) and RFCOMM (STREAM) I think SEQPACKET is an easier concept to program, and so would leave the packetising to the audio driver, which may help keep latency down.. regards, iain