Crackling / scratching noise using Pulseaudio

Bug #345627 reported by Jamie Lawler
372
This bug affects 58 people
Affects Status Importance Assigned to Milestone
PulseAudio
New
Undecided
Unassigned
Nominated for Trunk by nullack
linux (Ubuntu)
Won't Fix
Medium
Daniel T Chen
Jaunty
Fix Released
Medium
Daniel T Chen

Bug Description

Jaunty SRU information follows:

Impact: Users of certain Intel8x0 and Intel HDA controllers are experiencing crackling and popping while playing audio files. These symptoms appear when the mixer elements are unmuted. These anomalies are due to buffering and clock adjustment calculations that incorrectly assume that the underlying hardware is well-behaved.

Resolution/Fix: Improve the buffering and clock calculations by providing more conservative floors and ceilings. Changes are backported from linux-2.6.git and alsa-kmirror.git. Provenance is given in the commits listed below in the Changesets section. Users have fared well using test kernels from http://kernel.ubuntu.com/~dtchen/.

The original proposal is available at https://lists.ubuntu.com/archives/kernel-team/2009-April/005405.html.

Test case: If one's audio hardware is among the affected Intel8x0- or Intel HDA-based, simply playing music in GNOME using Rhythmbox will expose this behaviour.

Changesets:
 - http://kernel.ubuntu.com/git?p=dtchen/ubuntu-jaunty.git;a=commit;h=b77756ea8b7c973af68258febd7cd11d4b88893a
 - http://kernel.ubuntu.com/git?p=dtchen/ubuntu-jaunty.git;a=commit;h=c5197004ef2b0c4ebfb0fcb68715a0fce4c39cad
 - http://kernel.ubuntu.com/git?p=dtchen/ubuntu-jaunty.git;a=commit;h=3ed92131e73867a5fb6064642fd6873fcd194d75

ACKs:
 - https://lists.ubuntu.com/archives/kernel-team/2009-April/005414.html
 - https://lists.ubuntu.com/archives/kernel-team/2009-April/005427.html

Regression potential: Theoretically, there is extremely low probability for regression, as these patches simply remove the assumptions that the underlying hardware is well-behaved. Practically, users of jack-audio-connection-kit (JACK) and other native ALSA apps [not routed through PulseAudio as is the default in Ubuntu] may notice changes in jitter. Testing since Jaunty's release has revealed no regressions.

--
Original bug information follows:

I hope this isn't a dupe. A few people (myself included) are experiencing odd crackling / scratching noises when using pulseaudio. This frequently happens when you try to start a new piece of music or video. Sometimes it will crackle for a few seconds, then play as normal; sometimes it will fast-forward through a few minutes of the song then start playing; sometimes it will crackle then stop entirely and I have to kill pa.

Here's a URL of my output of alsa-info.sh: http://www.alsa-project.org/db/?f=44dc1549d60508bd181a03ee1c65465aa5c9024d

Here's a link to the ongoing thread at ubuntuforums: http://ubuntuforums.org/showthread.php?t=1084919&page=4

I have pulseaudio 0.9.14 from the main jaunty server.

ProblemType: Bug
Architecture: i386
DistroRelease: Ubuntu 9.04
MachineType: Packard Bell BV EasyNote MB85
NonfreeKernelModules: nvidia
Package: linux-image-2.6.28-11-generic 2.6.28-11.35
ProcCmdLine: root=UUID=36b4053e-7e48-4a1a-8666-b63058a30816 ro quiet splash
ProcEnviron:
 LANG=en_GB.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.28-11.35-generic
SourcePackage: linux

Revision history for this message
Jamie Lawler (jamie-lawler) wrote :
Revision history for this message
Tuomas Aavikko (taavikko) wrote :

Changing to confirmed as affected also.

Changed in linux (Ubuntu):
status: New → Confirmed
Revision history for this message
Tuomas Aavikko (taavikko) wrote :
Revision history for this message
Kristoffer Lundén (kristoffer-lunden) wrote :
Revision history for this message
Mark Falcey (mfalcey) wrote :

I am also having this problem but not on my ALC883 sound chip or my C-Media 8768 PCI sound card, only with my usb headset. If I do not open pavucontrol it works fine but if I do open pavucontrol and then close it the usb headset becomes glitchy and scratchy after a few seconds. If I then open pavucontrol sound returns to normal immediately and if I keep it open the sound is fine everywhere. I do have simultaneous output enabled in papref but it does not matter if I choose only usb or simultaneous or if I remove the simultaneous output.

This is on Jaunty with pulseaudio 0.9.14 and has persisted through the last two pulseaudio updates.

Revision history for this message
morryis (morryis) wrote :

I experience similar sound glitches with Jaunty. Rhythmbox, Totem and especially flashplugin_nonfree (when playing Flash videos in Firefox) are affected. The notification sound in pidgin creates that rasping sound too. This sound bug sometimes makes the application crash.

Sometimes when I play a video, there is only this clicking/rasping sound and the video is playing like in slow motion. I noticed a similar effect after pausing a video for a longer time. I then have to restart Totem multiple times to make it play the video properly again. There is sometimes also an error message: "Failed to connect stream: Invalid argument". This error appears sometimes when I fast-forward a video in Totem or a song in Rhythmbox. I attached the Totem debug messages.
Since I experienced bug 320875 ("alsa-util.c: snd_pcm_avail_update() returned a value that is exceptionally large:") until it was fixed and the fix is only a temporary workaround, the real cause may be the same.

Revision history for this message
morryis (morryis) wrote :

Output of utils_alsa-info.sh

Revision history for this message
phenest (steve-clark) wrote :

Here's my output of alsa-info.sh

http://www.alsa-project.org/db/?f=367d9b752df8d6c3677ba6f5ce5a009d95304e91

I have the same issue as the OP.

Revision history for this message
Dylan McCall (dylanmccall) wrote :

