[cs46xx] Need tweaks to daemon.conf to eliminate crackle/distortion

Bug #428619 reported by thathatman
114
This bug affects 17 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Invalid
Undecided
Unassigned
pulseaudio (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

Ever since the pulseaudio updates on 9/11 (1:0.9.16-0ubuntu1, see http://changelogs.ubuntu.com/changelogs/pool/main/p/pulseaudio/pulseaudio_0.9.16-0ubuntu1/changelog), I've had crackling or distortion on the audio output. Audio was perfect prior to that update.

The output will vary from normal, to crackling, to distorted, to the stuck "machine-gun" sound if and only if I change the audio volume up and down. This is the same across all sound sources.

Audio card is cs46xx based hercules game theater XP. Running latest Karmic.

Revision history for this message
thathatman (aaron-dorman) wrote : apport-collect data

Architecture: i386
ArecordDevices:
 **** List of CAPTURE Hardware Devices ****
 card 0: CS46xx [Sound Fusion CS46xx], device 0: CS46xx [CS46xx]
   Subdevices: 1/1
   Subdevice #0: subdevice #0
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: aaron 3145 F.... pulseaudio
 /dev/snd/pcmC0D0p: aaron 3145 F...m pulseaudio
Card0.Amixer.info:
 Card hw:0 'CS46xx'/'Sound Fusion CS46xx at 0xea100000/0xea000000, irq 19'
   Mixer name : 'Cirrus Logic CS4294 rev 5,Cirrus Logic CS4294 rev 5,Cirrus Logic CS4294 rev 5'
   Components : 'AC97a:4352592d AC97m:4352592d'
   Controls : 60
   Simple ctrls : 43
Card1.Amixer.info:
 Card hw:1 'UART'/'MPU-401 UART at 0x330, irq 10'
   Mixer name : ''
   Components : ''
   Controls : 0
   Simple ctrls : 0
Card1.Amixer.values:

CheckboxSubmission: c15b144655902aafd477daa25c10119e
CheckboxSystem: 4ded665cecdcafbe5d44f3cc00343775
DistroRelease: Ubuntu 9.10
Package: pulseaudio 1:0.9.16-0ubuntu1
PackageArchitecture: i386
ProcEnviron:
 SHELL=/bin/bash
 LANG=en_US.UTF-8
ProcVersionSignature: Ubuntu 2.6.31-10.32-generic
Uname: Linux 2.6.31-10-generic i686
UserGroups: adm admin cdrom dialout lpadmin plugdev sambashare

Revision history for this message
thathatman (aaron-dorman) wrote : AlsaDevices.txt
Revision history for this message
thathatman (aaron-dorman) wrote : AplayDevices.txt
Revision history for this message
thathatman (aaron-dorman) wrote : BootDmesg.txt
Revision history for this message
thathatman (aaron-dorman) wrote : Card0.Amixer.values.txt
Revision history for this message
thathatman (aaron-dorman) wrote : Card0.Codecs.codec97.0.ac97.0.0.txt
Revision history for this message
thathatman (aaron-dorman) wrote : Card0.Codecs.codec97.0.ac97.0.0.regs.txt
Revision history for this message
thathatman (aaron-dorman) wrote : Card0.Codecs.codec97.0.ac97.1.1.txt
Revision history for this message
thathatman (aaron-dorman) wrote : Card0.Codecs.codec97.0.ac97.1.1.regs.txt
Revision history for this message
thathatman (aaron-dorman) wrote : CurrentDmesg.txt
Revision history for this message
thathatman (aaron-dorman) wrote : Dependencies.txt
Revision history for this message
thathatman (aaron-dorman) wrote : PciMultimedia.txt
tags: added: apport-collected
Revision history for this message
thathatman (aaron-dorman) wrote : Re: pulseaudio crackle/distortion with cs46xx on latest update

Bug still present in 1:0.9.17-0ubuntu1.
Crackling/distortion appears to be diminished but "machine-gun" sound remains.
What other information would be helpful?

Revision history for this message
knarf (launchpad-ubuntu-f) wrote :

Same problem here on different hardware running latest pulseaudio from ubuntu-audio-dev. Symptoms are the same: sound is sort of allright when the volume client is maxed, anything below that sounds from bad to worse. Being that the symptoms seem to be volume-related I wonder if this is due to some bug in the new SSE-optimized volume code...

Revision history for this message
Daniel T Chen (crimsun) wrote : Re: [Bug 428619] Re: pulseaudio crackle/distortion with cs46xx on latest update

On Sun, Sep 20, 2009 at 11:26 AM, knarf <email address hidden> wrote:
> Same problem here on different hardware running latest pulseaudio from
> ubuntu-audio-dev. Symptoms are the same: sound is sort of allright when
> the volume client is maxed, anything below that sounds from bad to
> worse. Being that the symptoms seem to be volume-related I wonder if
> this is due to some bug in the new SSE-optimized volume code...

If this is indeed the case, you can test:

echo autospawn = no|tee -a ~/.pulse/client.conf
killall pulseaudio
PULSE_NO_SIMD=1 pulseaudio -vvvv

Revision history for this message
knarf (launchpad-ubuntu-f) wrote : Re: pulseaudio crackle/distortion with cs46xx on latest update

After modifying that incantation a bit by adding PULSE_NO_SIMD=1 to the mpd init script as mpd starts its own version of pulseaudio the noise dissappeared... in other words the recent problems with distorted sound ARE caused by the SSE-optimized code... There are very few changes to the actual assembler code in svolume_sse.c, I'll try a version of current pulseaudio with these changes reverted to see if that makes a difference... be right back...

Revision history for this message
knarf (launchpad-ubuntu-f) wrote :

Reverted svolume_sse.c does NOT solve the problem - the bug lives elsewhere.

Revision history for this message
knarf (launchpad-ubuntu-f) wrote :

Another observation: the volume control on a client (in my case mpd) does not actually change the volume. There are three states:

volume maxed, sound OK
volume between maxed and minimum, sound distorted at full volume
volume minimized, no sound

Revision history for this message
knarf (launchpad-ubuntu-f) wrote :

OK, I found it. The problem - in my case at least - lies in svolume_mmx.c (not svolume_sse.c). Reverting that file back to the previous version gets rid of the problem. These are the changes which caused the appearance of the distorted sound problem on my box:

diff -pruN ../pulseaudio-0.9.16~test7-14-g7ca81/src/pulsecore/svolume_mmx.c src/pulsecore/svolume_mmx.c
--- ../pulseaudio-0.9.16~test7-14-g7ca81/src/pulsecore/svolume_mmx.c 2009-09-20 17:26:04.657239828 +0200
+++ src/pulsecore/svolume_mmx.c 2009-09-18 22:21:44.000000000 +0200
@@ -57,14 +57,12 @@
       " punpcklwd %%mm4, "#s" \n\t" /* .. | 0 | p0 | */ \
       " pcmpgtw "#v", %%mm4 \n\t" /* .. | 0 | s(vl) | */ \
       " pand "#s", %%mm4 \n\t" /* .. | 0 | (p0) | (vl >> 15) & p */ \
- " movq %%mm6, %%mm5 \n\t" /* .. | ffff | 0 | */ \
- " pand "#v", %%mm5 \n\t" /* .. | vh | 0 | */ \
- " por %%mm5, %%mm4 \n\t" /* .. | vh | (p0) | */ \
- " pmulhw "#s", "#v" \n\t" /* .. | 0 | vl*p0 | */ \
- " paddw %%mm4, "#v" \n\t" /* .. | vh | vl*p0 | vh + sign correct */ \
- " pslld $16, "#s" \n\t" /* .. | p0 | 0 | */ \
- " por %%mm7, "#s" \n\t" /* .. | p0 | 1 | */ \
- " pmaddwd "#s", "#v" \n\t" /* .. | p0 * v0 | */ \
+ " movq "#s", %%mm5 \n\t" \
+ " pmulhw "#v", "#s" \n\t" /* .. | 0 | vl*p0 | */ \
+ " paddw %%mm4, "#s" \n\t" /* .. | 0 | vl*p0 | + sign correct */ \
+ " psrld $16, "#v" \n\t" /* .. | 0 | vh | */ \
+ " pmaddwd %%mm5, "#v" \n\t" /* .. | p0 * vh | */ \
+ " paddd "#s", "#v" \n\t" /* .. | p0 * v0 | */ \
       " packssdw "#v", "#v" \n\t" /* .. | p1*v1 | p0*v0 | */

 /* approximately advances %3 = (%3 + a) % b. This function requires that
@@ -105,10 +103,6 @@ pa_volume_s16ne_mmx (int16_t *samples, i
     __asm__ __volatile__ (
         " xor %3, %3 \n\t"
         " sar $1, %2 \n\t" /* length /= sizeof (int16_t) */
- " pcmpeqw %%mm6, %%mm6 \n\t" /* .. | ffff | ffff | */
- " pcmpeqw %%mm7, %%mm7 \n\t" /* .. | ffff | ffff | */
- " pslld $16, %%mm6 \n\t" /* .. | ffff | 0 | */
- " psrld $31, %%mm7 \n\t" /* .. | 0 | 1 | */

         " test $1, %2 \n\t" /* check for odd samples */
         " je 2f \n\t"

The simplest solution is to revert that piece of assembly back to what it was. The attached patch accomplishes this.

Revision history for this message
knarf (launchpad-ubuntu-f) wrote :

I should add that I run pulseaudio on a Thinkpad T23 with a Pentium III-m which does NOT support SSE2. As I do not have any systems available which do support SSE2 I can not test the validity of svolume_sse.c (which actually contains SSE2 code, not SSE...). Someone else, like the original bug reporter (who seems to run a Pentium 4 which does support SSE2) should try to revert svolume_sse.c back to a previous version and test with that.

Revision history for this message
thathatman (aaron-dorman) wrote :

knarf, thanks for all your work. Can you give me some help reverting and testing?
Thanks

Revision history for this message
knarf (launchpad-ubuntu-f) wrote :

Looking at the differences between svolume_sse.c from pulseaudio 0.9.16 and the current one I noticed that those changes are only cosmetical - only a comment has changed. It does not make sense to try to patch that... But you can of course try the patch I posted in #19 and see if that works for you.

It is quite simple really. Assuming you...

- keep your sources in /usr/src
- downloaded the patch to your home directory
- have not built pulseaudio before so there are no pulseaudio*.deb or libpulse*.deb packages in /usr/src

...it goes something like this:

(first get the build dependencies:)

   sudo apt-get build-dep pulseaudio

(now get the source:)

   cd /usr/src
   apt-get source pulseaudio

(patch the source:)
(cd whatever directory the source was installed to, currently pulseaudio-0.9.18 so...)

   cd pulseaudio-0.9.18
   patch -p1 < ~/revert_svolume_mmx_to_known_good_version.patch

(build the binary packages:)

   fakeroot dpkg-buildpackage -b

(install pulseaudio and libpulse:)
(while still in the pulseaudio source directory, directly after the build has finished:)

   sudo dpkg -i ../libpulse0_*.deb ../pulseaudio_*.deb

As to how to test the new build depends on how you use it. If you run a sound-generating package like mplayer or totem it should be sufficient to kill any running pulseaudio daemon with:

   pulseaudio -k

It should autostart the next time you start any sound-generating program... unless you have autospawn=no in your personal pulseaudio config of course... in that case you need to start it manually.

If you run some sound-generating daemon like mpd you may need to restart that to make sure it starts a fresh copy of pulseaudio.

Now try to change volume...

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

This bug was fixed in the package pulseaudio - 1:0.9.18-0ubuntu3

---------------
pulseaudio (1:0.9.18-0ubuntu3) karmic; urgency=low

  * debian/patches/:
    + 0052-revert-sse2-optimize.patch: Revert 3d5a57 causing audio
      anomalies (LP: #428619)

 -- Daniel T Chen <email address hidden> Tue, 22 Sep 2009 22:19:42 -0400

Changed in pulseaudio (Ubuntu):
status: New → Fix Released
Revision history for this message
Rob Speer (rspeer) wrote :

I have pulseaudio 0.9.18-0ubuntu3, and I am still experiencing terrible "machine-gun" noises, crackling, and distortion on my cs46xx.

Revision history for this message
thathatman (aaron-dorman) wrote :

Whoa, I didn't even see that this bug was marked as fixed. The patch posted above did not fix this bug for me. Sounds like Knarf and Daniel fixed a similar bug above.

I'm guessing that this must be a cs46xx related bug... How can I help track this bug down?

Rob, can you add all your system information to this bug?

Do you experience sound problems on volume changes? I've found that if I change the volume three or four times, it will temporarily fix the audio problems.

Changed in pulseaudio (Ubuntu):
status: Fix Released → Confirmed
Revision history for this message
Rob Speer (rspeer) wrote :

I know how to use ubuntu-bug to add my system information to a new bug, but how do I add it to an existing one?

Revision history for this message
Rob Speer (rspeer) wrote : apport-collect data

Architecture: i386
ArecordDevices:
 **** List of CAPTURE Hardware Devices ****
 card 0: CS46xx [Sound Fusion CS46xx], device 0: CS46xx [CS46xx]
   Subdevices: 1/1
   Subdevice #0: subdevice #0
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: rob 2278 F.... pulseaudio
Card0.Amixer.info:
 Card hw:0 'CS46xx'/'Sound Fusion CS46xx at 0xf9200000/0xf9100000, irq 18'
   Mixer name : 'Cirrus Logic CS4297A rev 4,Cirrus Logic CS4294 rev 5'
   Components : 'AC97a:43525914 AC97a:4352592d'
   Controls : 71
   Simple ctrls : 45
DistroRelease: Ubuntu 9.10
NonfreeKernelModules: nvidia
Package: pulseaudio 1:0.9.18-0ubuntu3
PackageArchitecture: i386
ProcEnviron:
 SHELL=/bin/bash
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 LANGUAGE=en_US.UTF-8
ProcVersionSignature: Ubuntu 2.6.31-12.41-generic
Uname: Linux 2.6.31-12-generic i686
UserAsoundrc:
 # ALSA library configuration file

 # Include settings that are under the control of asoundconf(1).
 # (To disable these settings, comment out this line.)
 </home/rob/.asoundrc.asoundconf>
UserGroups: adm admin audio cdrom dialout dip floppy fuse lpadmin netdev plugdev powerdev pulse pulse-access scanner video
XsessionErrors:
 (gnome-settings-daemon:2299): GLib-CRITICAL **: g_propagate_error: assertion `src != NULL' failed
 (gnome-settings-daemon:2299): GLib-CRITICAL **: g_propagate_error: assertion `src != NULL' failed
 (polkit-gnome-authentication-agent-1:2396): GLib-CRITICAL **: g_once_init_leave: assertion `initialization_value != 0' failed
 (nautilus:2392): Eel-CRITICAL **: eel_preferences_get_boolean: assertion `preferences_is_initialized ()' failed
 (gnome-panel:2391): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to allocate widget with width -14 and height 32
mtime.conffile..etc.pulse.system.pa: 2009-09-23T07:03:06

Revision history for this message
Rob Speer (rspeer) wrote : AlsaDevices.txt
Revision history for this message
Rob Speer (rspeer) wrote : AplayDevices.txt
Revision history for this message
Rob Speer (rspeer) wrote : BootDmesg.txt
Revision history for this message
Rob Speer (rspeer) wrote : Card0.Amixer.values.txt
Revision history for this message
Rob Speer (rspeer) wrote : Card0.Codecs.codec97.0.ac97.0.0.txt
Revision history for this message
Rob Speer (rspeer) wrote : Card0.Codecs.codec97.0.ac97.0.0.regs.txt
Revision history for this message
Rob Speer (rspeer) wrote : Card0.Codecs.codec97.0.ac97.1.1.txt
Revision history for this message
Rob Speer (rspeer) wrote : Card0.Codecs.codec97.0.ac97.1.1.regs.txt
Revision history for this message
Rob Speer (rspeer) wrote : CurrentDmesg.txt
Revision history for this message
Rob Speer (rspeer) wrote : Dependencies.txt
Revision history for this message
Rob Speer (rspeer) wrote : PciMultimedia.txt
Revision history for this message
Rob Speer (rspeer) wrote : UserAsoundrcAsoundconf.txt
Revision history for this message
Rob Speer (rspeer) wrote : modified.conffile..etc.pulse.system.pa.txt
26 comments hidden view all 106 comments
Revision history for this message
shanen (Shannon Jacobs) (shanen) wrote : Re: pulseaudio crackle/distortion with cs46xx on latest update

This bug is listed as a duplicate of a different bug report that more accurately described the symptoms that I am seeing. In my machines. What I see is total sound failure (apart from a few intermittent clicks at boot time) on machines that worked fine with 9.04. That includes three machines from two different makers, Lenovo and Sharp. Actually, it might be three makers, since one of the machines is old enough that it is probably an IBM. I've tried upgrades, clean installs, running live from the CD, and also from VMware Player. Most of the machines are fairly new.

Excuse me, but this is a massive failure. Ubuntu needs to do much better regression testing. I like Ubuntu, but it is no longer an OS that I can recommend to anyone. Off topic, but I think the main problem with Ubuntu is now the broken economic model that is driving the adoption of features without adequate testing, while at the same time leaving old bugs open, sometimes for years... (I've already suggested an alternative funding mechanism, but never detected any interest at the Ubuntu end...) Unless these massive show-stopping problems are fixed, Ubuntu is going to fail.

Revision history for this message
shanen (Shannon Jacobs) (shanen) wrote :

Whoops, I meant to say at least 3 machines, but I think I may have tested it on as many as five machines that failed, and found only one machine where the sound worked properly (from the live CD, as I recall).

Revision history for this message
thathatman (aaron-dorman) wrote :

Has anyone tested Lucid yet? Is this bug still present?

Daniel T Chen (crimsun)
affects: pulseaudio (Ubuntu) → linux (Ubuntu)
Revision history for this message
Mobius (jharag) wrote :

I have a Santa Cruz 5.1 card using Sound Fusion CS46xx. My sound actually stopped working when I went from 8.10 to 9.04. 9.04 to 9.10 got sound with pulseaudio troubleshooting. Exhibits the symptoms thathatman described unless I set the hardware in pulseaudio to 4.0 output, but only heard playback in audacious.

Revision history for this message
"Kosmonaut" Bernd Müller (bernado-tornado) wrote :

@thatthatman: Yes, this bug is still present in Lucid :-(

Revision history for this message
Jeff Sumner (jdos2) wrote :

Indeed- still present in Lucid.

Can't use the sound card for anything where I need to rely on it- like fldigi, where my transmission might become illegal if the sound card goes into a loop.

Revision history for this message
Jeff Sumner (jdos2) wrote :

Still a problem, right up to release date.
Is there a file, a log, any kind of information that might help in troubleshooting this?

Revision history for this message
jimbo (jimbobubbadj) wrote :

I am running a turtle beach santa cruz sound card cs46xx chipset. I had the same problems with motorboating noise in ubuntu 9.10 and ubuntu 10.04. With linuxmint 8, based on ubuntu 9.10, the sound is great! No problems at all! In windows xp the sound is also problem free!

Revision history for this message
Joseph Huber (huber-joseph) wrote :

Same problem here...Turtle Beach Santa Cruz PCI with CS4630 chipset in a Dell Optiplex 620. This card was working wonderfully in 9.04. I skipped the 9.10 upgrade after reading that support for this card was broken. I had to upgrade to 10.04 LTS to work on another project, and as mentioned above, the card is broken in 10.04 LTS. There are periods (10-15 seconds) of working sound, followed by "motorboating" for 5-10 seconds followed by working sound. When the sound is working, there is crackling. I played around with settings and tried a number of the fixes suggested in other forums and blogs, but nothing has worked so far. The card works wonderfully in Windows XP. This is a nice sound card that serves me well, and I really dislike throwing away working hardware because of buggy software support. Hopefully someone can find a fix and get it implemented.

Revision history for this message
Jeff Sumner (jdos2) wrote :

Any word? I see that there's no assigned person on this, and the Alsa folk seem just as reluctant to work on it.

Revision history for this message
rgonnering (roger-gonnering) wrote :

Like shanen (Shannon Jacobs), sound was working with 9.04 on my IBM T22 with Sound Fusion CS46xx. When I upgraded to 9.10, sound stopped working. I then upgraded to 10.04, and still no sound. I then loaded the 10.04 live disk and still no sound. Does anyone have a clue what is wrong or how to fix it? I really like Ubuntu, but I have been thinking of Red Hat or SUSE. Sound has become an important part of the User Experience.

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

I: alsa-sink.c: Using 32.0 fragments of size 2048 bytes (11.61ms), buffer size is 65536 bytes (371.52ms)
I: alsa-sink.c: Time scheduling watermark is 20.00ms

: alsa-sink.c: Starting playback.
D: alsa-sink.c: Cutting sleep time for the initial iterations by half.
D: alsa-sink.c: Cutting sleep time for the initial iterations by half.
D: alsa-sink.c: Cutting sleep time for the initial iterations by half.

cs46xx use snd_pcm_indirect_playback_transfer() , this mean than PA can most likely only rewind to period boundary so you may need to set rewind_safeguard of PA to fragment size 2048 bytes or double of fragment side used by PA for cs46xx instead of the default 256 when min_period_bytes is 128 for HDA

http://git.0pointer.de/?p=pulseaudio.git;a=commit;h=4df443bbe682055a41e7c2248877dcc7682a69b8

http://thread.gmane.org/gmane.comp.audio.pulseaudio.general/6671

Revision history for this message
Luke Yelavich (themuso) wrote : Re: [Bug 428619] Re: pulseaudio crackle/distortion with cs46xx on latest update

THis patch is not in the stable queue, so I am hesitant to pull it into the package for maverick, and this is probably not a patch that would qualify for an SRU. I'll get this patch into a PPA for you to test. if its favourable, then I will consider adding the aptch to the maverick pulseaudio package.

Thanks for pointing out that commit.

Revision history for this message
Cavia Porcellus (caviaporcellus) wrote : Re: pulseaudio crackle/distortion with cs46xx on latest update

I also have the same crackling sound problem on a Dell Dimension 8100 (Cirrus Logic CS 4614/22/24/30 [CrystalClear SoundFusion Audio Accelerator]). It started when I upgraded to Karmic, though now I'm using a fresh install of Maverick. The problem, however, is still there in Ubuntu 10.10.

Revision history for this message
gigaflop1000 (gigaflop1000) wrote :

I do not know much about ubuntu/linux, but I have been trying things blindly for awhile and will only add what has not already been said. I get huge variations in the quality of sound when I adjust the hardware profile under sound preferences. The changes range from no sound, to very tinny sound, to crashing audio on the system, to crackling, to machine gun, and on. All with different profiles. Today, after updating alsa and messing with the profiles some more, I managed to play one song on vlc with absolutely no audio problems. When I closed the audio player and played a different song, it was back to the regular problems and I haven't been able to replicate a good play again. I don't know what that means, but it seems strange as hell. hope that helps someone who knows whats going on.

Revision history for this message
hoocker (box-) wrote :

default-fragments = 2
default-fragment-size-msec = 5

in daemon.conf, and

load-module module-alsa-sink tsched=0 (only needed if using acpi, acpi=off or apm works nice without it)

in default.pa helped me on thinkpad 570e with snd_cs46xx ( 00:05.0 Multimedia audio controller: Cirrus Logic CS 4614/22/24/30 [CrystalClear SoundFusion Audio Accelerator] (rev 01) )

I'm on Debian, tested on 2.6.32 and 2.6.35 kernels. Pulseaudio 0.9.21-3

note: if you want to use APM with grub2 and get "apm: bios not found" error, try

--- before/10_linux 2010-12-02 19:03:54.000000000 +0300
+++ after/10_linux 2010-12-02 19:03:58.000000000 +0300
@@ -79,12 +79,12 @@
   printf '%s\n' "${prepare_boot_cache}"
   cat << EOF
        echo '$(printf "$(gettext_quoted "Loading Linux %s ...")" ${version})'
- linux ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args}
+ linux16 ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args}
 EOF
   if test -n "${initrd}" ; then
     cat << EOF
        echo '$(gettext_quoted "Loading initial ramdisk ...")'
- initrd ${rel_dirname}/${initrd}
+ initrd16 ${rel_dirname}/${initrd}
 EOF
   fi
   cat << EOF

$ update-grub
$reboot

Revision history for this message
Daniel T Chen (crimsun) wrote : Re: [cs46xx] Need tweaks to default.pa to eliminate crackle/distortion

@hoocker Thanks for the recommendation.

Would others with this controller test the workaround? I.e., disable glitch-free by using tsched=0, and modify the default-fragment* parameters in /etc/pulse/daemon.conf?

summary: - pulseaudio crackle/distortion with cs46xx on latest update
+ [cs46xx] Need tweaks to default.pa to eliminate crackle/distortion
summary: - [cs46xx] Need tweaks to default.pa to eliminate crackle/distortion
+ [cs46xx] Need tweaks to daemon.conf to eliminate crackle/distortion
Revision history for this message
Cavia Porcellus (caviaporcellus) wrote :

I modified daemon.conf and default.pa as per the instructions, but the problem unfortunately remains. (Ubuntu 10.10, pulseaudio version 0.9.21-63.)

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

@Aibara Would you please attach a verbose log as per https://wiki.ubuntu.com/PulseAudio/Log, too?

Revision history for this message
Cavia Porcellus (caviaporcellus) wrote :

Here you go.

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

It doesn't look like you've modified all the necessary bits:

D: module-udev-detect.c: Loading module-alsa-card with arguments 'device_id="0" name="pci-0000_02_0a.0" card_name="alsa_card.pci-0000_02_0a.0" tsched=yes ignore_dB=no card_properties="module-udev-detect.discovered=1"'

glitch-free is still enabled. What modifications did you make to default.pa?

Revision history for this message
hoocker (box-) wrote :

Can you please try to boot without ACPI (acpi=off kernel boot parameter)?

With ACPI I get a "machine gun" sound on volume change for two users, but not with my primary user, which I tested on. Pulse configuration is global (in /etc only, no user configs). It's so strange.. o_O I was not able to figure out the reason, so I'm back to APM for now.

Revision history for this message
Cavia Porcellus (caviaporcellus) wrote :

Err sorry, I had "load-module module-alsa-sink tsched=0" commented out in default.pa. Though it still doesn't seem to work. Here's another log, though I might still be doing something wrong. I'd like to try to turn acpi off, though I'm not sure how to do that (sorry, I'm kind of new at this). Thanks!

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

You'd specify "apci=off" at the kernel command line in GRUB2.

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

>> I have an old Turtle Beach Santa Cruz sound card using the CS46xx driver and was having exactly these symptoms after upgrading to Karmic (audio with pulseaudio was working perfectly in Jaunty).

What are the differences of pulseaudio in Jaunty and 0.9.16 ?

e.g. set the stop threshold to boundary to disable automatic stop at underrun/overrun

Revision history for this message
Cavia Porcellus (caviaporcellus) wrote :

Ok, so I turned acpi off, but everything remained the same.
However, with acpi off, but "load-module module-alsa-sink tsched=0" commented out (see attached log), the rapid crackling actually seemed to be gone, but when I would skip around a track it would sometimes go quiet, and changing the volume using volume control in the panel caused the same loud buzzing noise as it did before.

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

your cs46xx have dual ac97 codecs CS4297A and CS4294

There are two "Master Playback Volume" controls, I guess PA mis calculate the dB range -129.00 dB to 12.00 dB.

I: sink.c: device.description = "CS 4614/22/24/30 [CrystalClear SoundFusion Audio Accelerator] Analog Stereo"
I: sink.c: alsa.mixer_name = "Cirrus Logic CS4297A rev 4,Cirrus Logic CS4294 rev 5"
I: sink.c: alsa.components = "AC97a:43525914 AC97a:4352592d"

D: alsa-mixer.c: Activating path analog-output
D: alsa-mixer.c: Path analog-output (Analog Output), direction=1, priority=99, probed=yes, supported=yes, has_mute=yes, has_volume=yes, has_dB=yes, min_volume=0, max_volume=63, min_dB=-129, max_dB=12
D: alsa-mixer.c: Element Master, direction=1, switch=1, volume=1, enumeration=0, required=0, required_absent=0, mask=0x3600000000f66, n_channels=2, override_map=yes
D: alsa-mixer.c: Element Master Mono, direction=1, switch=2, volume=2, enumeration=0, required=0, required_absent=0, mask=0x7ffffffffffff, n_channels=1, override_map=no
D: alsa-mixer.c: Element Headphone, direction=1, switch=1, volume=3, enumeration=0, required=0, required_absent=0, mask=0x6, n_channels=2, override_map=no
D: alsa-mixer.c: Element PCM, direction=1, switch=1, volume=1, enumeration=0, required=0, required_absent=0, mask=0x402b600000000f66, n_channels=2, override_map=yes
D: alsa-mixer.c: Element External Amplifier, direction=1, switch=4, volume=0, enumeration=0, required=0, required_absent=0, mask=0x0, n_channels=0, override_map=no
D: alsa-mixer.c: Option on (output-amplifier-on/Amplifier) index=1, priority=10
D: alsa-mixer.c: Option off (output-amplifier-off/No Amplifier) index=0, priority=0
D: alsa-mixer.c: Setting output-amplifier-on (Amplifier) priority=10
D: alsa-mixer.c: Setting output-amplifier-off (No Amplifier) priority=0
I: alsa-sink.c: Hardware volume ranges from -129.00 dB to 12.00 dB.

Simple mixer control 'Master',0
  Capabilities: pvolume pswitch pswitch-joined
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 63
  Mono:
  Front Left: Playback 6 [10%] [-85.50dB] [on]
  Front Right: Playback 6 [10%] [-85.50dB] [on]
Simple mixer control 'Master',1
  Capabilities: pvolume pswitch pswitch-joined
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 63
  Mono:
  Front Left: Playback 0 [0%] [-94.50dB] [off]
  Front Right: Playback 0 [0%] [-94.50dB] [off]

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

>> Aibara Iduas wrote on 2010-12-06: #89
   * pulseverbose.log (151.1 KiB, text/plain)

( 10.906| 0.000) D: source.c: Processing rewind...
( 12.662| 1.755) W: ratelimit.c: 16 events suppressed
( 12.662| 0.000) I: alsa-sink.c: Underrun!
( 13.279| 0.616) D: sink-input.c: Requesting rewind due to corking
( 13.279| 0.000) D: module-suspend-on-idle.c: Sink alsa_output.default becomes idle, timeout in 5 seconds.
( 13.316| 0.036) D: sink-input.c: Requesting rewind due to uncorking
( 13.316| 0.000) D: alsa-sink.c: Requested to rewind 1760 bytes.
( 13.316| 0.000) D: alsa-sink.c: Limited to 1440 bytes.
( 13.316| 0.000) D: alsa-sink.c: before: 360
( 13.316| 0.000) D: alsa-sink.c: after: 360
( 13.316| 0.000) D: alsa-sink.c: Rewound 1440 bytes.
( 13.316| 0.000) D: sink.c: Processing rewind...
( 13.316| 0.000) D: source.c: Processing rewind...
( 13.317| 0.000) D: module-suspend-on-idle.c: Sink alsa_output.default becomes busy.
( 13.322| 0.005) D: protocol-native.c: Requesting rewind due to rewrite.
( 13.322| 0.000) D: alsa-sink.c: Requested to rewind 1760 bytes.
( 13.322| 0.000) D: alsa-sink.c: Limited to 1440 bytes.
( 13.322| 0.000) D: alsa-sink.c: before: 360
( 13.322| 0.000) D: alsa-sink.c: after: 360
( 13.322| 0.000) D: alsa-sink.c: Rewound 1440 bytes.
( 13.322| 0.000) D: sink.c: Processing rewind...
( 13.322| 0.000) D: sink-input.c: Have to rewind 1440 bytes on render memblockq.
( 13.322| 0.000) D: sink-input.c: Have to rewind 1440 bytes on implementor.
( 13.322| 0.000) D: source.c: Processing rewind...
( 13.323| 0.000) D: protocol-native.c: Underrun on ''I Got It Bad and That Ain't Go' by 'Billie Holiday'', 0 bytes in queue.

It is underrun because snd_pcm_rewind() can only rewind to period boundary for those drivers which use snd_pcm_indirect_playback_transfer() since the audio has already been transferred from system memory to DSP's internal memory

your card should allow you to run multiple oss playback applications

Does "mplayer -ao oss any.wav" give your bad sound ?

**** List of PLAYBACK Hardware Devices ****
card 0: CS46xx [Sound Fusion CS46xx], device 0: CS46xx [CS46xx]
  Subdevices: 30/31
card 0: CS46xx [Sound Fusion CS46xx], device 1: CS46xx - Rear [CS46xx - Rear]
  Subdevices: 31/31
card 0: CS46xx [Sound Fusion CS46xx], device 2: CS46xx - IEC958 [CS46xx - IEC958]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: CS46xx [Sound Fusion CS46xx], device 3: CS46xx - Center LFE [CS46xx - Center LFE]
  Subdevices: 31/31

or

try pulseaudio-0.9.14

Revision history for this message
Cavia Porcellus (caviaporcellus) wrote :

Apologies for the late reply, I've been quite busy. I'm away from home (and my desktop), and will continue to be for a few weeks, so I won't be able to test anything out until January. If it is still relevant, I'll try then. Thanks for the suggestions so far.

Revision history for this message
hoocker (box-) wrote :

Hi, I've played a bit more with pulseaudio and have something for you to test.

Try to comment udev line in default.pa, like this
#load-module module-udev-detect

And here is all together:

1) stop pulseaudio server

2) /etc/pulse/default.pa
load-module module-alsa-card tsched=0 (not sure, is it really necessary)
load-module module-alsa-sink tsched=0
(...skip...)
### Automatically load driver modules depending on the hardware available
.ifexists module-udev-detect.so
#load-module module-udev-detect
.else

3) /etc/pulse/daemon.conf
default-fragments = 2
default-fragment-size-msec = 5
resample-method = src-linear (helps to fix light crackling noise with some (48 KHz?) media)

4) rm -rf ~/.pulse/ (to be sure)

