A2DP Bluetooth audio skips terribly ["Skipping NNN us (= MMM bytes) in audio stream"]

Bug #405294 reported by volkris on 2009-07-27
580
This bug affects 119 people
Affects Status Importance Assigned to Milestone
PulseAudio
Fix Released
Medium
pulseaudio (Ubuntu)
High
Unassigned

Bug Description

As I upgraded to the Karmic alpha, bluetooth audio (via a2dp) stopped working properly. It was working fine in Jaunty.

My headphones are detected and configured by pulse, but the audio skips as if it's spending half of each second paused. Music is buffered so that after I click stop on rhythmbox (or whatever--it happens with whatever player I use) the audio continues until it's caught up.

syslog is full of the following lines:
Jul 27 08:55:45 carlin1 pulseaudio[3218]: alsa-source.c: Increasing minimal latency to 1.00 ms
Jul 27 08:55:46 carlin1 pulseaudio[3218]: module-bluetooth-device.c: Skipping 15128 us (= 2668 bytes) in audio stream
Jul 27 08:55:46 carlin1 pulseaudio[3218]: module-bluetooth-device.c: Skipping 36586 us (= 6452 bytes) in audio stream
Jul 27 08:55:46 carlin1 pulseaudio[3218]: module-bluetooth-device.c: Skipping 35593 us (= 6276 bytes) in audio stream
Jul 27 08:55:46 carlin1 pulseaudio[3218]: module-bluetooth-device.c: Skipping 36597 us (= 6452 bytes) in audio stream
Jul 27 08:55:46 carlin1 pulseaudio[3218]: module-bluetooth-device.c: Skipping 32601 us (= 5748 bytes) in audio stream
Jul 27 08:55:46 carlin1 pulseaudio[3218]: module-bluetooth-device.c: Skipping 32589 us (= 5748 bytes) in audio stream

This is with
bluez 4.45-0ubuntu4
pulseaudio 1:0.9.15-4ubuntu2 0

pulseaudio version 1:0.9.16~test2-0ubuntu1~ppa3 from ubuntu-audio-dev didn't help.

volkris (volkris) wrote :

Adding the work done in pulseaudio's bugtracker

Changed in pulseaudio:
importance: Undecided → Unknown
status: New → Unknown

On Wed, Aug 5, 2009 at 1:19 PM, Chris Carlin<email address hidden> wrote:
> Adding the work done in pulseaudio's bugtracker

See if 0.9.16-test4 alleviates the symptoms. Make sure you have rtkit
installed, too.

Changed in pulseaudio:
status: Unknown → New

Where can I find -test4? I've been following the ubuntu-audio-dev ppa and see only -test3

On Wed, Aug 5, 2009 at 2:07 PM, Chris Carlin<email address hidden> wrote:
> Where can I find -test4? I've been following the ubuntu-audio-dev ppa
> and see only -test3

pulseaudio 1:0.9.16~test4-0ubuntu1 and rtkit 0.4-0ubuntu1 are in karmic.

Luke Yelavich (themuso) wrote :

Note that rtkit is currently no use until the kernel side lands, which will likely require me to get the patches included in the Ubuntu kernel.

1:0.9.16~test4-0ubuntu1 didn't help.

Could this be related to the lack of rtkit?

On Thu, Aug 6, 2009 at 1:38 PM, Chris Carlin<email address hidden> wrote:
> 1:0.9.16~test4-0ubuntu1 didn't help.
>
> Could this be related to the lack of rtkit?

More effectively, the lack of the linux patch to which Luke refers. In
the meantime, you can try adding the audio group to have RT privileges
using /etc/security/limits.conf.

Updated to bluez 4.47-0ubuntu1 along with the distro. No difference.

On Sat, Aug 8, 2009 at 6:16 PM, Chris Carlin<email address hidden> wrote:
> Updated to bluez 4.47-0ubuntu1 along with the distro. No difference.

Have you made the recommended modifications to /etc/security/limits.conf?

Yes, I made the modifications and there was a difference: syslog started showing the "skipping..." messages more quickly :)

To be precise, they came at the same rate, but there used to be a larger pause before the first one appeared.

Marcin Szałowicz (lolek) wrote :

ok, i'll join to this bug... i can say that i have also problem with the a2dp profile in jaunty...
the first ghing is that i must connect to myh a2dp device manually (this is not a problkem for me).. but.. after that for about 1 horu of listening music... the next songs are played.. slowly... i mean.. the sound is like an old vinyl disc... (the black one).. you know what i mean?...
well it occurs more offen while lonhger i'm listening through the a2dp device.. if i reboot the ubuntu (reloading alsa doesn't help)... everything is fine for.. about an hour...

volkris (volkris) wrote :

Offhand, I'd say it sounds like a different bug. My problem is in karmic, which uses the native bluetooth, your is in Jaunty, which probably uses alsa; my problem is immediate, yours takes an hour; my problem is skips, yours is slowness.

Do you see messages in syslog about skipping bytes?

I'm using A2DP with Bluez through Pulseaudio like this:

I've got blueman from the daily-ppa for karmic, with the pulseaudio plugin activated and it works well!
Dunno whether it's because of my pulseaudio configurations but I just had to disable 2 of 3 profiles at pavucontrol - I think pa was connected to more than 1 profile on my headset, that why I had no sound before :)

give it a try - it works ( for me ;) )

volkris (volkris) wrote :

Interesting!

I was able to get the thing to work by doing something like connecting through PA's autodiscover, then disconnecting through blueman, then reconnecting through blueman's "Connect A2DP" command.

I'll have to repeat this process in the future to figure out exactly which steps make it work, but for the moment I'm not going to touch it.

Kzin (wmkzin) wrote :

Question; do you also have a bluetooth mouse/keyboard or any other bluetooth devices you use at the same time as the headset?

Kzin (wmkzin) wrote :

Chris Carlin;
Could you direct me to the software/command line arguments you used to do this?

volkris (volkris) wrote :

