You are not logged in.

#1 2016-11-12 10:08:14

Chocopuff
Member
Registered: 2016-10-02
Posts: 26

Bluetooth Speaker Lag on Macbook Pro

Hi, I'm having issues with my bluetooth speaker. I used Blueberry and bluetoothctl before to connect to my speaker but I always have horrible lag. The output gets jammed and jittery and is lagging behind the actual output.

I am not sure how to solve this, can't find any other documentation on this. Speaker works fine on same laptop on macOS

Output of lsusb if that helps.

Bus 002 Device 002: ID 05ac:8406 Apple, Inc.
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 05ac:0273 Apple, Inc. Internal Keyboard/Trackpad (ISO)
Bus 001 Device 003: ID 05ac:8290 Apple, Inc. Bluetooth Host Controller
Bus 001 Device 002: ID 05ac:1402 Apple, Inc. Ethernet Adapter [A1277]
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

I've also tried turning off USB autosuspend on TLP as I thought that might have been the issue.

Thanks!

Offline

#2 2016-11-13 09:31:38

bryan.paradis
Member
Registered: 2016-10-22
Posts: 43

Re: Bluetooth Speaker Lag on Macbook Pro

I was having issues that seem to have been fixed by doing the following. I find my Macbook Pro 9.2's bluetooth quite underwhelming in general and use an external UD100 usb bluetooth adapter with a massive antenna.

bluetoothctl
set-advertise-tx-power on

Offline

#3 2017-01-09 14:27:23

Chocopuff
Member
Registered: 2016-10-02
Posts: 26

Re: Bluetooth Speaker Lag on Macbook Pro

I think I've located the issue to this
https://bbs.archlinux.org/viewtopic.php?id=182108
This was in my journald systemd logs

 pulseaudio[15363]: W: [bluetooth] module-bluez5-device.c: Skipping 131210 us (= 23144 bytes) in audio stream

I don't get what the last poster on that thread linked meant by

mwc0623 wrote:

I've had this problem for months and months and *finally* found the cause and the solution. Through using kinfocenter (KDE app -- lsusb could be used as well), I noticed that my USB keyboard, USB mouse, and USB bluetooth dongle were hung off the same USB host controller. The mouse and keyboard generate lots of tiny packets and tend to dominate the bus, which leaves the bluetooth dongle locked out frequently and thus unable to send the large packets of music data. Moving the bluetooth dongle to a different USB port attached to the second USB controller on my computer completely solved the problem for me. No more "[bluetooth] module-bluez5-device.c: Skipping" messages and smooth audio playback. Good luck!

How do I do that?

Offline

#4 2017-01-18 14:21:03

paco3346
Member
Registered: 2017-01-13
Posts: 3

Re: Bluetooth Speaker Lag on Macbook Pro

Chocopuff wrote:

How do I do that?

Sorry, you don't hmm

mwc0623 meant that he literally unplugged his USB bluetooth adapter and plugged it into a different port. Since you're working with the MBP your device is on the same card as your WiFi adapter and can't be moved.

I too have dealt with this MBP bluetooth issue for quite some time. Here's what I've been able to piece together:

(DISCLAIMER: I don't know how factual all of this is).

- Both the wireless chip and bluetooth chip are off the shelf chips (BCM43602 and BCM20703. See https://wikidevi.com/wiki/Broadcom_BCM943602CS)
- Apple combined them onto a single card (this is unique to the MBP)
- The drivers have no type of interference mitigation so when the wireless chip sends packets on the 2.4GHz network the bluetooth packets may fail to send
- When a bluetooth packet can't be sent it stays in the buffer (rather than being discarded)
- As more packets can't be sent the audio stream gets further and further behind (https://bugs.freedesktop.org/show_bug.cgi?id=58746)

As a work around you can recompile to have a smaller bluetooth buffer. This prevents more data from being added when a packet fails to send and essentially limits the lag to ~1 second. Your audio will still stutter but it doesn't keep getting further and further behind. This is actually super easy to do with the AUR and an AUR client such as yaourt.

Check out this patch: https://github.com/dmitryvk/pulseaudio/commit/master

If you need assistance on recompiling I'd be happy to help.

Offline

Board footer

Powered by FluxBB