5) start pulseaudio server

This config works for me with acpi too. Hope it helps.

Revision history for this message
hoocker (box-) wrote :
Revision history for this message
hoocker (box-) wrote :
Revision history for this message
Cavia Porcellus (caviaporcellus) wrote :

Sorry for the delay...
Hoocker, your suggestion fixed it! No more crackling, skipping, or any other distortion while playing sounds; nothing bad happens when I skip around tracks or change the volume.
Thanks!!

Revision history for this message
hoocker (box-) wrote :

Ok, thanks for positive response on this workaround.

Revision history for this message
Francesco Castellana (xfranky) wrote : Re: [Bug 428619] Re: [cs46xx] Need tweaks to daemon.conf to eliminate crackle/distortion

Sorry for replying late but the workaround doesn't seem to work on my PCI
Hercules Fortissimo II.
Might try testing a little bit more tonight.

On Thu, Jan 20, 2011 at 1:23 PM, hoocker <email address hidden> wrote:

> Ok, thanks for positive response on this workaround.
>
> --
> You received this bug notification because you are a direct subscriber
> of the bug.
> https://bugs.launchpad.net/bugs/428619
>
> Title:
> [cs46xx] Need tweaks to daemon.conf to eliminate crackle/distortion
>
> Status in “linux” package in Ubuntu:
> Confirmed
> Status in “pulseaudio” package in Ubuntu:
> New
>
> Bug description:
> Ever since the pulseaudio updates on 9/11 (1:0.9.16-0ubuntu1, see
>
> http://changelogs.ubuntu.com/changelogs/pool/main/p/pulseaudio/pulseaudio_0.9.16-0ubuntu1/changelog
> ),
> I've had crackling or distortion on the audio output. Audio was
> perfect prior to that update.
>
> The output will vary from normal, to crackling, to distorted, to the
> stuck "machine-gun" sound if and only if I change the audio volume up
> and down. This is the same across all sound sources.
>
> Audio card is cs46xx based hercules game theater XP. Running latest
> Karmic.
>
> To unsubscribe from this bug, go to:
> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/428619/+subscribe
>

Revision history for this message
Andy Whitcroft (apw) wrote :

I am closing off the kernel task here as the majority of the issues seem to be pulseaudio related.

Changed in linux (Ubuntu):
status: Confirmed → Invalid
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
Andrew Schulman (andrex) wrote :

I just encountered this bug for the first time after upgrading from 12.04 to 14.04. My old Turtle Beach Santa Cruz card worked fine before, but after the upgrade I started to get distortion and crackling.

hoocker's suggestion in #96 seems to have fixed it! Or at least, greatly reduced it. Thanks much!

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

Thank you for reporting this bug to Ubuntu.
Ubuntu 9.10 (karmic) reached end-of-life on April 30, 2011.

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
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
Displaying first 40 and last 40 comments. View all 106 comments or add a comment.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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