I used to use a bluetooth mouse; A2DP would skip the same regardless of whether I was using the mouse. As a previous commenter said, I believe it had something to do withbluez or pulseaudio getting confused when A2DP and headset profiles were both available.

blueman is available through the normal repository. sudo apt-get install blueman

Kzin (wmkzin) wrote :

Fantastic, thanks.
By PA's autodiscover, are you just referring to the system>preferences>sound?

I have been doing a lot of digging on this one and it would seem that there is some problem with PA and the kernel. These links all seem to be related to this issue;
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/406702
http://<email address hidden>/msg02783.html

What do you think?

If that's truly the issue, you can try adding the audio group with rt
privileges to /etc/security/limits.conf.

PA's autodiscover is a feature where when the computer's bluetooth connects to an audio device, PA will automatically connect to the device as well. Without autodiscover the user had to manually tell PA that the device was there. It's all behind the scenes stuff not related to preferences>sound

I suspect that bluetooth is reporting headphones that can do both A2DP and headset modes, and PA autodiscovery is trying to configure for both at once, leading to this issue. Through blueman we can connect only A2DP, so autodiscovery only sees A2DP and the confusion is bypassed. That's my theory, at least.

The realtime (rtkit) stuff may be a problem, but it's not causing this problem. In fact, the pulseaudio people I've talked to are baffled that these "skipping bytes" messages are showing up even with PA isn't supposed to be sending bytes in the first place.

Kzin (wmkzin) wrote :

Ok my issue may be different than yours I suppose.
Using blueman fixes it so/so, I can disable the headset profile and have A2DP running. And it smooths out if I don't use the mouse long enough for it to enter sleep mode. I note that the ul/dl counters on blueman are at 27.5 kb/s up and 428 b/s down while listening to A2DP audio. The moment I wiggle the mouse or click any buttons the upstream drops to 2 then raises to about 12 kb/s and downstream 1.4 b/s.
At this point I am willing to take the pulseaudio dev's suggestion that perhaps I have a crappy dongle... I am using the Logitech Bluetooth 2.0 EDR dongle that came with the MX5000 Keyboard/Mouse combo.
Still it is kind of odd that the bitrate drops like mad when I use the mouse.
I suppose I could test this theory by using the headset with this dongle & mouse combo in (ugh) Wintendos and see if I get the same behaviour.

Thanks for taking the time to reply, Chris.

Kzin (wmkzin) wrote :

Just an update,
Updated the firmware on my Dongle. That did not resolve the issue. If I turn off the mouse and wait for a while, works fine. Using USB wired mouse instead doesn't interrupt playback.
Will update you on how this works in Windtendos when I get a chance. I may just go for 2 separate dongles at once. Wonder if that can be done?

volkris (volkris) wrote :

My issue was really defined by looking at the logs and seeing those messages about skipping bytes. If you don't see those messages, then I think it is a different matter.

One last thing you might try is using blueman to disconnect all audio connections to your headphones before adding A2DP back. I believe one time it was not enough to simply disconnect the headset profile; it had to start with a blank slate. Pause for a few seconds before adding A2DP back to make sure PA autodetection has time to notice the change.

Anyway, message me separately from this bug and I can try to give you some pointers about getting the mouse and headphones working. I don't want to dilute this bug with issues not related to the actual bug.

Kzin (wmkzin) wrote :

>My issue was really defined by looking at the logs and seeing those messages about skipping
>bytes. If you don't see those messages, then I think it is a different matter.

Yes, I have these messages. Was just trying to collate everything I found that seemed to be related to the issue.

Kzin (wmkzin) wrote :

Update;
I noticed updates to pulseaudio and bluetooth packages, problem persists after update.

omriasta (omri) wrote :

Kzin, Have the same issue as you. Working with EEEPC 1002HA internal bluetooth, Microsoft 5000 mouse and Motorola S9-HD headset. A2DP works great if I don't use the mouse, the second I wiggle the mouse, audio starts skipping, get the same messages about skipping in the syslog. Have Dual Boot and the issue does not exist in Windows XP (it's not a bad BT dongle or hardware/distance related). Any suggestions?

Kzin (wmkzin) wrote :

I have 2 mice hooked up to my machine. One USB and one wireless bluetooth. When I am not listening to headphones or they are charging, I use the wireless mouse. When I use them I turn off the wireless BT mouse and use the wired one =/.
Not much of a workaround but it's all I can do. I have another dongle on order, hoping I can get them on 2 separate channels somehow.
I can also confirm that this issue does not affect Wintendoes.

Kzin (wmkzin) wrote :

Its like the bandwidth is going only as fast as the slowest device or something, note post #21

Kzin (wmkzin) wrote :

Ok,
So I have a separate bluetooth dongle now, as in 2 on the computer. Keep the keyboard and mouse on one, and the headphones on the other. This works smoothly.
Again, not a very elegant workaround, but in my scenario, once the devs sort out the issue I can use the new usb bluetooth dongle on another computer, so I don't really come out short in the end.

Neil Green (neil-r-green) wrote :

I am seeing this exact same problem with Karmic. I'm using a bluetooth mouse and an A2DP headset. If I turn the mouse off the audio works perfectly well. When I turn on the mouse, syslog fills up with lines like

Nov 6 13:43:00 lenny pulseaudio[2544]: module-bluetooth-device.c: Skipping 5364 us (= 944 bytes) in audio stream

and the audio is punctuated by long silences.

The mouse is a Microsoft Wireless Presenter 8000, the headset a Jabra BT620s and the bluetooth adapter is Dell Wireless 360 Bluetooth (builtin). It doesn't seem to be a hardware related issue as I use the same hardware in Vista without issue.

Luciano (luciano) wrote :

Just wanted to add my two cents worth ...

I spent most of the day trying to figure out why this was happening.

This is definitely not a PA problem. It also occurs using ALSA with the bluetooth plugin.

This is a problem at the bluetooth stack level.

As stated above, it appears that it has something to do with the fact both A2DP and hsc are enabled simultaneously. I also was able to work around it using blueman and connecting/disconnecting the different profiles. However, before that I changed some settings on the bluez daemon configuration. Otherwise the blueman trick doesn't work. I have the following settings in audio.conf:

#[General]
Enable=Source,Control,Sink
Disable=Headset,Gateway
AutoConnect=false

#[Headset]
HFP=true
MaxConnected=1

And the following link setup (from hciconfig -a) :From this should be able to work out what goes in hcid.conf
hci0: Type: USB
 BD Address: 00:90:CC:ED:35:10 ACL MTU: 310:10 SCO MTU: 64:8
 UP RUNNING PSCAN
 RX bytes:119527 acl:77 sco:0 events:16505 errors:0
 TX bytes:4916687 acl:15925 sco:0 commands:553 errors:0
 Features: 0xff 0xff 0x8f 0xfe 0x9b 0xf9 0x00 0x80
 Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
 Link policy: RSWITCH HOLD SNIFF PARK
 Link mode: SLAVE ACCEPT
 Class: 0x5a010c
 Service Classes: Networking, Capturing, Object Transfer, Telephony
 Device Class: Computer, Laptop
 HCI Ver: 1.2 (0x2) HCI Rev: 0xc5c LMP Ver: 1.2 (0x2) LMP Subver: 0xc5c
 Manufacturer: Cambridge Silicon Radio (10)
hcid.conf:

lp rswitch,hold,sniff,park;
lm accept,master;

I'm running bluez 4.58 and pulseaudio 0.9.19 on a gentoo distro.
I know this should probably be raised as a bluez issue, but this is the only place I could find the exact same issue, so I thought I would post here. Sorry!

Finally, could you let me know what headset you were using? I have a pretty old HT820 motorola...

volkris (volkris) wrote :

I'm surprised that it happened for you using the alsa bluetooth module. It worked fine for me with the alsa module, but maybe that was the previous version various libraries shipped with the previous ubuntu.

I'm using Motorola headphones a swell, S620 or something like that.

Also check out the following bug: http://pulseaudio.org/ticket/612

I get this as well on a set of headphones from Sony, model DR-BT50. Used to work in Jaunty, now doesn't work in Karmic. Get the messages in the log and so forth.

I don't currently have any other BT devices connected so there is no interference as such, but I do guess that it gets recognized as both a headset and a a2dp device, as it is both.

I see that there are some workarounds involving setting configurations and then using extra programs - is there any way to simply set this once and for all, such as disabling the non-a2dp part?

xby (xby) wrote :

Hello,

I had the exact same problem and I found this in the bluez wiki :
You may get choppiness with a2dp. An hcid.conf with "lm accept,master;" and "lp hold,sniff,park;" will be more robust. For BlueZ 4.x, which has no hcid.conf, you will have to do something like 'hciconfig hci0 lm master; hciconfig hci0 lp hold,sniff,park' after bluetoothd starts up (or write a patch ;).

So I tried
sudo hciconfig hci0 lm master; sudo hciconfig hci0 lp hold,sniff,park

And it works well ! Does it work for you as well ?

The bad part is that you have to type it in everytime you restart your computer. Any idea how to do it automatically ? I was used to init.d but I can't figure out how upstart works.

Kzin (wmkzin) wrote :

Tried the hciconfig thing, now this happens

Dec 28 09:24:53 IT pulseaudio[4094]: module-bluetooth-device.c: Skipping 61160 us (= 10788 bytes) in audio stream
Dec 28 09:24:58 IT bluetoothd[1359]: Suspend request timed out
Dec 28 09:24:58 IT bluetoothd[1359]: suspend failed
Dec 28 09:24:58 IT pulseaudio[4094]: module-bluetooth-device.c: Received error condition: Input/output error
Dec 28 09:24:58 IT bluetoothd[1359]: Transaction label doesn't match
Dec 28 09:24:58 IT bluetoothd[1359]: SUSPEND request rejected: Bad State (49)

Kzin (wmkzin) wrote :

Amendment, if I may...
hci0 turned out to be the device I added in post #29. I just removed this device and did the same for hci1. This seems to have helped the issue greatly. I no longer get the syslog spam and the horrible skipping seems to have stopped.

Thank you, xby, you are on to something.

Kzin (wmkzin) wrote :

xby,
I wrote a startup script that handles this at boot time. There is not a lot of documentation that I can find on this, aside from man. So yea I warn you this is not likely the way to run an action at boot time, more like a service. But it works for me.
I put the attached file in my /etc/init.d/ folder and gave it the +x permission.
I then ran "sudo inssrv -nf /etc/initd/bluetooth-a2dphack".
It all looked ok so then I ran without the -n "sudo inssrv -f /etc/initd/bluetooth-a2dphack"

Nothing is configurable or dynamic, hardcoded, bad bad bad. I know, but it worked for me. If someone wants to fix this properly, or tell me how, I'll listen =). Provided without warranty etc etc.

A warning, while researching on how to use insserv, some people reported that it messed up their runlevels to the point that certain services like cups wouldn't start. Not sure that this will be the case for you, but you can look into it yourself. Worked fine for me.

hth

Kzin (wmkzin) wrote :

Bah, post was full of mistakes,
inssrv should be insserv
initd should be init.d

Luciano (luciano) wrote :

Another update on my previous post about bluez configuration. It turns out that the key thing here are the settings in hcid.conf:

lp rswitch,hold,sniff,park;
lm accept,master;

and audio.conf:

AutoConnect=false;

this one to prevent both a2dp and headset profiles connecting at the same time, when you turn it on.

Note that what I had previously set in audio.conf:
#Enable=Source,Control,Sink
#Disable=Headset,Gateway

is not a good idea. The 'Disable=Headset' removes the headset profile form the available services on the headphones altogether. i.e. you can't connect to 'headset' anymore. only a2dp.

Finally, if you want to have the headset profile work with pulseaudio (for e.g. skype), you need to use blueman, and make sure the bluetooth applet is enabled (in about -> plugins). The a2dp doesn't seem to need this, but the headset profile does.

Hope that made sense ...

volkris (volkris) wrote :

