Received: by 2002:a17:90a:9103:0:0:0:0 with SMTP id k3csp1185951pjo; Wed, 8 Jan 2020 13:26:50 -0800 (PST) X-Google-Smtp-Source: APXvYqxu1CrxURLrua/uVpYEUSzMq2N8BVVCI6OZBRyU2Lmjz0tDELLpLfbn+omvYibu8MaWniWr X-Received: by 2002:a05:6808:64e:: with SMTP id z14mr501715oih.79.1578518810562; Wed, 08 Jan 2020 13:26:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578518810; cv=none; d=google.com; s=arc-20160816; b=zFfb564UPiQq2aX6bmiVqNa/ItSodICir4jopg6QW9OEGrftlUiGZITul6nvnReVOG MFW3MVCTYVsNNU4lgEsUIy2twTnDtugUESy2qm9gFDhRe1jooAR9Vn4y27S4LTXFGY3a +yB4pMsAoL/vCSFNQWrU0K8X/IpOQ/pBMyWMhzVy/gPulG9U29P6ho/MmOEfhFRT1w1u y1vlKu7R1gDpyDXl5FiLPZYSgoOpctCveguFIfsK6Z1TJUdhYXsCQIKAxGLBQpjDNc15 ZXGorBFMq8iwH4Yf2ufODHIZ33pVdeyMzaY2rU3vQMXczlGne/N7A1Co3gacQzNB5Bj5 Zo+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=vYF6F85CJAvt1T7S6voLpFNrHSJS53VgqXA5TcNTGGI=; b=DPX4j/lO3mpfecKX0RhR2VDCZf/RAcRUGkpKUk+rsg0lT0e5GYfyKGmuoycQ7J1CpT SjZiuSSna3BPznONID9FJbPMZrsSt8ML2x/URd5/LM7wuDIPegRQS3emDDUGcpUcG0si 1HZS2d1aUT3APW9mSkZ3LCwlJy0+S+p525EsvfceTAVWsU83tuTw5U7dCsgmjdIg3NnN Ue7NLj9m5Kd3z9OfnFFqUtA0hnUT2/veRXjDu8vaS+HIEdYmwEW9tKBMknRIF02nUeX7 bXIOad7/Vep32fSMFNMz5hpq73Z0UFouoGMXB3tYfDqjmsUO1JOs8rBdyYUr2RskM6Dj tp1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=cEUJcoo0; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c19si2520760otn.7.2020.01.08.13.26.38; Wed, 08 Jan 2020 13:26:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=cEUJcoo0; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727458AbgAHVZm (ORCPT + 99 others); Wed, 8 Jan 2020 16:25:42 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:38771 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726636AbgAHVZl (ORCPT ); Wed, 8 Jan 2020 16:25:41 -0500 Received: by mail-wr1-f65.google.com with SMTP id y17so5036761wrh.5 for ; Wed, 08 Jan 2020 13:25:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=vYF6F85CJAvt1T7S6voLpFNrHSJS53VgqXA5TcNTGGI=; b=cEUJcoo0b0asCr7AQ5QXLZKdu29CU56MDPVyFCQhtOQeOfbgUJmYfpFjaOatwBJoxZ t4fMUd5lg0oDZp4VRon1We5rU9afGo6TIGX+XTT8ZMzjU4svDLbty629/ZkSG8Bqq4hv Iz1zHSGSc7M3mxbCx5wv+bl1KT+Ds98OyhlThMRT1hzAZR6LCZGgpYpouqb0aTU0TSOH eYgYempVPsoNccQEoPJz2PQy1V+aUHuE4E2PSBEYzo+avmp0pv7T+LE/LdoPa0RBNXl6 +tDd3wAndpsvGvkQRs4nZ0IqRR8BcPX9E1gDvSUclhZXTVhPjo9/ZEqtQbjtFIULSoty 4S9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=vYF6F85CJAvt1T7S6voLpFNrHSJS53VgqXA5TcNTGGI=; b=AhRIJUgMLzKUUeVtQGFeBXhZgGgKiqvXwDeUdAUgsGHCSFaMF87FYtXNcCE04HdLr1 dJnwgwnwsVs2XHlvtFdxNSwIN4Wu72Cf4axCTLYTY4m5eOj87H7wTMjA5l/8fYBAIhiO qCmXO+7fT3JbKx1AjF2M0hFzgCrCFiALSQm4puZ8B8I904GrvkLf1b8/u3oGLl+Hs+Eu teidhv42T2WvGUXZiGPjcX9Kkmd/S8dfzp9HPfK+7fSQwMvIr0yLJUp1sytnuvBslHzR qyOwS/EG8bgHn+0KembEfsX4W16zWxzsfQzqqKnJZFqn7kVlaxTdlUhXVtEpc0HSJpP/ R3Qw== X-Gm-Message-State: APjAAAX2sGUnRUV/Bn6+vvUKkASSrksq5Cs7V7mfKukWPCT2jQfCzOpT nH8QIwvnPBC06C/A3XDHXpQb/u0e X-Received: by 2002:a5d:6b88:: with SMTP id n8mr7192828wrx.288.1578518739585; Wed, 08 Jan 2020 13:25:39 -0800 (PST) Received: from pali ([2a02:2b88:2:1::5cc6:2f]) by smtp.gmail.com with ESMTPSA id n16sm6051585wro.88.2020.01.08.13.25.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jan 2020 13:25:38 -0800 (PST) Date: Wed, 8 Jan 2020 22:25:37 +0100 From: Pali =?utf-8?B?Um9ow6Fy?= To: Denis Kenzior Cc: ofono@ofono.org, linux-bluetooth@vger.kernel.org Subject: Re: HSP/HFP ofono bluetooth support for Linux desktop Message-ID: <20200108212537.zs6pesil2vjguvu6@pali> References: <20200107192311.efit6zftt27encdc@pali> <721332d3-336a-b9d2-f8cd-72da785fb9dc@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="gjl63b3enwqptwwu" Content-Disposition: inline In-Reply-To: <721332d3-336a-b9d2-f8cd-72da785fb9dc@gmail.com> User-Agent: NeoMutt/20180716 Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org --gjl63b3enwqptwwu Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello! On Wednesday 08 January 2020 14:34:32 Denis Kenzior wrote: > Hi Pali, >=20 > > Do you have a reasonable solution also for second issue? > >=20 >=20 > HSP profile has always been a problem child. It isn't really all that > useful as a profile, and given how minimal it is, the right place for it > always seemed to be inside Pulse Audio itself. This is what Marcel & I > agreed upon back about 8-9 years ago anyway. >=20 > You are advocating that HSP is still useful, particularly with vendor > extensions. Which is fair enough, but now you have to figure out how and > where to put this support. >=20 > As mentioned earlier, one idea you can explore is to create a small daemon > (or maybe it can even be part of ofonod itself) that will handle HSP > client/server roles. See for example the dundee daemon that is part of > ofono.git. dundee handles Bluetooth DUN profile and might be a good mode= l / > starting point for what you're trying to accomplish. I looked at dundee, but it does it is separated service, not on org.ofono So it looks like it does not fit into HSP / HFP needs. Currently you can list all audio cards by DBus call: "org.ofono", "/", "org.ofono.HandsfreeAudioManager", "GetCards" and so this (or some new) call should list all HSP and HFP devices/cards for audio application (pulseaudio). Audio application (e.g. pulseaudio) really do not want to handle two separate services to monitor and process HSP/HFP devices. For audio application are HSP and HFP devices equivalent, they provide same features: SCO socket, API for controlling microphone and speaker gain; plus optionally specify used codec. So having two separate services which fully divided for audio application purpose does not make sense. So it is possible that both HSP and HFP audio cards would be available via one audio API? Because I do not see how it could be done via design like dundee. > You can then implement the same API interfaces for setting up the HSP aud= io > stream as oFono does today (i.e. https://git.kernel.org/pub/scm/network/o= fono/ofono.git/tree/doc/handsfree-audio-api.txt), This API is unusable for both HSP and HFP audio streams. In pulseaudio it is somehow used, but it is not suitable. In part of designing hsphfpd I created a new DBus API for audio application to fit for audio daemons. See org.hsphfpd.AudioAgent: https://github.com/pali/hsphfpd-prototype/blob/prototype/hsphfpd.txt#L600-L= 663 Main objection for handsfree-audio-api.txt is that it does not provide information about locally used codec and somehow mixes air codec and local codec. In my hsphfpd.txt I used term "AgentCodec" for bluetooth local codec and term "AirCodec" for bluetooth air codec format. Another objection against handsfree-audio-api.txt API is that it is bound to HF codecs (via number) and does not support for pass e.g. CSR codecs. What is completely missing in that API is controlling volume level. And also API does not provide socket MTU information or ability to change/specify which codec would be used. So something like org.hsphfpd.AudioAgent API in my hsphfpd design would be needed. > which would make PulseAudio's job much easier, since the audio stream > aspects would be essentially identical to HFP. If you're part of oFono's > tree, then in theory many implementation aspects could be reused. >=20 > If you want to provide some higher-level APIs for external applications, > then HSP specific interfaces (APIs) can be added as needed. Non-audio APIs which are needed to export (for both HSP and HFP profiles): * battery level (0% - 100%) * power source (external, battery, unknown) * ability to send "our laptop" battery level and power source to remote dev= ice * send text message to embedded display * process button press event (exported via linux kernel uinput) (plus all telephony related operations, but those are already supported and provided by ofono) > If you decide this is something you want to pursue, then I'm happy to host > this in the oFono tree. >=20 > Regards, > -Denis --=20 Pali Roh=C3=A1r pali.rohar@gmail.com --gjl63b3enwqptwwu Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EARECAB0WIQS4VrIQdKium2krgIWL8Mk9A+RDUgUCXhZIzwAKCRCL8Mk9A+RD UltyAKCxBf9uLNyOoXizkvpJxCovTo8fmwCcCmWvv2YZnGpuuwxc++eR2NCVurQ= =kE8J -----END PGP SIGNATURE----- --gjl63b3enwqptwwu--