Pulseaudio over wifi stutters horribly

Bug #273742 reported by Steffen Rusitschka
184
This bug affects 40 people
Affects Status Importance Assigned to Milestone
pulseaudio (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

When streaming audio data via the local pulseaudio sound server of my laptop over wifi to my server, the sound lags a lot and mainly consists of "skippings". Starting an application, e.g. totem, via "PULSE_SERVER=<my_server> totem" from the shell, everything works perfectly. So it doesn't seem to be a problem with my wifi, but probably with the audio buffers of the local pulseaudio server (i.e. when tunneling streams via the local sound server).

Happened on Hardy and still happens on Intrepid, and now on Jaunty.

Revision history for this message
Craig (candrews-integralblue) wrote :

Have you reported this upstream? http://pulseaudio.org/report

description: updated
Revision history for this message
Steffen Rusitschka (rusi) wrote :

No I didn't... The current version is 0.9.12. From what I've read there are some changes in this version that may fix the problem.

Intrepid uses pulseaudio 0.9.10 - which means reporting a bug upstream probably results in "try the latest version and see if that helps..."

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

Is this symptom still reproducible in 9.04?

Changed in pulseaudio:
status: New → Incomplete
Revision history for this message
Craig (candrews-integralblue) wrote :

This bug is still valid. See http://pulseaudio.org/ticket/366

Changed in pulseaudio:
status: Incomplete → Confirmed
Changed in pulseaudio:
status: Unknown → New
description: updated
Daniel T Chen (crimsun)
Changed in pulseaudio (Ubuntu):
status: Confirmed → Triaged
Revision history for this message
Rola (pabswiss) wrote : Re: [Hardy+Intrepid+Jaunty] Pulseaudio tunnel over wifi lags big time

This also happens to me since day1 (started with jaunty on an Asus EEE 1005ha, and still happens in Lucid Beta1). Initially I blamed the atheros card, but after switching it for an Intel I still experience the same issues. One interesting thing is that audio stutters are much more noticeable when using N-speed network (using Apple Airport Extreme) than conventional G-speed network (thomson router). Sounds weird as supposedly there's more bandwidth with N... maybe the airport extreme is to blame, but again this stutter also happens in G networks (although it's almost un-noticeable).

Ben Gamari (bgamari)
summary: - [Hardy+Intrepid+Jaunty] Pulseaudio tunnel over wifi lags big time
+ Pulseaudio over wifi stutters horribly
Revision history for this message
MvW (2nv2u) wrote :

Seems to be an issue with 10.10 as well. Connecting to another pc over wifi results in really annoying strobing sound effects.
Using a cable fixes it but that's not a solution.
Tried upgrading wireless driver to no avail and after searching about a possible pulseaudio issue this bug popped up.
Any progress or possible solutions available?

Revision history for this message
MvW (2nv2u) wrote :

Anyone? Would love to see this fixed...

Revision history for this message
Martin Jensen (marjen) wrote :

I have the same problem. 10.10 on both computers. Wifi bandwidth is not the problem. Plugging in a cable solves the issue (but I don't want to do that). Thanks!

Revision history for this message
computerwiz_222 (computerwiz222) wrote :

I have the same issue on 11.04 when playing audio from my netbook through my laptop using PulseAudio.

The audio is very glitchy, playing at random. Sometimes it will play for 10-30 seconds just fine and then it goes into 10 seconds of choppiness.

With ethernet, it works great (and I love this feature btw).

Revision history for this message
MvW (2nv2u) wrote :

Same here, it still persists in 11.04 although it seems to be happening less then before.
I think it needs some buffering but this would mean a delay which will ruin any use where sound is used as reaction on something you did. For music (which is my main use) it would be fine though.
Maybe an idea to add some buffering options to the pulseaudio network stack?

Revision history for this message
crispy (efisker) wrote :

No need for me to add anything to this bug as we all know it exists. Wifi is laggy, cable good.

I would just like to add that this network sound is a killer feature of pulseaudio, and therefore also of ubuntu. There are so many use cases where this feature is useable by non-technical end users. Most people have a stationary computer connected to their stereo and use a laptop or other device around the area. Sending sound output to the stereo is in many cases a great convenience. I propose that this feature is a reason for many people who don't see a reason to shift from Windows or OSX to consider ubuntu, but as the situation is now there are a few issues that needs to be addressed:

1) Stability. For some reason my 10.04 installation stopped being able to play back sound it recieves from network. I believe this to be fixed with later installations.
2) Lag. Sound needs to play instantly, or almost instantly. I know that this an inherent design limitation of doing this over wireless, but there is a lag of more than what the latency of the network can account for. Sometimes 1-10 seconds.
3) Integration into the desktop. If issue 1 and 2 gets fixed to a point where it would be considered acceptable by end-users desktop integration should be addressed. For example, people need to be aware of this feature. It needs to be integrated into applications that ship with ubuntu. For example Totem could have a feature to compensate for the network lag if it was aware that it was redirecting sound over the network. Banshee could have a button next to the volume which could be pressed and sound would play over the network instead leaving other applications sounds still playing on the local sound card, for example system sounds, totem video, flash plugin etc.