I have observed this problem since upgrading to the Jaunty alpha. I was able to work around it by going to Sound Preferences and changing to sound playback in the "Music and Movies" profile to OSS. Using ALSA directly gave me the same issue as with pulseaudio.

Revision history for this message
Tuomas Aavikko (taavikko) wrote :

PA had to be killed, and restarted to make it work again.
Usually when testing sound via "gstreamer-properties" (auto-detect" it produces a beep.
When using a "pulseaudio" it produces an error message, just forgot to log it :( )

Revision history for this message
zp (zekopeko-deactivatedaccount) wrote :
Revision history for this message
Dave Jeffery (kecske-bak) wrote :

I've had this problem too.

Usually I can get the audio to start in Rhythmbox by restarting the file a few times until it finally plays, but occassionally you'll get loads of no entry signs appearing next to all of your tracks and you have to re-start.

Revision history for this message
morryis (morryis) wrote :

I also experience this problem when playing Flash-videos in Firefox, e.g. youtube. The video loads correctly. When the video starts to play, there is a scratching noise and after that only silence. The video playback than sometimes stops or displays only few frames and jumps. When I skip manually, it sometimes plays correctly for a few seconds. When I close the tab, the Firefox windows fades to gray and doesn't react anymore.

I experienced the same on a fresh Jaunty install on a friends laptop yesterday. This looks for me like a big and common problem and should recieve high attention/priority!

Revision history for this message
Asif Youssuff (yoasif) wrote :

Also affects me. See output of alsa-info.sh here:

http://www.alsa-project.org/db/?f=41eab7e4ad239353fc0bb93f2ab0fed7194aaa6b

Revision history for this message
Umuntu-Tim- (thembinkosi) wrote :

lspci, if there is any other file i can add please email me.

Revision history for this message
Umuntu-Tim- (thembinkosi) wrote :

dmesg

Revision history for this message
Umuntu-Tim- (thembinkosi) wrote :

I also noticed pulse starts crackling when i use the computer and there a peek on cpu usage.

Revision history for this message
Mimue (michael-mueller12) wrote :

Update of today for Jaunty Beta included also some changes in Alsa and pulseaudio. For me the sound works now properly, far better than before.
But I can still produce the crackling when playing too much around, meaning having open several windows with more than one source of sound active. Unfortunately I can't tell how to reproduce it reliably.

Revision history for this message
Ryan (ubuntu-draziw) wrote :

Have issue here too. I didn't reboot before collecting this...
Your ALSA information is located at:
http://www.alsa-project.org/db/?f=49ffd039a8c78b2e7f74e8ffe6c4ca9a80443221

VLC works fine, any can also play audio in totem, etc. But flash movie audio inside firefox is nothing but static, and audio in pidgen is static too.

Revision history for this message
Ryan (ubuntu-draziw) wrote :

Current boot, audio is working in vlc, etc - and in flash items. however, now my volume buttons trigger OSD notification changes, but do not affect the volume level (Dell Latitude D620). Right clicking volume and pulling up Volume Controller - using the HDA Intel (alsa mixer) Playback set to Master, the slider their does adjust volume level.

alsa-base.conf added
options snd-hda-intel power_save_controller=1
(read in post by Crimsum in forums)

Your ALSA information is located at http://www.alsa-project.org/db/?f=8f9ec0905132c49b3cca2b12bdaad29f9a6ac504

So this is progress, but how do I get my volume up/down buttons on the laptop to work again?

Revision history for this message
zp (zekopeko-deactivatedaccount) wrote :

this looks to be resolved with the latest jaunty up-dates

Revision history for this message
Asif Youssuff (yoasif) wrote :

Also looks to be resolved on my end with latest updates.

Revision history for this message
Dylan McCall (dylanmccall) wrote :

Definitely not resolved on my end :(

Crackling still happens, from the looks of it heavily influenced by CPU usage from other processes. Audio playback in videos is also crackly and gets out of sync / speeds up and slows down horribly.

alsa-info.sh output:
http://www.alsa-project.org/db/?f=7be8a26c7a881e91b7f82b61dbc0d5df245a7fe1

lspci output is attached.

Revision history for this message
talent03 (talent03) wrote :

I just came to say a me too. I have a m1330 dell and I get the same problems as @morryis above. I have the latest udpates as of April 8, 2009 for Jaunty.

Daniel T Chen (crimsun)
Changed in linux (Ubuntu):
assignee: nobody → Daniel T Chen (crimsun)
status: Confirmed → In Progress
Revision history for this message
Fernando Miguel (fernandomiguel) wrote :

I just installed dtchen kernel images, and it seems to help a lot with video playback. Sometimes i still get a bit of slowdown, but it quickly gets on track

mplayer presented me with this:
[pulse] working around probably broken pause functionality, see http://www.pulseaudio.org/ticket/440

$ uname -a
Linux blubug 2.6.28-12-generic #42~crimsun1lp345627 SMP Sat Apr 11 02:00:26 UTC 2009 x86_64 GNU/Linux

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

Just for reference, I have test kernels at http://kernel.ubuntu.com/~dtchen/

Note the ABI bump - it is not in Jaunty, so you will need to track carefully further updates to Jaunty's kernel images.

Changed in linux (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Dylan McCall (dylanmccall) wrote :

Note that the "duplicate" bug report linked to this one is not just a duplicate; it links to patches!

<https://bugs.edge.launchpad.net/ubuntu/+source/linux-meta/+bug/360062>

Thanks for finding those, David :)

Revision history for this message
David Nielsen (davidnielsen-deactivatedaccount) wrote :

I know it's very late in the game to put these into Jaunty but I am hoping we can get those patches in somehow.

Revision history for this message
Daniel T Chen (crimsun) wrote : Re: [Bug 345627] Re: Crackling / scratching noise using Pulseaudio

On Sun, 12 Apr 2009, Dylan McCall wrote:

> Note that the "duplicate" bug report linked to this one is not just a
> duplicate; it links to patches!

It is a duplicate. I've already rolled kernels with those patches
(yesterday), and you haven't given any feedback...

Revision history for this message
David Nielsen (davidnielsen-deactivatedaccount) wrote :

For what it is worth, I have been using that kernel all day playing sound and there has not been any crashing of pulseaudio. The logs still show some errors regarding possible driver bugs but PA itself is stable and the sound is crackle and pop free.

Revision history for this message
Dylan McCall (dylanmccall) wrote :

Daniel,
I tried your kernel images and whatnot... I'm hesitant to say for certain, but that _seems_ to have resolved the synchronization issues I had with video playback. (The video itself still performs horribly compared to last release, but that's probably another bug).
Audio still gets the occasional (though somewhat rare / hard to trace) crackle on my end, particularly when there are many things going on.

Revision history for this message
Conn O Griofa (psyke83) wrote :

BUGabundo & others,

If you're noticing video stuttering in media players (with or without audio stuttering), it's possible that your graphics hardware's MTRR ranges aren't setup properly, which causes performance issues. It's feasible that this may accentuate audio skipping slightly.

I suggest everyone take a look at bug #314928 (especially those with Intel graphics adaptors) to see if you're affected.

Revision history for this message
futurefx (force) wrote :

i hope it is fixed in final release because when i install Ubuntu 9.04 to someone i disable updates and someone has expensive mobile internet and cannot afford updates.

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

On Tue, 14 Apr 2009, futurefx wrote:

> i hope it is fixed in final release because when i install Ubuntu 9.04
> to someone i disable updates and someone has expensive mobile internet
> and cannot afford updates.

The fixes are too invasive beyond kernel freeze but will be in an SRU.

Revision history for this message
futurefx (force) wrote :

so you tell that ubuntu 9.04 will become broken release? do killing and removing pulseaudio helps

Revision history for this message
Ryan (ubuntu-draziw) wrote :

argh. My sound had been fixed by a prior mainstream update - and just broke again on the last batch. I'm back to having static, and no input sound device. :(

Revision history for this message
Asif Youssuff (yoasif) wrote :

I too am seeing the return of some stuttering while playing mp3s
(mocp). it seemed fixed for a while, but it seems to be back with my
latest updates.

On Tue, Apr 14, 2009 at 5:18 PM, Ryan <email address hidden> wrote:
> argh.  My sound had been fixed by a prior mainstream update - and just
> broke again on the last batch.  I'm back to having static, and no input
> sound device. :(
>
> --
> Crackling / scratching noise using Pulseaudio
> https://bugs.launchpad.net/bugs/345627
> You received this bug notification because you are a direct subscriber
> of the bug.
>

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

@asif use the test kernel mentioned above

On Apr 14, 2009 11:25 PM, "Asif Youssuff" <email address hidden> wrote:

I too am seeing the return of some stuttering while playing mp3s
(mocp). it seemed fixed for a while, but it seems to be back with my
latest updates.

On Tue, Apr 14, 2009 at 5:18 PM, Ryan <email address hidden> wrote: > argh. My
sound had been fixed b...
> You received this bug notification because you are a direct subscriber
> of the bug.

> -- Crackling / scratching noise using Pulseaudio
https://bugs.launchpad.net/bugs/345627 You rece...

Revision history for this message
Asif Youssuff (yoasif) wrote :

Daniel, running your test kernel now, seems fixed. Not sure if it's related, but Cheese now picks up my webcam in my laptop as well. (It didn't with the previous kernel) Not sure what you're patching here, but it seems be doing some good.

Revision history for this message
Asif Youssuff (yoasif) wrote :

I spoke too soon, the audio is now stuttering a bit... no more crackling or scratching (yet), but now I'm getting a stutter.

Daniel T Chen (crimsun)
description: updated
Stefan Bader (smb)
Changed in linux (Ubuntu):
status: In Progress → Fix Committed
Steve Langasek (vorlon)
tags: added: verification-needed
Martin Pitt (pitti)
Changed in linux (Ubuntu Jaunty):
status: New → Fix Committed
tags: added: verification-done
removed: verification-needed
Martin Pitt (pitti)
tags: added: hw-specific verification-needed
removed: verification-done
Daniel T Chen (crimsun)
Changed in linux (Ubuntu Jaunty):
status: Fix Committed → Confirmed
Martin Pitt (pitti)
tags: added: verification-failed
removed: verification-needed
Daniel T Chen (crimsun)
Changed in linux (Ubuntu):
status: Fix Committed → Triaged
Changed in linux (Ubuntu Jaunty):
assignee: nobody → Daniel T Chen (crimsun)
importance: Undecided → Medium
status: Confirmed → Triaged
75 comments hidden view all 155 comments
Revision history for this message
Sean (svz90) wrote :

Not sure if this is the same problem, but I'm having audio playback problems on my ForteMedia FM801-AU - sound in all applications suffers from occasional "hiccups". However, the most severe problem is that flash video seems to get stuck in "fast forward" after some time (playback of both audio and video is very fast and extremely choppy). Updating linux-image-generic to 2.6.28.12.16 in jaunty-proposed made the problem less severe (the system played a number of flash videos flawlessly, but then eventually suffered from the same fast-forward problem). Is this the same problem? Were there other packages that needed to be updated (other than linux-image) to fix the problem?

Sean

Revision history for this message
carl99fan (carl99fan) wrote :

I am having the same problem as Sean, for the most part. Also happens in Amarok for me. As long as I keep the sound Muted I can watch flash videos without problem. I am having the (cpulimit.c: Received request to terminate due to CPU overload) found in the log. Seems to have gotten gradually gotten worse noticing I had not gotten any updates since I had upgraded to Jaunty. After some research I found that I had a broken package that I had forgotten about. So I updated after fixing the broken package using the package manager. I had many updates about 274 megs worth and it included updates to my generic kernel. I have had this problem since and has gotten to the point I have no sound and I dare not enable it or I might even crash. Forcing a hard boot 2 times in the last 3 days. I have been searching everywhere and I find that Sean has the most similar problems.

Revision history for this message
carl99fan (carl99fan) wrote :

Had a problem while I was muted now. Gkrellm let me know to look for message.

May 30 23:02:05 sara-desktop pulseaudio[8504]: main.c: Called SUID root and real-time and/or high-priority scheduling was requested in the configuration. However, we lack the necessary privileges:
May 30 23:02:05 sara-desktop pulseaudio[8504]: main.c: We are not in group 'pulse-rt', PolicyKit refuse to grant us the requested privileges and we have no increase RLIMIT_NICE/RLIMIT_RTPRIO resource limits.
May 30 23:02:05 sara-desktop pulseaudio[8504]: main.c: For enabling real-time/high-priority scheduling please acquire the appropriate PolicyKit privileges, or become a member of 'pulse-rt', or increase the RLIMIT_NICE/RLIMIT_RTPRIO resource limits for this user.

Hope this helps or maybe you could direct me to someone who can help this bug.

Revision history for this message
Martin Pitt (pitti) wrote :

Accepted into jaunty-proposed:

 linux (2.6.28-13.44) jaunty-proposed; urgency=low
 .
   [ Stefan Bader ]
 .
   * Revert "SAUCE: [jaunty] ALSA: Add retry for Intel8x0 clock measurement"
   * Revert "SAUCE: [jaunty] ALSA: Fix clock and buffer calculations for
     Intel8x0"
   * Revert "SAUCE: [jaunty] ALSA: Fix buffer positions and checks"

This reverts the attempted fix for this and avoids the regression.

tags: removed: verification-failed
Revision history for this message
Jacob (jacob-rau) wrote :

This problem is definitely something to do with high CPU usage, at least on my machine. First, my specs: Dell Latitude D520, 1.66GHz Centrino Duo, 3GB of RAM, lspci lists my audio device as "00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 01)". Now, if you guys want, you can run me out of here--I am running an unofficial kernel build; it is "2.6.29-02062903-generic"; I installed it to combat the Intel graphics regression. If these two fixes are mutually exclusive, I am going to revert to 9.04 because that would make 9.10 unusable...

Let me know if you need more information.

Revision history for this message
Jacob (jacob-rau) wrote :

Forgot to say HOW I know it is a CPU-usage related problem...

If I am ripping a CD, my processor is being used just under 50% (and that means an entire core, as this is a dual-core system). When I am ripping CDs, this problem surfaces. I haven't seen this problem anywhere else, but I don't tend to stress my CPU when listening to music either. I will try some other ideas to stress it and see if the problem resurfaces.

As other people have hinted at, here is the behavior:
I start a track in either Rhythmbox or Totem. The counter stays at 0:00, or starts counting rather quickly (3-4 seconds per second). The audio is all crackling. CPU usage spikes well above 75%, and is fairly erratic. If I stop the track and start it back up, sometimes I can get it to play, but usually I have to restart the computer. I don't know how to kill PA and restart it, as I haven't had any problems until recently.

Sorry my original description was so lame...

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

This bug was fixed in the package linux - 2.6.28-13.44

---------------
linux (2.6.28-13.44) jaunty-proposed; urgency=low

  [ Stefan Bader ]

  * Revert "SAUCE: [jaunty] ALSA: Add retry for Intel8x0 clock measurement"
  * Revert "SAUCE: [jaunty] ALSA: Fix clock and buffer calculations for
    Intel8x0"
  * Revert "SAUCE: [jaunty] ALSA: Fix buffer positions and checks"

linux (2.6.28-12.43) jaunty-proposed; urgency=low

  [ Amit Kucheria ]

  * Enable SYN_COOKIES for iop32x and versatile flavours
    - LP: #361687
  * SAUCE: Quirk for BT USB device on MacbookPro to be reset before use
    - LP: #332443

  [ Brad Figg ]

  * [jaunty] Add missing mvsas (Marvel SAS 6440) module configuration.
    - LP: #352336

  [ Chuck Short ]

  * SAUCE: [USB] Unusual Device support for Gold MP3 Player Energy
    - LP: #125250

  [ Daniel T Chen ]

  * SAUCE: [jaunty] ALSA: Fix buffer positions and checks
    - LP: #345627
  * SAUCE: [jaunty] ALSA: Fix clock and buffer calculations for Intel8x0
    - LP: #345627
  * SAUCE: [jaunty] ALSA: Add retry for Intel8x0 clock measurement
    - LP: #345627

  [ Luke Yelavich ]

  * disable CONFIG_SND_HDA_INPUT_BEEP on amd64 and i386
    - LP: #331589

  [ Makito SHIOKAWA ]

  * [ARM] 5404/1: Fix condition in arm_elf_read_implies_exec() to set
    READ_IMPLIES_EXEC
    - LP: #364358

  [ Manoj Iyer ]

  * SAUCE: Added quirk to fix key release for Samsung NC20
    - LP: #360247

  [ Oleg Nesterov ]

  * posix timers: fix RLIMIT_CPU && fork()
    - LP: #361508

  [ Scott James Remnant ]

  * [Config] Disable libusual and the ub driver
    - LP: #364538

  [ Stefan Bader ]

  * Disable unwanted staging builds
    - LP: #366144
  * Remove prism2_usb driver from ubuntu and use the one from staging
    - LP: #325366
  * SAUCE: Make rtl8187se depend on WIRELESS_EXT
    - LP: #366144
  * Disable CONFIG_RTL8187SE for armel.versatile
    - LP: #366144

  [ Tejun Heo ]

  * libata: handle SEMB signature better
    - LP: #257790

  [ Tim Gardner ]

  * Set USB_SERIAL=m for i386/amd64
    - LP: #345002
  * SAUCE: Jaunty - aic79xx - set reset delay to 5 seconds, down from 15.
    - LP: #79542
  * SAUCE: (drop after 2.6.28) Wifi suspend/resume scan timeout fixes
    - LP: #336055
  * Sony laptop: Sony Vaio laptops do not enable wwan power by default.
    - LP: #364678

  [ Tyler Hicks ]

  * SAUCE: (drop after 2.6.28) eCryptfs: Larger buffer for encrypted
    symlink targets
    - LP: #357345

  [ Upstream Kernel Changes ]

  * V4L/DVB (9999): gspca - zc3xx: Webcam 046d:089d added.
    - LP: #326674
  * V4L/DVB (10044): gspca - pac7311: Webcam 093a:2620 added.
    - LP: #363195
  * hwmon: (it87) Add support for the ITE IT8720F
    - LP: #357766
  * vgacon: Return the upper half of 512 character fonts
    - LP: #355057
  * drm/i915: add support for G41 chipset
    - LP: #365958

 -- Stefan Bader <email address hidden> Mon, 25 May 2009 17:30:40 +0200

Changed in linux (Ubuntu Jaunty):
status: Triaged → Fix Released
Revision history for this message
Djainette (djainette) wrote :

Still not fixed.
Sound is still playing in fast-forward in audacious/vlc, and flash videos run in fast-forward too to keep the sync with the sound.

Revision history for this message
Conn O Griofa (psyke83) wrote :
Download full text (4.5 KiB)

Luke & Daniel,

I've been experimenting with PulseAudio in Karmic and Fedora 11, and I'm making some observations/suggestions relevant to this bug report, and PulseAudio as a whole.

My basic codec identifier, for reference:
conn@inspiron:~/.pulse$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: I82801DBICH4 [Intel 82801DB-ICH4], device 0: Intel ICH [Intel 82801DB-ICH4]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 0: I82801DBICH4 [Intel 82801DB-ICH4], device 4: Intel ICH - IEC958 [Intel 82801DB-ICH4 - IEC958]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

In Fedora 11 (which uses kernel 2.6.29 and PulseAudio 0.9.15 with glitch-free playback enabled and no resampler/fragment customizations, unlike Ubuntu), audio works perfectly without any stutters, and bug #374002 is not triggered on my system.

With Karmic using the default PulseAudio settings, I'm experiencing what I would call micro-stutters, where the sound appears to skip an extremely short duration (milliseconds) every 20 seconds or so - this never occurred on Intrepid or Hardy with PulseAudio, is 100% reproducible in Totem and other applications, and is definitely not due CPU starvation. Bug #374002 [1] is not triggered, but only because glitch-free playback is disabled.

On Karmic with kernel 2.6.30-10-generic, I modified PulseAudio's configuration to use a vanilla PulseAudio configuration that's equal to Fedora (tsched=1, and no customizations to the resampler or default-fragment* values). This eliminated the microstutters entirely, but it triggers bug #374002 on my laptop after some minutes of audio playback. Even Skype appears to work correctly for a short time, but the aforementioned bug always kicks in within a few minutes, which requires PulseAudio to be restarted manually.

Tonight I upgraded to kernel 2.6.31-1-generic and with the same vanilla configuration, microstutters are eliminated entirely *and* bug #374002 is no longer triggered on my system. Even the most troublesome application, Skype, works absolutely flawlessly with PulseAudio (when configured to use the "pulse" device). There are no stutters at all, and Skype maintains a single client connection to the PulseAudio server (I'm sure you've noticed the problem where Skype connects and disconnects to the server dozens or sometimes hundreds of times in the space of a few minutes, causing stuttering - this no longer occurs).

First, a question: why did kernel 2.6.30-10-generic trigger bug #374002, when it was supposed to be fixed since kernel 2.6.29 according to Fedora's bug report related to my particular codec [2]? As I said earlier, this bug did not occur when I tested Fedora 11 on my laptop.

Second, a proposal: let's enable glitch-free playback and revert the modifications to the default-resampler, default-fragments and default-fragment-size-msec parameters.

I understand that this will trigger the snd_pcm_delay/snd_pcm_avail errors in buggy drivers (even though my particular codec appears fixed), but we need to face facts:
a) interrupt-based playback in PulseAudio really is "glitchy", and audio quality is suffering for everyone on Karmic as a result;
b) the resampler/fragment modifications we ...

