<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head><body style='font-size: 10pt; font-family: Verdana,Geneva,sans-serif'>
<p>Hello Pulseaudio-Mailing-List,</p>
<p><br /></p>
<p><br /></p>
<p>as in my answer stated here: <a href="https://askubuntu.com/questions/1261148/how-to-switch-my-phone-to-headset-audio-gateway-hsp-hfp-in-pulseaudio/1292524#1292524">https://askubuntu.com/questions/1261148/how-to-switch-my-phone-to-headset-audio-gateway-hsp-hfp-in-pulseaudio/1292524#1292524</a></p>
<p>I do think me and many other Ubuntu users do suffer from an issue with HSP/HFP where one needs to manually change output and input device</p>
<p>if Ubuntu used as Bluetooth Headset for Phone Calls and Playback.</p>
<p><br /></p>
<p>Clarification:</p>
<p>A2DP Working fine:</p>
<p>A2DP Media Playback from my Android Galaxy S8+ working fine. If i switch back from phone call to youtube the Profile A2DP gets activated automatically and audio is played out of my headphones on ubuntu. perfect.</p>
<p>HSP/HFP Problem:</p>
<p>Switching to a phone call results in automatic switch in pulseaudio (pavucontrol) => Configuration-Tab Device "Galaxy S8+" from "Off" or "A2DP" to "HSP/HFP" which is expected and perfect.</p>
<p>But then there is no audio output nor audio input. One can see in pulseaudio that HSP/HFP gets activated. One can further inspect in pulseaudio that Input Device and Output Device for "Galaxy S8+" gets registered and shows as "Port: Phone".</p>
<p>But audio is not working.</p>
<p><br /></p>
<p>If I than manually switch (while in a phone call) with the use of i<code>ndicator-sound-switcher to:</code></p>
<pre><code>Input: Headset > FrontMicrophone
Output: Headset > Headphones<br /><br /></code>then I can send and receive audio in this phone call nicely. Quality in HSP/HFP is not as good as A2DP but thats another issue I will try to fix elsewhere... <br /><br /><br />So technically everything seems to work fine. But its very annoying while receiving or doing a phone call that audio input and output have to be set manually to FrontMicrophone and Headset Headphone.<br />I do have multiple input and output devices and during a business talk or in a stressful situation it's not so easy to select the right devices fast and accurate.<br /><br /><br />So I was looking for a solution to always set:</pre>
<pre><code>Input: Headset > FrontMicrophone
Output: Headset > Headphones<br /></code><br />when HSP/HFP gets activated. But I am not aware on how to achieve this.<br /><br /><br /><br /><strong>Tested Setup:</strong></pre>
<ul>
<li>OS Ubuntu 20.04 LTS</li>
<li>ofono installed.</li>
<li>Android Galaxy S8+</li>
<li>Card #8<br /> Name: bluez_card.88_75_98_9F_C3_35<br /> Driver: module-bluez5-device.c<br /> Owner Module: 145<br /> Properties:<br /> device.description = "Galaxy S8+"<br /> device.string = "88:75:98:9F:C3:35"<br /> device.api = "bluez"<br /> device.class = "sound"<br /> device.bus = "bluetooth"<br /> device.form_factor = "phone"<br /> bluez.path = "/org/bluez/hci0/dev_88_75_98_9F_C3_35"<br /> bluez.class = "0x5a020c"<br /> bluez.alias = "Galaxy S8+"<br /> device.icon_name = "audio-card-bluetooth"<br /> Profiles:<br /> a2dp_source: High Fidelity Capture (A2DP Source) (sinks: 0, sources: 1, priority: 20, available: yes)<br /> headset_audio_gateway: Headset Audio Gateway (HSP/HFP) (sinks: 1, sources: 1, priority: 10, available: yes)<br /> off: Off (sinks: 0, sources: 0, priority: 0, available: yes)<br /> Active Profile: off<br /> Ports:<br /> phone-output: Phone (priority: 0, latency offset: 0 usec)<br /> Part of profile(s): headset_audio_gateway<br /> phone-input: Phone (priority: 0, latency offset: 0 usec)<br /> Part of profile(s): a2dp_source, headset_audio_gateway</li>
</ul>
<p><br /></p>
<p>Settings adjusted so far:</p>
<pre><span style="background-color: #00ffff;"><code>sudo vim /etc/pulse/default.pa
</code></span></pre>
<pre><span style="background-color: #00ffff;"><code>.ifexists module-bluetooth-discover.so
#load-module module-bluetooth-discover
load-module module-bluetooth-discover headset=ofono
.endif</code></span></pre>
<pre><code>sudo useradd -g bluetooth pulse
</code></pre>
<pre><span style="background-color: #00ffff;"><code>vim /etc/dbus-1/system.d/ofono.conf</code></span></pre>
<pre><span style="background-color: #00ffff;"><code> <policy user="pulse">
<allow send_destination="org.ofono"/>
</policy></code></span></pre>
<p><br /></p>
<p>Question:</p>
<pre>How can one set Input and Output to FrontMicrophone and Headphones permanently for HSP/HFP Profile?</pre>
<p><br /></p>
<p>Thank you in advance for contribution to this issue.</p>
<p><br /></p>
<p>Kind regards,</p>
<p>Raphael</p>
<p><br /></p>
<div>-- <br />
<div class="pre" style="margin: 0; padding: 0; font-family: monospace">Development @ <a href="https://develissimo.com">develissimo.com</a></div>
</div>
</body></html>