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

Eytan Naim neytan at marvell.com
Thu Aug 27 03:46:39 PDT 2015


Hi Georg,
Thanks for your reply.
I tried to do what you suggested:

1)      I loaded module-null-sink

2)      I loaded module-null-source

3)      Both of them are defined as default.

4)      I try record by ‘parecord -rv --device=null.monitor /pulse/rec’

After answering the call, I get the following assert:

( 121.424|   0.012) E: [null-source][pulsecore/memblockq.c:286 pa_memblockq_push()] Assertion 'uchunk->index + uchunk->length <= pa_memblock_get_length(uchunk->memblock)' failed at pulsecore/memblockq.c:286, function pa_memblockq_push(). Aborting.

Larger log and is attached.
‘pacmd list’ before answering is also attached. – seems good to me.

Do you have any hint about what could be the cause?

Thanks, Eytan.


From: pulseaudio-discuss [mailto:pulseaudio-discuss-bounces at lists.freedesktop.org] On Behalf Of Georg Chini
Sent: Tuesday, August 25, 2015 10:57 PM
To: General PulseAudio Discussion
Subject: Re: [pulseaudio-discuss] HFP bluetooth profile isn't working

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/20150827/5a84ef06/attachment-0001.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: pa-assert.txt
URL: <http://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20150827/5a84ef06/attachment-0002.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: pacmd_list.txt
URL: <http://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20150827/5a84ef06/attachment-0003.txt>


More information about the pulseaudio-discuss mailing list