From owner-freebsd-bluetooth@FreeBSD.ORG Sun Jun 9 00:11:40 2013 Return-Path: Delivered-To: freebsd-bluetooth@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3A226613 for ; Sun, 9 Jun 2013 00:11:40 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-qe0-f44.google.com (mail-qe0-f44.google.com [209.85.128.44]) by mx1.freebsd.org (Postfix) with ESMTP id 039041F57 for ; Sun, 9 Jun 2013 00:11:39 +0000 (UTC) Received: by mail-qe0-f44.google.com with SMTP id 5so1044012qeb.31 for ; Sat, 08 Jun 2013 17:11:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; bh=uRqUXEkrFg6YdBKPbyyVHXlQSo/O4s7d0/mpjut/X78=; b=0ZAvy/W9ay50xaY2y8ZidU4ZH503YubnwZs7r3EMhSYid1v04nVkq+Xsoy4+HQjHNb yKg/Iq3WBIe/2zQ8/Ouu5bgUjdaBv0AQUpsaNXmh6QeZxD5tUEzTRgkrgOQImWPIk4Cn 2MBzu0qUxiDAfwllN4w53ljfBZZmh738pT2hfxNU77fXzsWf9ggEvl02MXEYfooZxFa9 F/O+zhQuIiyx9VzxqvyMZGGAjqs3AVTbO4WCGq6s6OTwrORoDwbhw4NW/c2icNddBcQO 8LR9fcPsYXNR3b0DAk3z4c8IYCz7rL0syQzPEgE7JjbB5BM+RjAhyPTkfRRF8wOh+1JJ x5Sg== MIME-Version: 1.0 X-Received: by 10.229.66.6 with SMTP id l6mr470324qci.133.1370736693665; Sat, 08 Jun 2013 17:11:33 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.5.65 with HTTP; Sat, 8 Jun 2013 17:11:33 -0700 (PDT) Date: Sat, 8 Jun 2013 17:11:33 -0700 X-Google-Sender-Auth: hdQIOIpXwB2CY627zQON0AFU13w Message-ID: Subject: What's it going to take to get basic A2DP support into -HEAD? From: Adrian Chadd To: freebsd-bluetooth@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: freebsd-bluetooth@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Using Bluetooth in FreeBSD environments List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Jun 2013 00:11:40 -0000 Hi all, I've bought some bluetooth audio devices and I'd like to use them with FreeBSD-HEAD. Specifically, I'd like to be able to use them _whilst_ doing active wifi traffic, so I can properly debug/diagnose all of the crazy bluetooth coexistence issues that exist. However, we don't have A2DP support as far as I can tell. So, given that these headphones pair, what would it take to write up a basic A2DP profile with the minimum-supported codec, and then route audio to it? Would it be something done in-kernel? Or would we just expose the audio to userland and do the (re) encoding there? What about supporting data sources that will happily supply a supported bitrate/encoding type? (eg, if a player wants to spit out MPEG encoded audio; why decode and re-encode it?) I'm happy to hack on code. I just don't know anything about the bluetooth stack here. :-) Thanks! Adrian From owner-freebsd-bluetooth@FreeBSD.ORG Sun Jun 9 06:48:49 2013 Return-Path: Delivered-To: freebsd-bluetooth@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D393EE90; Sun, 9 Jun 2013 06:48:49 +0000 (UTC) (envelope-from plunky@ogmig.net) Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by mx1.freebsd.org (Postfix) with ESMTP id 923741ACB; Sun, 9 Jun 2013 06:48:49 +0000 (UTC) Received: from mfilter3-d.gandi.net (mfilter3-d.gandi.net [217.70.178.133]) by relay4-d.mail.gandi.net (Postfix) with ESMTP id 77A30172074; Sun, 9 Jun 2013 08:48:32 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mfilter3-d.gandi.net Received: from relay4-d.mail.gandi.net ([217.70.183.196]) by mfilter3-d.gandi.net (mfilter3-d.gandi.net [10.0.15.180]) (amavisd-new, port 10024) with ESMTP id JdPfiiPQ611L; Sun, 9 Jun 2013 08:48:30 +0200 (CEST) X-Originating-IP: 31.68.199.240 Received: from galant.ogmig.net (unknown [31.68.199.240]) (Authenticated sender: plunky@ogmig.net) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 85CE2172067; Sun, 9 Jun 2013 08:48:29 +0200 (CEST) Received: by galant.ogmig.net (Postfix, from userid 1000) id 402232600B0; Sun, 9 Jun 2013 07:48:24 +0100 (BST) Date: Sun, 9 Jun 2013 07:48:24 +0100 (BST) From: Iain Hibbert To: Adrian Chadd Subject: Re: What's it going to take to get basic A2DP support into -HEAD? In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (NEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: freebsd-bluetooth@freebsd.org X-BeenThere: freebsd-bluetooth@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Using Bluetooth in FreeBSD environments List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Jun 2013 06:48:49 -0000 On Sat, 8 Jun 2013, Adrian Chadd wrote: > So, given that these headphones pair, what would it take to write up a > basic A2DP profile with the minimum-supported codec, and then route > audio to it? it is probably a couple of weeks work; the specification document is not that thick.. > Would it be something done in-kernel? Or would we just expose the > audio to userland and do the (re) encoding there? imo this is likely the best approach NetBSD has a simple "pseudo audio device" driver[1], which is like a pty but for audio devices.. I would use that (or something like, since I don't know how similar the FreeBSD kernel audio interface is to the NetBSD one) and provide a userland program to just route the audio back into a RFCOMM socket after conversion. > What about supporting data sources that will happily supply a > supported bitrate/encoding type? (eg, if a player wants to spit out > MPEG encoded audio; why decode and re-encode it?) your Bluetooth interface can be whatever you need, and you can transcode or feed whatever the kernel will accept (PCM in the case of pad(4) on NetBSD) > I'm happy to hack on code. I just don't know anything about the > bluetooth stack here. :-) just deal with an RFCOMM socket, is my advice.. (in part, because I am a NetBSD developer.. and our Bluetooth stack is somewhat different, but the socket interface is compatible :) iain [1] http://netbsd.gw.com/cgi-bin/man-cgi?pad++NetBSD-current [2] http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/dev/pad/ From owner-freebsd-bluetooth@FreeBSD.ORG Sun Jun 9 06:55:14 2013 Return-Path: Delivered-To: freebsd-bluetooth@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DB7456A for ; Sun, 9 Jun 2013 06:55:14 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-qa0-x22a.google.com (mail-qa0-x22a.google.com [IPv6:2607:f8b0:400d:c00::22a]) by mx1.freebsd.org (Postfix) with ESMTP id 9F8921AF2 for ; Sun, 9 Jun 2013 06:55:14 +0000 (UTC) Received: by mail-qa0-f42.google.com with SMTP id hu16so1789200qab.1 for ; Sat, 08 Jun 2013 23:55:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=J7NaZYuk7+zFISCRUE3fJ3+0e1mwBI9+QadYV8yMb1I=; b=SowMPTvgw8cEl3bTymaZZ+oSUwfG25xeOFc/LtgMgj431iY7bOvZeDIge6hA1uEVhH d3fRdVGaRyMC7KppwVQwq+9W5EuNFbnTzN0LySDsyPiquLxZMw/+6mSlFwQMRCvxTrfR 0en3caOhuI1gagqn2L4LuWb5+lv271jYcqdUtWg8y+JIA/68MAtvJw5DVS57nNwN0QnO DeQXiavMqn7jIS4g9Z2wxxpnfpBzmU3yJjIx9RM9NXR+ptb0n3ThjO3SeuG4CHcWPlsr cVGlH6onfOCZ5ssmesgDWDxB3+WMQHebtEWnrQSRRA6j7gfi/yu9W8ODrlMOLTMSCDA1 s1mA== MIME-Version: 1.0 X-Received: by 10.49.109.72 with SMTP id hq8mr4462030qeb.38.1370760914160; Sat, 08 Jun 2013 23:55:14 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.5.65 with HTTP; Sat, 8 Jun 2013 23:55:13 -0700 (PDT) In-Reply-To: References: Date: Sat, 8 Jun 2013 23:55:13 -0700 X-Google-Sender-Auth: 8C4jM__2kdSxdaP0-DHQMh3aP48 Message-ID: Subject: Re: What's it going to take to get basic A2DP support into -HEAD? From: Adrian Chadd To: Iain Hibbert Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-bluetooth@freebsd.org X-BeenThere: freebsd-bluetooth@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Using Bluetooth in FreeBSD environments List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Jun 2013 06:55:14 -0000 On 8 June 2013 23:48, Iain Hibbert wrote: > On Sat, 8 Jun 2013, Adrian Chadd wrote: > >> So, given that these headphones pair, what would it take to write up a >> basic A2DP profile with the minimum-supported codec, and then route >> audio to it? > > it is probably a couple of weeks work; the specification document is not > that thick.. Yeah, I see that. And lots of the codec types are optional, right? >> Would it be something done in-kernel? Or would we just expose the >> audio to userland and do the (re) encoding there? > > imo this is likely the best approach > > NetBSD has a simple "pseudo audio device" driver[1], which is like a pty > but for audio devices.. I would use that (or something like, since I don't > know how similar the FreeBSD kernel audio interface is to the NetBSD one) > and provide a userland program to just route the audio back into a RFCOMM > socket after conversion. > >> What about supporting data sources that will happily supply a >> supported bitrate/encoding type? (eg, if a player wants to spit out >> MPEG encoded audio; why decode and re-encode it?) > > your Bluetooth interface can be whatever you need, and you can transcode > or feed whatever the kernel will accept (PCM in the case of pad(4) on > NetBSD) > >> I'm happy to hack on code. I just don't know anything about the >> bluetooth stack here. :-) > > just deal with an RFCOMM socket, is my advice.. (in part, because I am a > NetBSD developer.. and our Bluetooth stack is somewhat different, but the > socket interface is compatible :) It's not a bad idea to begin with. I just have no idea where to begin there. I'll keep on reading, see if I can muster the energy to write some bluetooth socket code. Thanks, Adrian From owner-freebsd-bluetooth@FreeBSD.ORG Sun Jun 9 07:05:47 2013 Return-Path: Delivered-To: freebsd-bluetooth@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B4B871D3; Sun, 9 Jun 2013 07:05:47 +0000 (UTC) (envelope-from plunky@ogmig.net) Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by mx1.freebsd.org (Postfix) with ESMTP id 716541B24; Sun, 9 Jun 2013 07:05:47 +0000 (UTC) Received: from mfilter16-d.gandi.net (mfilter16-d.gandi.net [217.70.178.144]) by relay5-d.mail.gandi.net (Postfix) with ESMTP id D0B9D41C06D; Sun, 9 Jun 2013 09:05:35 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mfilter16-d.gandi.net Received: from relay5-d.mail.gandi.net ([217.70.183.197]) by mfilter16-d.gandi.net (mfilter16-d.gandi.net [10.0.15.180]) (amavisd-new, port 10024) with ESMTP id Tr2aj+A6lBkm; Sun, 9 Jun 2013 09:05:34 +0200 (CEST) X-Originating-IP: 31.68.199.240 Received: from galant.ogmig.net (unknown [31.68.199.240]) (Authenticated sender: plunky@ogmig.net) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id F177741C05C; Sun, 9 Jun 2013 09:05:32 +0200 (CEST) Received: by galant.ogmig.net (Postfix, from userid 1000) id CE1522600B0; Sun, 9 Jun 2013 08:05:22 +0100 (BST) Date: Sun, 9 Jun 2013 08:05:22 +0100 (BST) From: Iain Hibbert To: Adrian Chadd Subject: Re: What's it going to take to get basic A2DP support into -HEAD? In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (NEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: freebsd-bluetooth@freebsd.org X-BeenThere: freebsd-bluetooth@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Using Bluetooth in FreeBSD environments List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Jun 2013 07:05:47 -0000 On Sat, 8 Jun 2013, Adrian Chadd wrote: > On 8 June 2013 23:48, Iain Hibbert wrote: > > On Sat, 8 Jun 2013, Adrian Chadd wrote: > > > >> So, given that these headphones pair, what would it take to write up a > >> basic A2DP profile with the minimum-supported codec, and then route > >> audio to it? > > > > it is probably a couple of weeks work; the specification document is not > > that thick.. > > Yeah, I see that. And lots of the codec types are optional, right? I guess so.. and I haven't investigated, how many devices would be able to accept anything except the minimum required anyway. iain