[pulseaudio-discuss] A2DP - Bluetooth source to alsa sink audio routing

Maarten Bosmans mkbosmans at gmail.com
Tue Feb 22 06:23:01 PST 2011

2011/2/22 Cristina Cristea <doina.cristina at gmail.com>:
> Hi guys,
> First of all, sorry if this problem has been discussed before. I'm new on
> this list and haven't seen it on the archives.
> Shortly, I'm experiencing small underruns when playing music from the phone
> to my computer through bluetooth. At about every 5-6 minutes, the music
> stops  for 1-2 sec. and these messages are showed by pulseaudio:
> D: protocol-native.c: Underrun on 'lt-pacat', 0 bytes in queue.
> D: protocol-native.c: Requesting rewind due to end of underrun.
> D: alsa-sink.c: Requested to rewind 65536 bytes.
> D: alsa-sink.c: Limited to 44400 bytes.
> D: alsa-sink.c: before: 11100
> D: alsa-sink.c: after: 11100
> D: alsa-sink.c: Rewound 44400 bytes.src-sinc-best-quality
> D: sink.c: Processing rewind...
> D: sink-input.c: Have to rewind 44400 bytes on render memblockq.
> D: source.c: Processing rewind...
> I am using pacat and paplay apps as follows: parec -r --format s16le
> --channels 2 --rate 44100 | paplay -p
> I also tried to redirect audio with module-loopback module: load-module
> module-loopback source=bluez_source.00_23_76_E3_F3_C5
> sink=alsa_output.0.analog-stereo
> The results are still dissatisfactory:
> -the CPU load is about 60%
> -every 10 seconds, module-loopback is changing the sample rate which is not
> so pleasant for the listener:
> I: module-loopback.c: Loopback overall latency is 56.37 ms + 493.72 ms +
> 135.29 ms = 685.38 ms
> I: module-loopback.c: Should buffer 23552 bytes, buffered at minimum 24288
> bytes
> I: module-loopback.c: Old rate 44167 Hz, new rate 44118 Hz

You can pass adjust_time=0 to module-loopback. This way the adjustment
is never made and if the source and sink have the same rates, no
resampling is necessary. The rate change from the log snippet above is
inaudible, so should not be unpleasant for the listener.

Without adjusting the rate, you will probably get the underruns every
5-6 minutes, just as in the pacat case. Can you try git master? At
least this commit
should make the experience with module-loopback a bit better. (without

> -underruns are still showing and pulseaudio displays:
> I: module-loopback.c: Coud not peek into queue
> I'm running a meego and have this sound card:
> 0 [MID            ]: HDA-Intel - HDA Intel MID
>                      HDA Intel MID at 0xd2c00000 irq 16
> I'm not sure if this is a bluez or pulseaudio issue. I have tried my
> bluetooth and a bluetooth dongle and there is no difference.
> My question is: is there a better way to route audio in this case? One that
> could synchronize better the bluetooth and the sound card?
> Thanks,
> Cristina


More information about the pulseaudio-discuss mailing list