#786660 pulseaudio-module-bluetooth: Cracky sound when something else runs

Package:
pulseaudio-module-bluetooth
Source:
pulseaudio
Description:
Bluetooth module for PulseAudio sound server
Submitter:
Julien Palard
Date:
2015-05-31 20:57:08 UTC
Severity:
normal
#786660#5
Date:
2015-05-24 08:46:24 UTC
From:
To:
Dear Maintainer,

I'm listenning sound from my phone to my speakers thrue
pulseaudio-audio-bluetooth and a module-loopback to route from
bluetooth source to speakers sink.

But sometimes, typically when I load a page on chromium, easily
reproductible zooming and unzooming on a google map, sound becomes
very cracky.

It does not seems directly linked to my CPU usage, as I tried putting
my 4 cores to 100% using 4 simulatneous
`echo "scale=42000; 4*a(1)" | bc -l -q`
and sound remained OK.

#786660#10
Date:
2015-05-24 23:30:02 UTC
From:
To:
Control: tags -1 moreinfo

Des this problem happen if you use the following instead of the loopback module?

mkfifo test
paplay --raw test &
parec -d <your_bt_source> test

Also, please attach a verbose log of pulseaudio when the problem happens:

https://wiki.ubuntu.com/PulseAudio/Log

#786660#17
Date:
2015-05-28 22:00:31 UTC
From:
To:
Hello,
Just tried, did not heard any crack when playing thrue the fifo.
I logged a few seconds of very cracky sound, hope that helps.

#786660#22
Date:
2015-05-29 23:24:23 UTC
From:
To:
OK, this suggests a problem with the loopback module.

What parameters are you giving to the loopback module? I see in the log:

source="bluez_source.C4_43_8F_9F_F5_36" source_dont_move="true"
sink_input_properties="media.role=music"

Is that all?

Try increasing the latency (default is 200), or disabling remixing.

If that fails, try changing the resampler in the configuration file.

#786660#27
Date:
2015-05-30 19:18:30 UTC
From:
To:
o/

First thanks for your time,  it helped a lot:

It was just:

pactl load-module module-loopback source=bluez_source.C4_43_8F_9F_F5_36
sink=alsa_output.pci-0000_00_1b.0.analog-stereo
I tried with latency-msec=2000 -> same
I tried (keeping latency-msec=2000) to add remix=false -> A little bit
better, not sure.
I tried to set `resample-method = src-sinc-best-quality` -> That's GOOD !
I'm reverting to a default value to remix (not sure it's true) -> Still
good !
I'm reverting to the default value of 200 for latency-msec -> Still perfect

So it's the resample-method, it was not set in my configuration, only
commented, maybe the default ? Was:

; resample-method = speex-float-1

I tried to find for you which resample-method was picked with this
magical "best-quality" mode, and I found this in syslog:

resampler.c: Support for resampler 'src-sinc-best-quality' not compiled
in, reverting to 'auto', so I tried pulseaudio -vvv and got:

D: [pulseaudio] resampler.c: Resampler:
D: [pulseaudio] resampler.c:   rate 44100 -> 44100 (method speex-float-1)
D: [pulseaudio] resampler.c:   format s16le -> s16le (intermediate
float32le)
D: [pulseaudio] resampler.c:   channels 2 -> 2 (resampling 2)

Hope that's helps ? Tell me if you need more information / debugs / logs
/ tests / whatever.

Bests,

#786660#32
Date:
2015-05-31 20:53:19 UTC
From:
To:
Hmm, I see in the old logs:

(   1.028|   0.000) D: [pulseaudio] resampler.c: Resampler:
(   1.028|   0.000) D: [pulseaudio] resampler.c:   rate 44100 -> 25
(method peaks)
(   1.028|   0.000) D: [pulseaudio] resampler.c:   format s16le ->
float32le (intermediate s16le)
(   1.028|   0.000) D: [pulseaudio] resampler.c:   channels 2 -> 1
(resampling 1)

This looks wrong to me. However, I don't think I can be of more help
as my knowledge is limited in this regard. Could you please bring this
up at the upstream list or bug tracker? They will have better
understanding, and maybe a fix can be made to choose a better
resampler by default.

If you do so, please report back to this bug the link to the upstream report.