Read more...

Revision history for this message
Conn O Griofa (psyke83) wrote :

Sorry, slight correction to my previous post. With kernel 2.6.31-1-generic and glitch-free PulseAudio, Skype does have the problem of hundreds of connections opening/closing - but there is absolutely no stuttering even under CPU load.

This issue is probably due to Skype's buggy implemention of the ALSA API; nevertheless, it just shows that glitch-free handles this problem more robustly than using custom fragment values and lower-quality resamplers (as long as your ALSA kernel driver works correctly).

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

On Tue, Jun 30, 2009 at 10:52 PM, Conn<email address hidden> wrote:
> First, a question: why did kernel 2.6.30-10-generic trigger bug #374002,
> when it was supposed to be fixed since kernel 2.6.29 according to
> Fedora's bug report related to my particular codec [2]? As I said
> earlier, this bug did not occur when I tested Fedora 11 on my laptop.

2.6.30 does not contain all the core/pcm mid-layer fixes that 2.6.31-git does.

Note also that Fedora 11, Ubuntu Jaunty, and Ubuntu Karmic have
different audio stacks.

> Second, a proposal: let's enable glitch-free playback and revert the
> modifications to the default-resampler, default-fragments and default-
> fragment-size-msec parameters.

The latter two modifications don't make any difference when
glitch-free is enabled. I dogfood before putting changes into the
Ubuntu repository: to that end, for a bit I've tested 2.6.31-rc1-fix1
and glitch-free enabled with much improved results on a lot of
hardware (AC'97-, HDA-, USB-based).

So, yes, it makes sense to stop applying those two quilt patches to
Karmic's pulse source.

> (even though my particular codec appears fixed)

Distinction: we work around your broken controller (your codec is
quirky but not relevant here).

> a) interrupt-based playback in PulseAudio really is "glitchy", and audio quality is suffering for everyone on Karmic as a result;

