3

Objective is to attend the call via BT paired devices using HFP

Steps done:

a. The softwares used are

-pulseaudio-4.99.2

-Bluez-5.14

-ofono-1.14

b. The above mentioned application were started and then using bluetoothctl methods, I've paired and connected the mobile to the Ubuntu PC.

c. Call was made to the mobile. After the call was attended, I was trying to hear the audio via the headset connected to the ubuntu PC. But there was no audio heard.

d. I've tried to list the bluez sink and sources using the below command :

pactl list short sources | grep bluez_source
pactl list short sinks | grep -v Monitor | grep alsa_output.pci

e. Then loopback the devices using the below command

pactl load-module module-loopback source=[BTSOURCE] sink=[SINK]

f. I've also edited /etc/bluetooth/audio.conf to enable

[General]
Enable=Gateway,Source,Socket,Sink,Media,Headset

Please help me if I've missed something. Is there anything to be modified in the daemon.conf file ?

I'm also getting these logs in pulseAudio

D: [pulseaudio] module-loopback.c: Loopback overall latency is 43.55 ms + 335.02 ms + 26.97 ms = 405.54 ms

D: [pulseaudio] module-loopback.c: Should buffer 2112 bytes, buffered at minimum 3346 bytes

I: [pulseaudio] module-loopback.c: New rate of 8061 Hz not within 2‰ of 7919 Hz, forcing smaller adjustment

D: [pulseaudio] module-loopback.c: [alsa_output.pci-0000_00_1b.0.analog-stereo] Updated sampling rate to 7934 Hz.

D: [pulseaudio] module-loopback.c: Loopback overall latency is 0.00 ms + 19584.88 ms + 0.00 ms = 19584.88 ms

D: [pulseaudio] module-loopback.c: Should buffer 96 bytes, buffered at minimum 154078 bytes

W: [pulseaudio] module-loopback.c: Sample rates too different, not adjusting (8000 vs. 15699).

D: [pulseaudio] module-loopback.c: [bluez_sink.4C_21_D0_3A_29_04] Updated sampling rate to 8000 Hz.

D: [bluetooth] ratelimit.c: 134 events suppressed

D: [bluetooth] memblock.c: Pool full

D: [alsa-sink-ALC892 Analog] memblock.c: Pool full

D: [bluetooth] memblock.c: Pool full

============================================================================

Please help me !!!

3

2 Answers 2

1

I also faced this issue. If you see audio levels using pavucontrol, you will see that audio is actually coming to the laptop but the audio routing (at pulseaudio level) is misconfigured.

When you connect your phone with bluetooth to your linux machine and dial a call via your phone, you will see that the bluetooth profile is switched to HSP/HFP using "configuration" tab in pavucontrol. You can also check that, for your device, the default sink and source (PulseAudio) has been switched to that of bluez_sink and bluez_source.

To be able to get call audio on your speakers/wired headset and to send your voice on the call using internal microphone/wired headset microphone, try this script.

#!/bin/bash
SOUNDCARD_SOURCE="Find using $ pacmd list-sources | grep -e 'index:' -e device.string -e 'name:'"
SOUNDCARD_SINK="Find using $ pacmd list-sinks | grep -e 'index:' -e device.string -e 'name:'"
BLUEZ_SOURCE="Find using $ pacmd list-sources | grep -e 'index:' -e device.string -e 'name:'"
BLUEZ_SINK="Find using $ pacmd list-sinks | grep -e 'index:' -e device.string -e 'name:'"
pactl unload-module `pactl list short modules | grep bluez_sink | cut -d 'm' -f 1`
pactl unload-module `pactl list short modules | grep bluez_source | cut -d 'm' -f 1`
pacmd "set-default-sink $SOUNDCARD_SINK"
pacmd "set-default-source $SOUNDCARD_SOURCE"
pactl load-module module-loopback source=$SOUNDCARD_SOURCE sink=$BLUEZ_SINK latency_msec=1
pactl load-module module-loopback source=$BLUEZ_SOURCE sink=$SOUNDCARD_SINK latency_msec=1

What is does is simply unload the pactl loopback modules loaded by config and connect your microphone with bluez_sink and connect bluez_source with your speakers/heaphones.

This is my first time posting a solution, so please comment for further clarifications.

0

With Bluez and ofono you can achieve it.

I have tried it with bluez 4.x. Not sure if it'll work with bluez 5.x.

https://bugs.freedesktop.org/show_bug.cgi?id=73325

First to make sure HFP is supported by the hardware.

$ sdptool browse local

This will list all profiles supported. It should show up something like:

Service Name: Hands-Free Audio Gateway
Service RecHandle: 0x10002
Service Class ID List:
  "Handsfree Audio Gateway" (0x111f)
  "Generic Audio" (0x1203)
Protocol Descriptor List:
  "L2CAP" (0x0100)
  "RFCOMM" (0x0003)
    Channel: 13
Profile Descriptor List:
  "Handsfree" (0x111e)
    Version: 0x0105

Service Name: Hands-Free
Service RecHandle: 0x10003
Service Class ID List:
  "Handsfree" (0x111e)
  "Generic Audio" (0x1203)
Protocol Descriptor List:
  "L2CAP" (0x0100)
  "RFCOMM" (0x0003)
    Channel: 7
Profile Descriptor List:
  "Handsfree" (0x111e)
    Version: 0x0105

Next step is to pair your phone with pc using bluetoothctl or GUI. Now you need to check with ofono for modems. Here your phone acts as a modem. Goto ofono test directory and type

$./list-modems

Now it should list your phone in the list. Next enable it

$./enable-modem

Start calling your phone and you'll be able to get the voice to pc.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .