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

Bug #405294 reported by volkris
614
This bug affects 128 people
Affects Status Importance Assigned to Milestone
PulseAudio
Fix Released
Medium
pulseaudio (Ubuntu)
Fix Released
High
Alberto Milone
Nominated for Xenial by Daniel van Vugt
Bionic
Fix Released
High
Alberto Milone

Bug Description

SRU Request:

[Impact]
When the connection drops temporarily, using A2DP, a noticeable latency is introduced, and the audio goes out of sync.

[Test Case]
1) Enable the -proposed repository, and install the new pulseaudio

2) Restart your computer, connect it to a bluetooth device (e.g. a headset or a speaker), play one or more videos either locally or online, and see if you can still reproduce the problem.

[Regression Potential]
Low, as the changes are upstream, and, if anything, it should also fix a memory leak.

Furthermore, the changes only affect the bluez5-device module, in pulseaudio, and they make the buffer updating logic more conscious of how things can change when the connection drops. This is unlikely to affect anything else in pulseaudio.

____________________________________________________________________
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.

Revision history for this message
volkris (volkris) wrote :

Adding the work done in pulseaudio's bugtracker

Changed in pulseaudio:
importance: Undecided → Unknown
status: New → Unknown
Revision history for this message
Daniel T Chen (crimsun) wrote : Re: [Bug 405294] Re: a2dp skips terribly in Karmic

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
Revision history for this message
volkris (volkris) wrote : Re: a2dp skips terribly in Karmic

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

Revision history for this message
Daniel T Chen (crimsun) wrote : Re: [Bug 405294] Re: a2dp skips terribly in Karmic

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.

Revision history for this message
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.

Revision history for this message
volkris (volkris) wrote : Re: a2dp skips terribly in Karmic

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

Could this be related to the lack of rtkit?

Revision history for this message
Daniel T Chen (crimsun) wrote : Re: [Bug 405294] Re: a2dp skips terribly in Karmic

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.

Revision history for this message
volkris (volkris) wrote : Re: a2dp skips terribly in Karmic

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

Revision history for this message
Daniel T Chen (crimsun) wrote : Re: [Bug 405294] Re: a2dp skips terribly in Karmic

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?

Revision history for this message
volkris (volkris) wrote : Re: a2dp skips terribly in Karmic

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.

Revision history for this message
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...

Revision history for this message
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?

Revision history for this message
Thomas Karl Pietrowski (thopiekar) wrote :

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 ;) )

Revision history for this message
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.

Revision history for this message
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?

Revision history for this message
Kzin (wmkzin) wrote :

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

Revision history for this message
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

Revision history for this message
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?

Revision history for this message
Daniel T Chen (crimsun) wrote : Re: [Bug 405294] Re: a2dp skips terribly in Karmic

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

Revision history for this message
volkris (volkris) wrote : Re: a2dp skips terribly in Karmic

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.

Revision history for this message
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.

Revision history for this message
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?

Revision history for this message
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.

Revision history for this message
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.

Revision history for this message
Kzin (wmkzin) wrote :

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

Revision history for this message
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?

Revision history for this message
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.

Revision history for this message
Kzin (wmkzin) wrote :

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

Revision history for this message
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.

Revision history for this message
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.

Revision history for this message
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...

Revision history for this message
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

Revision history for this message
Kristoffer Lundén (kristoffer-lunden) wrote :

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?

Revision history for this message
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.

Revision history for this message
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)

Revision history for this message
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.

Revision history for this message
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

Revision history for this message
Kzin (wmkzin) wrote :

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

Revision history for this message
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 ...

Revision history for this message
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...

Revision history for this message
Kzin (wmkzin) wrote :

Did you try the sudo hciconfig hci0 lm master; sudo hciconfig hci0 lp hold,sniff,park?

Revision history for this message
Sandeep Bansal (sandeep-bansal85) wrote :

the same thing kept happening to do. I put in a whole day trying to different things. The hciconfig thing seems to fix the problem. I will wait and report if there are still any issues.

Revision history for this message
volkris (volkris) wrote :

Yes, I tried lm master and lp hold,sniff,park. Actually I wouldn't really have expected it to help anyway since, as I understand them, those options wouldn't do anything related to the symptoms I've reported here.

I thought the AutoConnect option might work to keep HSP from automatically connecting at the same time as A2DP, but no.

In the end, though, all of those were workarounds in my mind. Something in the stack is getting confused with two channels open at once.

Revision history for this message
Max Power (mpitke) wrote :

Just wanted to add my feedback - the hciconfig solution resolves the skipping issue on my system too. I am now able to simultaneously use a BT keyboard and headphones (in a2dp mode) simultaneously without issue. I'm using an Apple wireless kb, Motorola S805 headphones and a Broadcom-based BT dongle. I'm running kernel 2.6.31-19.
Kernel messages about skipping also seem to have stopped.

Revision history for this message
Paul Illes (illespal) wrote :

I just wanted to add my experience with this.
While I can get my Sony bluetooth headset dr-bt21g to play music with pulse-audio or simply bluetooth plugin of alsa, it's far from a perfect experience. It plays okay on a 2.1 profile bluetooth notebook, skips more frequently with a 2.0 profile notebook. Also the pitch can change with the quality of the signal, it plays on a higher than a lower pitch, changing by the second or ten second. I don't even have to move the device.

Meanwhile under Windows with the broadcomm drivers it's extremely hard to get any skip, and pitch doesn't change at all. So I concluded that the bluez stack and kernel drivers are just not good enough yet, i guess mostly for prioritizing lost packets resend. I will try to contact the bluez devs later.

Anyone with a solidly working headset and extra settings that we don't already know of from this thread?

(The worst thing is that having an android phone HTC hero which uses bluez, I can experience a rather similar issue, but it's far less serious, small skips and occasional slight pitch change.)

Revision history for this message
Paul Illes (illespal) wrote :

using bluez 4.60, pulse audio 0.9.21, alsa 1.0.22 and kernel 2.6.32

Revision history for this message
Paul Illes (illespal) wrote :

oh, i must check this ASAP:

"Release of bluez-4.61

This release fixes a couple of bugs within A2DP and Headset/Handsfree support.
"
http://www.bluez.org/bluez-461/

Anyone tested this?

Revision history for this message
volkris (volkris) wrote :

It sounds like you guys are reporting a few different bugs that, while they have some overlapping symptoms, are probably caused by different defects and require different fixes.

While it's always great to have people submitting bugs instead of just grumbling their way through problems, there's the risk that some of the bugs will be lost in the noise.

The initial bug that this was about shows "skipping bytes" messages in the logs and seems to be fixed by making sure the headphones are only connected through A2DP profile, without HSP in addition. If that doesn't sound like your bug, you should probably make sure there IS a bug similar to yours.

Revision history for this message
Paul Illes (illespal) wrote :

Chris, i think these may be with different cause , but I do have those logs when it skips:

Feb 16 10:51:27 xnote pulseaudio[2386]: module-bluetooth-device.c: Skipping 9676 us (= 1704 bytes) in audio stream
Feb 16 10:51:27 xnote pulseaudio[2386]: module-bluetooth-device.c: Skipping 4718 us (= 832 bytes) in audio stream
Feb 16 10:51:27 xnote pulseaudio[2386]: module-bluetooth-device.c: Skipping 4693 us (= 824 bytes) in audio stream
Feb 16 10:51:27 xnote pulseaudio[2386]: module-bluetooth-device.c: Skipping 9669 us (= 1704 bytes) in audio stream

And i have Headset disabled in audio config (in blueman its not present because of that so it cannot be connected). Also tried different lc / lm settings mentioned here.

Revision history for this message
David Reitz (dreitz) wrote :

For those of you that aren't running into the bug that is discussed above, I found today that these symptoms can also be caused by a weak signal. I moved my bluetooth dongle MUCH closer to my headset and I no longer get skips/dropouts. I also tried a newer 2.0 compliant dongle that a friend had and it seemed to provide a much more robust signal as well. Two tips for those of you who arrived here using a google search...

Daniel T Chen (crimsun)
Changed in pulseaudio (Ubuntu):
status: New → Invalid
Revision history for this message
volkris (volkris) wrote :

Why invalid?

Revision history for this message
Baptiste Mille-Mathias (bmillemathias) wrote :

because the problem is not in code but rather in the adapter which can't be fixed.

Revision history for this message
Paul Illes (illespal) wrote :

That's untrue, IMHO. To be honest, bluez is rather crappy in itself regardig Hi-Def audio transmission to bluetooth. This is the same issue that I have with my Android phone (uses bluez!), it can skip and changes pitch. Meanwhile, Mac (iPhone too) and Windows has no major problem with audio transmission to the headphones. I guess it wont be fixed soon, as there was reply to my question neither on bluez newsletter nor on IRC. Anyways, i will wait for a miracle, that in some years might happen. Until then, linux hi-def bluetooth audio is a dream.

Revision history for this message
Paul Illes (illespal) wrote :

sorry, that was bluez mailing list not newsletter :)

Revision history for this message
volkris (volkris) wrote :

I'm sorry, Baptiste, you're completely wrong.

The adapter doesn't show this problem under Windows, and it doesn't show the problem under previous versions of bluez.

The adapter works. It's a code issue.

Reopening.

Changed in pulseaudio (Ubuntu):
status: Invalid → New
Daniel T Chen (crimsun)
Changed in pulseaudio (Ubuntu):
status: New → Invalid
Revision history for this message
volkris (volkris) wrote :

Daniel, what's the reason for the invalid?

I tried your suggestions, but the bug remains.

It's not the adapter since the adapter works fine in other operating systems.

Even the bluez guys see this as a legitimate bug. When I discussed it with them on IRC they saw it as a valid bug.

So why are you marking it as invalid?

Revision history for this message
Daniel T Chen (crimsun) wrote :

Bah, that ajax thing bites again. Anyhow, it was supposed to be the status that I just set. In other words, we don't have enough information for your particular hardware -- not everyone else marking "me too" -- to go forward. I recommend you take this to the pulseaudio-discuss mailing list, where Lennart will ask for more information as appropriate.

Changed in pulseaudio (Ubuntu):
status: Invalid → Incomplete
Revision history for this message
Paul Illes (illespal) wrote :

Imho not many people are using Bluetooth stereo headset, that's the reason for few 'me too's.

Anyway:

Me too!

It's not a pulseaudio thing. it's bluez!

Revision history for this message
Paul Illes (illespal) wrote :

Also what details are needed? Just try any BT headset with any adapter and hi-fi audio. You'll get pitch changes or skips - unpresent with a rightly written bluetooth stack/driver of other operating systems.

Revision history for this message
databubble (phil-linttell) wrote :

Under ubuntu 10.04/Lucid I'm getting the same skipping messages in syslog as the original reporter, and the same glitching of audio over A2DP. I've tried two different A2DP headsets (Motorola S9 and Jabra BT320s) in combination with two different Bluetooth dongles. I also use a Bluetooth mouse (Sony VGP-BMS33). However, turning off the mouse does not allow the music to play cleanly.

This is a regression from Jaunty where the same hardware worked.

Revision history for this message
Dominik Holler (dominik-holler) wrote :

I installed linux 2.6.34 and audio over bluetooth works again. Maybe the reason is that the PC was affected with bug #450981 using linux < 2.6.34

Revision history for this message
Paul Illes (illespal) wrote :

2.6.34 kernel and latest bluez changes nothing either. It's bluez's problem with hifi audio and mouse usage at the same time. Looks like parallel open channels are still handled badly. (I'm following bluez's git commits to the source base, i couldnt spot anything changed related to this problem, so my guess it's gonna remain like this for another year or so... :( )

Revision history for this message
Sergey N. Yatskevich (syatskevich) wrote :

I've got the same errors but with following steps:

    1. I connect my Nokia-214 to notebook and first time after connect all things run fine
    2. pause rhythmbox (and any other sound source) about half minute
    3. continue playing and I've got the same errors in /var/log/messages and discontinuous sound

After reconnecting Nokia-214 all thing work fine again.

I use Ubuntu 10.04 with all last updates installed.

Revision history for this message
Cuppa-Chino (hamcatcher) wrote :

same issue here -- sony vaio e series with broadcom bcm2070 bluetooth chipset -- streaming to a A2DP Sink (Belkin BT receiver) causes endless skips in playback with the ubiquitous pulseaudio skip messages

Revision history for this message
Cuppa-Chino (hamcatcher) wrote :

doh forgot to write the specs ubuntu 10.04 bluez ppa blueman alsa 1.0.23

Revision history for this message
Andrew Gatt (a-gatt) wrote :

I'm getting very similar problems:

Jun 26 16:45:04 andrew bluetoothd[1144]: link_key_request (sba=00:15:83:15:A3:10, dba=00:02:72:E6:FA:C8)
Jun 26 16:45:05 andrew rtkit-daemon[1518]: Sucessfully made thread 2701 of process 1516 (n/a) owned by '1000' RT at priority 5.
Jun 26 16:45:05 andrew rtkit-daemon[1518]: Supervising 4 threads of 1 processes of 1 users.
Jun 26 16:48:55 andrew pulseaudio[1516]: module-bluetooth-device.c: Skipping 141017 us (= 24872 bytes) in audio stream
Jun 26 16:48:55 andrew pulseaudio[1516]: module-bluetooth-device.c: Skipping 89716 us (= 15824 bytes) in audio stream

Ubuntu 10.04 connected with blueman. Didn't need to install anything to get the sound control panel to recognise it as an audio output.

papukaija (papukaija)
summary: - a2dp skips terribly in Karmic
+ a2dp skips terribly
tags: added: karmic lucid
Revision history for this message
Allan Branch (megamanexent7) wrote : Re: a2dp skips terribly

While many of you are streaming A2DP audio FROM your computer, I am streaming audio TO the computer ( from an iPhone 3G and looping back to my sink ) and I get the "vinyl record" effect too. Sound slows down, Skips, and stutters and even the buffered audio play back. The phone is literally right next to the dongle! I do not connect any other bluetooth device while I stream audio. IMHO this is not a PulseAudio bug, it's a BlueZ bug! PulseAudio is just making the best of a bad situation to me.

I am on Ubuntu 10.04 Lucid
BlueZ 4.69
PulseAudio 0.9.21
Kernel 2.6.32

Revision history for this message
Paul Brannan (curlypaul924) wrote :

As kzin noted in post#28, it does seem as if everything drops to the speed of the slowest device. In fact, on my samsung nc10 netbook, my download speed over wifi degrades significantly when listening to music over A2DP with my Jabra Extreme. I do not recall having this problem with my earlier model Jabra device.

Revision history for this message
Paul Brannan (curlypaul924) wrote :

Ok, I'm not positive if I'm experiencing the same bug, so please let me know if I should enter a separate report. Here's what I notice:

* Running Lucid on a Samsung NC10 netbook

* When I turn on my Jabra Extreme bluetooth headset, it connects to both A2DP and telephony HSP/HFP. I tried disabling HSP/HFP per a suggestion in another bug report, but this kept me from connecting to A2DP as well.

* After the headset is connected, I immediately start seeing messages like this in /var/log/messages:
Aug 16 21:40:35 sapphire pulseaudio[2458]: module-bluetooth-device.c: Skipping 1934197 us (= 341192 bytes) in audio stream
Aug 16 21:40:38 sapphire pulseaudio[2458]: module-bluetooth-device.c: Skipping 2395199 us (= 422512 bytes) in audio stream

* The above messages come out every 20 seconds even though no audio is playing.

* The messages continue to come out every 20 seconds in pairs 3 seconds apart until they get rate limited:
Aug 16 21:32:29 sapphire pulseaudio[2458]: ratelimit.c: 35 events suppressed

* In dmesg, I see this:
[ 445.320774] l2cap_recv_acldata: Unexpected continuation frame (len 0)

* Audio is choppy and mplayer struggles to keep the audio and video in sync

* If I try kzin's suggestion of:
$ sudo hciconfig hci0 lm master; sudo hciconfig hci0 lp hold,sniff,park
then video is much less choppy, but every 20 minutes or so I get skips. It then takes a few minutes for audio and video to sync in mplayer. This is using the -autosync option, otherwise the audio is perpetually out of sync.

* The wireless network also often (but not always) slows down. I see the following messages in /var/log/messages:
Aug 16 21:12:17 sapphire kernel: [186631.588972] ath5k phy0: unsupported jumbo

* If I turn off my bluetooth headset, wireless speed returns to normal.

* Skipping audio is exacerbated by EM interference. For example, turning on an electric heater makes the audio skip terribly. Turning off the heater does not solve the problem, but it does make it better. There may be other sources of interference in my house, but I have not yet found them.

* There is no skipping if I try to watch a movie using HSP/HFP, but the sound quality is only just bearable.

* I tried upgrading bluez to 4.0.69, but saw no improvement.

* I did not yet try upgrading pulseaudio.

* I did not yet try upgrading the kernel to see if the ath5k problem will go away (another bug report suggested that the Maverick kernel would fix this problem).

Revision history for this message
Peter Hurley (phurley) wrote :

I'm running bluez-4.71 on lucid (backported maverick kernel 2.6.35-9) and had this exact problem.

Used the suggestion in comment #34 (thanks!) - { sudo hciconfig hci0 lm master;sudo hciconfig hci0 lp hold,sniff,park }, and that eliminated the messages in the log and significantly improved the skipping. I still get some skipping but I need to checkout the rtkit setup.

I'm surprised that along the way this bug was marked invalid!

Revision history for this message
Tom Wolf (infinite-finity) wrote :

me too

I just started using my old sony a2dp headset today on Ubuntu 10.04 and noticed EXACTLY the same problems as described above. The music cuts in and out at what I think is a constant rate of every 2-3 seconds. My audio also winds down like a record player running out of juice. The problem seems correlated with bluetooth mouse use, but not caused by it.

I can go for long periods of time without noticing the problem, then it starts winding down, then it cuts in and out so quickly that I have to just stop the music.

It's just one problem after another with Ubuntu, but it is fun when you fix a problem ; )

Revision history for this message
Christian Obkircher (christian-obkircher) wrote :

me too

I just switched from Gentoo to Ubuntu Karmic. I have the same issue on both systems. My hardware is:

- MSI BToes 2.1 EDR Micro Bluetooth 2.1 USB 2.0 (bluetooth dongle)
- ARCTIC SOUND HEADSET P311

I don't have problems in Windows 7. The headset works quite well with my Android 2.1 phone, but from time to time (every minute or so) I have single tiny skips there as well.

I noticed a strange behavior: the first video/song/whatever after connecting the headset works fine. If there is no sound for some time, something in the chain (I don't know which device) goes to some kind of standby. I can hear that, since the headset is never absolutely silent, but produces a silent high-frequency noise. This noise changes after some time of missing output. Skipping starts only after this period. After disconnecting and reconnecting most of the time it works fine again.

Revision history for this message
Alesh Slovak (aslovak) wrote :

I have the same problem. I've been living with it by using the following work-around.

I first start the music/video/whatever, and then connect my bluetooth headset. Connecting when playback is in midstream seems to "fix" the problem.

As Christian Obkircher mentions, if there is no audio playing for a while (1 or 2 minutes?) or if I connect while there is no audio playing back and then start playing something, I get the skipping problem. At this point, reconnecting the headset (after playback has started) will make things work again.

loko (arph)
Changed in pulseaudio (Ubuntu):
status: Incomplete → Confirmed
status: Confirmed → Incomplete
Revision history for this message
loko (arph) wrote :

So what kind of information is needed to get this bug marked as confirmed?

If i listen 2 music with a2dp it works until i stop music for 1 or 2 minutes. After this sound is not playing / or very choppy.
I then have to reconnect to the audiosink to have a2dp working again.

I am using Ubuntu 10.10, latest updates. I also tried with Bluez Version 4.81 and 4.87. Also tried with pulseaudio: 1:0.9.22+stable-queue-24-g67d18-0ubuntu2~bitpool~maverick. All of this does not help. I see these messages; "pulseaudio[12871]: module-bluetooth-device.c: Skipping 976797 us (= 172304 bytes) in audio stream" and "pulseaudio[12871]: module-bluetooth-device.c: Bitpool reduced to 38"

Revision history for this message
loko (arph) wrote :

The symptoms occurred because I was not using a fresh install of Maverick 10.10. I upgraded from 10.04. This must have been the problem. After installing a fresh install of 10.10, the problem is gone.

Revision history for this message
Alesh Slovak (aslovak) wrote :

I just installed 11.04 Alpha 3 from scratch and the same problem (skipping, unless I connect the bluetooth headset mid-playback) is still present.

Revision history for this message
Mario Manno (manno) wrote :

My bluetooth headset worked fine with maverick. Had to use blueman from time to time to disconnect, connect to audio.
I upgraded to natty a while ago and shortIy after that the bluetooth problems startet: stuttering sound, "skipping" messages in syslog (15/s).
Connecting mid-playback does not help. There are no other bluetooth devices connected.

I just tried the same headphones on my laptop and they work. The laptop has built-in bluetooth. Trying to use the usb dongle from my desktop resulted in the same problems with the laptop, too. So I guess in my case this is usb/bluetooth related.

Revision history for this message
dmizer (dmizer) wrote :

I can confirm that connecting bluetooth headset after starting a movie or music means sound plays perfectly in Maverick.

Revision history for this message
Maverick Crank GRey (maverick-crank-grey) wrote :

I CANNOT confirm that "connecting bluetooth headset after starting a movie or music means sound plays perfectly in" 11.04.
Actually, I'm using the same Bluetooth dongle under Win7 without "stuttering sound". So, I disagree with a blame on the dongle =)

Revision history for this message
Ivan Gagis (igagis) wrote :

Confirm the same problem in Natty.
In Maverick it was working for me fine, but after upgrading to Natty it started skipping terribly, no matter when you connect the BT headset - before starting the audio playback or after.
I have Asus eee PC 1215N laptop, it has built-in bluetooth adapter. And I use Jabra Halo BT headset.

Revision history for this message
Ivan Gagis (igagis) wrote :

I also noticed that it skips only with A2DP profile. When playing through HSP/HFP it does not skip, but the sound quality is, of course, very low.

Revision history for this message
Justin (jrfoell) wrote :

I have the "skipping BT audio while using a BT mouse" problem in Natty, on two (different) Broadcom / IOGear USB bluetooth adapters. After skipping stops, the sound is obviously higher in pitch during the catch up period, and several lines of this appear in my syslog:

l2cap_recv_acldata: Unexpected continuation frame (len 0)

It would be nice if the catchup code in pulseaudio only applied to HSP/HFP profiles (separate topic, I suppose).

All my testing was done with a Logitech V470 Bluetooth Mouse and a Sony HWS-BTA2W A2DP adapter on a Dell Studio 17 laptop. I was not able to reproduce the problem on a Samsung NC10 netbook with Natty & the built-in BT.

Would it be helpful to developers if we can narrow down the hardware combinations that have easily reproducible problems? Maybe the USB subsystem comes into play more than those using on-board adapters?

Revision history for this message
Luke Yelavich (themuso) wrote : Re: [Bug 405294] Re: a2dp skips terribly

On Wed, May 18, 2011 at 08:48:01AM EST, Justin wrote:
> Would it be helpful to developers if we can narrow down the hardware
> combinations that have easily reproducible problems? Maybe the USB
> subsystem comes into play more than those using on-board adapters?

Possibly, however most if not all onboard bluetooth adapters actually connect internally via USB as well, or at least so far as I have seen.

Changed in bluez (Ubuntu):
status: New → Confirmed
Revision history for this message
Timo Karhu (nalle-karhulitos) wrote : Re: a2dp skips terribly

Skipping, and this has been on all Ubuntu version I've used and tried to listen via HWS-BTA2W A2DP adapter. Sony Vaio VGN-FW41ZJ

Revision history for this message
Ivan Gagis (igagis) wrote :

I have just tried my BT headset again and skipping has gone!
Don't know what exactly fixed the problem, maybe it is the latest kernel update.
But now it works good for me!

My current kernel is 2.6.38-11-generic installed by one of latest ubuntu updates.

Revision history for this message
Ivan Gagis (igagis) wrote :

After updating ubuntu 11.10 skipping resumed :(. Although it is not that terrible as before... But still it skips.
The kernel version now is 3.0.0-12-generic.

Revision history for this message
Alesh Slovak (aslovak) wrote :

Upgrading to Ubuntu 11.10 seems to have resolved the issue for me.

Revision history for this message
killall (killall) wrote :

same problem on ubuntu 11.10, a2dp audio skips when use the bt mouse.

The bluetooth dongle is a bcm2070, capable to use up 5 a2dp connections simultaneously.

bluez version 4.96

Revision history for this message
sanmiguel9 (againsttcpa84) wrote :

Under Ubuntu 10.10 & 11.04 I could not use my bluetooth headset due to terrible skipping problems on my Lenovo Ideapad S12 (WLAN: Broadcom Corporation BCM4312 802.11b/g LP-PHY (rev 01)).

I noticed that if I turned of the wifi card, music over bluetooth seemed to be fine, but that was not an acceptable solution.

Now I booted Ubuntu 11.10 with a Live-USB and bluetooth worked like a charm! Even after I installed the wifi drivers with the restricted driver tool (still in Live-USB session). The wifi driver used was "wl". Once I upgraded my existing system to 11.10, bluetooth was the same mess as before, however the wifi driver was still "b43" and the restricted driver tool had some problems.
I unloaded the b43 module, purged all packages related to b43, fired the restricted driver tool up again, and now it was able to install the "wl" driver.
Since then I am enjoying again the beautiful sound of my headset :-)

Btw, in my case it was crystal clear that the b43 kernel module was the trouble maker. I listened to bluetooth music (bad skipping), unload b43 (skipping stopped immediately!), load b43 again (skipping starts), and so on...
--> bad b43, bad b43

Revision history for this message
Ivan Gagis (igagis) wrote :

I have Asus 1215N and I have wl driver loaded, no b43. Still, on ubuntu 11.10 it skips.

Revision history for this message
killall (killall) wrote :

Same here, using wl driver(bcm4313-wireless and bcm2070-bt) audios still skipping.

Revision history for this message
amias (amias) wrote :

I've experienced this problem with my dell vostro 1710 which uses a usb connected Dell Computer Corp. Wireless 360 Bluetooth module connecting to a motorolla dc800 bluetooth reciever on all ubuntu distros , although recently it has got less annoying to the point where its almost usable. this works from my android htc hero and my girlfriends macbookpro with maybe 1 tiny glitch per hour at most.

i get the skip messages in my syslog as well. i tried the hciconfig lines , limits.conf tweaks , disabling headset . nothing makes it reliable :(

i'm totally upto date with ubuntu 11.10 so am runnign kernel 3 and bluez

tags: added: maverick natty oneiric
Revision history for this message
amias (amias) wrote :

if i remove my wireless module (iwl4965) the bluetooth error rate drops and there might one glitch in an hour

Revision history for this message
Ivan Gagis (igagis) wrote :

Updated to kernel 3.0.0-13-generic today. After that skipping _almost_ gone. Now it does around 1 small skip in a couple of minutes.
And this small skipping is still annoying. Because, for example, if you are watching a video on the youtube and after that small skipping glitch you have to watch the rest of the video with audio track a little bit shifted relative to the video itself.
Still need improvement. Note, that for me it was working perfectly with kernel 2.6.38-11-generic.

Revision history for this message
Oskari Jokinen (oskari-jokinen) wrote :

Having the same problem with Ubuntu 11.10,
Terrible skipping with BT audio, weird thing is that it works perfectly with the same equipment if I use it through Windows 7. I've also tested this with an other laptop with Win7 and Ubuntu 11.10 and the problem persists in Ubuntu.
Apparently the problem seems to have something to do with the usage of wlan, but even with wlan disconnected it sometimes skips.
What's weird too is that the BT-audio used to work fine with older versions of Ubuntu, so what has been done differently in the 11.xx versions BT? What is slowing the Bluetooth transfer rate down?
Would be nice to get something out of this, wouldn't like to downgrade my Ubuntu but soon will have to because the continuous skipping is really annoying...

Revision history for this message
Michael Maddern (michael-maddern-m) wrote :

I also have the same problem. It works perfectly under Windows 7, and well with Ubuntu 10.04. But in Ubuntu 11.10 bluetooth audio skips a lot. It's not that noticeably affected by other bluetooth devices or WiFi. It is affected (obviously) by the distance, anything more than about 1 metre and it skips a lot, with Windows it's still playing perfectly at 10 metres. I've tried all the suggestions here and anywhere else I can find, and nothing fixes it.

Revision history for this message
amias (amias) wrote :

i had this problem and ive solved it for myself by getting an external usb bluetooth adapter and disabling the built in one on my dell vostro 1710 , i think there have also been a few fixes to the code as well but now it works great and pretty much never glitches.
thanks to everyone involved in making this possible , you are awesome !

Revision history for this message
Brian K. White (bkw777) wrote :

Same problem.

OS: oneiric, 3.0.0-17
System: Sony VGN-P530H
bluetooth:
  Internal, usb-connected,
  Bus 003 Device 002: ID 044e:3017 Alps Electric Co., Ltd BCM2046 Bluetooth Device
Receiver: Sony HWS-BTA2W

90% idle cpu, idle disk, pandora streaming in over wifi, using pianobar commandline client, no browser or flash.
Sometimes fine for one to four songs before it goes all skippy.
Disconnecting/reconnecting to ad2p sometimes fixes for a song or a few songs.
It's fine indefinitely on headphones, same software and same streaming over wifi.

Just for reference the wifi is internal, pci-express connected, ath9k.
product: AR928X Wireless Network Adapter (PCI-Express) [168C:2A]
vendor: Atheros Communications Inc. [168C]
bus info: pci@0000:02:00.0
logical name: wlan0
version: 01
serial: 00:23:4d:e1:29:f1
width: 64 bits
clock: 33MHz

--
bkw

Revision history for this message
Todd Howe (tehowe) wrote :

Possibly related, Headset Service HSP/HFP (mono) is skipping for me in Precise.

https://bugs.launchpad.net/ubuntu/+source/bluez/+bug/967250

isden (isden)
tags: added: precise
Revision history for this message
isden (isden) wrote :

I'm experiencing the same issue in the latest Ubuntu precise.

Apr 15 20:53:13 laptop pulseaudio[2338]: [bluetooth] module-bluetooth-device.c: Skipping 33435 us (= 5896 bytes) in audio stream
Apr 15 20:53:14 laptop pulseaudio[2338]: [bluetooth] module-bluetooth-device.c: Skipping 129846 us (= 22904 bytes) in audio stream
Apr 15 20:53:15 laptop pulseaudio[2338]: [bluetooth] module-bluetooth-device.c: Skipping 363882 us (= 64188 bytes) in audio stream
Apr 15 20:53:21 laptop pulseaudio[2338]: [bluetooth] module-bluetooth-device.c: Skipping 330683 us (= 58332 bytes) in audio stream

Linux laptop 3.2.0-23-generic #36-Ubuntu SMP Tue Apr 10 20:39:51 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

Bus 002 Device 005: ID 0a5c:21b4 Broadcom Corp. BCM2070 Bluetooth 2.1 + EDR

pulseaudio version 1:1.1-0ubuntu15
bluez/bluez-alsa/bluez-gstreamer version 4.98-2ubuntu7
bluez-btsco version 1:0.50-0ubuntu3

In /etc/security/limits.conf I have:

@audio hard rtprio

and in /etc/pulse/daemon.conf :

realtime-priority = 9

Please let me know if you need more details.

Revision history for this message
Hermit (78luphr0rnk2nuqimstywepozxn9kl19tqh0tx66b5dki1xxsh5mkz9gl21a5rlwfnr8jn6ln0m3jxne2k9x1ohg85w3jabxlrq-launchpad-a811i2i3ytqlsztthjth0svbccw8inm65tmkqp9sarr553jq53in4xm1m8wn3o4rlwaer06ogwvqwv9mrqoku2x334n7di44o65) wrote :

ASUS USB-BT211 Bluetooth adapter
ASUS P6T with Intel I7 and 12Gb RAM (AMI 0403 Bios 02/26/2009)
NVidia GTX 295

Ubuntu 11.10

Anycom Headset
Nokia BH-905i
Kernel : Linux 3.0.0-17-generic-pae (i686)
Compiled : #30-Ubuntu SMP Thu Mar 8 17:53:35 UTC 2012

Fully updated

Audio skips, hops, stutters

sudo hciconfig hci0 lm master; sudo hciconfig hci0 lp hold,sniff,park

Makes no difference

Apr 19 03:53:45 insane pulseaudio[1786]: [bluetooth] module-bluetooth-device.c: Skipping 84939 us (= 14980 bytes) in audio stream
Apr 19 03:53:45 insane pulseaudio[1786]: [bluetooth] module-bluetooth-device.c: Skipping 148840 us (= 26252 bytes) in audio stream
Apr 19 03:53:46 insane pulseaudio[1786]: [bluetooth] module-bluetooth-device.c: Skipping 180725 us (= 31876 bytes) in audio stream
Apr 19 03:53:46 insane pulseaudio[1786]: [bluetooth] module-bluetooth-device.c: Skipping 184823 us (= 32600 bytes) in audio stream
Apr 19 03:53:47 insane pulseaudio[1786]: [bluetooth] module-bluetooth-device.c: Skipping 80866 us (= 14264 bytes) in audio stream
Apr 19 03:53:47 insane pulseaudio[1786]: [bluetooth] module-bluetooth-device.c: Skipping 148935 us (= 26272 bytes) in audio stream
Apr 19 03:53:48 insane pulseaudio[1786]: [bluetooth] module-bluetooth-device.c: Skipping 180641 us (= 31864 bytes) in audio stream
Apr 19 03:53:48 insane pulseaudio[1786]: [bluetooth] module-bluetooth-device.c: Skipping 148810 us (= 26248 bytes) in audio stream
Apr 19 03:53:49 insane pulseaudio[1786]: [bluetooth] module-bluetooth-device.c: Skipping 184731 us (= 32584 bytes) in audio stream
Apr 19 03:54:09 insane pulseaudio[1786]: [bluetooth] module-bluetooth-device.c: Skipping 20171728 us (= 3558292 bytes) in audio stream

And tens of thousands more.
Please let me know if you need more details.

Revision history for this message
Jesse B (jayesbee) wrote :

The last post on this was april 19th.. this bug currently affects me as well

Ubuntu 12.04
Linux titan 3.5.7-030507-generic x86_64
Pulseaudio 2.0 (ubuntu-audio-dev ppa)
(not using blueman)

ive attached terminal output of the bluetooth service being restarted while I turn off and turn on the bluetooth headset.

Revision history for this message
Lorant Nemeth (loci) wrote :

I was trying to check if I can find the same logs as Jesse G, but the first time in 1.5-2 years I could not reproduce the problem. As I haven't tried using my headsets (because of this bug) for some time now, I don't know when it got better. I'll check with my other headset later and report if I can still reproduce the bug.

I'm running stock Ubuntu 12.04:
pulseaudio: 1:1.1-0ubuntu15.1
kernel: 3.2.0-33-generic

Revision history for this message
Alexey Brodkin (alexey-brodkin) wrote :

Personally I still experience this issue on HP Elitebook 8560w with Ubuntu 12.04 32-bit.
The same Logitech bluetooth receiver works perfectly with my Nexus S.
So definitely there's an issue in Ubuntu/laptop.

Revision history for this message
Lorant Nemeth (loci) wrote :

I'd like to rewoke my previous comment. I still experience the problem only this time it took about 15 minutes to experience the effect (watching movie wth mplayer). Like for Bolick: same headset works fine with phone and had been working fine with earlier releases (not sure, but I guess the latest release working fine was 11.04 or 10.10)

Revision history for this message
Lorant Nemeth (loci) wrote :

Forgot to mention, but once problem appears it's happening more often and often as long as it's impossible to watch movie longer than 1-5 seconds.

Revision history for this message
Lorant Nemeth (loci) wrote :

Hmmm,..changing the output device to the built-in audio and than back to the headset seem to allow reset the problem (no lagging for ~15 minutes, pausing movie to let sound catch up, no lagging for 2-3 minutes.... switch output device back and forth, no lagging for ~15 minutes....)

Revision history for this message
In , farbing (farbing) wrote :

I'm using a bluetooth headset with pulseaudio. Whenever the connection temporarily drops (e.g. by moving too far from the bt device), I get the message in the syslog:

[bluetooth] module-bluetooth-device.c: Skipping 24275 us (= 4280 bytes) in audio stream

and the audio lags behind after that. A workaround is to suspend and resume the sink using "pactl suspend-sink 1 && pactl suspend-sink 0", after which the audio is in sync again.

Using the same headset on Windows doesn't show the same behavior.

Revision history for this message
flm (flmommens) wrote :

I am also experiencing this problem with an up to date 12.04 32 bits on an Asus eee pc netbook connecting to a jambox. Same error messages in syslog. It has to do with the distance, more than 1m and the stutters appear.

Revision history for this message
Mark Duncan (eattheapple) wrote :

I am experiencing this in an up to date 12.10 64-bit as well. This bug is also going on 3 and a half years old. Seems like after attempting to mark invalid and pass the buck over to another project, this bug got largely ignored. Who do we need to throw money at to get this looked at?

Revision history for this message
Sebastian Sardina (ssardina) wrote :

I also have been suffering from this bugs for a long time hoping that it will be fixed eventually. I am currently running up to date Linux Mint 14 Nadia.

Indeed who do we have to throw money for this one to be looked after?

dino99 (9d9)
tags: removed: karmic lucid maverick natty oneiric
Revision history for this message
Lorant Nemeth (loci) wrote :

This bug is still present in 13.04. Tested with flash video.

Changed in pulseaudio (Ubuntu):
status: Incomplete → New
status: New → Confirmed
tags: added: raring
Revision history for this message
philip550c (philip550c) wrote :

I have this bug as well, its been a bad experience with ubuntu and a2dp for so long now I thought it didnt work with my hardware. Except it works fine in osx and windows. Im on 13.04 now and it still is broken. Please fix.

Revision history for this message
Artem Sheremet (dot-doom+launchpad) wrote :

Having the same issue here.

Linux 3.14.1 (from Arch Linux)
BlueZ 5.17

Jabra HALO2 Headset is being used.

A skip is accompanied by the following syslog messages (via systemd):

Apr 28 13:36:07 pulseaudio[15909]: [bluetooth] module-bluez5-device.c: Skipping 2345806 us (= 413800 bytes) in audio stream
Apr 28 13:36:14 pulseaudio[15909]: [bluetooth] module-bluez5-device.c: Skipping 2148930 us (= 379068 bytes) in audio stream
Apr 28 13:36:17 pulseaudio[15909]: [bluetooth] module-bluez5-device.c: Skipping 2336913 us (= 412228 bytes) in audio stream

Revision history for this message
Nicola Larosa (teknico) wrote :

Same issue here. Weird thing is, it worked flawlessly the first day, but it's been skipping frequently since the second one.

Clevo W740SU (rebranded as Schenker S413) notebook with Intel 7260 WiFi/Bluetooth controller
Sony SRS-BTX300 Bluetooth loudspeakers

Ubuntu 14.04 64 bit
Linux kerner v. 3.13.0-24-generic #47-Ubuntu SMP
Pulseaudio v. 1:4.0-0ubuntu11
libbluetooth3 v. 4.101-0ubuntu13
Music played by Quod Libet v. 3.0.2-3, configured with alsasink device=pulse

Syslog messages:

May 8 11:25:42 twobytwo pulseaudio[2411]: [bluetooth] module-bluetooth-device.c: Skipping 18573 us (= 3276 bytes) in audio stream
May 8 11:29:38 twobytwo pulseaudio[2411]: [bluetooth] module-bluetooth-device.c: Skipping 74848 us (= 13200 bytes) in audio stream
May 8 11:30:04 twobytwo pulseaudio[2411]: [bluetooth] module-bluetooth-device.c: Skipping 72893 us (= 12856 bytes) in audio stream
May 8 11:30:20 twobytwo pulseaudio[2411]: [bluetooth] module-bluetooth-device.c: Skipping 15928 us (= 2808 bytes) in audio stream
May 8 11:31:33 twobytwo pulseaudio[2411]: [bluetooth] module-bluetooth-device.c: Skipping 35423 us (= 6248 bytes) in audio stream
May 8 11:32:06 twobytwo pulseaudio[2411]: [bluetooth] module-bluetooth-device.c: Skipping 207527 us (= 36604 bytes) in audio stream
May 8 11:32:16 twobytwo pulseaudio[2411]: [bluetooth] module-bluetooth-device.c: Skipping 349828 us (= 61708 bytes) in audio stream
May 8 11:34:16 twobytwo pulseaudio[2411]: [bluetooth] module-bluetooth-device.c: Skipping 134223 us (= 23676 bytes) in audio stream

Revision history for this message
AssfaceJackson (assface-jackson) wrote :

In addition to the skipping problem that others are experiencing, my bluetooth headphones lag behind the laptop by about 500ms. I sometimes feel like the lag can get worse until I restart the laptop. This only started happening after upgrading to 14.04.

Lenovo t440s
Bluetooth => Intel Bluetooth firmware file: intel/ibt-hw-37.7.10-fw-1.80.2.3.d.bseq
Linux => 3.13.0-27-generic #50-Ubuntu SMP Thu May 15 18:06:16 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
pulseaudio => 1:4.0-0ubuntu11
pulseaudio-module-bluetooth => 1:4.0-0ubuntu11

Revision history for this message
Celian (r-launchpad-celian-dk) wrote :

Same problem - came after upgrading from 13.10 to 14.04.. Only 1 bluetooth device, stereo headset.

Revision history for this message
macher (macher91) wrote :

I have this same problem on Ubuntu GNOME 14.04LTS. I found that in my case is some conflict between wlan card and bluetooth. After turned off wlan card, A2DP working without skipping :)

Revision history for this message
macher (macher91) wrote :

After install drivers for wlan from "Additional Drivers", A2DP stopped skipping. I hope that it will be also fixing your skipping ;)

Revision history for this message
In , Dmbohdan (dmbohdan) wrote :

This bug is affecting to many users with bluetooth headphones.

https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/405294

Right now I'm ArchLinux user and tryed git version of pulseaudio, a2dp work is terribly.

I can help with finding bug, if you send me details how to do that

Revision history for this message
Paweł (thepawelad) wrote :

Same problem here, with ThinkPad x220

Mar 15 00:46:00 x220 pulseaudio[2035]: [bluetooth] module-bluetooth-device.c: Skipping 61300 us (= 10812 bytes) in audio stream
Mar 15 00:46:00 x220 pulseaudio[2035]: [bluetooth] module-bluetooth-device.c: Skipping 43008 us (= 7584 bytes) in audio stream
Mar 15 00:46:00 x220 pulseaudio[2035]: [bluetooth] module-bluetooth-device.c: Skipping 279302 us (= 49268 bytes) in audio stream
Mar 15 00:46:00 x220 pulseaudio[2035]: [bluetooth] module-bluetooth-device.c: Skipping 96393 us (= 17000 bytes) in audio stream
Mar 15 00:46:01 x220 pulseaudio[2035]: [bluetooth] module-bluetooth-device.c: Skipping 201482 us (= 35540 bytes) in audio stream
Mar 15 00:46:01 x220 pulseaudio[2035]: [bluetooth] module-bluetooth-device.c: Skipping 7530 us (= 1328 bytes) in audio stream
Mar 15 00:46:01 x220 pulseaudio[2035]: [bluetooth] module-bluetooth-device.c: Skipping 107377 us (= 18940 bytes) in audio stream
Mar 15 00:46:02 x220 pulseaudio[2035]: [bluetooth] module-bluetooth-device.c: Skipping 152131 us (= 26832 bytes) in audio stream

I just got my Bluetooth headphones and I can't believe that a basic thing like that is missing in 2015. This makes the headphones unusable.

Revision history for this message
kenjiru (kenjiru) wrote :

Same problem in Ubuntu 15.10
Sony Vaio VPCF11M1E laptop
Sony SRS-BTX300 Bluetooth speakers

$ uname -a
Linux atakama 4.2.0-16-generic #19-Ubuntu SMP Thu Oct 8 15:35:06 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

$ lspci -v | grep Audio
00:1b.0 Audio device: Intel Corporation 5 Series/3400 Series Chipset High Definition Audio (rev 05)
01:00.1 Audio device: NVIDIA Corporation GT216 HDMI Audio Controller (rev a1)

$ apt-cache madison pulseaudio-module-bluetooth
pulseaudio-module-bluetooth | 1:6.0-0ubuntu13 | http://at.archive.ubuntu.com/ubuntu/ wily/main amd64 Packages
pulseaudio | 1:6.0-0ubuntu13 | http://at.archive.ubuntu.com/ubuntu/ wily/main Sources

$ journalctl -n 20
-- Logs begin at Sun 2015-11-08 16:52:35 CET, end at Sun 2015-11-08 17:33:57 CET. --
Nov 08 17:33:18 atakama pulseaudio[1449]: [bluetooth] module-bluez5-device.c: Skipping 109174 us (= 19256 bytes) in audio stream
Nov 08 17:33:18 atakama pulseaudio[1449]: [bluetooth] module-bluez5-device.c: Skipping 18088 us (= 3188 bytes) in audio stream
Nov 08 17:33:18 atakama pulseaudio[1449]: [bluetooth] module-bluez5-device.c: Skipping 109280 us (= 19276 bytes) in audio stream
Nov 08 17:33:18 atakama pulseaudio[1449]: [bluetooth] module-bluez5-device.c: Skipping 11197 us (= 1972 bytes) in audio stream
Nov 08 17:33:19 atakama pulseaudio[1449]: [bluetooth] module-bluez5-device.c: Skipping 66045 us (= 11648 bytes) in audio stream
Nov 08 17:33:19 atakama pulseaudio[1449]: [bluetooth] module-bluez5-device.c: Skipping 48397 us (= 8536 bytes) in audio stream
Nov 08 17:33:19 atakama pulseaudio[1449]: [bluetooth] module-bluez5-device.c: Skipping 26452 us (= 4664 bytes) in audio stream
Nov 08 17:33:19 atakama pulseaudio[1449]: [bluetooth] module-bluez5-device.c: Skipping 25380 us (= 4476 bytes) in audio stream

Revision history for this message
sedot (blutkreislauf) wrote :

Affects me as well on Arch. Works flawless on Android.
Laptop: Thinkpad T430
Speaker: Sony SRS-X3

$ uname -a
Linux atlas 4.2.5-1-ARCH #1 SMP PREEMPT Tue Oct 27 08:13:28 CET 2015 x86_64 GNU/Linux

$ lspci -v | grep Audio

00:1b.0 Audio device: Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller (rev 04)

$ lsusb | grep blue
Bus 001 Device 006: ID 0a5c:21e6 Broadcom Corp. BCM20702 Bluetooth 4.0 [ThinkPad]

$ pacman -Qi pulseaudio | grep Version
Version : 7.1-1

$ journalctl
Nov 20 20:20:37 atlas pulseaudio[729]: W: [bluetooth] module-bluez5-device.c: Skipping 74038 us (= 13060 bytes) in audio stream
Nov 20 20:20:35 atlas pulseaudio[729]: W: [bluetooth] module-bluez5-device.c: Skipping 10034 us (= 1768 bytes) in audio stream
Nov 20 20:20:35 atlas pulseaudio[729]: W: [bluetooth] module-bluez5-device.c: Skipping 76683 us (= 13524 bytes) in audio stream

I feel it might be related to WiFi interference. How does Android handle this?

Revision history for this message
In , Odin Hørthe Omdal (velmont) wrote :

It might very well be somewhere other than Pulseaudio that this bug surfaces. But there's sure to be many experts on A2DP and the Linux stack for that here.

Changed in pulseaudio:
status: New → Unknown
Changed in pulseaudio:
importance: Unknown → Medium
status: Unknown → Confirmed
Revision history for this message
In , Z-mike-y (z-mike-y) wrote :

Bumping this due to the fact that this bug is still very much present in 5, 6, 7, 8 and renders the act of using a bluetooth headset on most linux operating systems using pulseaudio utterly useless. The slightest blip throws the whole audio out of sync with the video. I noticed this when trying to watch a movie from a 6ft distance away (sill in range) but occasionally the signal would blip and cause said problem. Evidence in the logs:

Three of many lines:

    Feb 13 17:25:49 saturn.net.overtmind.com pulseaudio[30599]: [bluetooth] module-bluez5-device.c: Skipping 5124656 us (= 903988 bytes) in audio stream
    Feb 13 17:25:49 saturn.net.overtmind.com pulseaudio[30599]: [bluetooth] mod ule-bluez5-device.c: Skipping 220060 us (= 38816 bytes) in audio stream
    Feb 13 17:25:49 saturn.net.overtmind.com pulseaudio[30599]: [bluetooth] module-bluez5-device.c: Skipping 346147 us (= 61060 bytes) in audio stream

Packages tested in Fedora 23:

rawhide:

    bluez-5.37-2.fc24.x86_64
    pulseaudio-8.0-3.fc24.x86_64

and also tried initially with:

    bluez-5.36-1.fc23.x86_64
    pulseaudio-7.1-1.fc23.x86_64

The rest of my findings are here, where someone else has also mentioned seeing this on Gentoo with PA 5,6 - I have tested 7 and 8:

https://www.reddit.com/r/linuxquestions/comments/45n710/pulseaudio_bluetooth_degraded_signal_out_of_sync/

Revision history for this message
In , Raymond (superquad-vortex2) wrote :

If you want audio sync with video after audio transmission is broken, you need the application to skip some audio and restart audio playback

Revision history for this message
In , Z-mike-y (z-mike-y) wrote :

Shouldn't the buffer reset after detecting a skip event?

Revision history for this message
yayfortrees (yayfortrees) wrote : Re: a2dp skips terribly

I was encountering this same issue on Gentoo. It appeared to be at random times but persistent once it started. I realized that it only happens if 'gnome-control-center bluetooth' is open. I would often leave this open after pairing the device, not really thinking about it. As soon as I close it the "module-bluez5-device.c: Skipping..." messages stop and the choppy sound goes away.

Posting in case it helps track this down.

Revision history for this message
In , Sb (sb56637) wrote :

(In reply to xenith from comment #3)
> Shouldn't the buffer reset after detecting a skip event?

This would seem to be the most logical thing. The way it is now, even stopping and re-starting the audio stream doesn't fix the latency issue if there has ever been a brief blip in the current Bluetooth connection. Quite a showstopper for watching video with bluetooth speakers/headphones.

Revision history for this message
In , Arun Raghavan (arunraghavan) wrote :

I've tried to reproduce this behaviour in the past, but it doesn't always happen this way (but I have seen the delays turn up on drops at times). If someone has a patch that definitely works (or a way to repro that is 100% reliable), I can try to look at this.

Revision history for this message
In , Sb (sb56637) wrote :

(In reply to Arun Raghavan from comment #5)
> I've tried to reproduce this behaviour in the past, but it doesn't always
> happen this way (but I have seen the delays turn up on drops at times). If
> someone has a patch that definitely works (or a way to repro that is 100%
> reliable), I can try to look at this.

I have about 6 different cheap Chinese bluetooth speakers, and they all exhibit this behavior. They all use the A2DP protocol, are you possibly seeing different behavior with HSP/HFP?

Revision history for this message
In , Sam Morris (yrro) wrote :

I can reproduce this easily by running 'speaker-test -c2 -t wav' and then walking away from my computer with my headphones on until the signal strength drops sufficiently that the headphones go silent. Then, when I walk back to the computer, the audio is waaaay out of sync, and pulseaudio has issued the 'skipping' message many times.

Revision history for this message
In , Kalyanov Dmitry (kalyanov-dmitry) wrote :

Created attachment 125291
Proof-of-concept patch

I've solved this issue for myself - I've been using pulseaudio with my changes for several months now with no major problems.

I've noticed that every time signal degrades audio gets more out of sync - up to about 10-15 seconds (if I remember correctly).

I've debugged bluez5 pulseaudio module and suspect that the problem lies in buffering for bluetooth socket. Here's my analysis:

1) Pulseaudio detects BT signal drop when write() on bluetooth socket returns EAGAIN (i.e., when the buffer is full).
2) Bluetooth socket buffer is quite big (by default)
3) When pulseaudio stops sending audio packets to BT socket the buffer still contains a lot of packets
4) pulseaudio considers those packets as successfully sent - but they aren't
5) BT connection seems to never be able to "catch up" with the amount of buffered packets and audio becomes out-of-sync.

So here's my patch. The main change is to decrease the buffer size as much as possible. I've experimented and found out that settings buffer size to 2x-5x of packet size works best for me. This ensures that audio lag won't accumulate after BT signal degradation while preventing audio skipping due to buffer underruns. Audio still may skip (sometimes several times in a row) - but without the lag after BT signal restores.

Unfortunately with this patch bluetooth microphone (headset profile) won't work - since I don't use one and couldn't test it. I hope that someone would be able to pick it up and make into a form that would be possible to merge in master branch.

The changes are contained in attached path on github: https://github.com/dmitryvk/pulseaudio/commit/12b13c75d3a9b377e0f7de7c86116e3af41ce5ee. Patch was developed against Pulseaudio-8.0 but it works with Pulseaudio-9.0.

Revision history for this message
Dan Dascalescu (ddascalescu+launchpad) wrote :

I'm on Ubuntu 16.04.1, and A2DP Bluetooth audio still skips about twice a minute, though randomly. I'm playing the same MP3 track on repeat, using SMPlayer. If I do that in Kubuntu 16.04.1, there are no skips. This is strange - don't Ubuntu and Kubuntu use the same Bluetooth stack?

I've installed blueman; no improvement.

Revision history for this message
In , teppot (teppot-deactivatedaccount) wrote :

