[pulseaudio-discuss] HFP bluetooth profile isn't working

Georg Chini georg at chini.tk
Tue Aug 25 12:57:29 PDT 2015


On 25.08.2015 13:58, Eytan Naim wrote:
>
> Hi,
>
> I’m trying to enable HFP on pulseaudio 6.0 using oFono and bluez 5 on 
> a new embedded platform which doesn’t support alsa yet.
>
> In order to confirm that audio is ‘played’ I record it using parecord 
> tool. – This method worked just fine when enabled a2dp a short time ago.
>
> After executing oFono & pulseaudio, a call is answered on the remote 
> device- It is seemed that the relevant profile is chosen on 
> pulseaudio, and parecord fails to record.
>

What is the source you are recording from?

> When executing ‘pacmd stat’ it seems that
>
> Memory blocks allocated during the whole lifetime: 192, size: 699.9 KiB.
>
> Is constant while pulseaudio prints to terminal the following message 
> along the call with relatively fixed intervals:
>
> ( 482.106|   0.013) D: [pulseaudio][modules/module-loopback.c:201 
> adjust_rates()] Should buffer 96 bytes, buffered at minimum 128 bytes
>
> ( 482.118|   0.012) D: [pulseaudio][modules/module-loopback.c:226 
> adjust_rates()] [bluez_sink.98_D6_F7_34_98_E8] Updated sampling rate 
> to 8000 Hz.
>
> ( 482.132|   0.013) D: [pulseaudio][modules/module-loopback.c:197 
> adjust_rates()] Loopback overall latency is 610.13 ms + 0.00 ms + 
> 25.00 ms = 635.13 ms
>
> ( 482.146|   0.014) D: [pulseaudio][modules/module-loopback.c:201 
> adjust_rates()] Should buffer 96 bytes, buffered at minimum 0 bytes
>
> ( 482.159|   0.012) D: [pulseaudio][modules/module-loopback.c:226 
> adjust_rates()] [bluez_sink.98_D6_F7_34_98_E8] Updated sampling rate 
> to 8000 Hz.
>
> ( 492.134|   9.975) D: [pulseaudio][modules/module-loopback.c:197 
> adjust_rates()] Loopback overall latency is 610.13 ms + 8.00 ms + 0.00 
> ms = 618.13 ms
>
> ( 492.148|   0.013) D: [pulseaudio][modules/module-loopback.c:201 
> adjust_rates()] Should buffer 96 bytes, buffered at minimum 128 bytes
>
> ( 492.161|   0.012) D: [pulseaudio][modules/module-loopback.c:226 
> adjust_rates()] [bluez_sink.98_D6_F7_34_98_E8] Updated sampling rate 
> to 8000 Hz.
>
> ( 492.175|   0.013) D: [pulseaudio][modules/module-loopback.c:197 
> adjust_rates()] Loopback overall latency is 610.13 ms + 0.00 ms + 
> 25.00 ms = 635.13 ms
>
> ( 492.189|   0.014) D: [pulseaudio][modules/module-loopback.c:201 
> adjust_rates()] Should buffer 96 bytes, buffered at minimum 0 bytes
>
> ( 492.201|   0.012) D: [pulseaudio][modules/module-loopback.c:226 
> adjust_rates()] [bluez_sink.98_D6_F7_34_98_E8] Updated sampling rate 
> to 8000 Hz.
>
> ( 502.176|   9.975) D: [pulseaudio][modules/module-loopback.c:197 
> adjust_rates()] Loopback overall latency is 610.13 ms + 8.00 ms + 0.00 
> ms = 618.13 ms
>
> ( 502.190|   0.013) D: [pulseaudio][modules/module-loopback.c:201 
> adjust_rates()] Should buffer 96 bytes, buffered at minimum 128 bytes
>
> ( 502.202|   0.012) D: [pulseaudio][modules/module-loopback.c:226 
> adjust_rates()] [bluez_sink.98_D6_F7_34_98_E8] Updated sampling rate 
> to 8000 Hz.
>
> ( 502.216|   0.013) D: [pulseaudio][modules/module-loopback.c:197 
> adjust_rates()] Loopback overall latency is 610.13 ms + 0.00 ms + 
> 25.00 ms = 635.13 ms
>
>

This looks fine, the messages are from two module-loopback which are 
loaded to play back
the audio coming from the phone and to transmit audio from your computer 
to the phone.
But this is also where it is getting strange because you have no other 
sound device.
The only sink available to play back audio to is the phone and the only 
source to record from
(except the phone source) is the monitor source of the phone sink (See 
below for explanation
of the monitor source).

To avoid that situation you should add a null sink and a null source to 
your system using
module-null-sink and module-null-source and make them the default sink 
and source.
Then audio coming from the phone will be played back to the null sink 
(and you can record
from null.monitor) while silence coming from the null-source is sent to 
the phone.

> Please note:
>
> I’m now familer with oFono at all – I simply run it as ofonod -d
>
> Pacmd list output is attached while call is still ongoing. – there are 
> 2 sources loaded and one sink.
>
> Also, could someone explain why are there two source available? Nexus 
> 4 and Nexus 4 monitor?
>

The monitor source is created for each sink so that you have a source 
from where you
can record what is played back to the sink.

> How can I confirm that the audio arrives at pulseaudio? By the log I 
> would assume that the answer is positive, but according to ‘pacmd 
> stat’ the value it seems not.
>

In general it looks like your setup is working.

> Thanks for your help,
>
> Eytan.
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20150825/10bfb7ac/attachment.html>


More information about the pulseaudio-discuss mailing list