[pulseaudio-discuss] Rate/Timing issues when streaming over BT from iPhone.....

pl bossart bossart.nospam at gmail.com
Sun Aug 1 19:42:33 PDT 2010


> Script:
> #!/usr/bin/pulseaudio -vvvnF
> load-module module-alsa-sink device=default:CARD=Live sink_name=output
> rate=48000
> load-module module-bluetooth-device address="XX:XX:XX:XX:XX:XX"
> path="/org/bluez/1662/hci0/dev_XX_XX_XX_XX_XX_XX" profile="a2dp_source"
> auto_connect=yes name=input rate=44100
> load-module module-loopback source=1 sink=0 rate=44100


It's not clear to me why you have two different rates. If you know the
incoming rate is 44.1kHz you could avoid resampling.
I think we also have a fundamental issue with the way the incoming
frequency is calculated in PulseAudio using latency estimates. I ran a
set of similar tests a while back with RTP streaming and the sampling
frequency estimated with the latency estimates varied wildly, by as
much as 10kHz. I had a patch to prevent variations of more than 1%
(which is already a lot), but that wasn't enough to remove all
frequency shifts introduced by the resampler.
We need to have some kind of long-term smoothing of these variations,
adjusting the sampling frequency with such variations isn't going to
work.

> Partial output:
> I: main.c: Daemon startup complete.
> I: module-loopback.c: Loopback overall latency is 100.04 ms + 0.00 ms +
> 39.51 ms = 139.55 ms
> I: module-loopback.c: Should buffer 35280 bytes, buffered at minimum 0 bytes
> I: module-loopback.c: Old rate 44100 Hz, new rate 43218 Hz
> D: bluetooth-util.c: dbus: interface=org.bluez.AudioSource,
> path=/org/bluez/1662/hci0/dev_64_B9_E8_19_DD_FA, member=PropertyChanged
> D: module-bluetooth-device.c: dbus: interface=org.bluez.AudioSource,
> path=/org/bluez/1662/hci0/dev_64_B9_E8_19_DD_FA, member=PropertyChanged
> D: bluetooth-util.c: dbus: interface=org.bluez.AudioSource,
> path=/org/bluez/1662/hci0/dev_64_B9_E8_19_DD_FA, member=PropertyChanged
> D: module-bluetooth-device.c: dbus: interface=org.bluez.AudioSource,
> path=/org/bluez/1662/hci0/dev_64_B9_E8_19_DD_FA, member=PropertyChanged
> I: main.c: Got signal SIGUSR2.
> I: module.c: Loaded "module-cli-protocol-unix" (index: #3; argument: "").
> I: module-loopback.c: Loopback overall latency is 99.98 ms + 0.00 ms + 39.51
> ms = 139.49 ms
> I: module-loopback.c: Should buffer 34576 bytes, buffered at minimum 0 bytes
> I: module-loopback.c: Old rate 43218 Hz, new rate 43236 Hz
> I: client.c: Created 0 "UNIX socket client"
> D: bluetooth-util.c: dbus: interface=org.bluez.AudioSource,
> path=/org/bluez/1662/hci0/dev_64_B9_E8_19_DD_FA, member=PropertyChanged
> D: module-bluetooth-device.c: dbus: interface=org.bluez.AudioSource,
> path=/org/bluez/1662/hci0/dev_64_B9_E8_19_DD_FA, member=PropertyChanged
> I: module-loopback.c: Loopback overall latency is 99.99 ms + 400.66 ms +
> 42.02 ms = 542.67 ms
> I: module-loopback.c: Should buffer 34592 bytes, buffered at minimum 2560
> bytes
> I: module-loopback.c: Old rate 43236 Hz, new rate 43300 Hz
> I: module-loopback.c: Loopback overall latency is 99.98 ms + 806.05 ms +
> 39.69 ms = 945.71 ms
> I: module-loopback.c: Should buffer 34640 bytes, buffered at minimum 69240
> bytes
> I: module-loopback.c: Old rate 43300 Hz, new rate 44965 Hz
> I: module-loopback.c: Loopback overall latency is 99.98 ms + 781.78 ms +
> 40.83 ms = 922.60 ms
> I: module-loopback.c: Should buffer 35976 bytes, buffered at minimum 134708
> bytes
> I: module-loopback.c: Old rate 44965 Hz, new rate 46568 Hz
> I: module-loopback.c: Loopback overall latency is 99.98 ms + 429.80 ms +
> 40.62 ms = 570.40 ms
> I: module-loopback.c: Should buffer 37256 bytes, buffered at minimum 79028
> bytes
> I: module-loopback.c: Old rate 46568 Hz, new rate 45144 Hz
> I: module-loopback.c: Loopback overall latency is 100.00 ms + 409.27 ms +
> 41.85 ms = 551.11 ms
> I: module-loopback.c: Should buffer 36120 bytes, buffered at minimum 73904
> bytes
> I: module-loopback.c: Old rate 45144 Hz, new rate 45044 Hz
> I: main.c: Daemon shutdown initiated.
>
> Thanks in advance
>
> Alex
>
> alex at apics.co.uk
>
> Homer Simpson: Facts are meaningless. You could use facts to prove anything
> that's even remotely true!
> _______________________________________________
> pulseaudio-discuss mailing list
> pulseaudio-discuss at mail.0pointer.de
> https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
>
>



More information about the pulseaudio-discuss mailing list