Could someone please look at the attached patch. This bug is super annoying and essentially makes it impossible to use a Bluetooth headset to watch movies.

Revision history for this message
In , Tanu Kaskinen (tanuk) wrote :

I have taken a look, but as the submitter himself says, it's not ready for merging. Someone needs to improve the patch so that it doesn't break stuff. I'm not volunteering to do that myself (at least any time soon). The general idea of reducing the socket buffer size seems good.

Revision history for this message
In , Kalyanov Dmitry (kalyanov-dmitry) wrote :

I've recently found out that there exists SIOCOUTQ ioctl which supposedly should work on bluetooth sockets (I haven't verified this).
ioctl(.., SIOCOUTQ, ..) returns amount of bytes in send buffer.
Using it should be more reliable way than simply reducing buffer size.

Revision history for this message
In , Tanu Kaskinen (tanuk) wrote :

*** Bug 95411 has been marked as a duplicate of this bug. ***

Revision history for this message
Filip (wheey) wrote :

Can confirm for ubuntu 16.04.1, have same issue as Dan, tried everything from previous posts but nothing works..

Revision history for this message
Filip (wheey) wrote :

One thing which I have notices just now, when I start downloading something it get's much worse

Revision history for this message
In , smekkleysa (smekkleysa) wrote :

Tried a patch from comment #8.
The issue still persists but it happens less frequently with the patch. And instead of bluetooth disconnecting, I get messages like the following every second until I reconnect the bluetooth device manually.