Ubuntu also does not use HZ=1000 combined with NOHZ or PREEMPT, unlike Fedora.

> b) the resampler/fragment modifications we use in Ubuntu are poor workarounds [3] for the erratic buffering behaviour in certain applications (Skype) and CPU usage caused by interrupt-based playback in PulseAudio;

Agreed (in the past there were concerns about limiting CPU usage for
low-powered devices).

> c) There is no guarantee that we can resolve the current stuttering/buffering issues with interrupt-based playback, as it seems pretty obvious that the majority of development is focused on glitch-free playback in PulseAudio;

Agreed, it's really an intractable problem, because far too much
hardware is plain broken.

> d) We are depriving ourselves of the opportunity to co-operate with the PulseAudio, Fedora, ALSA and upstream kernel developers in squashing the remaining bugs in PulseAudio and the ALSA kernel drivers that glitch-free playback exposes.

Timing is perhaps the biggest factor. These changes are queued, but
they weren't going to be put into Karmic without a 2.6.31-rc1-based
kernel landing first.

> I am aware that some sound cards may never work correctly with glitch-
> free (due to poor hardware documentation), but perhaps we can consider a
> method to blacklist cards later on - let's cross that bridge when we
> come to it.

Presently there is no callback into the driver for such information,
so we are incapable of doing so. Also, there are far too many hardware
combinations. It's much easier to simply disable glitch-free for those
cards.

