From owner-freebsd-bluetooth@FreeBSD.ORG Sun Mar 12 21:18:16 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 A86FC16A400 for ; Sun, 12 Mar 2006 21:18:14 +0000 (GMT) (envelope-from plunky@rya-online.net) Received: from mail10.svc.cra.dublin.eircom.net (mail10.svc.cra.dublin.eircom.net [159.134.118.26]) by mx1.FreeBSD.org (Postfix) with SMTP id 0A77143D46 for ; Sun, 12 Mar 2006 21:18:13 +0000 (GMT) (envelope-from plunky@rya-online.net) Received: (qmail 75621 messnum 6681062 invoked from network[159.134.177.180/159-134-177-180.as1.cra.dublin.eircom.net]); 12 Mar 2006 21:18:08 -0000 Received: from 159-134-177-180.as1.cra.dublin.eircom.net (HELO rya-online.net) (159.134.177.180) by mail10.svc.cra.dublin.eircom.net (qp 75621) with SMTP; 12 Mar 2006 21:18:08 -0000 Received: (nullmailer pid 6752 invoked by uid 1000); Sun, 12 Mar 2006 20:29:25 -0000 Date: Sun, 12 Mar 2006 20:29:25 +0000 (GMT) To: Maksim Yevmenkin In-Reply-To: <44107678.1080206@savvis.net> References: <1141918855.418446.1437.nullmailer@galant.ukfsn.org> <44107678.1080206@savvis.net> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-893933849-1142195365=:6674" Message-Id: <1142195365.759631.5369.nullmailer@galant.ukfsn.org> From: Iain Hibbert Cc: freebsd-bluetooth@freebsd.org Subject: Re: config files 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: Sun, 12 Mar 2006 21:18:16 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-893933849-1142195365=:6674 Content-Type: TEXT/PLAIN; charset=US-ASCII On Thu, 9 Mar 2006, Maksim Yevmenkin wrote: > i do not like this idea. having one huge config file for every possible > bluetooth application seems like a bad thing to me. i agree, parser code can > be moved in libbluetooth (or whatever), but config files should stay separate. well, yes - one massive file could be bad though not sure how many remote bluetooth devices would be in it anyway? Its just that to add a mouse to the system, I needed to enter details in 3 files (and, details are held in two more) which could be considered a bit much just for a mouse :) vaguely related to this, would the attached patch work to reload bthidd.conf on SIGHUP? It seems that it should, though I'm not sure if the fact that the new_device field is set would be an issue (maybe not, if the session already exists?) iain --0-893933849-1142195365=:6674 Content-Type: TEXT/PLAIN; charset=US-ASCII; name=xx Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: bthidd.c reload config file patch Content-Disposition: attachment; filename=xx LS0tIGJ0aGlkZC5jLm9yaWcJMjAwNC0xMS0xOCAxODowNToxNS4wMDAwMDAw MDAgKzAwMDANCisrKyBidGhpZGQuYwkyMDA2LTAzLTEyIDIwOjEwOjAyLjAw MDAwMDAwMCArMDAwMA0KQEAgLTU1LDcgKzU1LDggQEANCiAgKiBidGhpZGQN CiAgKi8NCiANCi1zdGF0aWMgaW50CWRvbmUgPSAwOyAvKiBhcmUgd2UgZG9u ZT8gKi8NCitzdGF0aWMgaW50CWRvbmUgPSAwOwkvKiBhcmUgd2UgZG9uZT8g Ki8NCitzdGF0aWMgaW50CXJlbG9hZCA9IDA7CS8qIHJlbG9hZCBjb25maWcg ZmlsZSAqLw0KIA0KIGludA0KIG1haW4oaW50IGFyZ2MsIGNoYXIgKmFyZ3Zb XSkNCkBAIC0xNjksNiArMTcwLDExIEBADQogDQogCQlpZiAoc2VydmVyX2Rv KCZzcnYpIDwgMCkNCiAJCQlicmVhazsNCisNCisJCWlmIChyZWxvYWQgJiYg cmVhZF9jb25maWdfZmlsZSgpIDwgMCkNCisJCQlicmVhazsNCisNCisJCXJl bG9hZCA9IDA7DQogCX0NCiANCiAJc2VydmVyX3NodXRkb3duKCZzcnYpOw0K QEAgLTI0OSw2ICsyNTUsOSBAQA0KIHsNCiAJc3lzbG9nKExPR19OT1RJQ0Us ICJHb3Qgc2lnbmFsICVkLCB0b3RhbCBudW1iZXIgb2Ygc2lnbmFscyAlZCIs DQogCQlzLCArKyBkb25lKTsNCisNCisJaWYgKHMgPT0gU0lHSFVQKQ0KKwkJ cmVsb2FkID0gMTsNCiB9DQogDQogLyoNCg== --0-893933849-1142195365=:6674-- From owner-freebsd-bluetooth@FreeBSD.ORG Tue Mar 14 00:19:00 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 A141816A400 for ; Tue, 14 Mar 2006 00:19:00 +0000 (UTC) (envelope-from maksim.yevmenkin@savvis.net) Received: from ismybrain.com (ismybrain.com [64.246.42.25]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3958843D49 for ; Tue, 14 Mar 2006 00:19:00 +0000 (GMT) (envelope-from maksim.yevmenkin@savvis.net) Received: from [10.254.186.111] (localhost.localdomain [127.0.0.1]) by ismybrain.com (8.11.6/8.11.6) with ESMTP id k2E0IpM24759; Mon, 13 Mar 2006 19:18:52 -0500 Message-ID: <44160BE9.9020306@savvis.net> Date: Mon, 13 Mar 2006 16:18:49 -0800 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: <1141918855.418446.1437.nullmailer@galant.ukfsn.org> <44107678.1080206@savvis.net> <1142195365.759631.5369.nullmailer@galant.ukfsn.org> In-Reply-To: <1142195365.759631.5369.nullmailer@galant.ukfsn.org> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-bluetooth@freebsd.org Subject: Re: config files 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: Tue, 14 Mar 2006 00:19:00 -0000 Iain Hibbert wrote: >>i do not like this idea. having one huge config file for every possible >>bluetooth application seems like a bad thing to me. i agree, parser code can >>be moved in libbluetooth (or whatever), but config files should stay separate. > > well, yes - one massive file could be bad though not sure how many remote > bluetooth devices would be in it anyway? i can only speak for myself. i have about 15 devices myself. > Its just that to add a mouse to the system, I needed to enter details in 3 > files (and, details are held in two more) which could be considered a bit > much just for a mouse :) 3 files, i assume, are: /etc/bluetooth/hosts, /etc/bluetooth/hcsecd.conf and /etc/bluetooth/bthidd.conf. entry in /etc/bluetooth/hosts file is optional. i'm not sure which other 2 files you are talking about. > vaguely related to this, would the attached patch work to reload > bthidd.conf on SIGHUP? It seems that it should, though I'm not sure if the > fact that the new_device field is set would be an issue (maybe not, if the > session already exists?) there is one problem with this particular patch. please see my comments inline > ------------------------------------------------------------------------ > > --- bthidd.c.orig 2004-11-18 18:05:15.000000000 +0000 > +++ bthidd.c 2006-03-12 20:10:02.000000000 +0000 > @@ -55,7 +55,8 @@ > * bthidd > */ > > -static int done = 0; /* are we done? */ > +static int done = 0; /* are we done? */ > +static int reload = 0; /* reload config file */ > > int > main(int argc, char *argv[]) > @@ -169,6 +170,11 @@ > > if (server_do(&srv) < 0) > break; > + > + if (reload && read_config_file() < 0) > + break; here we probably want to write_hids_file(), reload_config_file() and then read_hids_file(). this should address your concern about 'new_device' field. > + > + reload = 0; > } this probably should be moved inside if (reload) .. statement > server_shutdown(&srv); > @@ -249,6 +255,9 @@ > { > syslog(LOG_NOTICE, "Got signal %d, total number of signals %d", > s, ++ done); > + > + if (s == SIGHUP) > + reload = 1; > } everything above will never work correctly because of '++ done'. even though bthidd(8) might reload config, it will still exit on next iteration (because done > 0). also, i would prefer to have separate handler for SIGHUP. thanks, max > > /* From owner-freebsd-bluetooth@FreeBSD.ORG Tue Mar 14 08:48:29 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 E91D516A441 for ; Tue, 14 Mar 2006 08:48:28 +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 42CBD43D45 for ; Tue, 14 Mar 2006 08:48:27 +0000 (GMT) (envelope-from plunky@rya-online.net) Received: (qmail 47906 messnum 6391464 invoked from network[83.70.176.191/unknown]); 14 Mar 2006 08:48:25 -0000 Received: from unknown (HELO rya-online.net) (83.70.176.191) by mail00.svc.cra.dublin.eircom.net (qp 47906) with SMTP; 14 Mar 2006 08:48:25 -0000 Received: (nullmailer pid 2581 invoked by uid 1000); Tue, 14 Mar 2006 08:42:42 -0000 Date: Tue, 14 Mar 2006 08:42:42 +0000 (GMT) To: Maksim Yevmenkin In-Reply-To: <44160BE9.9020306@savvis.net> References: <1141918855.418446.1437.nullmailer@galant.ukfsn.org> <44107678.1080206@savvis.net> <1142195365.759631.5369.nullmailer@galant.ukfsn.org> <44160BE9.9020306@savvis.net> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-452280498-1142325762=:1853" Message-Id: <1142325762.357474.659.nullmailer@galant.ukfsn.org> From: Iain Hibbert Cc: freebsd-bluetooth@freebsd.org Subject: Re: config files 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: Tue, 14 Mar 2006 08:48:29 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-452280498-1142325762=:1853 Content-Type: TEXT/PLAIN; charset=US-ASCII On Mon, 13 Mar 2006, Maksim Yevmenkin wrote: > > Its just that to add a mouse to the system, I needed to enter details in 3 > > files (and, details are held in two more) which could be considered a bit > > much just for a mouse :) > > 3 files, i assume, are: /etc/bluetooth/hosts, /etc/bluetooth/hcsecd.conf and > /etc/bluetooth/bthidd.conf. entry in /etc/bluetooth/hosts file is optional. > > i'm not sure which other 2 files you are talking about. /var/db/bthcid.keys & /var/db/bthidd.hids which are automatic, though may need attention when batteries are changed? > > vaguely related to this, would the attached patch work to reload > > bthidd.conf on SIGHUP? It seems that it should, though I'm not sure if the > > fact that the new_device field is set would be an issue (maybe not, if the > > session already exists?) > > there is one problem with this particular patch. please see my comments inline Ok, this should be better - seems to work for me, thanks! (also you may need to enable "reload" in /etc/rc.d/bthidd?) -- On another issue, in libsdp/session.c you have sa.l2cap_psm = htole16(NG_L2CAP_PSM_SDP); which seems wrong? (will work ok on little endian machine) iain --0-452280498-1142325762=:1853 Content-Type: TEXT/PLAIN; charset=US-ASCII; name=bthidd.c.diff Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: add reload config files to bthidd.c Content-Disposition: attachment; filename=bthidd.c.diff LS0tIGJ0aGlkZC5jCTIwMDQtMTEtMTggMTg6MDU6MTUuMDAwMDAwMDAwICsw MDAwDQorKysgYnRoaWRkLmMJMjAwNi0wMy0xNCAwODowNDowOS4wMDAwMDAw MDAgKzAwMDANCkBAIC00OSwxMyArNDksMTUgQEANCiBzdGF0aWMgaW50CXJl bW92ZV9waWRfZmlsZQkoY2hhciBjb25zdCAqZmlsZSk7DQogc3RhdGljIGlu dAllbGFwc2VkCQkoaW50IHR2YWwpOw0KIHN0YXRpYyB2b2lkCXNpZ2hhbmRs ZXIJKGludCBzKTsNCitzdGF0aWMgdm9pZAlzaWdodXAJCShpbnQgcyk7DQog c3RhdGljIHZvaWQJdXNhZ2UJCSh2b2lkKTsNCiANCiAvKg0KICAqIGJ0aGlk ZA0KICAqLw0KIA0KLXN0YXRpYyBpbnQJZG9uZSA9IDA7IC8qIGFyZSB3ZSBk b25lPyAqLw0KK3N0YXRpYyBpbnQJZG9uZSA9IDA7CS8qIGFyZSB3ZSBkb25l PyAqLw0KK3N0YXRpYyBpbnQJcmVsb2FkID0gMDsJLyogcmVsb2FkIGNvbmZp ZyBmaWxlICovDQogDQogaW50DQogbWFpbihpbnQgYXJnYywgY2hhciAqYXJn dltdKQ0KQEAgLTEzNywxMyArMTM5LDE5IEBADQogCXNhLnNhX2hhbmRsZXIg PSBzaWdoYW5kbGVyOw0KIA0KIAlpZiAoc2lnYWN0aW9uKFNJR1RFUk0sICZz YSwgTlVMTCkgPCAwIHx8DQotCSAgICBzaWdhY3Rpb24oU0lHSFVQLCAmc2Es IE5VTEwpIDwgMCB8fA0KIAkgICAgc2lnYWN0aW9uKFNJR0lOVCwgJnNhLCBO VUxMKSA8IDApIHsNCiAJCXN5c2xvZyhMT0dfQ1JJVCwgIkNvdWxkIG5vdCBp bnN0YWxsIHNpZ25hbCBoYW5kbGVycy4gJXMgKCVkKSIsDQogCQkJc3RyZXJy b3IoZXJybm8pLCBlcnJubyk7DQogCQlleGl0KDEpOw0KIAl9DQogDQorCXNh cy5zYV9oYW5kbGVyID0gc2lnaHVwOw0KKwlpZiAoc2lnYWN0aW9uKFNJR0hV UCwgJnNhLCBOVUxMKSA8IDApIHsNCisJCXN5c2xvZyhMT0dfQ1JJVCwgIkNv dWxkIG5vdCBpbnN0YWxsIHNpZ25hbCBoYW5kbGVycy4gJXMgKCVkKSIsDQor CQkJc3RyZXJyb3IoZXJybm8pLCBlcnJubyk7DQorCQlleGl0KDEpOw0KKwl9 DQorDQogCXNhLnNhX2hhbmRsZXIgPSBTSUdfSUdOOw0KIAlpZiAoc2lnYWN0 aW9uKFNJR1BJUEUsICZzYSwgTlVMTCkgPCAwKSB7DQogCQlzeXNsb2coTE9H X0NSSVQsICJDb3VsZCBub3QgaW5zdGFsbCBzaWduYWwgaGFuZGxlcnMuICVz ICglZCkiLA0KQEAgLTE2OSw2ICsxNzcsMTUgQEANCiANCiAJCWlmIChzZXJ2 ZXJfZG8oJnNydikgPCAwKQ0KIAkJCWJyZWFrOw0KKw0KKwkJaWYgKHJlbG9h ZCkgew0KKwkJCWlmICh3cml0ZV9oaWRzX2ZpbGUoKSA8IDAgfHwNCisJCQkg ICAgcmVhZF9jb25maWdfZmlsZSgpIDwgMCB8fA0KKwkJCSAgICByZWFkX2hp ZHNfZmlsZSgpIDwgMCkNCisJCQkJYnJlYWs7DQorDQorCQkJcmVsb2FkID0g MDsNCisJCX0NCiAJfQ0KIA0KIAlzZXJ2ZXJfc2h1dGRvd24oJnNydik7DQpA QCAtMjQxLDcgKzI1OCw3IEBADQogfQ0KIA0KIC8qDQotICogU2lnbmFsIGhh bmRsZXINCisgKiBTaWduYWwgaGFuZGxlcnMNCiAgKi8NCiANCiBzdGF0aWMg dm9pZA0KQEAgLTI1MSw2ICsyNjgsMTMgQEANCiAJCXMsICsrIGRvbmUpOw0K IH0NCiANCitzdGF0aWMgdm9pZA0KK3NpZ2h1cChpbnQgcykNCit7DQorCXN5 c2xvZyhMT0dfTk9USUNFLCAiR290IFNJR0hVUDogcmVsb2FkIGNvbmZpZyIp Ow0KKwlyZWxvYWQgPSAxOw0KK30NCisNCiAvKg0KICAqIERpc3BsYXkgdXNh Z2UgYW5kIGV4aXQNCiAgKi8NCg== --0-452280498-1142325762=:1853-- From owner-freebsd-bluetooth@FreeBSD.ORG Tue Mar 14 18:11:44 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 8BB9416A422 for ; Tue, 14 Mar 2006 18:11:44 +0000 (UTC) (envelope-from kuba@server.roztocze.com.pl) Received: from mail.roztocze.com.pl (server.roztocze.com.pl [217.96.30.130]) by mx1.FreeBSD.org (Postfix) with ESMTP id B623743D4C for ; Tue, 14 Mar 2006 18:11:43 +0000 (GMT) (envelope-from kuba@server.roztocze.com.pl) Received: from server.roztocze.com.pl (localhost [127.0.0.1]) by mail.roztocze.com.pl (8.13.5/8.13.5) with ESMTP id k2EIBeJR025007 for ; Tue, 14 Mar 2006 19:11:41 +0100 Received: (from kuba@localhost) by server.roztocze.com.pl (8.13.5/8.13.4/Submit) id k2EIBeN0030522 for freebsd-bluetooth@freebsd.org; Tue, 14 Mar 2006 19:11:40 +0100 Date: Tue, 14 Mar 2006 19:11:40 +0100 From: KubaTyszko To: freebsd-bluetooth@freebsd.org Message-ID: <20060314181140.GB6870@lbl.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2i X-Virus-Scanned: amavisd-new at roztocze.com.pl Subject: headset/sco support in freebsd X-BeenThere: freebsd-bluetooth@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: kuba@lbl.pl List-Id: Using Bluetooth in FreeBSD environments List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Mar 2006 18:11:44 -0000 hi all. anyone knows what is current status of using bluetooth headset as input/output for audio ? i was able to pair my month-old -current, create SCO channel, establish rfcomm connection, i even see AT commands that headset sends to me when i press button. but i did not see anywhere something like bluetooth(sdo)-alsa support so that i could use it as "soundcard" is this possible in bsd ? cheers. From owner-freebsd-bluetooth@FreeBSD.ORG Tue Mar 14 18:26:50 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 5EFB316A401 for ; Tue, 14 Mar 2006 18:26:50 +0000 (UTC) (envelope-from maksim.yevmenkin@savvis.net) Received: from ismybrain.com (ismybrain.com [64.246.42.25]) by mx1.FreeBSD.org (Postfix) with ESMTP id F35A943D45 for ; Tue, 14 Mar 2006 18:26:49 +0000 (GMT) (envelope-from maksim.yevmenkin@savvis.net) Received: from [10.254.186.111] (localhost.localdomain [127.0.0.1]) by ismybrain.com (8.11.6/8.11.6) with ESMTP id k2EIQdM16216; Tue, 14 Mar 2006 13:26:40 -0500 Message-ID: <44170ADD.3080706@savvis.net> Date: Tue, 14 Mar 2006 10:26:37 -0800 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: <1141918855.418446.1437.nullmailer@galant.ukfsn.org> <44107678.1080206@savvis.net> <1142195365.759631.5369.nullmailer@galant.ukfsn.org> <44160BE9.9020306@savvis.net> <1142325762.357474.659.nullmailer@galant.ukfsn.org> In-Reply-To: <1142325762.357474.659.nullmailer@galant.ukfsn.org> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-bluetooth@freebsd.org Subject: Re: config files 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: Tue, 14 Mar 2006 18:26:50 -0000 Iain, >>>Its just that to add a mouse to the system, I needed to enter details in 3 >>>files (and, details are held in two more) which could be considered a bit >>>much just for a mouse :) >> >>3 files, i assume, are: /etc/bluetooth/hosts, /etc/bluetooth/hcsecd.conf and >>/etc/bluetooth/bthidd.conf. entry in /etc/bluetooth/hosts file is optional. >> >>i'm not sure which other 2 files you are talking about. > > /var/db/bthcid.keys & /var/db/bthidd.hids > > which are automatic, though may need attention when batteries are changed? yes, they these are "configuration files", but they are not really "configuration files" :) these are "persistent store". the only purpose of these is to preserve state between restarts. i doubt that these will need any attention when battery changed, because the remote device (i.e. mouse, keyboard etc.) has its own "persistent store" where all link keys and other settings are kept. it should almost never be required to modify /var/db/bthcid.keys file. /var/db/bthidd.hids may need some attention (depending on the remote device), but bthidcontrol(8) "forget" command can be used for this. >>>vaguely related to this, would the attached patch work to reload >>>bthidd.conf on SIGHUP? It seems that it should, though I'm not sure if the >>>fact that the new_device field is set would be an issue (maybe not, if the >>>session already exists?) >> >>there is one problem with this particular patch. please see my comments inline > > Ok, this should be better - seems to work for me, thanks! > > (also you may need to enable "reload" in /etc/rc.d/bthidd?) > > -- > > On another issue, in libsdp/session.c you have > > sa.l2cap_psm = htole16(NG_L2CAP_PSM_SDP); > > which seems wrong? (will work ok on little endian machine) actually, no. i think the problem is with bthidd(8) (and others, i.e. sdpd(8)). bluetooth byte order is le16. so, l2cap_psm field in sockaddr_l2cap should always be in le16 byte order. thanks for catching this! [...] > > + sas.sa_handler = sighup; this is obviously a typo. it should be "sa.sa_handler = sighup;". otherwise it wont compile. did you sent the patch before you have actually tried it? thanks, max From owner-freebsd-bluetooth@FreeBSD.ORG Tue Mar 14 18:43:45 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 D725916A400 for ; Tue, 14 Mar 2006 18:43:45 +0000 (UTC) (envelope-from maksim.yevmenkin@savvis.net) Received: from ismybrain.com (ismybrain.com [64.246.42.25]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7EFA043D49 for ; Tue, 14 Mar 2006 18:43:45 +0000 (GMT) (envelope-from maksim.yevmenkin@savvis.net) Received: from [10.254.186.111] (localhost.localdomain [127.0.0.1]) by ismybrain.com (8.11.6/8.11.6) with ESMTP id k2EIheM16636; Tue, 14 Mar 2006 13:43:41 -0500 Message-ID: <44170EDA.5000406@savvis.net> Date: Tue, 14 Mar 2006 10:43:38 -0800 From: Maksim Yevmenkin User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050404) X-Accept-Language: en-us, en MIME-Version: 1.0 To: kuba@lbl.pl References: <20060314181140.GB6870@lbl.pl> In-Reply-To: <20060314181140.GB6870@lbl.pl> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit 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: Tue, 14 Mar 2006 18:43:45 -0000 KubaTyszko wrote: > hi all. > > anyone knows what is current status of using bluetooth headset as > input/output for audio ? not supported yet > i was able to pair my month-old -current, create SCO channel, establish > rfcomm connection, i even see AT commands that headset sends to me when > i press button. well, yes. but you cant get any audio. this is because ng_ubt(4) does not support usb isoc. transfers (assuming that you are using bluetooth usb dongle). i have modified ng_ubt(4) and added support for isoc. transfers, but i have not committed it yet. there is also a bluetooth sco sockets layer to simplify programming api. > but i did not see anywhere something like bluetooth(sdo)-alsa support so > that i could use it as "soundcard" > is this possible in bsd ? not at the moment thanks, max From owner-freebsd-bluetooth@FreeBSD.ORG Tue Mar 14 19:01:11 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 8BBC616A41F for ; Tue, 14 Mar 2006 19:01:11 +0000 (UTC) (envelope-from maksim.yevmenkin@savvis.net) Received: from ismybrain.com (ismybrain.com [64.246.42.25]) by mx1.FreeBSD.org (Postfix) with ESMTP id 234BA43D45 for ; Tue, 14 Mar 2006 19:01:11 +0000 (GMT) (envelope-from maksim.yevmenkin@savvis.net) Received: from [10.254.186.111] (localhost.localdomain [127.0.0.1]) by ismybrain.com (8.11.6/8.11.6) with ESMTP id k2EJ16M17084; Tue, 14 Mar 2006 14:01:07 -0500 Message-ID: <441712F0.6060403@savvis.net> Date: Tue, 14 Mar 2006 11:01:04 -0800 From: Maksim Yevmenkin User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050404) X-Accept-Language: en-us, en MIME-Version: 1.0 To: kuba@lbl.pl References: <20060314181140.GB6870@lbl.pl> <44170EDA.5000406@savvis.net> <20060314184659.GC6870@lbl.pl> In-Reply-To: <20060314184659.GC6870@lbl.pl> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit 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: Tue, 14 Mar 2006 19:01:11 -0000 KubaTyszko wrote: > On Tue, Mar 14, 2006 at 10:43:38AM -0800, Maksim Yevmenkin wrote: > >>KubaTyszko wrote: >> >>>hi all. >>> >>>anyone knows what is current status of using bluetooth headset as >>>input/output for audio ? >> >>not supported yet >> >>>i was able to pair my month-old -current, create SCO channel, establish >>>rfcomm connection, i even see AT commands that headset sends to me when >>>i press button. >> >>well, yes. but you cant get any audio. this is because ng_ubt(4) does >>not support usb isoc. transfers (assuming that you are using bluetooth >>usb dongle). i have modified ng_ubt(4) and added support for isoc. >>transfers, but i have not committed it yet. there is also a bluetooth >>sco sockets layer to simplify programming api. >> >>>but i did not see anywhere something like bluetooth(sdo)-alsa support so >>>that i could use it as "soundcard" >>>is this possible in bsd ? >> >>not at the moment >> > > thanks for reply. > > so, if you commit your patch, what will be left to do with audio ? > a sound driver maybe ? it depends on what are you trying to do. after these changes are committed it will be possible to get a bluetooth sco socket and send/receive sco data packets. if you plan to transfer audio then payload of the sco packet should be encoded (a-law, u-law or cvsd) audio samples (8, 13 or 16 bits). how do you obtain and encode these samples or what are going to do with them once you have recevied them is completely up to you. you may write a special sound card driver or you may do something else. thanks, max From owner-freebsd-bluetooth@FreeBSD.ORG Tue Mar 14 19:21:13 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 0B5F716A41F for ; Tue, 14 Mar 2006 19:21:13 +0000 (UTC) (envelope-from plunky@rya-online.net) Received: from mail11.svc.cra.dublin.eircom.net (mail11.svc.cra.dublin.eircom.net [159.134.118.27]) by mx1.FreeBSD.org (Postfix) with SMTP id 0E71F43D49 for ; Tue, 14 Mar 2006 19:21:11 +0000 (GMT) (envelope-from plunky@rya-online.net) Received: (qmail 57138 messnum 11073921 invoked from network[83.70.176.191/unknown]); 14 Mar 2006 19:21:09 -0000 Received: from unknown (HELO rya-online.net) (83.70.176.191) by mail11.svc.cra.dublin.eircom.net (qp 57138) with SMTP; 14 Mar 2006 19:21:09 -0000 Received: (nullmailer pid 4396 invoked by uid 1000); Tue, 14 Mar 2006 19:20:14 -0000 Date: Tue, 14 Mar 2006 19:20:14 +0000 (GMT) To: Maksim Yevmenkin In-Reply-To: <44170ADD.3080706@savvis.net> References: <1141918855.418446.1437.nullmailer@galant.ukfsn.org> <44107678.1080206@savvis.net> <1142195365.759631.5369.nullmailer@galant.ukfsn.org> <44160BE9.9020306@savvis.net> <1142325762.357474.659.nullmailer@galant.ukfsn.org> <44170ADD.3080706@savvis.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Message-Id: <1142364014.786820.1535.nullmailer@galant.ukfsn.org> From: Iain Hibbert Cc: freebsd-bluetooth@freebsd.org Subject: Re: config files 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: Tue, 14 Mar 2006 19:21:13 -0000 On Tue, 14 Mar 2006, Maksim Yevmenkin wrote: > > sa.l2cap_psm = htole16(NG_L2CAP_PSM_SDP); > > > > which seems wrong? (will work ok on little endian machine) > > actually, no. i think the problem is with bthidd(8) (and others, i.e. > sdpd(8)). bluetooth byte order is le16. so, l2cap_psm field in sockaddr_l2cap > should always be in le16 byte order. > > thanks for catching this! Yes, in the packet, psm is le16 but in the sockaddr it should be host order, surely? It makes no sense to preserve byte ordering in a channel number.. > > + sas.sa_handler = sighup; > > this is obviously a typo. it should be "sa.sa_handler = sighup;". otherwise it > wont compile. did you sent the patch before you have actually tried it? Whoops, the version I have consists of a some other changes not relevant to FreeBSD (wscons stuff) and so to make that patch, I had to do a bit of cut and paste (and, I can't compile the unchanged version).. but it is working for me with no strange effects that I can detect. regards, iain From owner-freebsd-bluetooth@FreeBSD.ORG Tue Mar 14 19:27:36 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 D168C16A420 for ; Tue, 14 Mar 2006 19:27:36 +0000 (UTC) (envelope-from maksim.yevmenkin@savvis.net) Received: from ismybrain.com (ismybrain.com [64.246.42.25]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2126443D48 for ; Tue, 14 Mar 2006 19:27:35 +0000 (GMT) (envelope-from maksim.yevmenkin@savvis.net) Received: from [10.254.186.111] (localhost.localdomain [127.0.0.1]) by ismybrain.com (8.11.6/8.11.6) with ESMTP id k2EJRQM17701; Tue, 14 Mar 2006 14:27:27 -0500 Message-ID: <4417191C.8030501@savvis.net> Date: Tue, 14 Mar 2006 11:27:24 -0800 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: <1141918855.418446.1437.nullmailer@galant.ukfsn.org> <44107678.1080206@savvis.net> <1142195365.759631.5369.nullmailer@galant.ukfsn.org> <44160BE9.9020306@savvis.net> <1142325762.357474.659.nullmailer@galant.ukfsn.org> <44170ADD.3080706@savvis.net> <1142364014.786820.1535.nullmailer@galant.ukfsn.org> In-Reply-To: <1142364014.786820.1535.nullmailer@galant.ukfsn.org> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-bluetooth@freebsd.org Subject: Re: config files 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: Tue, 14 Mar 2006 19:27:36 -0000 Iain Hibbert wrote: > On Tue, 14 Mar 2006, Maksim Yevmenkin wrote: > > >>> sa.l2cap_psm = htole16(NG_L2CAP_PSM_SDP); >>> >>>which seems wrong? (will work ok on little endian machine) >> >>actually, no. i think the problem is with bthidd(8) (and others, i.e. >>sdpd(8)). bluetooth byte order is le16. so, l2cap_psm field in sockaddr_l2cap >>should always be in le16 byte order. >> >>thanks for catching this! > > Yes, in the packet, psm is le16 but in the sockaddr it should be host > order, surely? It makes no sense to preserve byte ordering in a channel > number.. well, not in freebsd. just like in sockaddr_in port/ip have to passed (to kernel) in network byte order, psm in sockaddr_l2cap has to be passed (to kernel) in le16 byte order. >>> + sas.sa_handler = sighup; >> >>this is obviously a typo. it should be "sa.sa_handler = sighup;". otherwise it >>wont compile. did you sent the patch before you have actually tried it? > > Whoops, the version I have consists of a some other changes not relevant > to FreeBSD (wscons stuff) and so to make that patch, I had to do a bit of > cut and paste (and, I can't compile the unchanged version).. but it is > working for me with no strange effects that I can detect. i see. thanks, max From owner-freebsd-bluetooth@FreeBSD.ORG Tue Mar 14 20:22:28 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 05CAD16A400 for ; Tue, 14 Mar 2006 20:22:28 +0000 (UTC) (envelope-from plunky@rya-online.net) Received: from mail04.svc.cra.dublin.eircom.net (mail04.svc.cra.dublin.eircom.net [159.134.118.20]) by mx1.FreeBSD.org (Postfix) with SMTP id 5F0C943D48 for ; Tue, 14 Mar 2006 20:22:26 +0000 (GMT) (envelope-from plunky@rya-online.net) Received: (qmail 18805 messnum 5264372 invoked from network[83.70.176.191/unknown]); 14 Mar 2006 20:22:25 -0000 Received: from unknown (HELO rya-online.net) (83.70.176.191) by mail04.svc.cra.dublin.eircom.net (qp 18805) with SMTP; 14 Mar 2006 20:22:25 -0000 Received: (nullmailer pid 4261 invoked by uid 1000); Tue, 14 Mar 2006 20:21:30 -0000 Date: Tue, 14 Mar 2006 20:21:30 +0000 (GMT) To: Maksim Yevmenkin In-Reply-To: <4417191C.8030501@savvis.net> References: <1141918855.418446.1437.nullmailer@galant.ukfsn.org> <44107678.1080206@savvis.net> <1142195365.759631.5369.nullmailer@galant.ukfsn.org> <44160BE9.9020306@savvis.net> <1142325762.357474.659.nullmailer@galant.ukfsn.org> <44170ADD.3080706@savvis.net> <1142364014.786820.1535.nullmailer@galant.ukfsn.org> <4417191C.8030501@savvis.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Message-Id: <1142367690.557055.3307.nullmailer@galant.ukfsn.org> From: Iain Hibbert Cc: freebsd-bluetooth@freebsd.org Subject: Re: config files 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: Tue, 14 Mar 2006 20:22:28 -0000 On Tue, 14 Mar 2006, Maksim Yevmenkin wrote: > well, not in freebsd. just like in sockaddr_in port/ip have to passed (to > kernel) in network byte order, psm in sockaddr_l2cap has to be passed (to > kernel) in le16 byte order. Its a confusing issue I agree - my decision was that bdaddr is an opaque type and I couldnt see any utility in swapping it around and getting confused (I think Linux does this with baswap() macro), but that psm was a value and should be represented as such. in inet(3) I see the following comment All Internet addresses are returned in network order (bytes ordered from left to right). All network numbers and local address parts are returned as machine format integer values. which matches what I did, so I'm happy :) iain