module-bluez5-device.c: Skipping 32025 us (= 5648 bytes) in audio stream

Revision history for this message
In , Paco3346-q (paco3346-q) wrote :

(In reply to Dmitry Kalyanov from comment #8)
> Created attachment 125291 [details] [review]
> Proof-of-concept patch
>
> I've solved this issue for myself - I've been using pulseaudio with my
> changes for several months now with no major problems.
>
> I've noticed that every time signal degrades audio gets more out of sync -
> up to about 10-15 seconds (if I remember correctly).
>
> I've debugged bluez5 pulseaudio module and suspect that the problem lies in
> buffering for bluetooth socket. Here's my analysis:
>
> 1) Pulseaudio detects BT signal drop when write() on bluetooth socket
> returns EAGAIN (i.e., when the buffer is full).
> 2) Bluetooth socket buffer is quite big (by default)
> 3) When pulseaudio stops sending audio packets to BT socket the buffer still
> contains a lot of packets
> 4) pulseaudio considers those packets as successfully sent - but they aren't
> 5) BT connection seems to never be able to "catch up" with the amount of
> buffered packets and audio becomes out-of-sync.
>
> So here's my patch. The main change is to decrease the buffer size as much
> as possible. I've experimented and found out that settings buffer size to
> 2x-5x of packet size works best for me. This ensures that audio lag won't
> accumulate after BT signal degradation while preventing audio skipping due
> to buffer underruns. Audio still may skip (sometimes several times in a row)
> - but without the lag after BT signal restores.
>
> Unfortunately with this patch bluetooth microphone (headset profile) won't
> work - since I don't use one and couldn't test it. I hope that someone would
> be able to pick it up and make into a form that would be possible to merge
> in master branch.
>
> The changes are contained in attached path on github:
> https://github.com/dmitryvk/pulseaudio/commit/
> 12b13c75d3a9b377e0f7de7c86116e3af41ce5ee. Patch was developed against
> Pulseaudio-8.0 but it works with Pulseaudio-9.0.