Revision history for this message
Sean (svz90) wrote :

Though I may be mistaken, don't the changes made by Stefan Bader in the recent kernel revision undo the fix? If so, doesn't that mean that status should still be Triaged, not Fix Released?

Revision history for this message
ken sease (seasekr2) wrote :

Good question. I am running along happy on my Jaunty 32bit. I have
noticed a couple of lockups when coming out of suspend the last couple
of days. Maybe because I installed VirtualBox and XP inside that. Not
sure what is causing the lockups yet...

I have a spare hard drive that I might install 64 bit Jaunty on because
I have never tried that before. It will be interesting to see how the
audio and video does. I have a DV6000 series HP Laptop with an AMD-64.

Ken

On Fri, 2009-07-03 at 18:35 +0000, Sean wrote:
> Though I may be mistaken, don't the changes made by Stefan Bader in the
> recent kernel revision undo the fix? If so, doesn't that mean that
> status should still be Triaged, not Fix Released?
>

Revision history for this message
TheJointChief (thejointchief) wrote :

I am running 9.04 (upgraded from 8.10) and have had sound/video issues ever
since, regardless of the application I am using. Basically, if I play a
video or music file, and pause, stop, or start a new video, the program
stops playing audio/video, or it plays it in a crackling way. I've tried
uninstalling the pulse audio stuff and reinstalling, but that didnt help nor
have any of the recent updates.

If anyone has any suggestions or questions, please ask away :)

-Wes

On Fri, Jul 3, 2009 at 7:47 PM, ken sease <email address hidden> wrote:

> Good question. I am running along happy on my Jaunty 32bit. I have
> noticed a couple of lockups when coming out of suspend the last couple
> of days. Maybe because I installed VirtualBox and XP inside that. Not
> sure what is causing the lockups yet...
>
> I have a spare hard drive that I might install 64 bit Jaunty on because
> I have never tried that before. It will be interesting to see how the
> audio and video does. I have a DV6000 series HP Laptop with an AMD-64.
>
> Ken
>
> On Fri, 2009-07-03 at 18:35 +0000, Sean wrote:
> > Though I may be mistaken, don't the changes made by Stefan Bader in the
> > recent kernel revision undo the fix? If so, doesn't that mean that
> > status should still be Triaged, not Fix Released?
> >
>
> --
> Crackling / scratching noise using Pulseaudio
> https://bugs.launchpad.net/bugs/345627
> You received this bug notification because you are a direct subscriber
> of a duplicate bug.
>

--
-TheJointChief

Revision history for this message
ken sease (seasekr2) wrote :
Download full text (5.2 KiB)

My only suggestion, from my experience, is to try to do a fresh complete
install, not an upgrade from 8.10. When I did the upgrade I had the
same problems but after doing a fresh from scratch install of Jaunty my
sound and video work fine.

Ken

On Sun, 2009-07-05 at 04:36 +0000, TheJointChief wrote:
> I am running 9.04 (upgraded from 8.10) and have had sound/video issues ever
> since, regardless of the application I am using. Basically, if I play a
> video or music file, and pause, stop, or start a new video, the program
> stops playing audio/video, or it plays it in a crackling way. I've tried
> uninstalling the pulse audio stuff and reinstalling, but that didnt help nor
> have any of the recent updates.
>
> If anyone has any suggestions or questions, please ask away :)
>
> -Wes
>
> On Fri, Jul 3, 2009 at 7:47 PM, ken sease <email address hidden> wrote:
>
> > Good question. I am running along happy on my Jaunty 32bit. I have
> > noticed a couple of lockups when coming out of suspend the last couple
> > of days. Maybe because I installed VirtualBox and XP inside that. Not
> > sure what is causing the lockups yet...
> >
> > I have a spare hard drive that I might install 64 bit Jaunty on because
> > I have never tried that before. It will be interesting to see how the
> > audio and video does. I have a DV6000 series HP Laptop with an AMD-64.
> >
> > Ken
> >
> > On Fri, 2009-07-03 at 18:35 +0000, Sean wrote:
> > > Though I may be mistaken, don't the changes made by Stefan Bader in the
> > > recent kernel revision undo the fix? If so, doesn't that mean that
> > > status should still be Triaged, not Fix Released?
> > >
> >
> > --
> > Crackling / scratching noise using Pulseaudio
> > https://bugs.launchpad.net/bugs/345627
> > You received this bug notification because you are a direct subscriber
> > of a duplicate bug.
> >
>
>
> --
> -TheJointChief
>
> --
> Crackling / scratching noise using Pulseaudio
> https://bugs.launchpad.net/bugs/345627
> You received this bug notification because you are a direct subscriber
> of a duplicate bug.
>
> Status in PulseAudio sound server: New
> Status in “linux” package in Ubuntu: Triaged
> Status in linux in Ubuntu Jaunty: Fix Released
>
> Bug description:
> Jaunty SRU information follows:
>
> Impact: Users of certain Intel8x0 and Intel HDA controllers are experiencing crackling and popping while playing audio files. These symptoms appear when the mixer elements are unmuted. These anomalies are due to buffering and clock adjustment calculations that incorrectly assume that the underlying hardware is well-behaved.
>
> Resolution/Fix: Improve the buffering and clock calculations by providing more conservative floors and ceilings. Changes are backported from linux-2.6.git and alsa-kmirror.git. Provenance is given in the commits listed below in the Changesets section. Users have fared well using test kernels from http://kernel.ubuntu.com/~dtchen/.
>
> The original proposal is available at https://lists.ubuntu.com/archives/kernel-team/2009-April/005405.html.
>
> Test case: If one's audio hardware is among the affected Intel8x0- or Intel HDA-based, simply playing music in GNOME using Rhythmbox...