I'm terribly sorry to say none of the above workarounds seems to solve this for me.

AutoConnect=false seems to do nothing at all

Disable=Headset,Gateway at least keeps the HSP from connecting, but then A2DP doesn't connect automatically either. I can connect it manually through blueman, and at least I don't have to worry about disconnecting both A2DP and HSP before reconnecting A2DP, but then I have to enable A2DP in pulse as well.

Ah well...

Daniel T Chen (crimsun) on 2010-03-06
Changed in pulseaudio (Ubuntu):
status: New → Invalid
volkris (volkris) on 2010-03-24
Changed in pulseaudio (Ubuntu):
status: Invalid → New
Daniel T Chen (crimsun) on 2010-03-24
Changed in pulseaudio (Ubuntu):
status: New → Invalid
Daniel T Chen (crimsun) on 2010-03-24
Changed in pulseaudio (Ubuntu):
status: Invalid → Incomplete
papukaija (papukaija) on 2010-08-10
summary: - a2dp skips terribly in Karmic
+ a2dp skips terribly
tags: added: karmic lucid
loko (arph) on 2011-02-19
Changed in pulseaudio (Ubuntu):
status: Incomplete → Confirmed
status: Confirmed → Incomplete
Changed in bluez (Ubuntu):
status: New → Confirmed
amias (amias) on 2011-10-31
tags: added: maverick natty oneiric
isden (isden) on 2012-04-15
tags: added: precise
dino99 (9d9) on 2013-05-04
tags: removed: karmic lucid maverick natty oneiric
Lorant Nemeth (loci) on 2013-05-10
Changed in pulseaudio (Ubuntu):
status: Incomplete → New
status: New → Confirmed
tags: added: raring
Changed in pulseaudio:
status: New → Unknown
Changed in pulseaudio:
importance: Unknown → Medium
status: Unknown → Confirmed
89 comments hidden view all 169 comments

I have occasionally seen this too, in kubuntu 17.04. What is weird is that it happens only sometimes, and I cannot recognize what triggers the issue. Last time it went away with a reboot.

Changed in bluez (Ubuntu):
importance: Undecided → High
Changed in pulseaudio (Ubuntu):
importance: Undecided → High
tags: added: xenial zesty
summary: - a2dp skips terribly
+ A2DP Bluetooth audio skips terribly
tags: added: yakkety
summary: - A2DP Bluetooth audio skips terribly
+ A2DP Bluetooth audio skips terribly ["Skipping NNN us (= MMM bytes) in
+ audio stream"]
tags: added: a2dp
Changed in pulseaudio (Ubuntu):
assignee: nobody → Daniel van Vugt (vanvugt)
assignee: Daniel van Vugt (vanvugt) → nobody
GPratique (gpratiqueav) wrote :

Exact same symptoms on a Dell E6520, running linux Mint 18.2 x64, with kernel 4.10.0-35-generic.

Tested with bluetooth speakers UE Mini Boom and JBL Flip 3.

I am absolutely stunned to find out that a bug from 2009 of this magnitude is still open.

Daniel van Vugt (vanvugt) wrote :

Indeed it is understandably disappointing, but you need to also consider that many/most of us have never experienced any such skipping. And if developers in particular can't reproduce the bug then it's less likely to get fixed. That's not to say it's unimportant, but a simple matter of nobody knows what to fix or how to test a fix when the problem isn't reproducible.

JoaoH (joao-machado-family) wrote :

Four or five years ago, A2DP just worked... ever since then, not ONE device that I have tried works...tried internal/external bluetooth modules, different brands, Dell, HP, Apple, Generic nothing works. Yet on every device, I can switch to Windows and it works perfectly!

Now, I do not know whom to even contact to address this issue, is it BlueZ, Pulse Audio, Alsa, or Engelbert Humperdinck... I spent $200 for a nice pair of Sony BT Headphones, I built a custom PC to make Linux scream, and I have to plug in the headphones by wire... This issue has been documented, reported all over the internet, no one cares!

Joao

Daniel van Vugt (vanvugt) wrote :

PulseAudio is what implements most of the Bluetooth audio logic (not BlueZ, surprising I know). You can contact the developers a few different ways, documented here:

https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Community/

GPratique (gpratiqueav) wrote :

@Daniel, please understand that this is not personal, and I know this is not the right place for such a discussion, but where else ?

This problem is really annoying in 2017, 8 years after the bug was first reported, in a world where bluetooth speakers are of everyday use.

I know this bug has been reported here but also under various Linux subsystem. Googling it returns a massive amount of results each one slightly different from the other, some with workaround, including from the pulseaudio documentation (yes, I read it, tried, made things worse).

Basically this means that the root cause may not have been found yet.

Asking end users to report again and again the same bug in different ways just makes it more difficult for the developers to understand and ultimately correct.

I am fairly sure that 100 people declaring here to be affected by this bug, means that a lot more are too. Maybe only 1 user out of 10 knows how to report it. So the real amount is probably way higher.

@Daniel if you have any influence in this, please try to forward this problem to whomever is able to fix it, it would be very much appreciated.

Best regards,

Hey, let me chime in into the discussion.

First I'm terribly sorry to see that people are affected by this kind of issue.
I remember a similar one on Ubuntu Phone which we have finally tracked down to
the hardware side but were never able to fix completely.

Canonical as a company and we as a developers working on Ubuntu do actually care
about Bluetooth. Myself, Daniel and a few others formed an informal group that
meets regularly and strives to set the course for improvement. Believe me, we
would be delighted to see it working flawlessly because well... among other
reasons we also use Bluetooth devices on daily basis. However, sadly, it is not
that easy as the underlying technology itself is fairly complex and requires
both hardware, software and remote side to click in.

We are not searching for the white flag though :) this would be too easy.
Instead we plan our work in a way that we are able to take down issues and
gradually improve the overall experience. This is a step by step process where
we tackle problems one by one aiming for these that have the best chance to be
solved in order to deliver improvements with each cycle.

In this case the audio in under running, PulseAudio tries to catch up and this
is why you see skipped bytes messages. There might be multiple reasons for this
starting from PulseAudio (and it's Bluetooth modules), through bluez, system
load and such and ending on the hardware configuration itself. For example
hugely popular WiFi+BT combo chipsets are prone to such issues as Bluetooth and
WiFi have to compete for throughput.

If I were you I would start from reporting this issue to Pulse Audio developers
through their mailing list (perhaps also on bluez) and start working from there.
We do keep an eye on these so if there is something interesting coming up in the
discussions we will pick it up. We will also remember about this one and for an
upcoming bluez 5.47 testing we will include high-load tests to see if we can
even experience this issue (so far we did not) with the hardware we test with.
Does it make sense?

Hope that at some point in the near future we will learn enough about this one
so that we can fix it.

Hope this helps,
K

amoeba (amoeba) wrote :

I have exactly the same issue with Dell XPS 13 (Atheros AR3012 bluetooth adapter and AR9462 wireless adapter), Bose speaker, and the latest Linux Mint. The bluetooth is almost unusable. It's unbelievable that such a major bug is open since 2009.

GPratique (gpratiqueav) wrote :

@Konrad: thanks for taking the time to explain the situation details.

However I have to report that when switching to Windows 10, on the exact same PC (just a drive swap), Bluetooth performs flawlessly with both my speakers (JBL Flip 3 and UE Miniboom).

This suggests that it is not a hardware problem but a software one.

FYI this problem sits high on the Pulseaudio bug list, but...

Best Regards,

Daniel van Vugt (vanvugt) wrote :

> FYI this problem sits high on the Pulseaudio bug list, but...

For Ubuntu users yes this is the "hottest" bug in the pulseaudio package:

https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bugs?orderby=-heat&start=0

However, upstream have been mostly silent on this bug since January 2015:

https://bugs.freedesktop.org/show_bug.cgi?id=88827

Any solution here will likely come from upstream so if you continue to experience this bug in Ubuntu 17.10 (and soon 18.04) please comment on the above link.

Interesting. I installed 17.10 and Bluetooth worked so much better than it had with 16.04 (I had basically given up using it).
Then I re-installed to eliminate any of my changes as a contributor to a different issue and now Bluetooth stutters again.

I've commented on bug 88827, but not sure where this goes from here. Bluetooth may seem like an nice-to-have item, but I use it daily.

Can confirm. 17.10 works much better so far.

Rob Schultz <email address hidden> schrieb am Do., 2. Nov. 2017, 15:46:

> Interesting. I installed 17.10 and Bluetooth worked so much better than it
> had with 16.04 (I had basically given up using it).
> Then I re-installed to eliminate any of my changes as a contributor to a
> different issue and now Bluetooth stutters again.
>
> I've commented on bug 88827, but not sure where this goes from here.
> Bluetooth may seem like an nice-to-have item, but I use it daily.
>
> --
> You received this bug notification because you are subscribed to a
> duplicate bug report (1665579).
> https://bugs.launchpad.net/bugs/405294
>
> Title:
> A2DP Bluetooth audio skips terribly ["Skipping NNN us (= MMM bytes) in
> audio stream"]
>
> Status in PulseAudio:
> Confirmed
> Status in bluez package in Ubuntu:
> Confirmed
> Status in pulseaudio package in Ubuntu:
> Confirmed
>
> Bug description:
> As I upgraded to the Karmic alpha, bluetooth audio (via a2dp) stopped
> working properly. It was working fine in Jaunty.
>
> My headphones are detected and configured by pulse, but the audio
> skips as if it's spending half of each second paused. Music is
> buffered so that after I click stop on rhythmbox (or whatever--it
> happens with whatever player I use) the audio continues until it's
> caught up.
>
> syslog is full of the following lines:
> Jul 27 08:55:45 carlin1 pulseaudio[3218]: alsa-source.c: Increasing
> minimal latency to 1.00 ms
> Jul 27 08:55:46 carlin1 pulseaudio[3218]: module-bluetooth-device.c:
> Skipping 15128 us (= 2668 bytes) in audio stream
> Jul 27 08:55:46 carlin1 pulseaudio[3218]: module-bluetooth-device.c:
> Skipping 36586 us (= 6452 bytes) in audio stream
> Jul 27 08:55:46 carlin1 pulseaudio[3218]: module-bluetooth-device.c:
> Skipping 35593 us (= 6276 bytes) in audio stream
> Jul 27 08:55:46 carlin1 pulseaudio[3218]: module-bluetooth-device.c:
> Skipping 36597 us (= 6452 bytes) in audio stream
> Jul 27 08:55:46 carlin1 pulseaudio[3218]: module-bluetooth-device.c:
> Skipping 32601 us (= 5748 bytes) in audio stream
> Jul 27 08:55:46 carlin1 pulseaudio[3218]: module-bluetooth-device.c:
> Skipping 32589 us (= 5748 bytes) in audio stream
>
> This is with
> bluez 4.45-0ubuntu4
> pulseaudio 1:0.9.15-4ubuntu2 0
>
> pulseaudio version 1:0.9.16~test2-0ubuntu1~ppa3 from ubuntu-audio-dev
> didn't help.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/pulseaudio/+bug/405294/+subscriptions
>

Sergio Arboleda (sergiogeek7) wrote :

same problem here, ubuntu 16.04. it is unbelievable that this bug is being ignored. I suppose install Ubuntu LTS version because of the support but this bug was reported since 8 years and not even assigned.

Sergio Arboleda (sergiogeek7) wrote :

this talks really bad about Ubuntu support and lets you think if is it worthy continue wasting time in a S.O that it's maintainers do not care about its bugs.

JoaoH (joao-machado-family) wrote :

If it's any consolation, I mean I know this is an Ubuntu forum, but my Manjaro system finally works with Bluetooth A2DP, no skipping and no delay!

A few weeks ago some major updates were pushed and seems to be working ever since.

Granted, the BT headphones connect as HSP and the default BT tools will not switch it to A2DP, but that is where you download "BLUEMAN" and just run through the setup for the particular device as Audio Sink. Once it is connected, it is working and has been working for two weeks.

DELL XPS14 Core i7 with Atheros Wi-FI and BT card running Manjaro Cinnamon Desktop 64bit.

Tim Werner (tim.werner) wrote :

I have this same exact issue for two years and was never able to use bluetooth audio with multiple headset devices on different pulseaudio devices.
<email address hidden>

nsklaus (nsklaus) wrote :

i'm using ubuntu 17.10 (single boot) on a macbookpro early 2015 (12,1 model).
i have the apple airpods. they work fantastic with my android phone.

on linux though, it's another story. "it works" but the result is awful. useless.
first, there's lot of time it is not able to connect. it fails. then i retry 5, 6 times and then it connects. when it works: audio is skipping, making long pauses, choppy sound most of the time. and i must stay close to the laptop or signal is lost.

- using bluetooth headset on osx and android (both unixes) is a really good experience. they both perform really well.

- using bluetooth headset on linux with pulseaudio is a terrible experience.

Danica Khan (danica.khan) wrote :

Ubuntu 17.10. Stuttering and lagging sound makes games unplayable for me. I hope this can get fixed after 9 years.

Best Regards

~ Danica Khan (<email address hidden>)

Daniel van Vugt (vanvugt) wrote :

Hi all,

If you would like to see fixes for issues like this in PulseAudio then we suggest you talk to the PulseAudio people directly. You can do that either by logging your own upstream bug or join the conversation here: https://bugs.freedesktop.org/show_bug.cgi?id=88827

Daniel van Vugt (vanvugt) wrote :

On second thoughts... it's been suggested today that this problem can be caused by some wifi drivers disabling Bluetooth/Wifi coexistence by default. When this happens and you're connected to a 2.4GHz wifi network you wifi signal may drown out the Bluetooth.

So I wonder; can people who experience this problem please let us know what model wifi/bluetooth chips you have? You can probably get that information by running "lspci -k" and maybe from "lsusb".

PeterPall (peterpall) wrote :

A workaround that works on my system can be found at: https://bugs.launchpad.net/ubuntu/+source/bluez/+bug/1746164

PeterPall (peterpall) wrote :

Added "Linux" as affected package since the problem is caused by a kernel default, not by a bug in bluez, see Bug 1746164.

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in linux (Ubuntu):
status: New → Confirmed
PeterPall (peterpall) wrote :

Since the history of Bug 1746164 isn't visible here I'm adding the short form here, too:

By default BT audio works fine on Ubuntu - if there is no WiFi active: Both work on the same frequency range, 2 WiFi channel is about 20 Bluetooth Channels wide and every time a WiFi package is sent bluetooth risks a packet loss.

We should ship things in a way that they work out-of-the-box => I am all for providing this file with Ubuntu, possibly with Bluez.

In the case of my laptop btcoex_enable=1 would already do the trick.

Technical background:
 - https://wireless.wiki.kernel.org/en/users/drivers/ath9k/btcoex
 - https://wiki.freebsd.org/dev/ath_hal(4)/AntennaDiversity

Until the kernel default is updated Creating a file named /etc/modprobe.d/bluetooth-audio.conf with the following content:

options ath9k btcoex_enable=1 bt_ant_diversity=1

should do the trick.

Jakub Paś (jakubpas) wrote :

Still a problem with Sony WH-1000xm2 headsed.

Feb 10 02:33:17 localhost pulseaudio[3304]: [bluetooth] module-bluetooth-device.c: Skipping 218182 us (= 38484 bytes) in audio stream
Feb 10 02:33:17 localhost pulseaudio[3304]: [bluetooth] module-bluetooth-device.c: Skipping 343085 us (= 60520 bytes) in audio stream
Feb 10 02:33:18 localhost pulseaudio[3304]: [bluetooth] module-bluetooth-device.c: Skipping 218071 us (= 38464 bytes) in audio stream
Feb 10 02:33:18 localhost pulseaudio[3304]: [bluetooth] module-bluetooth-device.c: Skipping 343087 us (= 60520 bytes) in audio stream
Feb 10 02:33:20 localhost pulseaudio[3304]: [bluetooth] module-bluetooth-device.c: Skipping 1718049 us (= 303060 bytes) in audio stream
Feb 10 02:33:20 localhost pulseaudio[3304]: [bluetooth] module-bluetooth-device.c: Skipping 342982 us (= 60500 bytes) in audio stream
Feb 10 02:33:20 localhost pulseaudio[3304]: [bluetooth] module-bluetooth-device.c: Skipping 282044 us (= 49752 bytes) in audio stream
Feb 10 02:33:49 localhost pulseaudio[3304]: [bluetooth] module-bluetooth-device.c: Skipping 10705 us (= 1888 bytes) in audio stream
Feb 10 02:34:11 localhost pulseaudio[3304]: [bluetooth] module-bluetooth-device.c: Skipping 31721 us (= 5592 bytes) in audio stream
Feb 10 02:34:11 localhost pulseaudio[3304]: [bluetooth] module-bluetooth-device.c: Skipping 205154 us (= 36188 bytes) in audio stream
Feb 10 02:34:11 localhost pulseaudio[3304]: [bluetooth] module-bluetooth-device.c: Skipping 37079 us (= 6540 bytes) in audio stream
Feb 10 02:34:11 localhost pulseaudio[3304]: [bluetooth] module-bluetooth-device.c: Skipping 7092 us (= 1248 bytes) in audio stream
Feb 10 02:34:11 localhost pulseaudio[3304]: [bluetooth] module-bluetooth-device.c: Skipping 37116 us (= 6544 bytes) in audio stream

amoeba (amoeba) wrote :

The fix suggested by @PeterPall above solved the problem for me!! AMAZING. Thank you so much.

-------- (fix copied from above) ------
Create a file named /etc/modprobe.d/bluetooth-audio.conf with the following content:

options ath9k btcoex_enable=1 bt_ant_diversity=1
---------------------------------------

Daniel van Vugt (vanvugt) wrote :

Please note most users won't have an ath9k chip, so that bug won't be relevant to them.

If you _do_ have an ath9k chip (see your 'lsmod' or 'lspci -k') then yeah bug 1746164 is probably the answer.

Everyone else, please reply to my question in comment #149.

Saleh (salehbozeed) wrote :
Download full text (3.8 KiB)

@Daniel van Vugt (vanvugt), here's my output!

$ lspci -k
00:00.0 Host bridge: Intel Corporation 3rd Gen Core processor DRAM Controller (rev 09)
 Subsystem: Toshiba America Info Systems 3rd Gen Core processor DRAM Controller
 Kernel driver in use: ivb_uncore
00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09)
 Subsystem: Toshiba America Info Systems 3rd Gen Core processor Graphics Controller
 Kernel driver in use: i915
 Kernel modules: i915
00:14.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller (rev 04)
 Subsystem: Toshiba America Info Systems 7 Series/C210 Series Chipset Family USB xHCI Host Controller
 Kernel driver in use: xhci_hcd
00:16.0 Communication controller: Intel Corporation 7 Series/C210 Series Chipset Family MEI Controller #1 (rev 04)
 Subsystem: Toshiba America Info Systems 7 Series/C210 Series Chipset Family MEI Controller
 Kernel driver in use: mei_me
 Kernel modules: mei_me
00:1a.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2 (rev 04)
 Subsystem: Toshiba America Info Systems 7 Series/C210 Series Chipset Family USB Enhanced Host Controller
 Kernel driver in use: ehci-pci
00:1b.0 Audio device: Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller (rev 04)
 Subsystem: Toshiba America Info Systems 7 Series/C210 Series Chipset Family High Definition Audio Controller
 Kernel driver in use: snd_hda_intel
 Kernel modules: snd_hda_intel
00:1c.0 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 1 (rev c4)
 Kernel driver in use: pcieport
 Kernel modules: shpchp
00:1c.1 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 2 (rev c4)
 Kernel driver in use: pcieport
 Kernel modules: shpchp
00:1c.2 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 3 (rev c4)
 Kernel driver in use: pcieport
 Kernel modules: shpchp
00:1c.3 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 4 (rev c4)
 Kernel driver in use: pcieport
 Kernel modules: shpchp
00:1d.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1 (rev 04)
 Subsystem: Toshiba America Info Systems 7 Series/C210 Series Chipset Family USB Enhanced Host Controller
 Kernel driver in use: ehci-pci
00:1f.0 ISA bridge: Intel Corporation HM76 Express Chipset LPC Controller (rev 04)
 Subsystem: Toshiba America Info Systems HM76 Express Chipset LPC Controller
 Kernel driver in use: lpc_ich
 Kernel modules: lpc_ich
00:1f.2 SATA controller: Intel Corporation 7 Series Chipset Family 6-port SATA Controller [AHCI mode] (rev 04)
 Subsystem: Toshiba America Info Systems 7 Series Chipset Family 6-port SATA Controller [AHCI mode]
 Kernel driver in use: ahci
 Kernel modules: ahci
00:1f.3 SMBus: Intel Corporation 7 Series/C210 Series Chipset Family SMBus Controller (rev 04)
 Subsystem: Toshiba America Info Systems 7 Series/C210 Series Chipset Family SMBus Controller
 Kernel modules: i2c_i801
02:00.0 Unassigned class [ff00]: Realtek ...

Read more...

Daniel van Vugt (vanvugt) wrote :

Saleh:

Thanks. Your system appears to be using:

03:00.0 Network controller: Broadcom Corporation BCM43142 802.11b/g/n (rev 01)
 Subsystem: XAVi Technologies Corp. BCM43142 802.11b/g/n
 Kernel driver in use: wl
 Kernel modules: bcma, wl

Please try uninstalling package 'bcmwl-kernel-source', reboot, and assuming your wifi+bluetooth still works, please retest bluetooth audio performance and repeat 'lspci -k'.

---------

EVERYONE ELSE STILL AFFECTED BY THIS BUG:

Please try disabling your wifi, and then assuming bluetooth still works, tell us if the problem persists with wifi disabled. Please also provide output from 'lspci -k' and 'lsusb' on your machine.

Changed in bluez (Ubuntu):
status: Confirmed → Incomplete
Changed in linux (Ubuntu):
status: Confirmed → Incomplete
Changed in pulseaudio (Ubuntu):
status: Confirmed → Incomplete
Saleh (salehbozeed) wrote :
Download full text (3.8 KiB)

I uninstalled 'bcmwl-kernel-source', and wifi stopped working after rebooting!

$ lspci -k
00:00.0 Host bridge: Intel Corporation 3rd Gen Core processor DRAM Controller (rev 09)
 Subsystem: Toshiba America Info Systems 3rd Gen Core processor DRAM Controller
 Kernel driver in use: ivb_uncore
00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09)
 Subsystem: Toshiba America Info Systems 3rd Gen Core processor Graphics Controller
 Kernel driver in use: i915
 Kernel modules: i915
00:14.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller (rev 04)
 Subsystem: Toshiba America Info Systems 7 Series/C210 Series Chipset Family USB xHCI Host Controller
 Kernel driver in use: xhci_hcd
00:16.0 Communication controller: Intel Corporation 7 Series/C210 Series Chipset Family MEI Controller #1 (rev 04)
 Subsystem: Toshiba America Info Systems 7 Series/C210 Series Chipset Family MEI Controller
 Kernel driver in use: mei_me
 Kernel modules: mei_me
00:1a.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2 (rev 04)
 Subsystem: Toshiba America Info Systems 7 Series/C210 Series Chipset Family USB Enhanced Host Controller
 Kernel driver in use: ehci-pci
00:1b.0 Audio device: Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller (rev 04)
 Subsystem: Toshiba America Info Systems 7 Series/C210 Series Chipset Family High Definition Audio Controller
 Kernel driver in use: snd_hda_intel
 Kernel modules: snd_hda_intel
00:1c.0 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 1 (rev c4)
 Kernel driver in use: pcieport
 Kernel modules: shpchp
00:1c.1 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 2 (rev c4)
 Kernel driver in use: pcieport
 Kernel modules: shpchp
00:1c.2 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 3 (rev c4)
 Kernel driver in use: pcieport
 Kernel modules: shpchp
00:1c.3 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 4 (rev c4)
 Kernel driver in use: pcieport
 Kernel modules: shpchp
00:1d.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1 (rev 04)
 Subsystem: Toshiba America Info Systems 7 Series/C210 Series Chipset Family USB Enhanced Host Controller
 Kernel driver in use: ehci-pci
00:1f.0 ISA bridge: Intel Corporation HM76 Express Chipset LPC Controller (rev 04)
 Subsystem: Toshiba America Info Systems HM76 Express Chipset LPC Controller
 Kernel driver in use: lpc_ich
 Kernel modules: lpc_ich
00:1f.2 SATA controller: Intel Corporation 7 Series Chipset Family 6-port SATA Controller [AHCI mode] (rev 04)
 Subsystem: Toshiba America Info Systems 7 Series Chipset Family 6-port SATA Controller [AHCI mode]
 Kernel driver in use: ahci
 Kernel modules: ahci
00:1f.3 SMBus: Intel Corporation 7 Series/C210 Series Chipset Family SMBus Controller (rev 04)
 Subsystem: Toshiba America Info Systems 7 Series/C210 Series Chipset Family SMBus Controller
 Kernel modules: i2c_i801
02:00.0...

Read more...

Daniel van Vugt (vanvugt) wrote :

OK, wifi doesn't work so it's a temporary test. Please still test bluetooth audio while wifi is gone. Is this bug fixed for you?

Saleh (salehbozeed) wrote :

Bluetooth works fine when wifi is disabled!

Daniel van Vugt (vanvugt) wrote :

Thanks Saleh. That means your problem is a bug in the bcmwl driver. bcmwl seems to not implement bluetooth coexistence at all, so its own wifi signal might be destroying its bluetooth quality. In fact I just found someone else has already logged a bug for you...

EVERYONE:

Please find out your wifi/bluetooth kernel driver names using the 'lspci -k' command. Then:

* Users of driver 'wl' from package 'bcmwl-kernel-source' such as Saleh, please subscribe to bug 1518408 instead of this one.

* Users of driver 'ath9k' please subscribe to bug 1746164 instead of this one.

* Users of all other drivers, please log your own new bugs using command:
    ubuntu-bug pulseaudio
or ubuntu-bug bluez
and also attach output of 'lspci -k' to your new bug.

I am closing this bug since it's become an unresolvable mess. We will resolve your individual issues as separate bugs.

Changed in bluez (Ubuntu):
status: Incomplete → Invalid
Changed in linux (Ubuntu):
status: Incomplete → Invalid
Changed in pulseaudio (Ubuntu):
status: Incomplete → Invalid
Daniel van Vugt (vanvugt) wrote :

Saleh, please also mention which version of Ubuntu you are using.

tags: added: a2dp-skip
Evgeniy Polyakov (ioremap) wrote :

Hi

I have this problem both on 16.04 and 17.10, and it is NOT related to wifi, since on my 16.04 desktop there is no wifi module at all. I tried installing 5.49 blues on 16.04 host, it does not seem to help, but I can not be 100% sure since I did not check whether exact new bt service was operating.

17.10 contrary is macbook laptop with BCM4360 adapter and wl driver, but disabling wifi and removing the module does not help.

Rebooting 17.10 with new audio.conf/hcid.conf and using blueman to pair seems to help, but that can be a coincidence.

What steps you want me to make to provide more debug information?

Daniel van Vugt (vanvugt) wrote :

Please log a new bug using this command so that we may examine your system in detail:

  ubuntu-bug bluez

Evgeniy Polyakov (ioremap) wrote :

@vanvugt I've compiled and installed the latest pulseaudio with and without ubuntu patches, and this does not help. Checked with fedora live cd and things work without any problems.
Changing @audio group to have rt permissions as well as tuning pulseaudio in its config (setting nice, rtprio, large memory limits and so on) does not seem to change anything.

Getting, that I currently have the pre-latest (5.48-0ubuntu3) bluez and pulseaudio, and problem persists, can it be related to something else?

desktop is problem in this case is a little bit different, it does not skip terribly, but once per 2-5 seconds, while laptop mentioned yesterday is indeed in trouble.

ubuntu-bug refuses to work if there is third-party software installed.

JoaoH (joao-machado-family) wrote :

@Evgeniy Polyakov

Live CD/USB almost always work perfectly, that is not a confirmation that the issue does not exist. It is not a Distro problem per say. If you installed Fedora, the second time you tried to use the audio device, it would fail/skip etc. I do not know why, but I have been fooled many times by a "working" live CD/USB only to find out that once installed, it does not.

Evgeniy Polyakov (ioremap) wrote :

This patch seems to fix the issue, at least on one of yet another my system (fedora for that matter) with rather rare skips

https://bugs.freedesktop.org/show_bug.cgi?id=58746#c27

Daniel van Vugt (vanvugt) wrote :

Thanks for the link!

I feel it is now appropriate to reopen this bug to see through the release of the patch for:
  https://bugs.freedesktop.org/show_bug.cgi?id=58746

But also still;

* Users of wifi driver 'wl' from package 'bcmwl-kernel-source' such as Saleh, please subscribe to bug 1518408.

* Users of wifi driver 'ath9k' please subscribe to bug 1746164.

Changed in pulseaudio:
importance: Medium → Unknown
status: Confirmed → Unknown
Changed in pulseaudio (Ubuntu):
status: Invalid → Triaged
no longer affects: bluez (Ubuntu)
no longer affects: linux (Ubuntu)
Changed in pulseaudio:
importance: Unknown → Medium
status: Unknown → Confirmed
Changed in pulseaudio:
status: Confirmed → Fix Released
Displaying first 40 and last 40 comments. View all 169 comments or add a comment.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.