Genius! I understand the problems with this patch but for now it's music to my ears (pun intended). Using on Arch with Pulseaudio 9.

Revision history for this message
Shadowpool (mikefriend51389) wrote :

On Xubuntu 16.04.1 64bit. Switching to the brcmsmac wireless driver seems to have fixed/significantly improved this issue for me. Using the original bcmwl-kernel-source driver, bluetooth audio would cut out completely during a network speedtest on wifi. With wifi off, bluetooth sound would be flawless.

I just installed b43-fwcutter, firmware-b43-installer, and completely removed / purged bcmwl-kernel-source all at once and restarted.

Now playback seems *greatly* improved during wireless network use.

Wireless card is BCM4313.

4.4.0-62-generic
pulseaudio 1:8.0-0ubuntu3.2
bluez 5.37-0ubuntu5

Also using pylover a2dp.py script 0.2.5.

Revision history for this message
Sergio Callegari (callegar) wrote :

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
Revision history for this message
In , Atmcclur (atmcclur) wrote :

I have used a version of a workaround -- though not adopting the code below, instead having an auto resetting of the headset mode which is a work around.

For the Pulseaudio developers -- I think the code that is causing this issue are around or between lines 1421 and 1503 of the below github code page for: module-bluez4-device.c

pulseaudio/src/modules/bluetooth/module-bluez5-device.c

https://github.com/pulseaudio/pulseaudio/blob/2417305ae755cbb3a92ca43a058f550809069cd9/src/modules/bluetooth/module-bluez5-device.c

The work around in the code seems to be about using a timer a to sync everything back up when a disruption occurs -- but either the timer is not working as intended, or the thresholds for the re-syncing process need to be considered.

This is what I can gather but am interpreting as best I can.

This is a common topic in troubleshooting boards for Bluetooth on linux distros.

Revision history for this message
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.

Revision history for this message
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.

Revision history for this message
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

Revision history for this message
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/

Revision history for this message
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,

Revision history for this message
Konrad Zapałowicz (kzapalowicz) wrote :

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

Revision history for this message
In , Tanu Kaskinen (tanuk) wrote :

*** Bug 102989 has been marked as a duplicate of this bug. ***

Revision history for this message
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.

Revision history for this message
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,

Revision history for this message
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.

Revision history for this message
Rob Schultz (rob-schultzfamily) wrote :

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.

Revision history for this message
Kevin (kevinhaefeli) wrote : Re: [Bug 405294] Re: A2DP Bluetooth audio skips terribly ["Skipping NNN us (= MMM bytes) in audio stream"]

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
>

Revision history for this message
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.

Revision history for this message
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.

Revision history for this message
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.

Revision history for this message
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>

Revision history for this message
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.

Revision history for this message
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>)

Revision history for this message
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

Revision history for this message
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".

Revision history for this message
PeterPall (peterpall) wrote :

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

Revision history for this message
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.

Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in linux (Ubuntu):
status: New → Confirmed
Revision history for this message
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.

Revision history for this message
In , Philipp+freedesktop (philipp+freedesktop) wrote :

This bug is extremely annoying during calls, when resetting the audio profile (as suggested as workaround by several people) can disrupt the call / cause feedback. How has this been open for over 5 years?

Revision history for this message
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

Revision history for this message
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
---------------------------------------

Revision history for this message
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.

Revision history for this message
In , Vincent Petry (pvince81) wrote :

Any guidance what we could do to help get the patch merged or an alternative fix developed ? Would testing the patch be enough or needs more research ?

Or can the maintainers not reproduce the issue yet ?

Let us know :-)

Revision history for this message
In , Tanu Kaskinen (tanuk) wrote :

(In reply to Vincent Petry from comment #18)
> Any guidance what we could do to help get the patch merged or an alternative
> fix developed ? Would testing the patch be enough or needs more research ?

See comment #10, I think the comment answers all your questions. If you can't improve the patch yourself or find someone else to do it, I don't think there's anything you can do.

> Or can the maintainers not reproduce the issue yet ?

Speaking only for myself here: bluetooth works so badly on my machine that testing anything is a huge pain, if possible at all. For that reason I don't work much on bluetooth issues (and there's no shortage of other work).

Revision history for this message
In , Vincent Petry (pvince81) wrote :

So are you saying that getting you a new machine (or a working setup) is also a possible approach ? :-D

Revision history for this message
In , Tanu Kaskinen (tanuk) wrote :

(In reply to Vincent Petry from comment #20)
> So are you saying that getting you a new machine (or a working setup) is
> also a possible approach ? :-D

I suppose so :) Now that I think about it, I have another machine that I could and should try first, so don't send me stuff yet!

I have more urgent things to work on first, though, so I don't expect progress on this in the near future.

Revision history for this message
In , Georg Chini (gchini) wrote :

Created attachment 137440
patch: rewrite of thread function

Could you try if the attached patch fixes your issues?

Revision history for this message
In , Georg Chini (gchini) wrote :

Created attachment 137477
patch: rewrite of thread function

Sorry, I had other patches in my tree, so the posted patch would not apply cleanly to current master. Here an updated version.

Revision history for this message
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...

Revision history for this message
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
Revision history for this message
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...

Revision history for this message
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?

Revision history for this message
Saleh (salehbozeed) wrote :

Bluetooth works fine when wifi is disabled!

Revision history for this message
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
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

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

tags: added: a2dp-skip
Revision history for this message
In , Georg Chini (gchini) wrote :

Nobody willing to test?

Revision history for this message
In , Johannes Larsen (johslarsen) wrote :