Read more...

Revision history for this message
Dave Gilbert (ubuntu-treblig) wrote :

I'm still hearing popping with current Karmic (2.6.31-2) kernel - it's very noticeable.

Dave

Revision history for this message
Conn O Griofa (psyke83) wrote :

Dave,

You won't see any improvement until you enable glitch-free audio (providing that glitch-free works for your hardware) - see the recent posts by myself and Daniel. Until this is done officially, you can edit the configuration files yourself:

1. Create a copy of the configuration files to your user's pulse folder:
$ cp /etc/pulse/* ~/.pulse/

2. Edit ~/.pulse/default.pa, do a search for "tsched=0" and change to "tsched=1".

3. (Optional). Edit ~/.pulse/daemon.conf and comment the "resample-method", "default-fragments" and "default-fragments-msec" lines, like so:

; resample-method = speex-float-1
; default-fragments = 8
; default-fragment-size-msec = 10

This should completely eliminate stuttering, as long as your audio card doesn't trigger certain kernel bugs (see my previous comment to see a related bug).

Note: be sure to delete the contents of ~/.pulse/ to revert these settings if there is a pulseaudio update, otherwise the newer configuration files in /etc/pulse will get ignored.

Revision history for this message
Dave Gilbert (ubuntu-treblig) wrote :

Hi Conn,
  Neither of those tweaks helped (I made them in the /etc/pulse files and then restarted pa with pactl exit).
I also tried setting the default sample rate to 48k that has helped a bit in the past; doesn't seem to make much odds.

Dave

Revision history for this message
cmcginty (casey-mcginty) wrote :

Just wondering if any has actually seen an improvement in this bug? I just updated and followed the suggestions from Conn, but still have stuttering on audio. The changes from Conn seamed to make it more noticeable actually. Is it just my system, or what?

Sorry, but this bug is going on 4 months now. Is there anyway this one can be killed soon?

Revision history for this message
RdeWit (rdewit) wrote :

Hi, I gave up on the current kernel with PulseAudio. I installed Linux Kernel 2.6.30 and reverted back to Alsa and that seems to work for me. This link explains how to install the new kernel: http://www.ramoonus.nl/2009/06/10/linux-kernel-2-6-30-installation-guide-for-ubuntu-and-debian-linux/.

I hope this helps someone.

Revision history for this message
Djainette (djainette) wrote :

I even removed pulseaudio to use Alsa instead => no fix.
Updated Jaunty with kernel version 2.6.28-14 and reinstalled pulseaudio => worked a few minutes and then the sound glitches started again.

I don't know if this problem is related to pulseaudio or if this is a kernel problem, but to me Jaunty has just been dead space on my hard drive for more than 3 months. I'm just totally ridiculous when I talk of free software around me.

Revision history for this message
pt123 (pt123) wrote :

why are the other bugs (where the video stutters) being assigned as a duplicate of this when this bug has been marked as fixed. When people are still experiencing Video stuttering and audio being out of sync?

Revision history for this message
Djainette (djainette) wrote :

Tried Karmic alpha 4 today... "Null output" for sound.
Probably because of https://bugs.launchpad.net/ubuntu/+source/udev/+bug/393665

Revision history for this message
Djainette (djainette) wrote :

With 2.6.28-15-generic on Jaunty,
when booting with acpi=off option, sound is OK
when booting with noapic option, sound is borked.
Can't boot without one of these.

Revision history for this message
Dave Gilbert (ubuntu-treblig) wrote :

I'm curious if my original bug that was marked as a dupe of this (clicks/pops - often associated with video)
might be helped by the fix that's just gone into 2.6.31-8.28 as a fix for 412492 which increases a latency figure for intel video; in the case of video it got some flicker/dropping on the video.

(The current set of updates with 2.6.31-8 do seem to be better for my audio - I wonder if it was that fix or something else or another package update).

Dave

Revision history for this message
Djainette (djainette) wrote :

Tried the karmic 20090829.2 daily build : the sound seems to work fine (except a single loud crackle when the device is awaken). Just installed it instead of jaunty, more reports once I get to activate the proprietary wifi drivers from an ethernet connection.

Revision history for this message
cmcginty (casey-mcginty) wrote :

+1 for post <a href="https://bugs.launchpad.net/ubuntu/+source/linux/+bug/345627/comments/139">#139</a>.

I applied the "acpi=off" to my grub boot and it seems to have fixed all my sound issues.

Revision history for this message
nullack (nullack) wrote :

Daniel this is happening on Karmic. I get popping / scratching on all audio following the first desktop attempt to play a sound. I have an audigy 2 soundcard.

Revision history for this message
Brad Bowman (launchpad-bereft) wrote :

Crackly sounds on a fresh Jaunty install. I've tried various things but
haven't upgraded the kernel/alsa yet.

I'm still not clear that this is the bug I'm having, is there diagnostic
test other than upgrading the kernel?

I changed /etc/pulse/client.conf to "autospawn = no" and ran
aplay and still got some skips and crackles, hopefully this is
showing it's not pulseaudio in my case (?).
Is this the right way to test alsa without pulseaudio involved?
(With autospawn still "no", I ran pulseaudio --start, then aplay,
then pulseaudio --kill and audio stopped as expected)

The "Sound Playback" test sound in System > Preferences > Sound (gnome)
was choppy/stuttering/glitchy via Auto, Alsa, OSS and PulseAudio (when running).
It sounds like morse code. One oddity is that the drop-out only occurs at
volume levels over about 80%, with glitches getting more frequent up to 100%.

http://www.alsa-project.org/db/?f=7cb7e160ca7c796d8a76619080c54086e374dadb

"ubuntu-bug alsa-base", recommended at https://launchpad.net/~crimsun,
wasn't showing me this bug to attach to, I guess because it's "Fix Released"?

$ pulseaudio --dump-conf | egrep 'real|prior|resample|nice'
I: caps.c: Limited capabilities successfully to CAP_SYS_NICE.
I: caps.c: Dropping root privileges.
I: caps.c: Limited capabilities successfully to CAP_SYS_NICE.
high-priority = yes
nice-level = -11
realtime-scheduling = no
realtime-priority = 5
resample-method = auto
rlimit-nice = 31

Revision history for this message
Brad Bowman (launchpad-bereft) wrote :

It seems this bug doesn't apply to me, and that I just needed to find the right
documentation, then set the model= parameter. Sorry for the waste of time.

I'll note my solution in case it helps random web searchers, but it's NOT
related to this bug. I should also qualify these hints: I just found something
that worked for me and don't deeply understand what is going on.

==
The document with the hint required was ALSA-Configuration.txt's
"Module snd-hda-intel" section, online at:
  http://www.kernel.org/doc/Documentation/sound/alsa/ALSA-Configuration.txt
or /usr/share/doc/alsa-base/driver/ALSA-Configuration.txt.gz locally.
(It's mentioned in https://help.ubuntu.com/community/SoundTroubleshooting)

I set the option in a new file (/etc/modprobe.d/alsa-hda-intel-model.conf):
  options snd-hda-intel model=6stack-dig
(the first one I tried worked with my headphones, that's all I need)

I applied the change with:
$ sudo alsa force-reload # BEWARE kills you're audio using processes
$ cat /sys/module/snd_hda_intel/parameters/model

This fixed the stutters/crackles at high volume for via both alsa and pulse.

I've since discovered the excruciating details:
http://www.kernel.org/doc/Documentation/sound/alsa/HD-Audio.txt
http://www.kernel.org/doc/Documentation/sound/alsa/HD-Audio-Models.txt

(Things that didn't help:
* Jaunty proposed kernel (I think I already had the patches discussed above)
   2.6.28-15-generic #52-Ubuntu SMP Wed Sep 9 10:48:52 UTC 2009 x86_64 GNU/Linux
* snd-hda-intel position_fix parameter, description sounded relevant though)

Revision history for this message
TheCheeze (mrcheeze) wrote :

I am currently having this bug on Karmic Final Release using an HDA Nvidia Conexant sound card in my HP Pavilion DV2000 Series laptop. The sound crackles on notifications and they tend to play at double-speed as well.

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

@TheCheeze Those symptoms read like a hardware issue, not PA-related
(though PA does push ALSA harder than anything). You may need one/both
of position_fix/bdl_pos_adj module parameters.

Revision history for this message
ken sease (seasekr2) wrote :

same problem on my dv6000 but does not occur on my 9.04 install...

TheCheeze wrote:
> I am currently having this bug on Karmic Final Release using an HDA
> Nvidia Conexant sound card in my HP Pavilion DV2000 Series laptop. The
> sound crackles on notifications and they tend to play at double-speed as
> well.
>
>

Revision history for this message
efexorce (mustafa-ulker) wrote :
Revision history for this message
bntly (ev3rsion) wrote :

The fixes in this thread have removed the major beeps/glitches/cracking, but i am still getting 'glitching' in the audio during movie playback with both VLC/Mplayer. Where gltiching is an undulating in the audio (So, high lows synced to CPU usage it seems).

I'm using onboard audio on an EVGA N560sli (with nvidia chipset..)

Since my Xi-F isn't supported! Damn SB!

Revision history for this message
bntly (ev3rsion) wrote :

Futher: This does not happen during pure audio playback -> only when Video is thrown in the mix.

Changed in pulseaudio:
status: New → Opinion
Revision history for this message
anthony burman (antburman) wrote :

ubuntu-bug pulseaudio

I don't know how to file a bug report. That's what I was asked to enter from askUbuntu forum.

I have Ubuntu 10.10, upgraded from 10.4. When I play Rythmbox the sound cuts and cracks or crackles if eg Firefox or Software Manager or my Photos files are open. I have Linux Kernel 2.6.35-23generic Gnome 2,32.0. Memory is 496.1 Mb. Processor is Intel (R) Celeron (R) CPU 430@ 1.80GHz. My graphic card is a Nvidia gigabyte Geforce GT 210.

Help!

Changed in pulseaudio:
status: Opinion → New
Revision history for this message
ken sease (seasekr2) wrote :

My brain is getting taxed now. I remember the problem but haven't seen
it for quite some time. I presently installed Maverick, from scratch,
and have not seen any issues on my old HP laptop. Have you tried
installing from scratch rather than upgrading?

Ken

Revision history for this message
anthony burman (antburman) wrote :

Upgrade-reinstall was recently executed with Ubuntu 11.04. Problem is cured.

Revision history for this message
Brad Figg (brad-figg) wrote : Unsupported series, setting status to "Won't Fix".

This bug was filed against a series that is no longer supported and so is being marked as Won't Fix. If this issue still exists in a supported series, please file a new bug.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: Triaged → Won't Fix
Displaying first 40 and last 40 comments. View all 155 comments or add a comment.
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.