Revision history for this message
crispy (efisker) wrote :

I would like to add that I think this bug or feature should have much higher priority.

Changed in pulseaudio (Ubuntu):
status: Triaged → Opinion
status: Opinion → Incomplete
Revision history for this message
crispy (efisker) wrote :

Sorry I changed the status of this bug by mistake. Didn't know what the button was for :D

Revision history for this message
Pedro Alves (alves-ped) wrote :

So do we need to put the status back to "Triaged" to raise awareness of the issue? I'm guessing the "Incomplete" status is making it so the people that should look at it aren't even looking...

Revision history for this message
Michał Kozal (panaut0lordv) wrote :

There is some good idea in pulseaudio ticket to implement some compression eg http://opus-codec.org/

Revision history for this message
Pedro Alves (alves-ped) wrote :

As per above, bug was "Incomplete" by mistake. Please put it back to Triaged or whatever state is more appropriate.

Changed in pulseaudio (Ubuntu):
status: Incomplete → New
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in pulseaudio (Ubuntu):
status: New → Confirmed
Revision history for this message
dimovnike (dimovnike) wrote :

i have raring on both machines, the desktop has a wired connection and a laptop has wifi-n the audio i still bad, every 3-10 seconds i hear pauses. WHen using wired connection on a laptop - works perfectly. My wifi pulls 80mbit/s according to iperf, while pulseaudio uses 3093.7 kbits, according to iptraf. Is there a way to increase the pulseaudi default buffering? May be there is a way to setup default lafency required from such connections?

Revision history for this message
Adam Porter (alphapapa) wrote :

For a few weeks I've been using PulseAudio network tunneling over wifi. I've noticed that on a very regular interval the audio stutters for a few seconds. I've been watching network traffic in KSysGuard, and I noticed that the transmit rate is usually about 200 KB/sec, but when the audio stutters, the transfer rate drops slightly. When that's the only thing going on on my network, I can observe this happening at a completely regular interval.

I finally figured out that it's caused by my laptop's wireless card scanning for other networks. I can make it stutter in exactly the same way on command by running "iwlist scan".

My laptop has an "Intel Corporation PRO/Wireless 4965 AG" network card, and it uses the iwl4965 driver. Now my laptop very rarely moves anywhere, and it is always on my home wifi network, so I don't need it to scan for other networks. If I could simply disable scanning on my laptop, it wouldn't stutter anymore.

Of course, more buffering in PulseAudio would help a little, but I think all it would do is cause it to stutter a bit less often. Eventually the stuttering would cause the buffer to empty, because it can't fill faster than audio is being played. So it could stutter less often, for a longer period of time, but it would still end up stuttering.

I've been googling around, trying to find a way to adjust the scan interval, but I haven't found anything yet. I'm not sure if it's controlled by wpa_supplicant or the driver. I've also seen that some cards seem to support "background scanning" and others "progressive scanning", and I don't know if one of those would mitigate it, or if my card already does one of them.

Anyway, for anyone else who is having stuttering, if you're on wireless, one cause of it is almost surely the scan interval. Find a way to fix that and you may solve it.

Revision history for this message
Adam Porter (alphapapa) wrote :

I figured out that Network Manager is what causes the scanning, and that can be stopped by setting the BSSID of the connection in the Network Manager settings. (In KDE there's a "Select" button next to the BSSID field that fills this in automatically if you're already connected to your AP.) Since the BSSID is set, you won't be roaming from one AP to another, so NM doesn't scan for other APs with the same SSID.

So I set my BSSID and that has stopped the scans, which I think happened every 120 seconds (according to the NM source). That has nearly completely fixed the stuttering. Any stuttering that remains is much less frequent and less severe; I'm not sure if it's network-related.

Here are some relevant bug reports:

https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/373680
https://bugzilla.redhat.com/show_bug.cgi?id=490493
https://bugzilla.gnome.org/show_bug.cgi?id=513820
https://bugzilla.redhat.com/show_bug.cgi?id=490493

This could also help if you need to disable it but forcing the BSSID isn't an option:

http://nilvec.com/disable-scanning-in-networkmanager-when-connected.html

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

Thank you for reporting this bug to Ubuntu.
Ubuntu 9.04 (jaunty) reached end-of-life on October 23, 2010.

See this document for currently supported Ubuntu releases:
https://wiki.ubuntu.com/Releases

Please upgrade to the latest version and re-test.

Changed in pulseaudio (Ubuntu):
status: Confirmed → Incomplete
affects: pulseaudio → ubuntu
no longer affects: ubuntu
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for pulseaudio (Ubuntu) because there has been no activity for 60 days.]

Changed in pulseaudio (Ubuntu):
status: Incomplete → Expired
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.