(In reply to Georg Chini from comment #24)
> Nobody willing to test?

I have tested the patch with a pair of Mackie CR4BT bluetooth speakers that suffers from the lag issues after they reconnect. That patch was applied 7f09164e and built as part of the [pulseaudio-git] AUR package.

When the computer initiate connection with the speakers (i.e. `echo connect MAC | bluetoothctl`) everything works fine, but every few seconds the logs are flooded with 1000s of these messages:

  [bluetooth] module-bluez5-device.c: Broken kernel: we got EAGAIN on write() after POLLOUT!

When the speakers initiate the connection they disconnect after about a second (even before they start making sound), and when the speakers disconnects (either a second after they connected or if I turn them off after computer initiated the connection) pulseaudio aborts with:

  [bluetooth] module-bluez5-device.c: Skipping 2176 us (= 384 bytes) in audio stream
  [bluetooth] module-bluez5-device.c: Assertion 'u->write_memchunk.length == u->write_block_size' failed at modules/bluetooth/module-bluez5-device.c:437, function a2dp_process_render(). Aborting.

I only observe the out-of-sync audio problems when the connection is initiated by the audio device (e.g. power on, pushing their connect buttons, after signal loss). I am happy to test further patches, but I do not see any means to reproduce the problem as long as pulseaudio aborts whenever any of my devices tries to reconnect.

I also have a Bose QC35 and a RHA MA 650 Wireless headset to test with, but they usually take longer to suffer from audio sync problems than the Mackie CR4BT speakers. I tested the patch with the headsets to, and they observed the same crashing behavior as when I tested it with the speakers.

BTW, as a workaround until the problem is fixed I have a script I use whenever I notice audio sync problems that disconnect then reconnects the device, so that it is the computer that initiated the connection. This seems to work consistently and avoids the problem until there are intermittent connection problem (e.g. I walk too far away from the computer with a headset) or I turn off and on the audio devices.

[pulseaudio-git] https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=pulseaudio-git

Revision history for this message
In , Georg Chini (gchini) wrote :

Thanks for testing. I can not reproduce your problems here with both of my headsets using current master. Can you please send a full log from the moment you press the connect button on your BT device, so that I can see what happens?

Revision history for this message
In , Georg Chini (gchini) wrote :

Created attachment 137779
patch: rewrite of thread function

I think I figured out what went wrong. Could you give the updated patch a try? If it still causes problems, please send a log as requested earlier.

Revision history for this message
In , Johannes Larsen (johslarsen) wrote :

(In reply to Georg Chini from comment #27)
> Could you give the updated patch a try?

I tried the new patch. With it I do not get any aborts. Additionally I am getting way fewer of these messages:

  [bluetooth][modules/bluetooth/module-bluez5-device.c:1464 write_block()] Broken kernel: we got EAGAIN on write() after POLLOUT! (libpulsecommon-11.0.so(+0x414e7) [0x7f6f7492b4e7]<<libpulsecommon-11.0.so(pa_log_levelv_meta+0x4af) [0x7f6f7492beb9])

And most importantly, I cannot reproduce the audio sync issues. I have tried to have my Mackie CR4BT speakers autoconnect when they power on, which caused audio sync problems for me almost immediately before. Along with moving so far away from the computer with my headsets that the sound crackles and disappears, and then moving back before the device disconnects.

Revision history for this message
In , Georg Chini (gchini) wrote :

Thanks again for testing. Sounds good. Regarding those broken kernel messages, do you only get them once in a while or still annoyingly often? It is just a warning message, so if it's annoying I could drop it completely.

Revision history for this message
In , Johannes Larsen (johslarsen) wrote :

(In reply to Georg Chini from comment #29)
> Thanks again for testing. Sounds good.

You are welcome. Thanks for making bluetooth audio usable in linux.

> Regarding those broken kernel messages, do you only get them once in a while or still annoyingly often?

I seem to only get them when there are intermittent signal problems, so it is not annoyingly often.

Revision history for this message
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?

Revision history for this message
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

Revision history for this message
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.

Revision history for this message
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.

Revision history for this message
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

Revision history for this message
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
Revision history for this message
In , Georg Chini (gchini) wrote :

Created attachment 138573
patch: rewrite of thread function

Could you test this updated patch? There have been a few changes due to review and I want to make sure that it still works.

Revision history for this message
In , Johannes Larsen (johslarsen) wrote :

(In reply to Georg Chini from comment #31)
> Could you test this updated patch?

Sure, I have applied the new patch to b1d74c86, and it seems to work as well as the previous patch. Also, I have yet to see any warning messages in the system log.

I had the previous patch running since the start of march and I did not notice any new problems. I will be running with the new patch from now on, and I will report if I notice any further problems.

Revision history for this message
In , Georg Chini (gchini) wrote :

Perfect. Thanks a lot for your tests.

Revision history for this message
In , Amaury-pouly (amaury-pouly) wrote :

(In reply to Georg Chini from comment #31)
> Created attachment 138573 [details]
> patch: rewrite of thread function
>
> Could you test this updated patch? There have been a few changes due to
> review and I want to make sure that it still works.

I have tried this patch (applied against pulseaudio 11.1 in Debian unstable, it applies with fuzz but works) and I saw a great improvement! My bluetooth chip is very susceptible to interferences, it was common for me to have a few seconds of delays. With this patch, the delay stays small at all times. The fact that it drops samples more aggressively was not noticeable for me because on drop out the speaker just stops anyway. I did not get any warning in the log, just debug messages about skipping.

Thank you for your work, I hope it will make it to mainline.

Revision history for this message
In , riccardo (garis94) wrote :

(In reply to Georg Chini from comment #31)
> Created attachment 138573 [details]
> patch: rewrite of thread function
>
> Could you test this updated patch? There have been a few changes due to
> review and I want to make sure that it still works.

Thank you very much for the patch!

I also was having loss of audio sync. This patch solved the problem.

Occasionaly will still delay the audio, but before the delay was something like 3-4 seconds, now the worst case that I have seen so far is a couple tens of milliseconds (very small and ok for music and films).

Tested on Arch linux, patch applied to the latest version of Pulseaudio on github (last commit Apr 19, 2018), zero problems applying the patch.

Revision history for this message
In , Georg Chini (gchini) wrote :

Thank you all for testing. The patch is in master now and will be part of the 12.0 release. I will (finally, after five and a half years) close this bug.

Changed in pulseaudio:
status: Confirmed → Fix Released
Changed in pulseaudio (Ubuntu):
assignee: nobody → Alberto Milone (albertomilone)
status: Triaged → In Progress
Changed in pulseaudio (Ubuntu Bionic):
status: New → Triaged
importance: Undecided → High
assignee: nobody → Alberto Milone (albertomilone)
Changed in pulseaudio (Ubuntu Bionic):
status: Triaged → In Progress
Revision history for this message
Alberto Milone (albertomilone) wrote :

Please approve pulseaudio 11.1-1ubuntu7.1 in bionic-proposed.

description: updated
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

pulseaudio (1:11.1-1ubuntu8) cosmic; urgency=medium

  * 0804-bluez5-device-Rewrite-of-thread-function-reduce-send.patch,
    0805-bluez5-device-Fix-memory-leak-in-sco_process_render.patch:
    - Reduce latency over bluetooth, using A2DP, when the connection drops
      temporarily (LP: #405294).

 -- Alberto Milone <email address hidden> Mon, 21 May 2018 16:41:41 +0200

Changed in pulseaudio (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package pulseaudio - 1:11.1-1ubuntu8

---------------
pulseaudio (1:11.1-1ubuntu8) cosmic; urgency=medium

  * 0804-bluez5-device-Rewrite-of-thread-function-reduce-send.patch,
    0805-bluez5-device-Fix-memory-leak-in-sco_process_render.patch:
    - Reduce latency over bluetooth, using A2DP, when the connection drops
      temporarily (LP: #405294).

 -- Alberto Milone <email address hidden> Mon, 21 May 2018 16:41:41 +0200

Changed in pulseaudio (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

I'm generally fine with getting this approved, but before that I'd like some more regression potential analysis to be done and included in the Regression Potential field. The first patch added to fix the issue is quite big and includes a rewrite of thread_func() in there - and any rewrite with so much code modified carries some regression potential. What we'd like to know is which parts of pulseaudio's functionality could regress in worst case scenarios, at which parts testers should look to expect issues.

description: updated
Revision history for this message
Alberto Milone (albertomilone) wrote :

@Łukasz: I have updated the regression potential part with more details.

As a side note, I've been running the code for days, using my Yamaha SRT-1000 (a bluetooth soundbar) with my laptop, and I have yet to see the audio go out of sync, or crackle (which were quite frequent before the changes). This makes bluetooth audio pretty much on par with MacOS.

Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello volkris, or anyone else affected,

Accepted pulseaudio into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/pulseaudio/1:11.1-1ubuntu7.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in pulseaudio (Ubuntu Bionic):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-bionic
Revision history for this message
Alberto Milone (albertomilone) wrote :

The packages in bionic-proposed work well here, on my Lenovo Yoga Pro 2 with my Yamaha SRT-1000 soundbar.

Sound quality is really good using A2DP, and the audio never goes out of sync when I watch videos, and it doesn't break up when I listen to music.

I'm also attaching the output of "apt-cache policy '*pulse*'".

tags: added: verification-done-bionic
removed: verification-needed-bionic
tags: removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package pulseaudio - 1:11.1-1ubuntu7.1

---------------
pulseaudio (1:11.1-1ubuntu7.1) bionic; urgency=medium

  * 0804-bluez5-device-Rewrite-of-thread-function-reduce-send.patch,
    0805-bluez5-device-Fix-memory-leak-in-sco_process_render.patch:
    - Reduce latency over bluetooth, using A2DP, when the connection drops
      temporarily (LP: #405294).

 -- Alberto Milone <email address hidden> Mon, 21 May 2018 16:41:41 +0200

Changed in pulseaudio (Ubuntu Bionic):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for pulseaudio has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Yura Pakhuchiy (yura-p) wrote :

Is it possible to backport fix which recently landed for bionic to xenial?

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Probably, but not definitely. I've nominated xenial for a fix in case we can.

Revision history for this message
In , Paco3346-q (paco3346-q) wrote :

OMG. You are my favorite people ever.

I can confirm that this path fixes _all_ of my out of sync issues. I run a 2015 MBP on which the bluetooth and Wifi share the same antenna. When running on a 2.4Ghz network I have little blips when there's interference but the audio doesn't get out of sync.

Also, my connection issues are gone. Previously I'd need to re-pair the headset nearly every time otherwise the connection would close almost immediately.

Furthermore- HFP/HSP _finally_ works!! I can actually use my mic now! This is just the best day.

Revision history for this message
Justin Jia (abscii) wrote :

I still have this problem, Anybody running the latest pulseaudio on Raspberry Pi or CM3? I'm using pulseaudio 12.2 with bluez 5.50.

After I connected to a Bluetooth speaker. When play something, it's really choppy and skipping a lot. The debug message shows:

D: [bluetooth] module-bluez5-device.c: Skipping 43083 us (= 7600 bytes) in audio stream

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

This bug is closed. Please log a new bug by running:

  ubuntu-bug pulseaudio

Revision history for this message
In , Miroslav Hadzhiev (xtigyro) wrote :

Hey folks - I'm still experiencing sound disruptions.

Is a specific Kernel version expected to be present in order the patch to work fine?

I'm using Kubuntu 18.04 with updated bluetooth and pulseaudio related pkgs:

root@xtigyro-kubuntu:~# pulseaudio --version
pulseaudio 12.2-2
root@xtigyro-kubuntu:~# bluetoothd --version
5.50

Thank you for your time!

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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